/* Wrappit's look, as in the Wrappit app: the same colours and fonts, typewriter
   buttons with an underline, light and dark themes. Dark is the default; the
   theme button sets data-theme on the page. */
@font-face { font-family: "Hanken Grotesk"; src: url("/fonts/hanken-grotesk.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("/fonts/dm-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("/fonts/dm-mono-500.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }
:root {
  --ground: #141414; --panel: #1f1f1f; --panel-2: #141414; --raise: #2a2a2a;
  --ink: #f0f0ee; --ink-2: #b5b5b2; --ink-3: #8a8a87; --line: #2e2e2e;
  --accent: #f0f0ee; --accent-soft: #141414; --accent-ink: #141414;
  --ok: #6e6e6b; --ok-ink: #b5b5b2; --warn: #f2b632; --warn-ink: #f2b632; --warn-soft: #2b2512;
  --bad: #ff5a4c; --bad-ink: #ff7a6e; --bad-soft: #2e1714; --agent: #a993ff; --agent-soft: #221d33;
  --mono: "DM Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --ground: #e7e7e4; --panel: #ffffff; --panel-2: #e7e7e4; --raise: #efefec;
  --ink: #121212; --ink-2: #545454; --ink-3: #7c7c7a; --line: #e2e2df;
  --accent: #121212; --accent-soft: #e7e7e4; --accent-ink: #ffffff;
  --ok: #9a9a97; --ok-ink: #545454; --warn: #e0a000; --warn-ink: #8a5c00; --warn-soft: #f6ecd2;
  --bad: #e5372b; --bad-ink: #c22b20; --bad-soft: #fbe3e0; --agent: #5b3fd6; --agent-soft: #ebe6fb;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 17px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
h1, h2, p { margin: 0; }
a { color: var(--ink); font-family: var(--mono); font-size: .92em; text-decoration-thickness: 1.5px; text-decoration-color: var(--ink-3); text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--ink); }
.muted { color: var(--ink-2); }

/* Buttons: words in the typewriter font, no box. The main one is black with a
   thick line under it; the rest are grey until you point at them. */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 1px 3px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; font: 400 15px var(--mono); text-transform: lowercase; white-space: nowrap; color: var(--ink-2); text-decoration: none; }
.btn:hover { color: var(--ink); border-bottom-color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; border-bottom-color: transparent; }
.btn.primary { color: var(--ink); font-weight: 500; border-bottom-color: var(--ink); }
.btn.primary:hover { border-bottom-width: 3px; padding-bottom: 2px; }
.btn.big { font-size: 18px; padding: 8px 2px 4px; align-self: flex-start; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 10px; border: 0; background: none; color: var(--ink-2); font: 400 18px var(--mono); }
.icon-btn:hover { background: var(--panel); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }

input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 0; background: var(--panel); color: var(--ink); font: 400 17px var(--sans); }
input::placeholder { color: var(--ink-3); }
input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--ink); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.field .hint { font: 400 13px var(--mono); color: var(--ink-3); }

/* The brand: the Wrappit mark and word, as in the app's top bar. */
.brand { display: inline-flex; align-items: center; gap: 9px; padding: 4px; color: var(--ink); text-decoration: none; font: 700 22px var(--sans); letter-spacing: -.03em; }
.brand:hover { text-decoration: none; }

/* The join screen, shown until the server welcomes us. */
.join { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; overflow: auto; background: var(--ground); }
.join-card { width: min(460px, 100%); display: flex; flex-direction: column; gap: 14px; }
.kicker { font: 400 13px var(--mono); color: var(--ink-3); text-transform: lowercase; margin-top: 18px; }
.join h1 { font: 700 40px/1.1 var(--sans); letter-spacing: -.035em; overflow-wrap: anywhere; }
.lead { color: var(--ink-2); font-size: 18px; }
.join-form { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.signed { color: var(--ink-2); }
.signed b { font-weight: 600; color: var(--ink); }
.err { color: var(--bad-ink); font-weight: 600; }
.signin { font-size: 15px; color: var(--ink-2); }

/* Dialogs: the same sheet as the Wrappit app's. */
dialog { border: 0; border-radius: 14px; background: var(--panel); color: var(--ink); padding: 0; width: min(460px, 92vw); }
dialog::backdrop { background: rgba(0, 0, 0, .4); }
.dlg-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.dlg-body h2 { font: 700 22px/1.2 var(--sans); letter-spacing: -.02em; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 22px; flex-wrap: wrap; margin-top: 4px; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { display: flex; align-items: flex-start; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--ink); }
.choice input { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--ink); }
.choice span { display: grid; gap: 4px; color: var(--ink-2); font-size: 15px; }
.choice b { color: var(--ink); font-weight: 500; }
.copy-row { display: flex; gap: 12px; align-items: center; }
.copy-row input { flex: 1; min-width: 0; font: 400 14px var(--mono); }
/* The add agent dialog's message: a sunken box of mono text that wraps, so the links and commands stay whole. */
.agent-msg { width: 100%; min-height: 240px; max-height: 42vh; resize: vertical; padding: 12px 14px; border: 0; border-radius: 10px; background: var(--panel-2); color: var(--ink); font: 400 13px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Messages: one at a time, at the top, like the Wrappit app's. */
.toast { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 60; max-width: 92vw; padding: 12px 20px; border-radius: 10px; background: var(--ink); color: var(--panel); font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.toast.err { background: var(--bad); color: #fff; }

/* A small menu hung from a button. */
.menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 190px; padding: 6px; display: grid; border-radius: 12px; background: var(--panel); box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(0, 0, 0, .28); }
.menu-item { text-align: left; border: 0; background: none; border-radius: 8px; padding: 10px 12px; font: 400 15px var(--mono); text-transform: lowercase; color: var(--ink); }
.menu-item:hover { background: var(--ground); }
