:root {
  --ink: #18312c;
  --muted: #64746e;
  --paper: #f6f0e4;
  --panel: #fffdf8;
  --green: #1f6b52;
  --green-soft: #dcece4;
  --ochre: #bc6c2c;
  --line: #ded6c8;
  --danger: #a43d35;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top right, #e2eddf 0, transparent 34rem), var(--paper); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hero, main { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.hero { display: flex; justify-content: space-between; gap: 24px; align-items: end; padding: 56px 0 28px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-family: Georgia, serif; font-size: clamp(2.5rem, 7vw, 5.4rem); line-height: .9; letter-spacing: -.055em; }
h2 { margin-bottom: 18px; font-family: Georgia, serif; font-size: 1.65rem; }
.eyebrow, .section-kicker { margin-bottom: 8px; color: var(--ochre); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.intro { max-width: 620px; color: var(--muted); font-size: 1.05rem; }
.progress { min-width: 150px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.62); text-align: center; }
.progress strong { display: block; font: 700 1.8rem Georgia, serif; }
.progress span { color: var(--muted); font-size: .8rem; }
main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 20px; padding-bottom: 60px; }
.panel { border: 1px solid var(--line); border-radius: 22px; background: rgba(255,253,248,.9); box-shadow: 0 16px 45px rgba(39,50,45,.06); padding: 24px; }
.add-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: end; }
.add-panel form { display: grid; grid-template-columns: 2fr 1fr auto auto; gap: 14px; align-items: end; }
label { display: grid; gap: 7px; color: var(--muted); font-size: .82rem; font-weight: 650; }
input, select { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); }
input:focus, select:focus { outline: 3px solid rgba(31,107,82,.16); border-color: var(--green); }
.check { grid-template-columns: auto 1fr; align-items: center; align-self: center; }
.check input { width: 18px; min-height: 18px; accent-color: var(--green); }
.primary, .secondary, .danger { border: 0; border-radius: 10px; padding: 11px 15px; font-weight: 750; }
.primary { background: var(--green); color: white; }
.secondary { background: #eae5da; color: var(--ink); }
.danger { background: #f6deda; color: var(--danger); }
.small { padding: 7px 10px; font-size: .78rem; }
.message { grid-column: 2; min-height: 20px; margin: 0; color: var(--green); font-weight: 700; }
.message.error { color: var(--danger); }
.candidates-panel { grid-column: 2; grid-row: 2; }
.map-panel { grid-column: 1; grid-row: 2 / span 2; }
.alphabetical-panel { grid-column: 2; grid-row: 3; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.counter { display: inline-grid; place-items: center; min-width: 32px; height: 32px; border-radius: 50%; background: var(--green-soft); font-weight: 800; }
.hint, .empty-state { color: var(--muted); font-size: .85rem; }
.candidates { display: grid; gap: 10px; }
.candidate { display: grid; gap: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.candidate.selected { border-color: var(--ochre); box-shadow: 0 0 0 3px rgba(188,108,44,.13); }
.card-actions { display: flex; gap: 8px; }
.badge { width: fit-content; padding: 3px 7px; border-radius: 999px; font-size: .68rem; font-weight: 800; }
.badge.certain { background: var(--green-soft); color: var(--green); }
.badge.hypothesis { background: #f5e6d3; color: #8b4c1c; }
.slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.slot { position: relative; min-height: 105px; display: flex; flex-direction: column; justify-content: space-between; gap: 7px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: white; text-align: left; transition: transform .15s, border-color .15s; }
.slot.filled:hover, .slot.available:hover { transform: translateY(-2px); border-color: var(--green); }
.slot.empty { background: repeating-linear-gradient(135deg, #faf7f0, #faf7f0 8px, #f5f0e6 8px, #f5f0e6 16px); }
.slot.available { border: 2px dashed var(--ochre); }
.slot-number { color: var(--ochre); font: 700 1.3rem Georgia, serif; }
.slot strong { line-height: 1.12; overflow-wrap: anywhere; }
.hole { color: #b7ad9d; font-size: 1.4rem; }
.slot-suggestions { color: #9a9f9b; font-size: .66rem; font-style: italic; line-height: 1.25; overflow-wrap: anywhere; }
.alphabetical { display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); }
.alpha-item { border: 1px solid var(--line); border-radius: 999px; background: white; padding: 7px 10px; color: var(--ink); font-size: .78rem; }
.hidden { display: none; }
dialog { width: min(520px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 20px; padding: 24px; color: var(--ink); background: var(--panel); }
dialog::backdrop { background: rgba(17,31,27,.55); backdrop-filter: blur(3px); }
#edit-form { display: grid; gap: 14px; }
.password-dialog form { display: grid; gap: 14px; }
.password-dialog p { color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.login-page { display: grid; place-items: center; padding: 24px; }
.login-shell { width: min(520px, 100%); }
.login-card { padding: 34px; }
.login-card h1 { font-size: clamp(3rem, 12vw, 5rem); }
.login-card form { display: grid; gap: 16px; margin-top: 28px; }
@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
  .add-panel, .candidates-panel, .map-panel, .alphabetical-panel { grid-column: 1; grid-row: auto; }
  .add-panel { grid-template-columns: 1fr; }
  .add-panel form { grid-template-columns: 1fr 1fr; }
  .message { grid-column: 1; }
  .slots { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .hero { align-items: start; padding-top: 32px; }
  .progress { min-width: 105px; }
  .add-panel form { grid-template-columns: 1fr; }
  .slots { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 18px; }
}
