/* 2kfest.com/survey — page styles. Base tokens come from ../rsvp/css/styles.css. */

:root {
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --panel: #121215;
  --panel-2: #18181c;
  --line: rgba(255, 255, 255, 0.1);
  --green: #4cc38a;
  --amber: #e8b04a;
  --red: #ff6b5e;
}

body { background: #0c0c0e; }
body[data-view="map"], body[data-view="place"] { overflow: hidden; }

.topbar { gap: 18px; }
.crumbs {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--gold); }
.crumbs span:last-child { color: var(--text); }
.crumbs .sep { opacity: 0.4; }

.mono { font-family: var(--mono); }
.muted { color: var(--text-dim); }
.small { font-size: 0.84rem; }
.right { text-align: right; }
.danger { color: var(--red) !important; }

.page { max-width: 900px; margin: 0 auto; padding: 36px 24px 80px; }
.page.wide { max-width: 1200px; }
.page-title {
  font-family: var(--font-heading);
  letter-spacing: 2px;
  font-size: 2.6rem;
  color: var(--gold);
  margin-bottom: 16px;
}
.hero-title { font-size: clamp(3rem, 8vw, 4.6rem); }
.hero-sub { margin-bottom: 22px; }

.banner {
  background: rgba(255, 107, 94, 0.1);
  border: 1px solid rgba(255, 107, 94, 0.4);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 0.92rem;
}
.banner.info { background: rgba(46, 196, 182, 0.1); border-color: rgba(46, 196, 182, 0.4); }
.banner pre { max-height: 240px; overflow: auto; font-size: 0.75rem; white-space: pre-wrap; }

.btn-sm { font-size: 0.92rem; padding: 8px 16px; border-radius: 9px; }
.btn-xs { font-size: 0.82rem; padding: 4px 10px; border-radius: 7px; letter-spacing: 1px; }
.btn-primary.btn-sm, .btn-primary.btn-xs { box-shadow: none; }
.btn-ghost.on { border-color: var(--teal); color: var(--teal-light); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary.is-disabled { filter: grayscale(0.8) brightness(0.7); }
.file-btn { cursor: pointer; }
.link-btn {
  background: none; border: none; color: var(--gold); cursor: pointer;
  font: inherit; padding: 0; text-decoration: underline; text-underline-offset: 2px;
}

.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0; }
.row-actions.tight { gap: 6px; margin: 8px 0; }

.card { padding: 22px; animation: none; }
.form-grid { display: grid; gap: 14px; margin: 14px 0; }
.form-grid.cols { grid-template-columns: 1fr 260px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid h2 {
  font-family: var(--font-heading); letter-spacing: 1.5px; color: var(--gold);
  font-size: 1.25rem; margin-top: 8px; font-weight: normal;
}
.form-grid label { display: grid; gap: 5px; font-size: 0.88rem; color: var(--text-dim); }
.form-grid label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
.form-grid small { color: var(--text-dim); font-size: 0.8rem; }
.form-actions { display: flex; gap: 10px; align-items: center; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { flex: 1; }

input, select, textarea {
  font: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: #0d0d10;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 9px;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 2px rgba(46, 196, 182, 0.2); }
input[type="checkbox"] { accent-color: var(--gold); width: 16px; height: 16px; }
input.bad { border-color: var(--red); background: rgba(255, 107, 94, 0.08); }
textarea { resize: vertical; }

table.list { width: 100%; border-collapse: collapse; margin-top: 18px; }
table.list th, table.list td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
table.list th { font-family: var(--font-heading); letter-spacing: 1.5px; color: var(--text-dim); font-weight: normal; }

.pill {
  display: inline-block; font-size: 0.75rem; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-dim); margin-left: 4px;
}
.pill.green { color: var(--green); border-color: rgba(76, 195, 138, 0.5); }
.pill.amber { color: var(--amber); border-color: rgba(232, 176, 74, 0.5); }
.pill.red { color: var(--red); border-color: rgba(255, 107, 94, 0.5); }

/* Job view */
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.map-card {
  display: grid; grid-template-columns: 120px 1fr; gap: 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px;
}
.map-card .thumb {
  display: grid; place-items: center; background: #fff1; border-radius: 8px; overflow: hidden;
  aspect-ratio: 1; color: var(--text-dim); font-size: 0.8rem;
}
.map-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.map-label { font-weight: 700; color: var(--text); }
.drop-hint { margin-top: 18px; }
body.dragging .page { outline: 2px dashed var(--teal); outline-offset: 6px; border-radius: 12px; }
.saved { color: var(--teal-light); font-size: 0.85rem; opacity: 0; transition: opacity 0.3s; }
.saved.on { opacity: 1; }

/* Modal and toast */
.modal {
  position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.6);
  display: grid; place-items: center; padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px; max-width: 640px; width: 100%; max-height: 85vh; overflow: auto;
  box-shadow: var(--shadow);
}
.modal-msg { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.page-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.page-picks label { display: grid; gap: 4px; justify-items: center; font-size: 0.8rem; cursor: pointer; }
.page-picks img { width: 100%; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.conflicts { margin: 8px 0 0 18px; font-size: 0.88rem; }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 110;
  background: #1d1d22; border: 1px solid var(--border); color: var(--text);
  padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow); font-size: 0.92rem;
  max-width: min(680px, 92vw);
}

/* Workspace */
.ws { display: flex; flex-direction: column; height: calc(100vh - 57px); }
.ws-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.ws-bar-right { display: flex; align-items: center; gap: 10px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.seg button {
  font-family: var(--font-heading); letter-spacing: 1.2px; font-size: 0.95rem;
  background: transparent; color: var(--text-dim); border: none; padding: 6px 14px; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: rgba(212, 175, 55, 0.16); color: var(--gold-light); }
.seg.small button { font-size: 0.85rem; padding: 4px 10px; }

.ws-body { flex: 1; display: grid; grid-template-columns: 55% 45%; min-height: 0; }
.ws-left { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.viewer { flex: 1; position: relative; min-height: 0; overflow: hidden; background: #16161a; }
.viewer-canvas { display: block; touch-action: none; outline: none; }
.no-image { flex: 1; display: grid; place-content: center; gap: 12px; text-align: center; color: var(--text-dim); }
.tool-strip { padding: 8px 12px; border-top: 1px solid var(--line); background: var(--panel); min-height: 44px; }
.tools-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.tools-row label { display: inline-flex; align-items: center; gap: 6px; }
.tools-row .w-sm { width: 130px; }
.divider { width: 1px; height: 20px; background: var(--line); }

.ws-right { overflow-y: auto; padding: 12px 14px 40px; min-height: 0; }
.map-head { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: end; margin-bottom: 10px; }
.map-head label { display: grid; gap: 3px; font-size: 0.78rem; color: var(--text-dim); }
.map-head label.check { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 0.85rem; padding-bottom: 6px; }
.map-head .grow { flex: 1 1 180px; }
.map-head .grow2 { flex: 2 1 240px; }
.map-head .num { width: 110px; font-family: var(--mono); }
.map-head .num-sm { width: 64px; font-family: var(--mono); }
.map-head label[hidden] { display: none; }

.fig-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 8px; }
.fig-ctl { display: inline-flex; gap: 6px; align-items: center; }
.fig-ctl select { max-width: 200px; }

table.calls { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
table.calls th {
  font-family: var(--font-heading); letter-spacing: 1px; font-weight: normal; color: var(--text-dim);
  text-align: left; padding: 4px 4px; border-bottom: 1px solid var(--line); position: sticky; top: -12px; background: #0c0c0e; z-index: 1;
}
table.calls td { padding: 3px 4px; vertical-align: middle; }
table.calls input:not([type="checkbox"]), table.calls select { width: 100%; padding: 4px 6px; font-size: 0.85rem; }
table.calls input.num { text-align: right; }
table.calls .mono { font-family: var(--mono); }
table.calls td.seq { color: var(--text-dim); width: 24px; text-align: right; }
table.calls td.pts { font-family: var(--mono); font-size: 0.78rem; color: var(--text-dim); white-space: nowrap; }
table.calls td.conf { font-family: var(--mono); font-size: 0.78rem; white-space: nowrap; cursor: help; }
table.calls td.ck { text-align: center; }
table.calls td.act { white-space: nowrap; }
table.calls td.act button {
  background: none; border: 1px solid transparent; color: var(--text-dim); cursor: pointer;
  width: 22px; height: 22px; border-radius: 5px; font-size: 0.85rem; padding: 0;
}
table.calls td.act button:hover { border-color: var(--border); color: var(--gold); }
table.calls tr.call td:first-child { border-left: 3px solid transparent; }
table.calls tr.call.unchecked td:first-child { border-left-color: var(--gold); }
table.calls tr.conf-amber { background: rgba(232, 176, 74, 0.1); }
table.calls tr.conf-red { background: rgba(255, 107, 94, 0.13); }
table.calls tr.sel td { background: rgba(46, 196, 182, 0.12); }
table.calls tr.curve-row td { padding-top: 0; }
table.calls .ttable tr.unchecked td:first-child { border-left: 3px solid var(--gold); }
.curve-fields { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 2px 0 6px; }
.curve-fields label { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--text-dim); }
.curve-fields label[hidden] { display: none; }
.curve-fields input:not([type="checkbox"]) { width: 96px !important; }
.curve-fields select { width: auto !important; }
tr.msg-row td.msg { font-size: 0.78rem; padding: 0 4px 6px; }
tr.msg-row .err { color: var(--red); }
tr.msg-row .warn { color: var(--amber); }
.table-actions { margin-top: 10px; }
.kbd-hint { margin-left: auto; }
.tbl-title { font-family: var(--font-heading); letter-spacing: 1.5px; color: var(--gold); font-weight: normal; margin: 14px 0 4px; }
.ttable input.lbl { width: 60px !important; }

.other { margin: 10px 0; font-size: 0.85rem; }
.other summary { cursor: pointer; color: var(--text-dim); }
.other ul { list-style: none; margin-top: 6px; display: grid; gap: 4px; }

.closure {
  margin-top: 14px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); font-size: 0.92rem;
}
.closure.green { border-color: rgba(76, 195, 138, 0.6); background: rgba(76, 195, 138, 0.08); }
.closure.amber { border-color: rgba(232, 176, 74, 0.6); background: rgba(232, 176, 74, 0.09); }
.closure.red { border-color: rgba(255, 107, 94, 0.6); background: rgba(255, 107, 94, 0.08); }
.closure-main b { font-family: var(--mono); font-weight: 600; }
.closure.green .closure-main b { color: var(--green); }
.closure.amber .closure-main b { color: var(--amber); }
.closure.red .closure-main b { color: var(--red); }
.closure-grid { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; font-size: 0.84rem; color: var(--text-dim); }
.closure-grid b { color: var(--text); font-family: var(--mono); font-weight: 500; }
.closure-note { margin: 6px 0 10px; }

.sketch-wrap { background: #0f0f12; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
#sketch { width: 100%; height: 320px; display: block; }
#sketch .seg { fill: none; stroke: var(--gold); stroke-linecap: round; }
#sketch .seg.sel { stroke: var(--teal-light); }
#sketch .seg-hit { fill: none; stroke: transparent; cursor: pointer; }
#sketch .gap { stroke: var(--red); }
#sketch .pt { fill: #0f0f12; stroke: var(--text); stroke-width: 0.6; vector-effect: non-scaling-stroke; }
#sketch .pt-label { fill: var(--text-dim); font-family: var(--mono); }
#sketch .north path { fill: var(--text-dim); }
#sketch .north text, #sketch .scale text { fill: var(--text-dim); font-family: var(--mono); }
#sketch .scale line { stroke: var(--text-dim); }

/* Export menu */
.menu { position: relative; }
.menu summary { list-style: none; display: inline-block; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 290px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 6px;
  box-shadow: var(--shadow); display: grid;
}
.menu-list button {
  text-align: left; background: none; border: none; color: var(--text); padding: 8px 10px;
  border-radius: 6px; cursor: pointer; font: inherit; font-size: 0.9rem;
}
.menu-list button:hover { background: rgba(212, 175, 55, 0.12); color: var(--gold-light); }
.menu-note { font-size: 0.78rem; color: var(--text-dim); padding: 6px 10px 4px; border-top: 1px solid var(--line); margin-top: 4px; }

/* Place view */
.place { display: grid; grid-template-columns: 1fr 380px; height: calc(100vh - 57px); }
.place-map { position: relative; min-height: 0; }
.place-map #lmap { position: absolute; inset: 0; background: #111; }
.place-warning {
  position: absolute; left: 12px; bottom: 12px; z-index: 500; max-width: 420px;
  background: rgba(10, 10, 12, 0.85); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 10px; font-size: 0.78rem; color: var(--text);
}
.place-search {
  position: absolute; left: 56px; top: 10px; z-index: 500; display: flex; gap: 6px;
  background: rgba(10, 10, 12, 0.85); padding: 6px; border-radius: 9px; border: 1px solid var(--border);
}
.place-search input { width: 260px; }
.place-side { overflow-y: auto; padding: 14px; border-left: 1px solid var(--line); background: var(--panel); }
.place-side h3 { font-family: var(--font-heading); letter-spacing: 1.5px; color: var(--gold); font-weight: normal; margin: 14px 0 6px; }
.place-side h3:first-child { margin-top: 0; }
.place-side label { display: grid; gap: 3px; font-size: 0.8rem; color: var(--text-dim); margin-bottom: 8px; }
.place-side label.check { display: flex; align-items: center; gap: 6px; color: var(--text); }
.place-side .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.place-side .kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 0.84rem; }
.place-side .kv b { font-family: var(--mono); font-weight: 500; }
.anchor-row { display: flex; align-items: center; gap: 6px; font-size: 0.84rem; margin: 4px 0; font-family: var(--mono); }
.anchor-row .res { color: var(--text-dim); }
.place-points { max-height: 180px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.place-points button {
  display: flex; justify-content: space-between; width: 100%; background: none; border: none;
  border-bottom: 1px solid var(--line); color: var(--text); padding: 5px 8px; cursor: pointer; font-family: var(--mono); font-size: 0.8rem;
}
.place-points button.on { background: rgba(46, 196, 182, 0.15); color: var(--teal-light); }
.place-points button.anchored::after { content: "⚓"; }
.pt-icon { background: #0a0a0a; border: 2px solid var(--gold); border-radius: 50%; }
.pt-icon.anchor { border-color: var(--teal-light); background: var(--teal); }
.leaflet-container { font-family: var(--font-body); }
.leaflet-tooltip.pt-tip { background: rgba(10, 10, 12, 0.8); color: var(--text); border: none; box-shadow: none; font-family: var(--mono); font-size: 11px; padding: 1px 4px; }
.leaflet-tooltip.pt-tip::before { display: none; }

@media (max-width: 900px) {
  body[data-view="map"], body[data-view="place"] { overflow: auto; }
  .ws { height: auto; }
  .ws-body { grid-template-columns: 1fr; }
  .viewer { height: 60vh; flex: none; }
  .place { grid-template-columns: 1fr; height: auto; }
  .place-map { height: 60vh; }
  .form-grid.cols { grid-template-columns: 1fr; }
}
