.lab-link { margin-left: auto; color: #d4efe3; font: 600 0.9rem/1.3 system-ui; }
* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --ink: #1d2a37;
  --muted: #54616b;
  --paper: #f8f7f2;
  --rule: #d6d9d4;
  --teal: #145d57;
  --rust: #963d30;
  --display: "STIX Two Text", Georgia, "Times New Roman", serif;
  font-family: "Instrument Sans", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
button:focus-visible, input:focus-visible, a:focus-visible, main:focus-visible {
  outline: 3px solid #298a82;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.sr-only, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus { position: fixed; z-index: 5; left: 1rem; top: 1rem; padding: .7rem; background: white; color: var(--ink); }
.frame { width: min(1120px, calc(100% - clamp(2rem, 10vw, 8rem))); margin-inline: auto; }
.masthead {
  color: #f9f5e9;
  background: radial-gradient(ellipse at 80% 132%, #275756 0, #1d373e 30%, #172434 64%);
  overflow: hidden;
}
.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid #526169;
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -.04em;
}
.brand-mark { position: relative; width: 1.85rem; height: 1.85rem; display: block; transform: rotate(-28deg); }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; border: 1.5px solid #b2ddcb; border-radius: 50%; }
.brand-mark::before { inset: 13% 17%; }
.brand-mark::after { inset: 36% -3%; }
.hero { position: relative; min-height: clamp(185px, 18vw, 246px); display: flex; align-items: center; isolation: isolate; }
.hero-copy { z-index: 1; padding-block: 2.4rem; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 400; }
h1 { font-size: clamp(2.65rem, 5.4vw, 5rem); line-height: 1.03; letter-spacing: -.054em; }
h1 em { font-weight: inherit; color: #c2ddc6; }
.hero-copy p { margin-top: 1rem; color: #d5ddda; font-size: 1rem; letter-spacing: .01em; }
.sky {
  position: absolute;
  z-index: 0;
  top: 0;
  right: -1%;
  width: 45%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 9% 35%, #aac2b5 0 1px, transparent 1.5px),
    radial-gradient(circle at 21% 11%, #a5c8bc 0 .6px, transparent 1.3px),
    radial-gradient(circle at 67% 23%, #dce2c9 0 1px, transparent 1.8px),
    radial-gradient(circle at 89% 16%, #aab7ad 0 .6px, transparent 1.3px),
    radial-gradient(circle at 81% 76%, #a4c6b7 0 1px, transparent 1.5px),
    radial-gradient(circle at 26% 91%, #b4cbb3 0 .8px, transparent 1.5px),
    radial-gradient(circle at 94% 52%, #a4b6aa 0 1px, transparent 1.4px);
}
.globe, .moon, .orbit { display: block; position: absolute; border-radius: 50%; }
.globe {
  left: 54%; top: 53%; width: clamp(100px, 11vw, 165px); aspect-ratio: 1; transform: translate(-50%, -50%) rotate(-25deg);
  background:
    radial-gradient(ellipse at 28% 12%, #f6efcc54, transparent 48%),
    radial-gradient(ellipse at 125% 60%, #152b36 12%, #1e3a4396 38%, transparent 64%),
    repeating-linear-gradient(174deg, transparent 0 5%, #ead9a332 6%, transparent 11%),
    linear-gradient(160deg,#cdd8b9, #9eb9aa 28%, #8ab1a9 42%, #b5c2a1 55%, #7caaa5 73%, #618c89);
  box-shadow: inset -8px -8px 15px #19364466, inset 2px 1px 2px #ecedd185, 0 0 40px #bdcfaa12;
}
.orbit { left: 54%; top: 53%; border: 1px solid #adc8b682; transform: translate(-50%,-50%) rotate(-21deg); }
.orbit-outer { width: 100%; height: 69%; border-style: dashed; border-color: #abc8ba57; }
.orbit-near { width: 70%; height: 35%; border-color: transparent #c4d7bb9c #d6ddbaa6 #b4cfbb9e; }
.moon { left: 14%; top: 74%; width: 8px; height: 8px; background: #e8c59a; box-shadow: inset -2px -1px 1px #9f9978; }
.content { padding-block: clamp(2rem, 4vw, 3.6rem) 4rem; }
.section-head, .toolbar, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.section-head { margin-bottom: 1.4rem; }
h2 { font-size: clamp(1.8rem, 3.3vw, 2.6rem); line-height: 1.12; letter-spacing: -.04em; }
.primary, .secondary, .danger {
  min-height: 42px; padding: .65rem 1.1rem; border-radius: 6px; border: 1px solid transparent;
  font-size: .94rem; line-height: 1.2; font-weight: 600;
}
.primary { background: var(--teal); color: white; }
.primary:hover:enabled { background: #0c4844; }
.plus { display: inline-block; font-size: 1.2em; margin-right: .3rem; line-height: .6; vertical-align: -.02em; }
.secondary { background: transparent; border-color: #aab2ab; color: var(--ink); }
.secondary:hover:enabled { background: #ecefe7; }
.danger { color: white; background: var(--rust); }
.danger:hover:enabled { background: #7a2c22; }
.toolbar { margin-bottom: 1.15rem; }
.search-box { position: relative; width: min(100%, 22rem); display: flex; align-items: center; }
.search-box input, .field input { border: 1px solid #aeb8b1; border-radius: 6px; background: #fffefa; color: var(--ink); }
.search-box input { width: 100%; height: 42px; padding: .6rem .8rem .6rem 2.5rem; }
.search-box input::placeholder { color: #5c6a6c; opacity: 1; }
.search-icon { position: absolute; left: .9rem; width: .78rem; height: .78rem; border: 1.6px solid #667573; border-radius: 50%; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; background: #667573; width: 6px; height: 1.6px; right: -4.7px; bottom: -2.3px; transform: rotate(45deg); }
.result-count { color: var(--muted); font: .82rem/1.45 "IBM Plex Mono", Consolas, monospace; text-align: right; }
.list-wrap { border-block: 1px solid var(--rule); }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead { color: var(--muted); background: #efefe8; }
thead th { padding: .72rem 1.1rem; font-size: .75rem; font-weight: 650; text-transform: uppercase; letter-spacing: .075em; }
tbody th, tbody td { padding: .85rem 1.1rem; border-top: 1px solid var(--rule); }
tbody th { font-weight: 600; }
tbody tr:hover { background: #f2f3ec; }
.planet-name { display: flex; align-items: center; gap: .85rem; overflow-wrap: anywhere; }
.planet-dot {
  flex: 0 0 23px; height: 23px; border-radius: 50%; background-color: #9cb9aa;
  background-image: radial-gradient(circle at 24% 20%, #fffa, transparent 50%), radial-gradient(circle at 100% 90%, #19354499, transparent 75%), repeating-linear-gradient(160deg, transparent 0 3px, #ffffff3d 4px, transparent 7px);
  box-shadow: inset 0 0 0 1px #19354419;
}
.planet-dot.tone-1 { background-color: #ca8d74; }
.planet-dot.tone-2 { background-color: #83abb9; }
.planet-dot.tone-3 { background-color: #b69ba4; }
.planet-dot.tone-4 { background-color: #cead77; }
.planet-dot.tone-5 { background-color: #929ec4; }
.diameter-col { text-align: right; }
.diameter { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.unit { color: var(--muted); font-size: .88em; }
#action-head, .row-actions { text-align: right; }
.row-actions { white-space: nowrap; width: 32%; }
.row-button, .text-button { border: 0; color: var(--teal); background: transparent; font-weight: 600; }
.row-button { min-height: 34px; padding: .38rem .58rem; font-size: .88rem; border-radius: 4px; }
.row-button:hover, .text-button:hover { text-decoration: underline; }
.row-button.remove { color: #814437; margin-left: .28rem; }
.text-button { font-size: .94rem; padding: .4rem .2rem; text-decoration: underline; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .text-button { margin-top: .3rem; }
.notice { color: #14594e; background: #e3eee5; }
.notice:not(:empty), .list-error, .form-error:not(:empty) { padding: .8rem 1rem; border-radius: 6px; margin-block: 0 1rem; }
.notice:empty, .form-error:empty, .field-error:empty { display: none; }
.list-error, .form-error { color: #742c26; background: #faeae2; line-height: 1.45; }
.list-error .text-button { margin-left: .8rem; color: inherit; }
.modal { width: min(27rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: clamp(1.3rem, 4vw, 2rem); color: var(--ink); background: var(--paper); border: 1px solid #d1d6cd; border-radius: 12px; box-shadow: 0 1rem 4rem #121d2b55; }
.modal::backdrop { background: #101b2bc9; }
.modal h2 { margin-bottom: 1.6rem; font-size: 2rem; }
.field { margin-block: 1rem; display: grid; gap: .4rem; }
.field label { font-weight: 600; }
.field label span, .field small, .dialog-copy { color: var(--muted); }
.field input { padding: .65rem .8rem; width: 100%; }
.field input[aria-invalid="true"] { border-color: var(--rust); }
.field small, .field-error { font-size: .84rem; line-height: 1.45; }
.field-error { color: #8b3127; }
.dialog-actions { justify-content: flex-end; gap: .6rem; margin-top: 1.6rem; }
.dialog-copy { line-height: 1.6; margin-bottom: 1rem; overflow-wrap: anywhere; }
@media (max-width: 680px) {
  .frame { width: calc(100% - 2rem); }
  .brand { padding-block: .95rem; }
  .hero { min-height: 165px; }
  .hero-copy { padding-block: 1.7rem; }
  .hero-copy p { max-width: 20ch; font-size: .92rem; line-height: 1.4; }
  h1 { font-size: clamp(2rem, 6.9vw, 2.95rem); }
  .sky { width: 35%; right: -.5rem; }
  .globe { width: 67%; }
  .orbit-outer { width: 132%; height: 38%; }
  .orbit-near { width: 105%; height: 19%; }
  .moon { width: 5px; height: 5px; top: 67%; }
  .section-head { align-items: center; flex-wrap: wrap; }
  .toolbar { align-items: flex-start; flex-direction: column; gap: .6rem; }
  .search-box { width: 100%; }
  .result-count { text-align: left; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody, tr, td, th, table { display: block; }
  tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: baseline; padding: .8rem .2rem .65rem; gap: .3rem .5rem; }
  tbody tr + tr { border-top: 1px solid var(--rule); }
  tbody th, tbody td { border: 0; padding: 0; }
  .planet-name { gap: .6rem; }
  .planet-dot { flex-basis: 19px; height: 19px; align-self: center; }
  .row-actions { grid-column: 1 / -1; width: auto; text-align: left; padding-left: 1.1rem; }
}
@media (max-width: 380px) {
  .hero-copy { max-width: 71%; }
  .section-head { align-items: baseline; gap: .7rem; }
  .section-head .primary { padding-inline: .65rem; }
  tbody tr { grid-template-columns: minmax(0, 1fr); }
  .diameter { text-align: left; padding-left: 1.8rem; }
}
