:root {
  --bg: #f4f5f2; --panel: #fff; --ink: #1d2523; --muted: #66716d; --line: #d9ded9;
  --accent: #0f766e; --accent-ink: #fff; --bad: #b42318; --warn: #b45309; --bride: #d6537f; --groom: #3f78d6; --host: #3a9b7a; --none: #8a93a0;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
button, input, select { font: inherit; }
button { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 5px 10px; border-radius: 6px; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.primary:disabled { opacity: .6; cursor: progress; }
button.small { padding: 1px 7px; font-size: 12px; }
button.danger { color: var(--bad); }
input, select { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: #fff; color: var(--ink); }
input[type=number] { width: 70px; }
.top { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 8px 14px; background: #10312d; color: #fff; }
.top h1 { margin: 0; font-size: 18px; letter-spacing: .02em; }
.top label { font-size: 12px; opacity: .9; display: inline-flex; gap: 5px; align-items: center; }
.top .files, .top .solvebar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.top .files { margin-left: auto; }
.top button { background: #1b4a44; color: #fff; border-color: #2c6a62; }
.top button.primary { background: #fff; color: #10312d; border-color: #fff; }
#views { display: flex; gap: 2px; }
#views button { border-radius: 6px 6px 0 0; border: 0; background: transparent; color: #cfe3df; }
#views button[aria-current=page] { background: var(--bg); color: var(--ink); font-weight: 600; }
.status { padding: 6px 14px; background: #e6efe9; border-bottom: 1px solid var(--line); font-size: 13px; min-height: 31px; }
.status b.bad { color: var(--bad); } .status b.ok { color: var(--accent); }
.plan { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 12px; padding: 12px; align-items: start; }
.side { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; max-height: calc(100vh - 130px); position: sticky; top: 8px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; border-radius: 0; background: #f0f3f0; padding: 8px 4px; }
.tabs button[aria-selected=true] { background: #fff; font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.panel { padding: 10px; overflow: auto; }
.panel h3 { margin: 12px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.panel h3:first-child { margin-top: 0; }
.row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 5px 0; }
.row > label { display: inline-flex; gap: 4px; align-items: center; }
.row.spread > label { justify-content: space-between; width: 100%; }
.muted { color: var(--muted); font-size: 12px; }
.msgs { max-height: 110px; overflow: auto; font-size: 12px; background: #fff7ed; border: 1px solid #fed7aa; padding: 6px 8px; border-radius: 6px; margin: 6px 0; }
.gtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.gtable th { text-align: left; font-size: 11px; color: var(--muted); padding: 2px 4px; position: sticky; top: -10px; background: #fff; }
.gtable td { padding: 2px 4px; border-top: 1px solid #eef0ed; vertical-align: middle; }
.gtable tr[draggable=true] { cursor: grab; }
.gtable select { max-width: 92px; padding: 1px 2px; font-size: 12px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; background: var(--none); }
.dot.bride { background: var(--bride); } .dot.groom { background: var(--groom); } .dot.host { background: var(--host); }
.tag { display: inline-block; font-size: 11px; padding: 0 5px; border-radius: 8px; background: #e7eeeb; margin-left: 3px; }
.tcard { border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; }
.tcard.sel { border-color: var(--accent); box-shadow: 0 0 0 2px #0f766e33; }
.tcard.bad { border-color: var(--bad); }
.tcard header { display: flex; justify-content: space-between; align-items: center; padding: 5px 8px; background: #f0f3f0; border-radius: 8px 8px 0 0; cursor: pointer; }
.tcard ol { margin: 0; padding: 4px 8px 6px 30px; font-size: 13px; }
.tcard li { display: flex; justify-content: space-between; gap: 6px; cursor: grab; }
.tcard li button { visibility: hidden; }
.tcard li:hover button { visibility: visible; }
.stage { min-width: 0; }
.floorwrap { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
#floor { display: block; width: 100%; aspect-ratio: 1200 / 760; touch-action: none; cursor: default; }
.tip { position: absolute; pointer-events: none; background: #10312d; color: #fff; padding: 3px 8px; border-radius: 5px; font-size: 12px; white-space: nowrap; transform: translate(10px, 10px); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 2px; font-size: 12px; color: var(--muted); }
.legend .hint { margin-left: auto; }
.issues { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.issues h3 { margin: 6px 0 4px; font-size: 13px; }
.issues ul { margin: 0; padding-left: 18px; }
.issues li { margin: 2px 0; }
.issues li.link { cursor: pointer; }
.issues li.link:hover { text-decoration: underline; }
.issues .hard { color: var(--bad); } .issues .soft { color: var(--warn); } .issues .note { color: #6b21a8; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: #10312d; color: #fff; padding: 8px 16px; border-radius: 8px; z-index: 9; max-width: 80vw; }
.toast.err { background: var(--bad); }
.sheet { padding: 16px; max-width: 1100px; margin: 0 auto; }
.sheet .bar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.sheet h2 { margin: 0; font-size: 18px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.card { border: 1px dashed #8a948f; border-radius: 6px; padding: 14px 10px; text-align: center; background: #fff; break-inside: avoid; min-height: 110px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.card .nm { font-size: 20px; font-weight: 600; font-family: Georgia, serif; }
.card .tb { font-size: 14px; color: #444; letter-spacing: .06em; text-transform: uppercase; }
.card .tb b { font-size: 22px; }
.card.escort .nm { font-size: 16px; font-weight: 500; }
.tlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tlist section { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; break-inside: avoid; }
.tlist h3 { margin: 0 0 4px; font-size: 15px; }
.tlist ol { margin: 0; padding-left: 22px; }
.lookup { columns: 2 300px; column-gap: 28px; background: #fff; border: 1px solid var(--line); padding: 12px 16px; border-radius: 6px; }
.lookup h3 { margin: 10px 0 2px; font-size: 16px; border-bottom: 1px solid var(--line); break-after: avoid; }
.lookup div.l { display: flex; justify-content: space-between; padding: 1px 0; break-inside: avoid; }
@media (max-width: 900px) {
  .plan { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media print {
  .noprint { display: none !important; }
  body { background: #fff; }
  #plan { display: none !important; }
  .sheet { padding: 0; max-width: none; }
  .card, .tlist section, .lookup { border-color: #888; }
}
[hidden] { display: none !important; }
