/* /space/charts — the full searchable/sortable saved-charts list */

.sc-stage { padding: 32px 48px 64px; }
@media (max-width: 900px) { .sc-stage { padding: 77px 20px 48px; } }
.sc-page { max-width: 980px; min-width: 0; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

.sc-crumb {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-size: 14px; color: var(--ink-dim);
}
.sc-crumb a { color: var(--accent); text-decoration: none; }
.sc-crumb a:hover { text-decoration: underline; }

.sc-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.sc-head h1 {
  margin: 0; font-family: var(--serif); font-weight: 500; font-size: 36px; line-height: 1.1;
  color: var(--ink);
}
.sc-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sc-search {
  font: inherit; font-size: 13.5px; width: 220px; box-sizing: border-box;
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
}
.sc-search:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.sc-sort-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-faint);
}
.sc-sort-label select {
  font: inherit; font-size: 13.5px; padding: 7px 8px; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
}

.sc-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 24px 28px; border-radius: var(--radius-xl);
  border: 1px solid var(--line); background: var(--surface);
}
.sc-card[hidden] { display: none; }
.sc-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px;
  border-radius: var(--radius-pill); background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 14.5px; text-decoration: none;
}
.sc-btn:hover { background: var(--accent-hover); }

.sc-no-match { margin: 0; font-size: 13.5px; color: var(--ink-faint); }
.sc-no-match[hidden] { display: none; }

/* the table scrolls inside its own box on phones, same as the chart
   page's own reference tables — the page itself never scrolls sideways */
.sc-table-wrap { overflow-x: auto; }
.sc-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
.sc-table[hidden] { display: none; }
.sc-table th {
  text-align: left; padding: 0 10px 8px 0; border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint);
}
.sc-table td { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.sc-row:last-child td { border-bottom: none; }
.sc-name a { color: var(--ink); font-weight: 700; text-decoration: none; }
.sc-name a:hover { color: var(--accent); }
.sc-badge {
  margin-left: 8px; padding: 2px 8px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.sc-muted { color: var(--ink-dim); white-space: nowrap; }
.sc-placement { color: var(--ink-dim); white-space: nowrap; }

.sc-actions { text-align: right; }
.sc-more-wrap { position: relative; display: inline-block; }
.sc-more {
  width: 28px; height: 28px; line-height: 26px; text-align: center;
  font-size: 14px; letter-spacing: -1px; color: var(--ink-faint); cursor: pointer;
  background: none; border: none; border-radius: 50%;
  transition: color .15s var(--ease-soft), background .15s var(--ease-soft);
}
.sc-more:hover, .sc-more[aria-expanded="true"] { color: var(--ink); background: var(--surface-2); }
.sc-menu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 10;
  display: flex; flex-direction: column; min-width: 160px; padding: 5px;
  border-radius: var(--radius-sm); background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--ink) 16%, transparent);
}
.sc-menu[hidden] { display: none; }
.sc-menu-item {
  font: inherit; font-size: 13px; text-align: left; cursor: pointer;
  padding: 7px 9px; border-radius: 6px; color: var(--ink-dim);
  background: none; border: none;
  transition: background .12s var(--ease-soft), color .12s var(--ease-soft);
}
.sc-menu-item:hover { background: var(--surface-2); color: var(--ink); }
.sc-menu-item.is-danger:hover { color: var(--dynamic); }

/* phones: one card per chart instead of a 640px-wide table (plan item 72) */
@media (max-width: 767px) {
  .sc-stage { min-width: 0; }
  .sc-table-wrap { overflow: visible; }
  .sc-table { min-width: 0; display: block; }
  .sc-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sc-table tbody { display: flex; flex-direction: column; gap: 12px; }
  .sc-row {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px 12px; align-items: start;
    padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  }
  .sc-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .sc-row .sc-name { grid-column: 1 / 4; font-size: 17px; }
  .sc-row .sc-actions { grid-column: 4; grid-row: 1; text-align: right; margin: -8px -8px 0 0; }
  .sc-row .sc-born, .sc-row .sc-opened { grid-column: 1 / -1; }
  .sc-row .sc-born::before, .sc-row .sc-opened::before { content: attr(data-label) " · "; color: var(--ink-faint); }
  .sc-row .sc-placement::before {
    display: block; content: attr(data-label); margin-bottom: 2px;
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint);
  }
  .sc-search { width: 100%; }
  .sc-controls { width: 100%; }
  .sc-menu { right: 0; }
}

/* duplicates banner + merge dialog */
.sc-dupes { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-2); font-size: 14px; }
.sc-dupes[hidden] { display: none; }
.sc-dupes p { margin: 0; color: var(--ink-dim); flex: 1 1 260px; }
.sc-dupes-go { font: inherit; font-weight: 700; font-size: 14px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-pill); border: 1px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; }
.sc-merge { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); color: var(--ink); }
.sc-merge::backdrop { background: color-mix(in srgb, var(--ink) 38%, transparent); }
.sc-merge h2 { margin: 0 0 8px; font-family: var(--serif); font-weight: 500; font-size: 26px; }
.sc-merge-lede { margin: 0 0 14px; color: var(--ink-dim); font-size: 14px; }
.sc-merge-group { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.sc-merge-group legend { padding: 0 6px; font-weight: 700; }
.sc-merge-warn { margin: 4px 0 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.sc-merge-opt { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 8px 0; cursor: pointer; }
.sc-merge-opt small { display: block; color: var(--ink-dim); font-size: 13px; }
.sc-merge-err { margin: 0 0 10px; font-weight: 600; }
.sc-merge-err[hidden] { display: none; }
.sc-merge-actions { display: flex; gap: 12px; align-items: center; }
.sc-merge-cancel { font: inherit; font-weight: 600; min-height: 44px; padding: 0 14px; background: none; border: none; color: var(--ink-dim); cursor: pointer; }
