/* LIVE team site: shared shell (sidebar + main) for index / fmap / wiki. The map viewer itself
   (viewer.html) has its own styles and is framed by fmap.html. */
:root {
  color-scheme: dark;
  --side: #1e1f22;      /* sidebar */
  --bg: #313338;        /* main grey */
  --card: #2b2d31;
  --card-2: #383a40;
  --line: #3f4147;
  --fg: #dbdee1;
  --dim: #949ba4;
  --acc: #f0b429;       /* gold, same as the map viewer */
  --acc-dim: rgba(240, 180, 41, .14);
  --red: #f23f43;
  --green: #23a559;
  --side-w: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font: 15px/1.55 system-ui, "Segoe UI", Roboto, sans-serif;
  display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh;
}
a { color: var(--acc); text-decoration: none; } a:hover { text-decoration: underline; }
code { background: #1e1f22; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; font: 13px Consolas, "Cascadia Mono", monospace; }
kbd { background: #1e1f22; border: 1px solid #55585f; border-bottom-width: 2px; border-radius: 4px; padding: 0 6px; font: 600 12px system-ui, sans-serif; color: #fff; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.25; } h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 15px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
p { margin: 0 0 1em; }
button, .btn {
  display: inline-flex; align-items: center; gap: 6px; background: var(--card-2); color: var(--fg);
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer;
}
button:hover, .btn:hover { border-color: var(--acc); text-decoration: none; }
button.primary, .btn.primary { background: var(--acc); color: #1e1f22; border-color: var(--acc); font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: #ffc94d; }
button.quiet { background: transparent; border-color: transparent; color: var(--dim); padding: 4px 8px; } button.quiet:hover { color: var(--red); }
input[type=text], textarea { width: 100%; background: #1e1f22; color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit; }
input:focus, textarea:focus { outline: none; border-color: var(--acc); }
textarea { min-height: 110px; resize: vertical; }

/* ---- sidebar ------------------------------------------------------------------------------ */
nav.side {
  background: var(--side); border-right: 1px solid #111214; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 18px 12px;
}
nav.side .brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
nav.side .brand .mark {
  width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, var(--acc), #d9822b);
  color: #1e1f22; font: 800 17px/40px system-ui, sans-serif; text-align: center; letter-spacing: .02em; flex: none;
}
nav.side .brand b { display: block; font-size: 17px; letter-spacing: .04em; } nav.side .brand small { color: var(--dim); font-size: 12px; }
nav.side a.item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--dim); font-weight: 500;
  position: relative; transition: background .12s, color .12s;
}
nav.side a.item:hover { background: #26282c; color: var(--fg); text-decoration: none; }
nav.side a.item.active { background: var(--acc-dim); color: #fff; }
nav.side a.item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--acc); }
nav.side a.item svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
nav.side a.item.active svg { color: var(--acc); }
nav.side .foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; line-height: 1.6; }
nav.side .foot .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); margin-right: 6px; vertical-align: 0; }
nav.side .foot .dot.on { background: var(--green); } nav.side .foot .dot.off { background: var(--red); }

/* ---- main --------------------------------------------------------------------------------- */
main { min-width: 0; padding: 36px 40px 60px; }
main.full { padding: 0; display: flex; flex-direction: column; height: 100vh; }
main.full iframe { flex: 1; width: 100%; border: 0; display: block; }
.wrap { max-width: 900px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; margin-bottom: 16px; }
.hero { background: linear-gradient(160deg, #2b2d31, #232428); border-color: #45474d; padding: 28px 30px; }
.hero h1 { font-size: 30px; } .hero h1 span { color: var(--acc); }
.hero p { color: var(--dim); max-width: 620px; font-size: 15.5px; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 12px; }
.section-head h2 { margin: 0; } .section-head .hint { color: var(--dim); font-size: 13px; }
.muted { color: var(--dim); }
.empty { color: var(--dim); text-align: center; padding: 30px 0; }

/* announcements */
.post { position: relative; }
.post .when { color: var(--dim); font-size: 12.5px; margin-bottom: 8px; }
.post h2 { font-size: 17px; margin-bottom: 2px; }
.post .body { white-space: pre-wrap; margin: 0; }
.post .del { position: absolute; top: 10px; right: 10px; }
form.post-form label { display: block; color: var(--dim); font-size: 13px; margin: 10px 0 4px; }
form.post-form .row { display: flex; gap: 10px; margin-top: 14px; align-items: center; }
form.post-form .msg { color: var(--dim); font-size: 13px; } form.post-form .msg.err { color: var(--red); }

/* wiki */
details.tool { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
details.tool > summary {
  list-style: none; cursor: pointer; padding: 16px 22px; display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 16px; user-select: none;
}
details.tool > summary::-webkit-details-marker { display: none; }
details.tool > summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--dim); border-bottom: 2px solid var(--dim); transform: rotate(-45deg); transition: transform .15s; }
details.tool[open] > summary::after { transform: rotate(45deg); }
details.tool > summary .tag { font-size: 11.5px; font-weight: 500; color: var(--dim); background: #1e1f22; border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; }
details.tool[open] > summary { border-bottom: 1px solid var(--line); background: #26282c; }
details.tool .content { padding: 6px 22px 20px; }
details.tool h3 { margin-top: 20px; } details.tool h3:first-child { margin-top: 12px; }
details.tool ol, details.tool ul { padding-left: 22px; margin: 0 0 1em; } details.tool li { margin: 4px 0; }
table.keys { border-collapse: collapse; margin: 0 0 1em; } table.keys td { padding: 5px 14px 5px 0; vertical-align: top; } table.keys td:first-child { white-space: nowrap; }
.note { border-left: 3px solid var(--acc); background: var(--acc-dim); padding: 10px 14px; border-radius: 0 6px 6px 0; margin: 0 0 1em; }
.note.warn { border-color: var(--red); background: rgba(242, 63, 67, .1); }

code, .post .body { overflow-wrap: anywhere; }

/* phones: the sidebar becomes a top bar, the map page fills the rest of the screen */
@media (max-width: 760px) {
  body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  body.map-page { height: 100vh; height: 100dvh; }
  nav.side {
    position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px;
    padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); border-right: 0; border-bottom: 1px solid #111214;
  }
  nav.side .brand { border: 0; margin: 0 auto 0 0; padding: 2px 4px; gap: 8px; }
  nav.side .brand .mark { width: 30px; height: 30px; line-height: 30px; font-size: 13px; } nav.side .brand small { display: none; }
  nav.side a.item { padding: 8px 10px; gap: 6px; font-size: 14px; } nav.side a.item.active::before { display: none; }
  nav.side .foot { display: none; }
  main { padding: 18px 16px 40px; }
  main.full { height: auto; min-height: 0; }
  .hero { padding: 20px 18px; } .hero h1 { font-size: 23px; }
  .section-head { margin-top: 22px; }
  details.tool > summary { padding: 14px 16px; font-size: 15px; } details.tool .content { padding: 4px 16px 16px; }
  table.keys td { padding-right: 10px; }
}
