/* The night look, taken from the old TCY (map/app/style.css and look.css): graphite, thin silver edges, small corners.
   Orange only for work, blue only for your own words, white for news and the one main button; everything else a grey. */
:root {
  --bg: #0b0c11; --panel: #111318; --card: #171a21; --field: #0b0c11; --bar: #0e1014;
  --line: rgba(174,183,198,.3); --line-soft: rgba(174,183,198,.16); --edge-hi: rgba(226,232,242,.55);
  --text: #f4f7fb; --sub: #d5dae3; --muted: #b4bcc9; --faint: #aab3c2; --dim: #8b94a3; --off: #5b6474;
  --silver: #c9d0db; --white: #e9edf4; --on-white: #0e1014;
  --orange: #ff8a1f; --on-orange: #1a0f00; --blue: #3d95ff;
  --head: 'Space Grotesk', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow: 0 14px 40px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.35);
  --edge-light: inset 0 1px 0 rgba(226,232,242,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); overflow: hidden; }
[hidden] { display: none !important; }
#scene { position: fixed; inset: 0; }
h1, h2 { font-family: var(--head); font-weight: 600; }
h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); margin: 16px 0 6px; }
.meta { color: var(--muted); font-size: 12px; }
.help { color: var(--muted); font-size: 12px; }

/* buttons and fields */
.btn { font: inherit; font-size: 13px; font-weight: 500; padding: 8px 12px; border-radius: 4px; border: 1px solid rgba(174,183,198,.45); background: none;
  color: #eef1f6; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.primary { background: var(--white); color: var(--on-white); border-color: transparent; font-weight: 600; }
.btn.primary:active:not(:disabled) { box-shadow: inset 0 1px 3px rgba(0,0,0,.35); }
.btn:disabled { opacity: .5; cursor: default; }
textarea, .field { width: 100%; padding: 10px; border-radius: 4px; border: 1px solid var(--line); background: var(--field); color: #eef1f6; font: inherit; font-size: 14px; }
textarea::placeholder, .field::placeholder, input::placeholder { color: var(--dim); }
input[type="date"] { color-scheme: dark; }

/* a card, as the old pages draw one */
.card { border: 1px solid rgba(174,183,198,.2); border-radius: 6px; background: var(--card); padding: 14px; margin: 0 0 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,.5), var(--edge-light); }

/* one short line over everything: top middle, then it fades */
.toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 60; background: var(--panel);
  border: 1px solid var(--line); border-top-color: var(--edge-hi); border-radius: 6px; padding: 10px 14px; font-size: 13px; max-width: min(90vw, 460px);
  box-shadow: 0 10px 24px rgba(0,0,0,.5), var(--edge-light); transition: opacity .35s; }
.toast.gone { opacity: 0; }

/* the line at the top left while the line to the mini PC is down (the old counters' pill) */
#state { position: fixed; top: calc(16px + env(safe-area-inset-top)); left: 16px; z-index: 9; display: flex; gap: 10px; align-items: center; padding: 8px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); font-size: 13px; color: var(--sub); }
#state .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--off); }

/* the city's name plates (CSS2D labels over the buildings) */
.lbl { color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; }
.lbl.bname { font-size: 12px; letter-spacing: .02em; padding: 2px 8px; border: 1px solid rgba(200,208,222,.32); background: rgba(8,9,13,.8); color: #e3e7ee; text-align: center;
  pointer-events: auto; cursor: pointer; }   /* a tap on a name opens its building, as a tap on the building does */
.lbl.bname::after { content: ''; position: absolute; left: -6px; right: -6px; top: -12px; bottom: -12px; }   /* 44 px to tap */
.lbl.bname.hq { font-size: 13px; letter-spacing: .04em; padding: 3px 10px; border-color: rgba(226,232,242,.75); background: rgba(8,9,13,.82); color: #f4f7fb; }
.lbl.bname.fine { border-color: rgba(200,208,222,.14); background: rgba(8,9,13,.9); color: #8f98aa; }   /* a part not rebuilt yet: its plate pale */

/* no city (no WebGL, or three.js could not load): one tile for every building (the old City desk's tiles) */
.tiles { position: fixed; z-index: 2; left: 16px; right: 104px; top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 96px; padding: 8px; border: 1px solid rgba(174,183,198,.18);
  border-radius: 4px; background: var(--card); color: var(--sub); font: inherit; cursor: pointer; }
.tile b { font-size: 14px; font-weight: 500; } .tile.dim { color: var(--off); }

/* the lock screen (the old frame TopLock) */
#lock { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg); }
.lock-form { background: var(--panel); border: 1px solid var(--line); border-top-color: rgba(226,232,242,.7); border-radius: 8px; box-shadow: 0 24px 60px rgba(0,0,0,.7);
  padding: 24px 18px 20px; max-width: 380px; width: 100%; display: flex; flex-direction: column; gap: 14px; }
.lock-head { display: flex; align-items: center; gap: 12px; }
.lock-ico { width: 44px; height: 44px; flex: none; border: 1px solid rgba(174,183,198,.45); border-radius: 4px; background: var(--card); display: flex; align-items: center; justify-content: center; color: var(--sub); }
.lock-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lock-head h1 { margin: 0; font-size: 24px; line-height: 30px; color: var(--text); }
.lock-field { display: flex; flex-direction: column; gap: 6px; }
.lock-field label { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.lock-field input { height: 48px; padding: 0 12px; border: 1px solid rgba(174,183,198,.45); border-radius: 4px; background: var(--field); color: #eef1f6; font: inherit; font-size: 16px; outline: none; }
.lock-field input:focus-visible { border-color: var(--edge-hi); }
.lock-go { height: 48px; border: 0; border-radius: 4px; background: var(--white); color: var(--on-white); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.lock-go:disabled { opacity: .6; cursor: default; }
.lock-note { margin: 0; font-size: 13px; line-height: 18px; color: var(--faint); }
.lock-note:empty { display: none; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(12px) scale(.97); opacity: 0; } }

/* the phone: everything you tap is at least 44 px; 16 px fields so the iPhone does not zoom in */
@media (max-width: 760px) {
  html, body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
  body { font-size: 15px; }
  .btn { min-height: 44px; min-width: 44px; padding: 8px 14px; font-size: 14px; }
  textarea, .field, input { font-size: 16px !important; }
  .tiles { right: 16px; top: calc(16px + env(safe-area-inset-top)); grid-template-columns: 1fr 1fr; }
  #state { left: 12px; top: calc(8px + env(safe-area-inset-top)); }
}
