/* common/css/astro-workspace-pro.css
 * A15 Astronomy Workspace Pro layout and form polish.
 */

body[data-calculator-slug="astro-workspace"] {
  --a15-accent: #0b57d0;
  --a15-accent-soft: rgba(11, 87, 208, 0.15);
  --a15-ink: #0f172a;
  --a15-muted: #475569;
  --a15-line: #c7d6ea;
  --a15-card: #ffffff;
  --a15-soft: #f4f8ff;
}

body[data-calculator-slug="astro-workspace"] .astro-workspace-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

body[data-calculator-slug="astro-workspace"] .a15-list-card,
body[data-calculator-slug="astro-workspace"] .a15-detail-card {
  border: 1px solid var(--a15-line);
  border-radius: 14px;
  background:
    radial-gradient(760px 220px at 0% -80%, rgba(11, 87, 208, 0.09), transparent 55%),
    linear-gradient(180deg, #fcfdff 0%, var(--a15-soft) 100%);
}

body[data-calculator-slug="astro-workspace"] .a15-list-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

body[data-calculator-slug="astro-workspace"] .a15-list-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-calculator-slug="astro-workspace"] #a15-workspace-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 76vh;
  overflow: auto;
}

body[data-calculator-slug="astro-workspace"] .a15-list-item {
  border: 1px solid var(--a15-line);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 8px;
}

body[data-calculator-slug="astro-workspace"] .a15-list-item.is-active {
  border-color: color-mix(in srgb, var(--a15-accent) 50%, var(--a15-line));
  box-shadow: 0 0 0 3px var(--a15-accent-soft);
}

body[data-calculator-slug="astro-workspace"] .a15-open-workspace {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 4px;
}

body[data-calculator-slug="astro-workspace"] .a15-item-name {
  color: var(--a15-ink);
  font-weight: 700;
  line-height: 1.25;
}

body[data-calculator-slug="astro-workspace"] .a15-item-meta {
  font-size: 0.82rem;
  color: var(--a15-muted);
  line-height: 1.25;
}

body[data-calculator-slug="astro-workspace"] .a15-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-calculator-slug="astro-workspace"] .a15-sticky-head {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 8px 0 10px;
  background: linear-gradient(180deg, rgba(244, 248, 255, 0.97), rgba(244, 248, 255, 0.92));
  backdrop-filter: blur(3px);
}

body[data-calculator-slug="astro-workspace"] .a15-topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

body[data-calculator-slug="astro-workspace"] .a15-current-name {
  margin: 0;
  font-size: 1.08rem;
  color: var(--a15-ink);
}

body[data-calculator-slug="astro-workspace"] .a15-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

body[data-calculator-slug="astro-workspace"] .a15-tab-btn {
  border: 1px solid var(--a15-line);
  border-radius: 999px;
  min-height: 36px;
  padding: 6px 14px;
  background: #fff;
  color: var(--a15-ink);
  font-weight: 650;
  cursor: pointer;
}

body[data-calculator-slug="astro-workspace"] .a15-tab-btn.is-active {
  background: linear-gradient(140deg, #0a3f96, #0b57d0);
  color: #f8fafc;
  border-color: transparent;
}

body[data-calculator-slug="astro-workspace"] .a15-tab-panel {
  margin-top: 10px;
  display: grid;
  gap: 12px;
}

body[data-calculator-slug="astro-workspace"] .a15-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-calculator-slug="astro-workspace"] .a15-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-calculator-slug="astro-workspace"] .a15-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-calculator-slug="astro-workspace"] .a15-grid label,
body[data-calculator-slug="astro-workspace"] .a15-input-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  font-weight: 650;
  color: var(--a15-ink);
}

body[data-calculator-slug="astro-workspace"] .a15-grid .a15-span-2 {
  grid-column: span 2;
}

body[data-calculator-slug="astro-workspace"] .a15-grid .a15-span-3 {
  grid-column: span 3;
}

body[data-calculator-slug="astro-workspace"] .a15-grid .a15-span-4 {
  grid-column: span 4;
}

body[data-calculator-slug="astro-workspace"] .a15-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--a15-line);
  border-radius: 12px;
  background: #fff;
  padding: 8px 10px;
}

body[data-calculator-slug="astro-workspace"] .a15-table-wrap {
  overflow-x: auto;
}

body[data-calculator-slug="astro-workspace"] .a15-target-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

body[data-calculator-slug="astro-workspace"] .a15-target-table th,
body[data-calculator-slug="astro-workspace"] .a15-target-table td {
  border-bottom: 1px solid var(--a15-line);
  padding: 7px 8px;
  vertical-align: top;
}

body[data-calculator-slug="astro-workspace"] .a15-target-table tr.is-active td {
  background: color-mix(in srgb, #fff 78%, var(--a15-accent-soft));
}

body[data-calculator-slug="astro-workspace"] .a15-target-table .a15-links {
  white-space: nowrap;
}

body[data-calculator-slug="astro-workspace"] .a15-target-table .a15-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 28px;
  border: 1px solid var(--a15-line);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 650;
  margin-right: 4px;
  color: var(--a15-ink);
  background: #fff;
}

body[data-calculator-slug="astro-workspace"] .a15-target-table .a15-links a:hover,
body[data-calculator-slug="astro-workspace"] .a15-target-table .a15-links a:focus-visible {
  border-color: var(--a15-accent);
  box-shadow: 0 0 0 3px var(--a15-accent-soft);
}

body[data-calculator-slug="astro-workspace"] .a15-status-wrap {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

body[data-calculator-slug="astro-workspace"] #a15-unsaved {
  color: #92400e;
  font-weight: 650;
}

body[data-calculator-slug="astro-workspace"] #a15-warn {
  color: #b42318;
  font-weight: 600;
}

body[data-calculator-slug="astro-workspace"] .a15-output-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-calculator-slug="astro-workspace"] .a15-output-links .button {
  text-decoration: none;
}

@media (max-width: 1180px) {
  body[data-calculator-slug="astro-workspace"] .astro-workspace-layout {
    grid-template-columns: 1fr;
  }

  body[data-calculator-slug="astro-workspace"] #a15-workspace-list {
    max-height: 42vh;
  }
}

@media (max-width: 960px) {
  body[data-calculator-slug="astro-workspace"] .a15-grid,
  body[data-calculator-slug="astro-workspace"] .a15-grid.cols-3,
  body[data-calculator-slug="astro-workspace"] .a15-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-calculator-slug="astro-workspace"] .a15-grid .a15-span-4,
  body[data-calculator-slug="astro-workspace"] .a15-grid .a15-span-3,
  body[data-calculator-slug="astro-workspace"] .a15-grid .a15-span-2 {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  body[data-calculator-slug="astro-workspace"] .a15-list-actions,
  body[data-calculator-slug="astro-workspace"] .a15-grid,
  body[data-calculator-slug="astro-workspace"] .a15-grid.cols-3,
  body[data-calculator-slug="astro-workspace"] .a15-grid.cols-2 {
    grid-template-columns: 1fr;
  }

  body[data-calculator-slug="astro-workspace"] .a15-grid .a15-span-4,
  body[data-calculator-slug="astro-workspace"] .a15-grid .a15-span-3,
  body[data-calculator-slug="astro-workspace"] .a15-grid .a15-span-2 {
    grid-column: span 1;
  }

  body[data-calculator-slug="astro-workspace"] .a15-sticky-head {
    position: static;
    background: transparent;
    backdrop-filter: none;
  }

  body[data-calculator-slug="astro-workspace"] .a15-output-links .button,
  body[data-calculator-slug="astro-workspace"] .astro-actions .button {
    flex: 1 1 100%;
  }
}
