/* Castid — Wild Week Athens system: warm grey stage, cobalt inscription. */

:root {
  --stage: #CBCBCB;
  --stage-panel: #DCDCDC;
  --ink: #0755BB;
  --ink-deep: #063E8A;
  --plaster: #EDEAE4;
  --plaster-shadow: #C9C6BE;
  --chrome-lo: #3A3F47;
  --font-display: "Albertus Nova", "Albertus MT", Cinzel, Optima, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--stage);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button, input, select {
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  color: var(--ink);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--ink);
}

.wordmark {
  /* Photopolymer relief: stone-on-stone, raised from the stage, lit from above. */
  color: #D2D1CF;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.38em;
  line-height: 1;
  text-shadow:
    0 -1px 0 rgba(251, 252, 255, 0.9),
    0 -2px 2px rgba(251, 252, 255, 0.4),
    0 1px 1px rgba(58, 63, 71, 0.38),
    0 3px 4px rgba(58, 63, 71, 0.16);
}

.tagline { font-size: 13px; letter-spacing: 0.14em; opacity: 0.85; flex: 1; }

@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px 20px; }
  .tagline { flex: none; }
}

.btn-solid {
  background: var(--ink);
  color: var(--stage);
  border: 1px solid var(--ink);
  padding: 9px 16px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn-solid:hover { background: var(--ink-deep); }
.btn-solid:disabled { opacity: 0.35; cursor: default; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 7px 12px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn-ghost:hover { background: var(--stage-panel); }
.btn-ghost:disabled { opacity: 0.35; cursor: default; }

.empty-hint { text-align: center; padding: 80px 0 0; font-size: 15px; letter-spacing: 0.2em; opacity: 0.6; }

.panes {
  flex: 1;
  display: grid;
  gap: 18px;
  padding: 22px 28px;
  align-items: start;
  grid-template-columns: 1fr;
}
.panes.n2, .panes.n3, .panes.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panes.n5, .panes.n6, .panes.n7, .panes.n8, .panes.n9 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panes.n10, .panes.n11, .panes.n12 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Phones: one chart window per row, full width. */
@media (max-width: 700px) {
  .panes, .panes.n2, .panes.n3, .panes.n4, .panes.n5, .panes.n6,
  .panes.n7, .panes.n8, .panes.n9, .panes.n10, .panes.n11, .panes.n12 {
    grid-template-columns: 1fr;
  }
}

.pane {
  border: 1px solid var(--ink);
  background: var(--stage-panel);
  min-height: 420px;
  display: flex;
  flex-direction: column;
}
.pane.expanded { grid-column: 1 / -1; }

.pane-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink);
  font-size: 12px;
}
.pane-idx { letter-spacing: 0.18em; }
.pane-title { flex: 1; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-actions button {
  background: none; border: none; cursor: pointer; font-size: 14px;
  color: var(--ink); padding: 2px 6px;
}
.pane-actions button:hover { color: var(--ink-deep); }

.pane-body { flex: 1; container-type: inline-size; }

.cast-form {
  max-width: 430px;
  margin: 30px auto;
  padding: 0 22px 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-title { font-size: 17px; letter-spacing: 0.22em; text-align: center; padding-bottom: 6px; border-bottom: 1px solid var(--ink); }

.f-label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; letter-spacing: 0.14em; flex: 1; position: relative; min-width: 0; }
.cast-form input[type="date"], .cast-form input[type="time"], .side input[type="datetime-local"] {
  min-width: 0;
  max-width: 100%;
  -webkit-appearance: none;
  appearance: none;
}
input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; }
.f-dim { opacity: 0.45; }
.f-row { display: flex; gap: 14px; align-items: flex-end; }
.f-check { font-size: 11px; letter-spacing: 0.14em; display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.f-check input { accent-color: var(--ink); }

.cast-form input[type="text"], .cast-form input[type="date"],
.cast-form input[type="time"], .cast-form select {
  background: var(--plaster);
  border: 1px solid var(--ink);
  padding: 8px 10px;
  font-size: 14px;
  width: 100%;
}

.loc-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; background: var(--plaster); border: 1px solid var(--ink); border-top: none; display: flex; flex-direction: column; }
.loc-results:empty { display: none; }
.loc-opt { background: none; border: none; border-bottom: 1px solid var(--plaster-shadow); text-align: left; padding: 8px 10px; font-size: 13px; cursor: pointer; }
.loc-opt:hover { background: var(--stage-panel); }
.loc-opt .loc-tz { opacity: 0.55; font-size: 11px; }
.loc-err { padding: 8px 10px; font-size: 11px; letter-spacing: 0.1em; }
.loc-chosen { font-size: 11px; letter-spacing: 0.1em; opacity: 0.7; min-height: 14px; padding-top: 3px; }

.f-actions { display: flex; gap: 10px; align-items: center; }
.f-actions .spacer { flex: 1; }
.f-error { font-size: 11px; letter-spacing: 0.12em; color: #8A2B20; text-align: center; min-height: 14px; }

.wheel-wrap { display: grid; grid-template-columns: 1fr; gap: 0; }
@container (min-width: 720px) {
  .wheel-wrap { grid-template-columns: minmax(0, 1fr) 300px; }
  .side { border-left: 1px solid var(--ink); border-top: none !important; }
}
.wheel-wrap.nosides { grid-template-columns: 1fr; }
.wheel-wrap.nosides .side { display: none; }

.wheel-box { padding: 12px; display: flex; justify-content: center; }
.wheel-svg { width: 100%; height: auto; display: block; min-width: 0; max-width: max(420px, calc(100vh - 200px)); }

.side { padding: 14px; border-top: 1px solid var(--ink); display: flex; flex-direction: column; gap: 16px; font-size: 12px; }
.side-label { font-size: 11px; letter-spacing: 0.2em; border-bottom: 1px solid var(--ink); padding-bottom: 4px; margin-bottom: 8px; }
.side select, .side input[type="number"], .side input[type="datetime-local"] {
  background: var(--plaster); border: 1px solid var(--ink); padding: 6px 8px; font-size: 11px; width: 100%;
}

.ring-chip { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--plaster-shadow); }
.ring-dot { width: 10px; height: 10px; background: var(--rc); flex: none; }
.ring-name { letter-spacing: 0.08em; text-transform: uppercase; color: var(--rc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ring-when { font-size: 10px; opacity: 0.65; flex: 1; text-align: right; white-space: nowrap; }
.ring-acts button { background: none; border: none; color: var(--ink); cursor: pointer; font-size: 12px; padding: 1px 4px; }
.ring-acts button:hover { color: var(--ink-deep); }
.ring-add { display: flex; gap: 8px; padding-top: 10px; flex-wrap: wrap; }

.anim-row { display: flex; gap: 6px; margin-bottom: 8px; }
.anim-row input[type="number"] { width: 64px; flex: none; }
.anim-readout { font-size: 10px; letter-spacing: 0.08em; opacity: 0.75; min-height: 13px; }

.tables details { border-bottom: 1px solid var(--plaster-shadow); padding: 4px 0; }
.tables summary { cursor: pointer; letter-spacing: 0.12em; font-size: 11px; padding: 4px 0; }
.postable { width: 100%; border-collapse: collapse; font-size: 11px; }
.postable td { padding: 3px 4px; border-bottom: 1px solid var(--plaster-shadow); letter-spacing: 0.06em; }
.t-glyph { font-size: 14px; width: 22px; }
.moonbadge { display: inline-flex; align-items: center; gap: 4px; margin-left: 7px; font-size: 10px; opacity: 0.85; vertical-align: middle; }
.moonbadge svg { display: block; }
.g-glyph { vertical-align: middle; display: inline-block; }
.t-lon .g-glyph { margin: 0 1px; }
.t-lon { white-space: nowrap; }
.t-house { width: 34px; text-align: center; }
.t-rx { width: 18px; }

.notes { font-size: 10px; letter-spacing: 0.08em; color: #8A2B20; }

.w-line { fill: none; stroke: var(--ink); stroke-width: 1.3; }
.w-hair { fill: none; stroke: var(--ink); stroke-width: 0.6; opacity: 0.45; }
.w-signfill { fill: var(--plaster); opacity: 0.6; stroke: none; }
.w-signglyph { font-size: 30px; fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
.w-planet { font-size: 32px; text-anchor: middle; dominant-baseline: central; }
.w-deg { font-size: 15px; font-weight: 700; text-anchor: middle; dominant-baseline: central; letter-spacing: 0.03em; }
.w-housenum { font-size: 13px; fill: var(--ink); opacity: 0.7; text-anchor: middle; dominant-baseline: central; }
.w-cusp { stroke: var(--ink); stroke-width: 0.7; opacity: 0.35; }
.w-cusp-major { stroke: var(--ink); stroke-width: 2; opacity: 0.85; }
.w-anglemark { text-anchor: middle; dominant-baseline: central; letter-spacing: 0.08em; opacity: 0.85; }

.foot {
  padding: 14px 28px;
  border-top: 1px solid var(--ink);
  font-size: 10px;
  letter-spacing: 0.16em;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 44px;
}
.foot-row { display: flex; gap: 12px; align-items: baseline; }
.foot-label { border-bottom: 1px solid var(--ink); padding-bottom: 2px; }
.foot-val { opacity: 0.6; }
