/* Open Sky room. worklab42 language (Cold Harbour page and desk): DM Sans with DM Mono 11px uppercase labels;
   ground, card, tile and ink tokens from the desk; glass field and quay photo from Cold Harbour.
   Sized for 14-inch laptops (1366x768 to 1536x864). Light and dark follow the device until switched; the choice
   is not saved (nothing is kept in the browser). */
:root {
  --ground: #efeeeb; --ink: #17191b; --soft: #6a6e72; --desc: #4e5256; --line: #d8d6d1;
  --card: #f7f6f3; --card-line: #dfddd8; --tile: #efeeea; --sheet: #ffffff; --rule: #cfd2d5; --head: #eef0f2;
  --pill: #17191b; --on-pill: #f5f5f3; --ok: #3f8f5e; --due: #c98a2b;
  --ctl: #c9c7c2; --ctl-hi: #9a9894; --meter: #dddbd6;
  --glass: rgba(255,255,255,.34); --glass-focus: rgba(255,255,255,.5);
  --lift: 0 1px 2px rgba(23,25,27,.04), 0 6px 18px rgba(23,25,27,.05);
  --deep: 0 30px 90px rgba(23,25,27,.20), 0 6px 18px rgba(23,25,27,.08);
  --sans: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.22,.9,.24,1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ground: #141516; --ink: #ecebe8; --soft: #9a9da0; --desc: #b5b8bb; --line: #2c2e30;
  --card: #1b1c1e; --card-line: #2e3032; --tile: #222426; --sheet: #202224; --rule: #34373a; --head: #26282a;
  --pill: #ecebe8; --on-pill: #17191b; --ok: #6fbf8c; --due: #e0a84e;
  --ctl: #3c3f42; --ctl-hi: #5f6366; --meter: #34373a;
  --lift: 0 1px 2px rgba(0,0,0,.3); --deep: 0 30px 90px rgba(0,0,0,.6);
  color-scheme: dark;
}
.theme { all: unset; cursor: pointer; display: inline-grid; place-items: center; width: 26px; height: 26px; color: var(--ink); }
.theme svg { transition: transform .3s ease; }
:root[data-theme="dark"] .theme svg { transform: rotate(180deg); }
.theme:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.quay, .quay * { --ink: #17191b; }
:root[data-theme="dark"] .quay { filter: brightness(.82); }
.signing { min-height: 100vh; display: grid; place-items: center; }

* { box-sizing: border-box; min-width: 0; }
html, body { height: 100%; margin: 0; }
body { background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, select, input, textarea { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
p { margin: 0; }
.screen { display: none; min-height: 100vh; }
.screen.on { display: block; }
.k { font-family: var(--mono); font-size: 11px; font-weight: 300; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
.nm { font-weight: 170; line-height: 1; white-space: nowrap; margin: 0; }
.nm b { font-weight: 510; }
.wm { font-size: 19px; font-weight: 600; letter-spacing: -.012em; }
.wm span { font-weight: 300; }
.pill { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px; background: var(--pill); color: var(--on-pill); font-size: 15px; font-weight: 500; }
.act { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--card-line); border-radius: 10px; font-size: 14px; line-height: 1; transition: background .2s, border-color .2s; }
.act:hover { border-color: color-mix(in srgb, var(--ink) 45%, transparent); background: var(--tile); }
.pill:active, .act:active, .who button:active { transform: scale(.97); }
svg.arr { flex: none; transition: transform .2s ease; }
a:hover svg.arr, button:hover svg.arr { transform: translate(2px, -2px); }

/* ---------- Quay screens: same page, photo and placement as Cold Harbour ---------- */
.quay { position: relative; min-height: 100vh; overflow: hidden; background: #b9b8b3 url("/assets/quay-wide.jpg") 14% 50% / cover no-repeat; }
.quay .wm { position: absolute; left: clamp(28px, 8.75vw, 126px); top: 38px; }
.quay .seat { position: absolute; left: 61%; top: 44.3%; width: min(400px, 34vw); }
.quay .nm { font-size: 45px; letter-spacing: -.006em; }
.gate { position: relative; display: flex; align-items: center; height: 58px; padding: 0 7px 0 20px; border-radius: 12px; margin-top: 31px;
  background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.15); backdrop-filter: blur(18px) saturate(1.15); transition: background .2s ease; }
.gate:focus-within { background: var(--glass-focus); }
.gate input { flex: 1; height: 100%; border: 0; outline: 0; background: transparent; font-size: 17px; font-weight: 500; letter-spacing: .01em; }
.gate input::placeholder { color: rgba(23,25,27,.5); font-weight: 200; letter-spacing: .02em; }
.gate .go { width: 44px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; border-radius: 8px; }
.gate .g { width: 30px; text-align: center; font-size: 17px; font-weight: 300; opacity: .42; margin-right: 5px; }
.gate.shake { animation: shake .5s var(--ease); }
@keyframes shake { 20%,60% { transform: translateX(-10px); } 40%,80% { transform: translateX(10px); } }
.quay .say { margin-top: 22px; font-size: 17px; font-weight: 300; }
a.gate { text-decoration: none; color: var(--ink); justify-content: space-between; padding-right: 14px; font-size: 17px; font-weight: 400; }
a.gate:hover { background: var(--glass-focus); }
.quay .foot { position: absolute; left: clamp(28px, 8.75vw, 126px); bottom: 16px; font-family: var(--mono); font-size: 11.4px; font-weight: 300; letter-spacing: .12em; text-transform: uppercase; color: rgba(23,25,27,.75); }

/* ---------- Room: tools left, chat right ---------- */
.room { display: grid; grid-template-columns: clamp(256px, 23vw, 330px) minmax(0, 1fr); height: 100vh; }
.tools { background: var(--card); border-right: 1px solid var(--card-line); display: flex; flex-direction: column; padding: 24px clamp(18px, 1.8vw, 26px) 14px; overflow-y: auto; }
.tools .nm { font-size: 34px; margin-top: 20px; }
.tools .note { margin-top: 8px; color: var(--desc); font-weight: 300; font-size: 14px; line-height: 1.4; }
.tools .art { margin-top: 16px; height: 64px; border-radius: 14px; overflow: hidden; background: #cfcfcf url("/assets/opensky-sky.jpg") center 30% / cover; filter: contrast(.92); }
.tl { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--line); }
.tl > li { border-bottom: 1px solid var(--line); }
.tl > li > button { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: grid; grid-template-columns: minmax(0,1fr) 16px; gap: 12px; align-items: center; padding: 13px 0; }
.tl .tn { display: block; font-size: 19px; font-weight: 200; line-height: 1.1; }
.tl .tw { display: block; margin-top: 5px; }
.tl > li > button[aria-expanded="true"] svg { transform: rotate(90deg); }
.tl > li > button svg { transition: transform .2s ease; }
.tx { padding: 0 0 14px; }
.tx[hidden] { display: none; }
.zones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.zone { background: var(--sheet); border: 1px solid var(--card-line); border-radius: 12px; padding: 10px 12px; }
.zone b { display: block; margin-top: 4px; font-size: 22px; font-weight: 200; line-height: 1.05; }
.zone span.d { display: block; margin-top: 3px; font-size: 12.5px; color: var(--desc); font-weight: 300; }
.soonline { color: var(--desc); font-weight: 300; font-size: 14px; }
.tools > * { flex: none; }
/* Session chats: page memory only */
.chl { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.chl button { all: unset; box-sizing: border-box; cursor: pointer; display: block; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; transition: background .2s, border-color .2s; }
.chl button:hover { background: var(--tile); }
.chl button[aria-current="true"] { background: var(--sheet); border-color: var(--card-line); }
.chl button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.chl .ct { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chl .k { display: block; margin-top: 4px; }

.tools .foot { margin-top: auto; padding-top: 18px; }
/* Notes: kept on the server, newest first */
.nnew { background: var(--sheet); border: 1px solid var(--card-line); border-radius: 12px; padding: 10px 12px; }
.nnew:focus-within { border-color: var(--ctl-hi); }
.nnew textarea { width: 100%; border: 0; outline: 0; resize: none; background: transparent; font-size: 15px; line-height: 1.45; max-height: 160px; }
.nrow { display: flex; justify-content: flex-end; margin-top: 6px; }
.notes { list-style: none; margin: 12px 0 0; padding: 0 4px 0 0; display: grid; gap: 10px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--ctl) transparent; }
.notes.scroll { overflow-y: auto; }
.ntc { background: var(--sheet); border: 1px solid var(--card-line); border-radius: 12px; padding: 12px 14px; }
.ntc.fresh { animation: nfresh 2s ease-out; }
@keyframes nfresh { from { background: var(--tile); } to { background: var(--sheet); } }
.ntc .nb { margin-top: 6px; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cm { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.cm li { background: var(--tile); border-radius: 10px; padding: 8px 10px; }
.cm li p { margin-top: 3px; font-size: 14px; overflow-wrap: anywhere; }
.na { display: flex; gap: 16px; margin-top: 10px; align-items: center; }
.lnk { all: unset; cursor: pointer; font-family: var(--mono); font-size: 11px; font-weight: 300; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.lnk:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.lnk:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.cform { display: flex; gap: 8px; margin-top: 10px; }
.cform input { flex: 1; height: 36px; border: 1px solid var(--ctl); border-radius: 10px; padding: 0 10px; background: var(--sheet); font-size: 14px; outline: 0; }
.cform input:focus { border-color: var(--ctl-hi); }
.cform[hidden], .ask[hidden] { display: none; }
.ask { display: flex; gap: 14px; align-items: center; margin-top: 10px; font-size: 14px; }


.chat { display: flex; flex-direction: column; height: 100vh; min-width: 0; }
.top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px clamp(18px, 3vw, 44px) 8px; }
.picker { position: relative; display: inline-flex; align-items: center; gap: 12px; }
.sel { position: relative; display: inline-block; }
.sel select { appearance: none; -webkit-appearance: none; height: 36px; padding: 0 38px 0 12px; border: 1px solid var(--ctl); border-radius: 10px; background: var(--sheet); font-size: 14.5px; cursor: pointer; min-width: 220px; }
.sel::after { content: ""; position: absolute; right: 15px; top: 50%; width: 7px; height: 7px; border-right: 1.3px solid var(--ink); border-bottom: 1.3px solid var(--ink); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.who { display: flex; align-items: center; gap: 14px; color: var(--soft); }
.info { flex: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; padding: 0 clamp(18px, 3vw, 44px) 10px; border-bottom: 1px solid var(--line); }
.mi { font-size: 13.5px; color: var(--desc); line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi b { color: var(--ink); font-weight: 500; }
.use .ur { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.use .ur b { font-size: 22px; font-weight: 200; line-height: 1; }
.use .meter { flex: 1; margin-top: 0; }
.use .ud { display: block; margin-top: 4px; font-size: 13px; color: var(--soft); font-weight: 300; }
.meter { display: block; height: 3px; border-radius: 2px; background: var(--meter); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ink); }
.who button { all: unset; cursor: pointer; color: var(--ink); font: inherit; letter-spacing: inherit; text-transform: inherit; white-space: nowrap; }
.who button:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.who .t b { color: var(--ink); font-weight: 400; }
.thread { flex: 1; overflow-y: auto; padding: 16px clamp(18px, 3vw, 44px); }
.inner { max-width: 760px; margin: 0 auto; }
.empty { margin-top: 12vh; }
.empty .nm { font-size: 28px; }
.empty p { margin-top: 12px; color: var(--desc); font-weight: 300; }
.msg { margin-bottom: 20px; }
.msg.you { display: flex; justify-content: flex-end; }
.msg.you .body { background: var(--tile); border: 1px solid var(--card-line); border-radius: 14px; padding: 10px 14px; max-width: 80%; font-size: 15.5px; white-space: pre-wrap; }
.msg.ai .k { margin-bottom: 8px; }
.msg.ai .body { font-size: 15.5px; line-height: 1.55; white-space: pre-wrap; }
.msg.ai .acts { margin-top: 10px; }
.stop { background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; padding: 14px 16px; }
.cursor::after { content: ""; display: inline-block; width: 7px; height: 1.05em; background: var(--ink); vertical-align: -3px; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.compose { flex: none; padding: 0 clamp(18px, 3vw, 44px) 12px; }
.box { max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; gap: 6px; background: var(--sheet); border: 1px solid var(--ctl); border-radius: 14px; padding: 7px 7px 7px 18px; box-shadow: var(--lift); }
.box:focus-within { border-color: var(--ctl-hi); }
.box textarea { flex: 1; border: 0; outline: 0; resize: none; font-size: 15.5px; line-height: 1.45; max-height: 180px; padding: 10px 0; background: transparent; }
.box .go { width: 44px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; border-radius: 8px; }
.box .go:hover { background: var(--tile); }
.compose .k { max-width: 760px; margin: 8px auto 0; text-align: center; }
.lim { max-width: 760px; margin: 0 auto 8px; display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink); }
.lim[hidden] { display: none; }
.lim .lnk { margin-left: auto; }
.box .go[disabled] { opacity: .3; cursor: default; }

/* Five-minute warning */
.veil { position: fixed; inset: 0; z-index: 40; background: rgba(23,25,27,.28); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.veil.on { opacity: 1; pointer-events: auto; }
.warn { width: min(440px, 92vw); background: var(--card); border-radius: 14px; padding: 26px 28px 24px; box-shadow: var(--deep); transform: translateY(8px) scale(.98); transition: transform .3s var(--ease); }
.veil.on .warn { transform: none; }
.warn b.num { display: block; margin-top: 10px; font-size: 44px; font-weight: 200; line-height: 1; letter-spacing: -.01em; }
.warn p { margin-top: 12px; color: var(--desc); }
.warn .row2 { margin-top: 22px; display: flex; gap: 12px; align-items: center; }

@media (max-width: 900px) {
  .room { grid-template-columns: 1fr; height: auto; }
  .tools { border-right: 0; border-top: 1px solid var(--card-line); order: 2; }
  .chat { height: 100vh; }
  .quay .seat { left: 7vw; width: 86vw; } .quay .wm, .quay .foot { left: 7vw; }
  .wk-head { grid-template-columns: 1fr; } .wk-art { display: none; }
  .tiles { grid-template-columns: 1fr 1fr; } .proj { grid-template-columns: 1fr; } .ptabs { position: static; flex-direction: row; flex-wrap: wrap; }
  .who .t { display: none; } .sel select { min-width: 0; } .info { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
