/* Kantr Studio.
   A light design studio: warm paper with a dotted canvas, soft pastel surfaces, sharp ink edges ("kant" is
   Norwegian for edge) and one loud colour, a sharp yellow, for what matters: the main action and where you are.
   Shapes have hard offset shadows instead of blur, and press down when clicked. */

@font-face { font-family: "Bricolage Grotesque"; font-weight: 200 800; font-style: normal; font-display: swap;
             src: url(/static/fonts/bricolage-grotesque.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 100 900; font-style: normal; font-display: swap;
             src: url(/static/fonts/inter.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --paper: #FAF8F3;          /* the canvas */
  --dot: #E4DED3;
  --card: #FFFFFF;
  --soft: #F5F2EC;           /* quiet fields, table heads */
  --ink: #18161D;            /* text and the sharp edges */
  --ink-2: #3B3743;
  --muted: #6F6A78;
  --faint: #A39EAB;
  --line: #E7E2EA;           /* soft separators */
  --field: #CFC8D6;

  --yellow: #FFD60A;         /* the accent: main actions, where you are, focus */
  --yellow-2: #FFC400;
  --yellow-soft: #FFF5BF;

  --lilac: #E8E1FF; --mint: #D5F3E4; --peach: #FFE2D2; --sky: #D9E9FF; --rose: #FFDDE6; --butter: #FFF4C7;

  --ok-bg: #D5F3E4;   --ok-fg: #1F6B45;
  --warn-bg: #FFF1B8; --warn-fg: #6B5300;
  --bad-bg: #FFDDE6;  --bad-fg: #A3214A;
  --idle-bg: #EFECF3; --idle-fg: #3B3743;
  --red: #D4245A;

  --term-bg: #18161D; --term-ink: #E9E5EF;

  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --edge: 1.5px solid var(--ink);
  --r: 14px;                 /* cards */
  --r-sm: 10px;              /* buttons, fields */
  --lift: 3px 3px 0 var(--ink);
  --lift-soft: 4px 4px 0 var(--lilac);
}

/* ------------------------------------------------------------------ base */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink-2); font-family: var(--text); font-size: 14.5px; line-height: 1.6;
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--yellow-2); text-decoration-thickness: 2px;
    text-underline-offset: 0.18em; transition: background-color 120ms, text-decoration-color 120ms; }
a:hover { background: var(--yellow-soft); text-decoration-color: var(--ink); }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--yellow); border-radius: 6px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
code { font-family: var(--mono); font-size: 0.9em; }
::selection { background: var(--yellow); color: var(--ink); }

h1, h2, h3 { font-family: var(--display); color: var(--ink); font-weight: 700; }
h1 { font-size: 34px; line-height: 1.1; letter-spacing: -0.025em; margin: 0; font-weight: 750; }
h2 { font-size: 21px; line-height: 1.3; letter-spacing: -0.01em; margin: 44px 0 14px; }
h3 { font-size: 16.5px; line-height: 1.35; margin: 0; }
.lede { color: var(--muted); margin: 6px 0 0; max-width: 68ch; font-size: 15px; }
.hint, small { color: var(--muted); font-size: 13px; font-weight: 400; }
.eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.strong { font-weight: 600; color: var(--ink); }
.grow { flex: 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ top bar */

.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 20px;
  padding: 10px 28px; min-height: 64px;
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: var(--edge);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; border-radius: 10px; }
.brand:hover { background: none; }
.brand .mark { width: 34px; height: 34px; transition: transform 200ms cubic-bezier(.3, 1.6, .5, 1); }
.brand:hover .mark { transform: rotate(-8deg) scale(1.06); }
.brand .word { font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -0.03em; line-height: 1; }
.brand .word b { font-weight: 400; margin-left: 4px; color: var(--muted); letter-spacing: -0.01em; }
.brand.big .mark { width: 52px; height: 52px; }
.brand.big .word { font-size: 30px; }

.mainnav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; white-space: nowrap;
  color: var(--ink-2); font-weight: 550; font-size: 14px; text-decoration: none; border: 1.5px solid transparent;
}
.mainnav a svg { width: 16px; height: 16px; flex: none; opacity: 0.75; }
.mainnav a:hover { background: var(--card); border-color: var(--line); }
.mainnav a[aria-current="page"] { background: var(--yellow); border-color: var(--ink); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.mainnav a[aria-current="page"] svg { opacity: 1; }

.me { display: flex; align-items: center; gap: 12px; margin-left: auto; flex: none; }
.langs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); }
.langs a { padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; color: var(--muted); text-decoration: none; }
.langs a:hover { color: var(--ink); background: var(--soft); }
.langs a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; text-decoration: none;
  background: var(--icon-bg, var(--lilac)); color: var(--icon-fg, var(--ink)); border: var(--edge);
  font-family: var(--display); font-weight: 750; font-size: 14px; transition: transform 120ms, box-shadow 120ms;
}
.avatar:hover, .avatar[aria-current="page"] { background: var(--icon-bg, var(--lilac)); box-shadow: 2px 2px 0 var(--ink); transform: translate(-1px, -1px); }

.content { padding: 40px 28px 96px; }
.page { max-width: 1160px; margin: 0 auto; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 30px; }
.page-title { display: flex; align-items: center; gap: 16px; min-width: 0; }
.page-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none;
             background: var(--lilac); border: var(--edge); color: var(--ink); box-shadow: var(--lift); transform: rotate(-3deg); }
.page-icon svg { width: 24px; height: 24px; }
.page-title .eyebrow { margin: 0 0 4px; }
.page-title .eyebrow a { color: inherit; text-decoration: none; }

.crumbs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--faint); }

/* ------------------------------------------------------------------ cards, tables */

.card { background: var(--card); border: var(--edge); border-radius: var(--r); box-shadow: var(--lift-soft); }
.card.pad { padding: 22px 26px; }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-bottom: 1.5px solid var(--line); }
.card-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 20px; border-top: 1.5px solid var(--line); }
.card-head + .card-foot { border-top: 0; }
.card-title { font-family: var(--display); font-size: 17px; font-weight: 700; color: var(--ink); margin: 0 0 12px; }
.scroll { overflow-x: auto; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.grid-2 > .card + .card { margin-top: 0; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 12px 18px 8px; font-size: 11.5px; font-weight: 650; text-transform: uppercase;
     letter-spacing: 0.07em; color: var(--muted); white-space: nowrap; }
td { padding: 13px 18px; border-top: 1.5px solid var(--line); vertical-align: middle; color: var(--ink-2); }
thead + tbody tr:first-child td { border-top-color: var(--line); }
tbody tr { transition: background-color 120ms; }
tbody tr.link:hover, tbody tr[data-href]:hover { background: var(--yellow-soft); cursor: pointer; }
td.strong { font-weight: 600; color: var(--ink); }
td.right, th.right { text-align: right; }
.row-title { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; color: var(--ink); text-decoration: none; }
.row-title:hover { background: none; }
.row-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }

/* site tiles: pastel squares with the site's first letter */
.app-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none;
            background: var(--icon-bg); color: var(--icon-fg); border: var(--edge);
            font-family: var(--display); font-weight: 750; font-size: 18px; }
.app-icon.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; border-width: 1.2px; }
.app-icon.lg { width: 54px; height: 54px; border-radius: 15px; font-size: 22px; box-shadow: var(--lift); }

/* the site overview */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.app-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; color: inherit; text-decoration: none;
            transition: transform 140ms, box-shadow 140ms; }
.app-card:hover { background: var(--card); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--icon-bg, var(--lilac)), 6px 6px 0 1.5px var(--ink); }
.app-card .top { display: flex; align-items: center; gap: 14px; }
.app-card h3 { font-size: 18px; }
.app-card p { margin: 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-card .foot { margin-top: auto; padding-top: 14px; border-top: 1.5px dashed var(--line);
                  display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.app-card .open { font-size: 13px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.app-card:hover .open { background: var(--yellow); border-radius: 6px; padding: 0 6px; margin: 0 -6px; }

/* ------------------------------------------------------------------ pills, tags */

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 11px;
        font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap;
        background: var(--idle-bg); color: var(--idle-fg); border: 1.2px solid color-mix(in srgb, currentColor 35%, transparent); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.running, .pill.succeeded { background: var(--ok-bg); color: var(--ok-fg); }
.pill.queued, .pill.running-job, .pill.partly, .pill.pending { background: var(--warn-bg); color: var(--warn-fg); }
.pill.stopped, .pill.failed, .pill.interrupted, .pill.not, .pill.exited, .pill.dead, .pill.error { background: var(--bad-bg); color: var(--bad-fg); }
.pill.running-job::before, .pill.queued::before { animation: blink 1.2s ease-in-out infinite; }
.tag { display: inline-block; font-size: 11px; font-weight: 650; padding: 0 8px; border-radius: 999px; border: 1.2px solid var(--ink);
       color: var(--ink); background: var(--yellow); margin-left: 8px; vertical-align: middle; line-height: 1.6; }
@keyframes blink { 50% { opacity: 0.25; } }

/* ------------------------------------------------------------------ buttons */

.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.4;
  padding: 8px 16px; border-radius: var(--r-sm); border: var(--edge);
  background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: 2px 2px 0 var(--ink); transition: transform 100ms, box-shadow 100ms, background-color 120ms;
}
.btn svg, button svg { width: 16px; height: 16px; flex: none; }
.btn:hover, button:hover { background: var(--soft); color: var(--ink); text-decoration: none; transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active, button:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn.primary, button.primary, .btn.accent, button.accent { background: var(--yellow); }
.btn.primary:hover, button.primary:hover, .btn.accent:hover, button.accent:hover { background: var(--yellow-2); }
button.danger { background: var(--red); color: #fff; }
button.danger:hover { background: #B51C4B; color: #fff; }
button.danger-quiet, .btn.danger-quiet { color: var(--red); box-shadow: none; border-color: color-mix(in srgb, var(--red) 45%, transparent); }
button.danger-quiet:hover, .btn.danger-quiet:hover { background: var(--bad-bg); color: var(--red); box-shadow: none; transform: none; }
.btn.sm, button.sm { padding: 5px 12px; font-size: 13px; border-radius: 9px; }
.btn.wide, button.wide { width: 100%; padding-top: 11px; padding-bottom: 11px; font-size: 15px; }
button.link { border: 0; box-shadow: none; background: none; padding: 0; color: var(--muted); font-weight: 500;
              text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 0.18em; }
button.link:hover { color: var(--ink); background: none; transform: none; box-shadow: none; text-decoration-color: var(--ink); }
button:disabled { opacity: 0.55; cursor: progress; transform: none; }
button[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor;
                                   border-right-color: transparent; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.icon-btn { padding-left: 9px; padding-right: 9px; }

/* ------------------------------------------------------------------ forms */

form.stack, .stack { display: grid; gap: 18px; }
label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
label small, label .hint { font-weight: 400; }
input[type=text], input[type=number], input[type=email], input[type=password], input[type=search], input[type=url], select, textarea {
  font: inherit; font-size: 14.5px; color: var(--ink); background: var(--card); width: 100%;
  border: 1.5px solid var(--field); border-radius: var(--r-sm); padding: 9px 13px;
  transition: border-color 120ms, box-shadow 120ms;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 3px 3px 0 var(--yellow); }
input:user-invalid { border-color: var(--red); }
input.code-input { font-family: var(--mono); font-size: 22px; letter-spacing: 0.3em; text-align: center; padding: 10px; }
.field-error { display: none; color: var(--red); font-size: 12.5px; font-weight: 400; }
label:has(input:user-invalid) .field-error { display: block; }
.form-err { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--bad-bg); color: var(--bad-fg);
            border: 1.5px solid color-mix(in srgb, var(--bad-fg) 35%, transparent); font-weight: 500; }
.affix { display: flex; }
.affix input { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.affix span { display: flex; align-items: center; padding: 0 12px; border: 1.5px solid var(--field); border-left: 0;
              border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--soft); color: var(--muted); font-family: var(--mono);
              font-size: 12.5px; white-space: nowrap; }
.preview { font-family: var(--mono); font-size: 12.5px; color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.preview b { color: var(--ink); background: var(--yellow-soft); font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--ink); flex: none; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input { flex: 1; min-width: 200px; }
.inline select { width: auto; }

.split2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; color: var(--muted); font-size: 13.5px; counter-increment: s; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
                    background: var(--yellow); border: 1.5px solid var(--ink); color: var(--ink); font-weight: 750; font-size: 12.5px;
                    font-family: var(--display); }
.steps b { color: var(--ink); font-weight: 600; display: block; }

/* ------------------------------------------------------------------ feedback */

.toasts { position: fixed; top: 82px; right: 24px; z-index: 50; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 48px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--ink); color: var(--paper); border-radius: 12px;
         padding: 11px 14px; font-size: 14px; box-shadow: 4px 4px 0 var(--yellow); transition: opacity 300ms, transform 300ms; }
.toast .ico { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none;
              margin-top: 1px; color: var(--ink); background: var(--yellow); }
.toast.err { box-shadow: 4px 4px 0 var(--rose); }
.toast.err .ico { background: var(--rose); color: var(--bad-fg); }
.toast button { margin-left: auto; padding: 0 4px; border: 0; background: none; color: var(--faint); font-size: 17px; line-height: 1; box-shadow: none; }
.toast button:hover { color: var(--paper); background: none; transform: none; box-shadow: none; }
.toast.leaving { opacity: 0; transform: translateY(-6px); }

.banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--r-sm);
          border: 1.5px solid; margin-bottom: 18px; }
.banner.ok { background: var(--ok-bg); color: var(--ok-fg); border-color: color-mix(in srgb, var(--ok-fg) 35%, transparent); }
.banner.err { background: var(--bad-bg); color: var(--bad-fg); border-color: color-mix(in srgb, var(--bad-fg) 35%, transparent); }
.banner.warn { background: var(--warn-bg); color: var(--warn-fg); border-color: color-mix(in srgb, var(--warn-fg) 35%, transparent); }
.banner .grow { flex: 1; }
.banner strong { font-weight: 650; }

.callout { padding: 14px 16px; border-radius: var(--r-sm); background: var(--sky); border: 1.5px solid color-mix(in srgb, var(--ink) 15%, transparent);
           font-size: 13.5px; color: var(--ink-2); }

.empty { text-align: center; padding: 56px 24px; color: var(--muted); background: var(--card); }
.empty h3 { margin-bottom: 6px; font-size: 20px; }
.empty .btn { margin-top: 18px; }
.empty-row { margin: 0; padding: 18px; }
.tab-note { margin: 12px 0 0; }

/* ------------------------------------------------------------------ job log */

.log-wrap { position: relative; }
pre.log { margin: 0; background: var(--term-bg); color: var(--term-ink); border-radius: var(--r); padding: 18px 22px; border: var(--edge);
          font: 12.5px/1.65 var(--mono); max-height: 64vh; overflow: auto; white-space: pre-wrap; word-break: break-word; box-shadow: var(--lift-soft); }
.jump { position: absolute; right: 16px; bottom: 16px; }

/* ------------------------------------------------------------------ danger zone, confirmations */

details.danger-zone { margin-top: 44px; }
details.danger-zone summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px;
                              color: var(--red); font-weight: 600; }
details.danger-zone summary::-webkit-details-marker { display: none; }
details.danger-zone summary::before { content: "›"; font-size: 18px; line-height: 1; transition: transform 150ms; }
details.danger-zone[open] summary::before { transform: rotate(90deg); }
details.danger-zone .card { margin-top: 12px; box-shadow: 4px 4px 0 var(--rose); }
.inline-confirm { display: inline-block; text-align: left; }
.inline-confirm > summary { list-style: none; cursor: pointer; }
.inline-confirm > summary::-webkit-details-marker { display: none; }
.inline-confirm[open] { max-width: 280px; }

/* ------------------------------------------------------------------ sign-in pages */

body.auth {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 18%, var(--lilac) 0, transparent 26%),
    radial-gradient(circle at 88% 12%, var(--peach) 0, transparent 22%),
    radial-gradient(circle at 80% 86%, var(--mint) 0, transparent 26%),
    radial-gradient(circle at 18% 90%, var(--sky) 0, transparent 22%),
    radial-gradient(var(--dot) 1.1px, transparent 1.2px);
  background-size: auto, auto, auto, auto, 22px 22px;
  background-attachment: fixed;
}
.auth-wrap { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 26px; padding: 40px 16px; }
.auth-card { width: min(460px, calc(100vw - 32px)); padding: 32px 34px; box-shadow: 6px 6px 0 var(--ink); }
.auth-card h1 { font-size: 30px; margin-bottom: 4px; }
.auth-card .lede { margin-bottom: 20px; }
.auth-card form.stack { margin-top: 18px; }
.auth-card > .hint { margin: 18px 0 0; }
.auth-card > form:last-child { margin-top: 8px; }
.auth-foot { margin: 0; display: flex; gap: 12px; }
.auth-foot a { font-size: 13px; color: var(--muted); text-decoration: none; padding: 2px 8px; border-radius: 999px; }
.auth-foot a[aria-current="true"] { color: var(--ink); background: var(--yellow); border: 1.2px solid var(--ink); }
.totp { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 16px; border-radius: var(--r);
        background: var(--butter); border: 1.5px dashed var(--ink); }
.totp .qr svg { display: block; width: 150px; height: 150px; border-radius: 10px; border: 1.5px solid var(--ink); background: #fff; }
code.key { font-size: 13.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--ink); background: var(--card);
           border: 1.5px solid var(--line); border-radius: 8px; padding: 6px 10px; overflow-wrap: anywhere; user-select: all; }
ol.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 14px; margin: 18px 0 22px; padding: 16px 18px 16px 38px;
           background: var(--butter); border: 1.5px dashed var(--ink); border-radius: var(--r); }
ol.codes code { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: 0.05em; }
.link-card { margin-bottom: 22px; background: var(--yellow-soft); box-shadow: 5px 5px 0 var(--ink); }
.copy-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.copy-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; background: var(--card); border: 1.5px solid var(--line);
                 padding: 8px 12px; border-radius: var(--r-sm); user-select: all; }

/* ------------------------------------------------------------------ Code: workspaces with Claude */

.page:has(.code-page) { max-width: none; }
.content:has(.code-page) { padding-top: 24px; padding-bottom: 20px; }
.code-page { display: flex; flex-direction: column; gap: 14px; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.code-head h1 { font-size: 26px; margin: 0; line-height: 1.15; }
.code-sub { margin: 6px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.code-sub .mono { font-size: 12.5px; }
.code-sub .sm svg, #code-preview svg { width: 14px; height: 14px; }
.code-sub button.sm { display: inline-flex; align-items: center; gap: 5px; }
#code-preview .btn { display: inline-flex; align-items: center; gap: 6px; }
.code-top { margin-bottom: 8px; }
.files-toggle { display: inline-flex; align-items: center; gap: 8px; }
.files-toggle .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--yellow); color: var(--ink);
  border: 1.2px solid var(--ink); font-size: 11.5px; font-weight: 750; display: inline-grid; place-items: center; }
.files-toggle .count[data-count="0"] { display: none; }

.code-tabs { display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; margin-bottom: -1.5px; position: relative; z-index: 1; }
.code-tabs [role=tab] { display: inline-flex; align-items: center; gap: 7px; padding: 7px 16px; border-radius: 12px 12px 0 0;
  border: var(--edge); border-bottom-color: transparent; background: var(--soft); color: var(--muted); font-weight: 600; box-shadow: none; }
.code-tabs [role=tab]:hover { transform: none; box-shadow: none; color: var(--ink); }
.code-tabs [role=tab] svg { width: 15px; height: 15px; }
.code-tabs [role=tab][aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: inset 0 4px 0 var(--yellow); }
.code-tabs .tab-hint { margin-left: 10px; }

.claude-wrap { background: var(--term-bg); border-radius: 0 var(--r) var(--r) var(--r); overflow: hidden; border: var(--edge); box-shadow: var(--lift-soft); }
.claude-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px;
  background: #221F29; color: #CFC9D9; font-size: 13px; border-bottom: 1px solid #34303D; }
.claude-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: #fff; }
.claude-title svg { width: 16px; height: 16px; color: var(--yellow); }
.claude-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.claude-right .claude-status { margin-right: 6px; }
.claude-cmd { padding: 3px 10px; font-size: 12.5px; background: transparent; color: #EDE9F3; border: 1px solid #4A4555; border-radius: 7px; box-shadow: none; }
.claude-cmd:hover:not(:disabled) { background: #2E2A37; border-color: var(--yellow); transform: none; box-shadow: none; color: #fff; }
.claude-cmd:disabled { opacity: .45; cursor: default; }
.claude-status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px;
  background: var(--yellow); vertical-align: 1px; }
.claude-status[data-state="connected"]::before { background: #4ADE80; }
.claude-status[data-state="failed"]::before { background: #F43F5E; }
.claude-term { height: 70vh; min-height: 360px; padding: 8px 4px 4px 10px; }   /* code.js sizes it to the window */
.claude-term .xterm { height: 100%; }

.agent-wrap { display: flex; flex-direction: column; height: 70vh; min-height: 380px; background: var(--card);
  border: var(--edge); border-radius: 0 var(--r) var(--r) var(--r); box-shadow: var(--lift-soft); }
.agent-log { flex: 1; min-height: 0; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.agent-log > * { width: 100%; max-width: 860px; margin-left: auto; margin-right: auto; }
.agent-hello { margin: auto; text-align: center; max-width: 560px; }
.agent-hello h2 { margin: 0 0 8px; font-size: 26px; }
.agent-turn { display: flex; flex-direction: column; gap: 6px; }
.agent-turn .msg-body { color: var(--ink); }
.msg.user { display: flex; flex-direction: column; align-items: flex-end; }
.msg.user .msg-body { max-width: 85%; background: var(--lilac); border: 1.5px solid var(--ink); padding: 9px 14px;
  border-radius: 16px 16px 4px 16px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.msg-body { overflow-wrap: anywhere; }
.msg-body.md { white-space: normal; }
.msg-body.md > :first-child { margin-top: 0; }
.msg-body.md > :last-child { margin-bottom: 0; }
.msg-body.md h1, .msg-body.md h2, .msg-body.md h3 { font-size: 16px; margin: 18px 0 6px; }
.msg-body.md p, .msg-body.md ul, .msg-body.md ol { margin: 0 0 10px; }
.msg-body.md pre { background: var(--term-bg); color: var(--term-ink); padding: 12px 14px; border-radius: 10px; overflow-x: auto; }
.msg-body.md :not(pre) > code { background: var(--soft); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.msg-body.md table { margin: 0 0 10px; border: 1.5px solid var(--line); }
.msg-body.md blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--yellow); color: var(--muted); }
.msg-note { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.msg-note.err { color: var(--bad-fg); }
.agent-turn.pending .msg-note::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 8px;
  background: var(--yellow); border: 1px solid var(--ink); vertical-align: 0; animation: wiggle 1s ease-in-out infinite; }
@keyframes wiggle { 50% { transform: rotate(45deg) scale(.8); } }
.step { font-size: 12.5px; color: var(--muted); padding: 3px 0 3px 12px; border-left: 2.5px solid var(--line); overflow-wrap: anywhere; }
.step .label { font-weight: 650; margin-right: 6px; color: var(--ink-2); }
.step .detail { font-family: var(--mono); font-size: 12px; color: var(--ink-2); background: var(--soft); padding: 1px 5px; border-radius: 4px; }
.step.edit, .step.write { border-left-color: var(--yellow-2); }
.step.run { border-left-color: #8B7FE8; }
.step.failed { border-left-color: var(--red); }
.step.failed .label { color: var(--bad-fg); }
.step-out { margin-top: 4px; }
.step-out summary { cursor: pointer; font-size: 12px; }
.step-out pre { margin: 4px 0 0; max-height: 260px; overflow: auto; background: var(--term-bg); color: var(--term-ink);
  padding: 8px 10px; border-radius: 8px; font-size: 11.5px; white-space: pre-wrap; }
.todos { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.todos li::before { content: "○"; margin-right: 6px; }
.todos li.in_progress::before { content: "◐"; color: var(--ink); }
.todos li.completed { text-decoration: line-through; color: var(--faint); }
.todos li.completed::before { content: "✓"; color: var(--ok-fg); }
.composer { border-top: 1.5px solid var(--line); padding: 12px 16px 14px; display: grid; gap: 8px; }
.composer textarea { width: 100%; max-width: 860px; margin: 0 auto; display: block; resize: none; max-height: 40vh; border-radius: 12px; }
.composer-row { width: 100%; max-width: 860px; margin: 0 auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.composer select { width: auto; max-width: 100%; }
.composer .banner { margin: 12px 16px 16px; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 40; overflow-y: auto;
  background: var(--card); border-left: var(--edge); visibility: hidden;
  padding: 22px 24px 28px; transform: translateX(100%);
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .28s; }
.drawer.open { transform: none; visibility: visible; box-shadow: -8px 0 0 var(--lilac);
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.drawer-head h2 { margin: 0; font-size: 20px; }
.drawer-sub { font-size: 15px; margin: 26px 0 10px; }
.drawer-scrim { position: fixed; inset: 0; z-index: 39; background: rgba(24, 22, 29, .2); opacity: 0; transition: opacity .2s; }
.drawer-scrim.show { opacity: 1; }
.file-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 8px; justify-content: space-between; font-size: 13px; }
.file-list li .mono { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.file-list li svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.tips { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.drop-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--yellow) 18%, transparent); border: 4px dashed var(--ink); }
.drop-overlay > div { background: var(--card); color: var(--ink); padding: 22px 30px; border-radius: var(--r); text-align: center;
  border: var(--edge); box-shadow: var(--lift); font-weight: 650; }
.drop-overlay svg { width: 30px; height: 30px; }
.drop-overlay p { margin: 6px 0 0; }

.dropzone { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; cursor: pointer;
            padding: 36px 20px; border: 2px dashed var(--field); border-radius: var(--r); background: var(--soft);
            font-weight: 400; transition: border-color 120ms, background-color 120ms; }
.dropzone.compact { padding: 22px 20px; }
.dropzone:hover, .dropzone.over { border-color: var(--ink); background: var(--yellow-soft); }
.dropzone:focus-within { border-color: var(--ink); box-shadow: 3px 3px 0 var(--yellow); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone .dz-icon svg { width: 32px; height: 32px; }
.dropzone .dz-title { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.dropzone.has-file .dz-title { font-family: var(--mono); font-size: 13px; }
.dropzone .hint { max-width: 52ch; }

.help-wrap { position: relative; }
.help-toggle { width: 38px; padding-left: 0; padding-right: 0; justify-content: center; font-weight: 800; border-radius: 999px; }
.popover { position: absolute; top: calc(100% + 10px); right: 0; z-index: 45; width: min(360px, calc(100vw - 32px));
  background: var(--card); border: var(--edge); border-radius: var(--r); padding: 16px 18px;
  box-shadow: 5px 5px 0 var(--ink); transform-origin: top right; animation: pop-in .16s ease-out; }
.popover h3 { margin: 0 0 10px; font-size: 15px; }
@keyframes pop-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.contents { display: contents; }

.ai-brief { padding: 18px 20px; margin-bottom: 24px; background: var(--yellow-soft); }
.ai-brief-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ai-brief-row .grow { flex: 1; min-width: 240px; }
.ai-preview { margin-top: 14px; }
.ai-preview summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
.ai-preview textarea { display: block; width: 100%; height: 360px; margin-top: 10px; resize: vertical; font: 12.5px/1.6 var(--mono); }

/* tabs (tabs.js) */
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin: 0 0 24px; overflow-x: auto; }
.tabs [role=tab] { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 10px 14px;
  color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tabs [role=tab]:hover { color: var(--ink); background: none; transform: none; box-shadow: none; }
.tabs [role=tab][aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--yellow); }

/* ------------------------------------------------------------------ responsive + preferences */

@media (max-width: 960px) {
  .split2, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px 0; gap: 10px 14px; }
  .brand .word b { display: none; }
  .mainnav { order: 3; flex-basis: 100%; margin: 0 -16px; padding: 0 16px 10px; }
  .mainnav a svg { display: none; }
  .content { padding: 26px 16px 64px; }
  h1 { font-size: 28px; }
  .page-head > .actions, .page-head > .btn { width: 100%; }
  .page-head > .actions > .btn, .page-head > .actions > form { flex: 1; }
  .page-head > .actions > form > button { width: 100%; }
  .toasts { top: 16px; right: 16px; }
  .totp { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .auth-card { padding: 26px 22px; }
}
@media (max-width: 700px) { .popover { position: fixed; top: auto; left: 16px; right: 16px; width: auto; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (prefers-contrast: more) {
  :root { --line: #9A93A3; --field: #6F6A78; --muted: #3B3743; }
}

/* Create site: what it's built with */
fieldset.kinds { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
fieldset.kinds legend { font-size: 13.5px; font-weight: 600; color: var(--ink); padding: 0; margin-bottom: 6px; }
label.kind { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--field);
             border-radius: var(--r-sm); background: var(--card); cursor: pointer; font-weight: 400; }
label.kind:hover { border-color: var(--ink-2); }
label.kind:has(input:checked) { border-color: var(--ink); background: var(--yellow-soft); box-shadow: 3px 3px 0 var(--ink); }
label.kind input { width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--ink); flex: none; }
label.kind > span { display: grid; gap: 2px; }
label.kind b { color: var(--ink); }
