/* Watchman app layout. Everything visual comes from the design system
   (tokens.css + components.css); this file is layout glue only. */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-body);
  font-size: var(--text-body); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
button { font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* ── Auth ── */
.auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  background: var(--green-gradient); padding: var(--space-4); }
.auth-inner { width: 100%; max-width: 380px; text-align: center; }
.auth .wm-microlabel { color: rgba(212, 188, 120, 0.7); }
.auth-title { font-family: var(--font-display); font-style: italic; font-size: 3.4rem;
  color: #FAF8F3; margin: 8px 0 4px; font-weight: 400; }
.auth-sub { color: rgba(250, 248, 243, 0.65); font-weight: 300; margin-bottom: 24px; }
.auth-card { text-align: left; display: flex; flex-direction: column; gap: 12px; }
.auth-card .wm-microlabel { color: var(--ink-45); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field input, .field select, .field textarea {
  background: var(--panel); border: 1px solid transparent; border-radius: var(--radius-inner);
  padding: 11px 12px; font-family: var(--font-mono); font-size: 14px; color: var(--ink);
  width: 100%; outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green-mid); }
.form-error { color: var(--loss); min-height: 12px; }

/* ── App shell ── */
.app { max-width: 430px; margin: 0 auto; min-height: 100dvh; display: flex;
  flex-direction: column; position: relative; }
.statusbar { display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 22px 6px;
  font-family: var(--font-mono); font-size: 11px; color: rgba(21, 32, 27, 0.55);
  letter-spacing: 0.1em; }
.statusbar-btn { background: none; border: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.15em;
  color: var(--ink-35); }
#screens { flex: 1; padding: 4px 20px calc(96px + env(safe-area-inset-bottom)); }
.screen { display: flex; flex-direction: column; gap: 12px; }

.screen-head { display: flex; justify-content: space-between; align-items: flex-end;
  margin-top: 8px; }
.screen-head .wm-title { margin-top: 2px; }

/* ── Bottom nav ── */
.bottomnav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px; z-index: 40;
  padding-bottom: env(safe-area-inset-bottom); }
.navicon { width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ── Shared bits ── */
.row { display: flex; align-items: center; gap: 8px; }
.row--between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { border-radius: var(--radius-inner); padding: 12px 8px; text-align: center;
  background: var(--panel); }
.tile-value { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 600; }
.tile .wm-microlabel { display: block; margin-top: 4px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.quiet { color: var(--ink-60); font-size: var(--text-small); line-height: 1.55; }
.spacer { flex: 1; }

/* Direction toggle */
.dir-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Confluence rows */
.conf-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 4px 0; }
.conf-left { display: flex; align-items: center; gap: 10px; }
.conf-detail { display: flex; gap: 6px; align-items: center; }
.conf-detail select, .conf-detail input { background: var(--panel); border: none;
  border-radius: 8px; padding: 6px 8px; font-family: var(--font-mono); font-size: 11px;
  color: var(--ink); max-width: 110px; outline: none; }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--hairline);
  background: var(--card); cursor: pointer; flex: none; display: inline-flex;
  align-items: center; justify-content: center; padding: 0; }
.tick.on { background: var(--win); border-color: var(--win); }
.tick svg { width: 13px; height: 13px; stroke: #fff; stroke-width: 2.5; fill: none;
  stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.tick.on svg { opacity: 1; }

/* Toggle pills (dxy / silver state) */
.pill-toggle { display: flex; gap: 6px; }
.pill-toggle button { flex: 1; border: 1px solid var(--hairline); background: var(--card);
  border-radius: var(--radius-pill); padding: 7px 0; font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
  color: var(--ink-45); }
.pill-toggle button.on { background: var(--green); border-color: var(--green); color: #FAF8F3; }
.pill-toggle button.on.bad { background: var(--loss); border-color: var(--loss); }

/* Check row (gate) */
.checkrow { display: flex; align-items: center; justify-content: space-between; }
.checkrow .lbl { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dot { width: 18px; height: 18px; border-radius: 50%; flex: none; display: inline-flex;
  align-items: center; justify-content: center; }
.dot.ok { background: var(--win-soft); }
.dot.ok svg { width: 11px; height: 11px; stroke: var(--win); stroke-width: 2.5; fill: none;
  stroke-linecap: round; stroke-linejoin: round; }
.dot.bad { background: var(--loss-soft); }
.dot.bad svg { width: 11px; height: 11px; stroke: var(--loss); stroke-width: 2.5; fill: none;
  stroke-linecap: round; }

/* Arrival tile states */
.arrival-btn { width: 100%; }

/* News banner text */
.wm-newsbanner .big { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 700;
  color: #FAF8F3; }

/* Journal MFE */
.trade-card + .trade-card { margin-top: 0; }
textarea.debrief { min-height: 84px; resize: vertical; font-family: var(--font-body);
  font-size: 12px; line-height: 1.6; }

/* Override modal-ish inline block */
.override-box { border: 1px solid rgba(185, 28, 28, 0.4); border-radius: var(--radius-card);
  padding: var(--space-3); background: #fff; }

/* Toast */
#toast { position: fixed; bottom: calc(84px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%); background: var(--green); color: #FAF8F3;
  border-radius: var(--radius-pill); padding: 10px 18px; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em; z-index: 60; box-shadow: var(--shadow-elevated);
  max-width: 90%; text-align: center; }
#toast.error { background: var(--loss); }
