/* ---------------------------------------------------------------------------
   Application styles
   A printed, workshop-like look: paper ground, ink type, hard offset shadows,
   one warm accent. No gradients, no glows.
--------------------------------------------------------------------------- */
:root {
  --paper: #f4f1ea;
  --card: #fffdf8;
  --card-2: #efebe1;
  --ink: #16140f;
  --ink-2: #3f3b33;
  --muted: #736d61;
  --line: #ddd6c7;
  --line-2: #c7bfad;
  --accent: #bf3f26;        /* vermillion */
  --accent-ink: #8f2f1c;
  --green: #2c6049;
  --blue: #2a4d7a;
  --gold: #a9762a;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 3px 3px 0 var(--shadow-ink);
  --shadow-soft: 0 2px 10px rgba(22, 20, 15, .08);
  --font: 'IBM Plex Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --topbar-h: 62px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); background: var(--paper); color: var(--ink); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 2.1rem; } h2 { font-size: 1.6rem; } h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); font-size: .88em; }
code { background: var(--card-2); padding: 1px 5px; border-radius: 4px; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 1600px; margin: 0 auto; padding: 0 20px; }
.page { padding-block: 34px 72px; min-height: 60vh; }
.muted { color: var(--muted); } .small { font-size: .86em; } .center { text-align: center; }
.mt { margin-top: 24px; } .mb { margin-bottom: 24px; } .mt-sm { margin-top: 12px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row-between { justify-content: space-between; }
.spacer { flex: 1; }

/* Header ------------------------------------------------------------------ */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--line-2); }
/* The bar spans the window: the logo at its left edge, the menu and the favourites star at its right. */
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: var(--topbar-h); gap: 16px; padding: 0 20px; }
/* A staging installation (config 'environment' => 'staging'): a thin band above everything, so nobody works in the wrong tab. */
.env-band { background: #b3261e; color: #fff; font-size: 13px; font-weight: 600; line-height: 1.2; padding: 7px 20px; text-align: center; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 700; font-size: 1.12rem; color: var(--ink); letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; flex: none; object-fit: contain; }
/* The uploaded logo carries the name itself, so it gets the room the mark and the name shared. */
.brand-logo { display: block; height: 48px; width: auto; max-width: 300px; object-fit: contain; }
@media (max-width: 640px) { .brand-logo { height: 40px; max-width: 210px; } }
/* The claim beside the logo; the menu needs the room on narrower screens. */
.brand-claim { font-family: var(--display); font-weight: 600; font-size: .95rem; letter-spacing: -.01em; color: var(--muted); white-space: nowrap; margin-right: auto; padding-left: 14px; border-left: 1px solid var(--line-2); }
.theme-teal .topbar .brand-claim { color: var(--head-ink); opacity: .75; }
@media (max-width: 980px) { .brand-claim { display: none; } }

/* Every control in the nav is one height, one type size and one corner – links, the button, the
   wallet, and the profile menu line up as a single row. Plain links are
   borderless; the two things that carry state (wallet, profile) are outlined chips. */
.nav { display: flex; gap: 4px; align-items: center; --nav-h: 36px; }
.nav > a, .nav-menu > summary { display: inline-flex; align-items: center; gap: 7px;
  height: var(--nav-h); padding: 0 12px; border-radius: var(--radius); border: 1px solid transparent;
  color: var(--ink-2); font-family: inherit; font-weight: 500; font-size: .92rem; line-height: 1; white-space: nowrap; }
.nav > a:hover { color: var(--ink); background: var(--card-2); text-decoration: none; }
.nav > a.btn { color: #fff; border-color: var(--accent-ink); font-weight: 600; margin: 0 4px; }
.nav > a.btn:hover { transform: none; box-shadow: none; background: var(--accent-ink); }
.nav-svg { width: 18px; height: 18px; flex: none; }
.nav > a.nav-icon { width: var(--nav-h); padding: 0; justify-content: center; }
.nav > a.nav-credits, .nav-menu > summary { border-color: var(--line-2); background: var(--card); }
.nav > a.nav-credits { font-variant-numeric: tabular-nums; }
.nav > a.nav-credits .nav-svg { color: var(--accent); width: 16px; height: 16px; }
.nav > a.nav-credits:hover, .nav-menu > summary:hover, .nav-menu[open] > summary:hover { border-color: var(--ink); color: var(--ink); background: var(--card); }
.nav-user .avatar { margin-left: -4px; }
.nav-toggle { display: none; background: var(--card); border: 1px solid var(--line-2); color: var(--ink); border-radius: var(--radius); padding: 5px 10px; font-size: 1.05rem; }
@media (max-width: 880px) {
  .nav { display: none; position: absolute; top: var(--topbar-h); left: 0; right: 0; background: var(--card); border-bottom: 1px solid var(--line-2); flex-direction: column; align-items: stretch; padding: 10px 20px; box-shadow: var(--shadow-soft); }
  body.nav-open .nav { display: flex; }
  .nav-toggle { display: block; }
}

/* The profile menu is a <details>, so it opens without JavaScript; app.js only closes it again
   on a click elsewhere. */
.nav-menu { position: relative; }
.nav-menu > summary { list-style: none; cursor: pointer; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-caret { font-size: .7rem; color: var(--muted); }
.nav-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 180px; padding: 6px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  display: flex; flex-direction: column; }
.nav-menu-list a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: var(--radius); color: var(--ink-2); font-size: .92rem; }
.nav-menu-list a:hover { background: var(--card-2); color: var(--ink); text-decoration: none; }
@media (max-width: 880px) {
  .nav-menu-list { position: static; box-shadow: none; border: 0; padding: 0 0 0 12px; background: none; min-width: 0; }
  .nav > a.nav-credits, .nav > a.nav-icon, .nav > a.btn, .nav-menu > summary { align-self: flex-start; }
  .nav > a.btn { margin: 4px 0; }
}

/* Buttons ----------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius); border: 1.5px solid var(--ink); background: var(--card); color: var(--ink); font-family: inherit; font-weight: 600; font-size: .93rem; cursor: pointer; transition: transform .1s, box-shadow .1s, background .1s; white-space: nowrap; }
.btn:hover { text-decoration: none; background: var(--surface-hi); transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--shadow-ink); }
.btn:active { transform: translate(0, 0); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
/* A button laid out as a flex box would otherwise ignore the attribute that hides it. */
.btn[hidden] { display: none; }
.btn-primary { background: var(--accent); border-color: var(--accent-ink); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); box-shadow: 2px 2px 0 var(--shadow-ink); }
.btn-ghost { border-color: var(--line-2); background: transparent; font-weight: 500; }
.btn-ghost:hover { box-shadow: none; transform: none; background: var(--card-2); }
.btn-danger { border-color: var(--accent-ink); color: var(--accent-ink); background: var(--surface-hi); }
.btn-success { border-color: var(--green); color: #fff; background: var(--green); }
.btn-sm { padding: 6px 12px; font-size: .84rem; border-width: 1px; }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; }
.btn-block { width: 100%; }
/* A button that is only its icon: the name shows on hover and on keyboard focus, as a small label
   under the button, and is in aria-label for everyone else. */
.btn-icon { position: relative; padding-left: 10px; padding-right: 10px; min-width: 36px; }
/* The icon language (inc/icons.php): line icons in the ink of the text beside them, brand logos in their own colours. */
.ui-icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.btn-icon .ui-icon { width: 1.05rem; height: 1.05rem; vertical-align: middle; }
.builder-tabs button .ui-icon, .design-devices button .ui-icon, .pixel-toolbar .ui-icon { margin-right: 5px; }
.ui-brand { width: 1.25em; height: 1.25em; vertical-align: -.28em; }
.btn .ui-brand { vertical-align: middle; }
.card h3 .ui-brand { width: 1.15em; height: 1.15em; margin-right: 6px; }
.svc-name .ui-brand { margin-right: 6px; }
.btn-icon[data-tip]::after { content: attr(data-tip); position: absolute; top: calc(100% + 6px); left: 50%; transform: translate(-50%, -4px); z-index: 70;
  padding: 4px 8px; border-radius: var(--radius); background: var(--ink); color: var(--on-ink, var(--paper)); font-size: .74rem; font-weight: 500; line-height: 1.3; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s ease, transform .12s ease; }
.btn-icon[data-tip]:hover::after, .btn-icon[data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

/* Surfaces ---------------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 22px; }
.card-sm { padding: 15px; }
.card h2, .card h3 { margin-top: 0; }
.stat { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 16px 18px; }
.stat .value { font-family: var(--display); font-size: 1.65rem; font-weight: 600; line-height: 1.1; }
.stat .label { color: var(--muted); font-size: .83rem; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: .74rem; font-weight: 600; background: var(--card-2); border: 1px solid var(--line-2); color: var(--ink-2); letter-spacing: .02em; }
.badge-success { background: #e4efe6; color: var(--green); border-color: #bcd6c3; }
.badge .nav-svg { width: 13px; height: 13px; vertical-align: -2px; }
.badge-warn { background: #f6ead2; color: var(--gold); border-color: #e2cda3; }
.badge-danger { background: #f7e2dd; color: var(--accent-ink); border-color: #e5bfb4; }
.badge-accent { background: #ece6f0; color: var(--blue); border-color: #c9d3e2; }

/* Charts (admin traffic) ---------------------------------------------------
   One hue for the marks, hairline grid, labels in text colours. The bars are
   plain HTML so a long page URL stays readable text instead of clipped SVG. */
.chart { margin: 0; }
/* The plot stretches to the width it is given and keeps a readable height; the strokes hold their
   thickness (non-scaling-stroke) and every label is HTML on top, so nothing is squeezed flat on a
   phone. Positions are percentages, which is exactly how the SVG maps its own coordinates here. */
.chart-plot { position: relative; height: 260px; margin-left: 46px; }
.chart-plot svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-axis { position: absolute; left: -46px; width: 40px; text-align: right; transform: translateY(-50%);
  font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--card); pointer-events: none; }
.chart-flag { position: absolute; transform: translate(-50%, -160%); font-size: .78rem; font-weight: 600;
  color: var(--ink); white-space: nowrap; pointer-events: none; }
.chart-flag-end { transform: translate(-105%, -60%); }
.chart-dates { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted);
  margin: 4px 0 0 46px; }
/* The marks sit in the plot's own box, so a percentage here is the same percentage the SVG used. */
.chart-readout { font-size: .84rem; color: var(--ink-2); margin-bottom: 8px; min-height: 1.3em; }
.chart-readout b { font-weight: 600; }
.chart-cursor { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ink); opacity: 0;
  pointer-events: none; }
.chart-cursor.on { opacity: .45; }
.chart-cursor-dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--card); opacity: 0; }
.chart-cursor.on .chart-cursor-dot { opacity: 1; }
.chart-plot { cursor: crosshair; }
@media (max-width: 620px) { .chart-plot { height: 200px; } }
.chart-table { margin-top: 10px; }
.chart-table summary { font-size: .8rem; color: var(--muted); cursor: pointer; }
.chart-table .table-wrap { max-height: 260px; overflow-y: auto; margin-top: 8px; }

/* The live view on the visitors tab: a meter under each number, a pulse while it is reading. */
.live-meter { height: 6px; margin-top: 8px; }
.live-meter .bar-fill { width: 0; transition: width .4s ease; }
.live-of { font-size: .85rem; font-weight: 400; color: var(--muted); font-family: inherit; }
.live-sub { margin-top: 6px; min-height: 1.4em; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.live-sub .badge:empty { display: none; }
.live-cap-label { left: 0; transform: translate(0, -130%); font-weight: 400; color: var(--muted); font-size: .72rem; }
.live-pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 8px;
  vertical-align: 2px; animation: live-pulse 2s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .live-pulse { animation: none; } .live-meter .bar-fill { transition: none; } }

.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.bar-list li { display: grid; grid-template-columns: minmax(0, 11rem) 1fr auto; gap: 10px; align-items: center; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; color: var(--ink-2); }
.bar-track { background: var(--card-2); border-radius: 4px; height: 14px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.bar-value { font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
@media (max-width: 620px) {
  .bar-list li { grid-template-columns: 1fr auto; }
  .bar-list .bar-track { grid-column: 1 / -1; }
}

/* Forms ------------------------------------------------------------------- */
label { display: block; font-size: .83rem; color: var(--ink-2); margin-bottom: 5px; font-weight: 600; letter-spacing: .01em; }
.field { margin-bottom: 16px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], input[type=file], input[type=date], input[type=month], select, textarea {
  width: 100%; background: var(--surface-hi); border: 1px solid var(--line-2); color: var(--ink); border-radius: var(--radius); padding: 10px 12px; font-size: .94rem; font-family: inherit; transition: border-color .12s, box-shadow .12s;
}
/* iOS zooms the whole page in when a field under 16px gets the focus, and leaves it zoomed – the
   page then looks wider than the screen. On a touch screen every field is 16px, whatever a
   smaller rule for one page (the marketplace filters, the builder chat) says. Not the code
   editor: its textarea has to keep the size of the coloured copy painted behind it. */
@media (hover: none) and (pointer: coarse) {
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], input[type=date], input[type=month], select, textarea:not(.code) { font-size: 16px !important; }
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 2px 2px 0 var(--line-2); }
input:disabled, select:disabled, textarea:disabled { background: var(--card-2); color: var(--muted); }
textarea { min-height: 104px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23736d61' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 42px; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: .93rem; color: var(--ink); cursor: pointer; font-weight: 400; }
.check input { margin-top: 4px; accent-color: var(--accent); }
.avatar-upload { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
/* A file field as a drop area (assets/js/app.js): the field stays inside, hidden from sight only. */
.file-drop { position: relative; flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 16px 14px; border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--card-2); color: var(--muted); font-size: .88rem; font-weight: 400; letter-spacing: 0; text-align: center; cursor: pointer; transition: border-color .12s, background .12s, color .12s; }
.file-drop:hover, .file-drop:focus-within { border-color: var(--ink); background: var(--surface-hi); color: var(--ink-2); }
.file-drop:focus-within { box-shadow: 2px 2px 0 var(--line-2); }
.file-drop.is-over { border-color: var(--accent); border-style: solid; background: color-mix(in srgb, var(--accent) 9%, var(--card-2)); color: var(--ink); }
.file-drop.has-file { border-style: solid; }
.file-drop.is-wrong { border-color: var(--accent); }
.file-drop.is-wrong .file-drop-name { color: var(--accent-ink, var(--accent)); }
.file-drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; padding: 0; border: 0; pointer-events: none; }
.file-drop:has(input:disabled) { cursor: not-allowed; opacity: .6; }
.file-drop-icon { flex: none; opacity: .75; }
.file-drop.is-over .file-drop-icon { color: var(--accent); opacity: 1; }
.file-drop-text { line-height: 1.5; }
.file-drop-btn { display: inline-block; background: var(--surface-hi); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 4px 11px; font-weight: 600; color: var(--ink); }
.file-drop-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-drop-name:empty { display: none; }
.file-drop.has-file .file-drop-name { color: var(--ink); font-weight: 600; }
/* Beside a button in a row (the builder's files): one line, the button at its side. */
.row > .file-drop { flex-direction: row; flex-wrap: wrap; padding: 10px 14px; }
.help { font-size: .8rem; color: var(--muted); margin-top: 5px; font-weight: 400; }
.form-narrow { max-width: 440px; margin: 0 auto; }
/* Name and claim above the heading of the sign-in and sign-up pages (auth_claim_html()). */
.auth-claim { margin: 0 0 6px; font-family: var(--mono); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
.auth-claim span { font-weight: 700; color: var(--ink); margin-right: .35em; }
/* A paid tool opened at its own address: what it costs and the button (tool.php?pay=1). */
.pay-prompt { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-color: var(--accent); }
/* The eye that shows a password while typing (added by app.js). */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 44px; }
.pw-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; font-size: 1.05rem; line-height: 1; cursor: pointer; opacity: .65; }
.pw-eye:hover, .pw-eye:focus-visible { opacity: 1; background: var(--card-2); }
[dir=rtl] .pw-wrap input { padding-right: 12px; padding-left: 44px; }
[dir=rtl] .pw-eye { right: auto; left: 6px; }

/* Flash ------------------------------------------------------------------- */
.flash { padding: 11px 15px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; border-left-width: 4px; font-size: .93rem; }
.flash-success { background: #e8f1ea; border-color: #9cc0a8; color: #1f4a38; }
.flash-error { background: #fae9e4; border-color: #d6a294; color: var(--accent-ink); }
.flash-info { background: #eeeae2; border-color: var(--line-2); color: var(--ink-2); }

/* Tables ------------------------------------------------------------------ */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--card); }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; background: var(--card-2); }
.table tr:hover td { background: var(--surface-hi); }
/* A cell of buttons stays a table cell: made a flexbox, it drops out of the row's table layout and
   its line under it no longer meets the others. The buttons line up inside it instead. */
.table td.row { display: table-cell; }
.table td.row > * { display: inline-flex; align-items: center; vertical-align: middle; margin-block: 3px; }
.table td.row > * + * { margin-inline-start: 6px; }
/* A <button> keeps its own line height where a link takes the page's, and would come out shorter. */
.table td.row > button { line-height: inherit; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--radius-lg); }
/* A sortable column (table[data-sortable], app.js): the heading is a button, an arrow shows the order. */
.table .th-sort { all: inherit; display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; white-space: nowrap; }
.table .th-sort:hover { color: var(--ink); }
.table .th-sort:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; border-radius: 3px; }
.table .th-sort::after { content: "↕"; opacity: .35; font-size: .9em; }
.table th[aria-sort="ascending"] .th-sort::after { content: "↑"; opacity: 1; }
.table th[aria-sort="descending"] .th-sort::after { content: "↓"; opacity: 1; }
.table th[aria-sort] { color: var(--ink); }

/* Tool cards -------------------------------------------------------------- */
.tool-card { position: relative; display: block; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 18px; color: var(--ink); transition: transform .12s, box-shadow .12s; }
.tool-card:hover, .tool-card:focus-within { text-decoration: none; transform: translate(-2px, -2px); box-shadow: var(--shadow); }
/* The title's link covers the card; the creator's name is a link of its own above it. */
.tool-card-link { color: inherit; }
.tool-card-link:hover { text-decoration: none; }
.tool-card-link:focus-visible { outline: none; }
.tool-card-link::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.tool-card-author { position: relative; z-index: 2; pointer-events: none; }
.tool-card-author .author-link { pointer-events: auto; }
.tool-card-author .author-link:hover { text-decoration: underline; }
.tool-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tool-icon { font-size: 1.6rem; line-height: 1; width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius); }
.tool-icon-lg { font-size: 2.6rem; width: 78px; height: 78px; border-radius: var(--radius-lg); }
/* A drawn icon (64×64) stands where the emoji would: as tall as the text around it, or filling
   the icon box. Smaller than its own size it is scaled smoothly, so no line of it disappears. */
.tool-icon-img { width: 1.2em; height: 1.2em; vertical-align: -.25em; object-fit: contain; }
/* A tool's icon from the line set ("ic:name"): drawn in the colour of its text, as large as the emoji it replaces. */
.tool-icon-svg { width: 1.2em; height: 1.2em; vertical-align: -.25em; }
.tool-icon .tool-icon-svg { width: 30px; height: 30px; vertical-align: middle; stroke-width: 1.6; }
.tool-icon-lg .tool-icon-svg { width: 56px; height: 56px; }
.fav-icon .tool-icon-svg { width: 20px; height: 20px; }
.shell-bar .tool-icon .tool-icon-svg { width: 22px; height: 22px; }
.widget-icon .tool-icon-svg { width: 18px; height: 18px; }
.dash-row-icon .tool-icon-svg { width: 24px; height: 24px; }
.tool-icon .tool-icon-img { width: 34px; height: 34px; vertical-align: middle; }
.tool-icon-lg .tool-icon-img { width: 64px; height: 64px; image-rendering: pixelated; }
.tool-price { font-weight: 700; font-size: .88rem; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.tool-price.free { color: var(--green); }
.tool-card h3 { margin: 0 0 3px; font-size: 1.05rem; }
.tool-card p { color: var(--muted); font-size: .88rem; margin: 0 0 10px; min-height: 2.5em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; }
.tool-card-author { margin-top: 5px; }
.tool-card.painted { background: var(--tc-bg); color: var(--tc-ink); border-color: rgba(0,0,0,.12); }
.tool-card.painted p, .tool-card.painted .muted { color: inherit; opacity: .78; }
.tool-card.painted .tool-icon { background: rgba(255,255,255,.72); border-color: rgba(0,0,0,.08); }
.tool-card.painted .tool-price { color: inherit; background: rgba(255,255,255,.22); padding: 2px 8px; border-radius: 999px; }
.stars { color: var(--gold); letter-spacing: 1px; }
/* Rating a tool from the stars next to its title (inc/ratings.php, assets/js/rating.js). */
.rate { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 4px; margin: 0; }
.rate-stars { display: inline-flex; }
.rate-star { appearance: none; margin: 0; padding: 2px 1px; border: 0; border-radius: 4px; background: none; color: inherit; font: inherit; line-height: 1; letter-spacing: 0; cursor: pointer; }
.rate-star:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rate-status { color: var(--ink-2); }
.rate-status.rate-bad { color: var(--accent-ink); }
.rate-panel { margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--card-2); color: var(--ink); }
.rate-panel label { display: block; margin-bottom: 6px; }
.rate-panel textarea { width: 100%; min-height: 72px; }
.rate-panel .row { gap: 8px; margin-top: 8px; }
@media (pointer: coarse) { .rate-star { padding: 10px 3px; } }

/* Plans ------------------------------------------------------------------- */
.plan .plan-sub { margin: -4px 0 6px; }
.plan .plan-own-price { color: var(--green); font-weight: 600; margin: 0 0 8px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(225px, 1fr)); gap: 18px; }
.plan { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 24px; position: relative; display: flex; flex-direction: column; }
.plan.highlight { border: 1.5px solid var(--ink); box-shadow: var(--shadow); }
.plan .plan-badge { position: absolute; top: -11px; left: 22px; background: var(--ink); color: var(--paper); font-size: .7rem; font-weight: 600; padding: 3px 10px; border-radius: 3px; letter-spacing: .06em; text-transform: uppercase; }
.plan h3 { font-size: 1.15rem; }
.plan .price { font-family: var(--display); font-size: 2.1rem; font-weight: 600; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.plan .price.price-text { font-size: 1.5rem; padding: 7px 0 6px; }
.plan .price small { font-size: .85rem; font-weight: 400; color: var(--muted); font-family: var(--font); }
.plan ul { list-style: none; padding: 0; margin: 16px 0 20px; color: var(--ink-2); font-size: .9rem; flex: 1; }
.plan li { padding: 5px 0 5px 20px; position: relative; border-bottom: 1px solid var(--line); }
.plan li::before { content: '·'; position: absolute; left: 4px; color: var(--accent); font-weight: 700; font-size: 1.3em; line-height: 1; }

/* Tabs -------------------------------------------------------------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); margin-bottom: 20px; overflow-x: auto; }
.tabs a, .tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 9px 13px; font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap; font-family: inherit; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; }
.tabs .nav-svg { width: 17px; height: 17px; opacity: .8; }
.tabs a.active, .tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
/* The admin's three areas sit above the tabs of the area that is open. */
.tabs.admin-sections { margin-bottom: 4px; border-bottom-color: transparent; }
.tabs.admin-sections a { font-size: 1.02rem; padding: 10px 16px 9px; }
.tabs.admin-sections .badge { margin-left: 4px; }

/* Runner ------------------------------------------------------------------ */
.runner-frame { width: 100%; height: 72vh; min-height: 470px; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: #fff; }

/* Builder ----------------------------------------------------------------- */
.mismatch { border-color: var(--accent); border-left: 3px solid var(--accent); }
.mismatch ul { margin: 0 0 10px; padding-left: 18px; color: var(--ink-2); }
.mismatch li { padding: 2px 0; }

/* The workspace fills the window under the topbar, and on a wide screen the page ends with it (no
   footer, see below): a message above it scrolls away, then the tool's head and tabs stay put. */
.builder { display: grid; grid-template-columns: 335px 1fr; gap: 16px; height: calc(100vh - var(--topbar-h) - 32px); min-height: 620px; }
@media (min-width: 981px) {
  .builder-page main.page { padding-bottom: 16px; min-height: 0; }
  .builder-page .footer { display: none; }
}
.builder-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.builder-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; gap: 10px; }
.builder-tabs { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.builder-tabs button { background: var(--card); border: 1px solid var(--line-2); color: var(--ink-2); padding: 6px 12px; border-radius: var(--radius); font-weight: 600; font-size: .84rem; cursor: pointer; font-family: inherit; }
.builder-tabs button:hover { background: var(--surface-hi); }
.builder-tabs button.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.builder-pane { flex: 1; min-height: 0; display: none; }
/* The Code view: the tool's three files, one at a time, picked like files in an editor. */
.code-files { display: flex; gap: 0; margin-bottom: -1px; flex-shrink: 0; position: relative; z-index: 1; }
.code-files button { background: transparent; border: 1px solid transparent; border-bottom: 0; color: var(--muted); padding: 6px 14px; border-radius: var(--radius) var(--radius) 0 0; font: 600 .8rem var(--mono); cursor: pointer; }
.code-files button:hover { color: var(--ink); }
.code-files button.active { background: var(--code-bg); border-color: var(--line-2); color: var(--ink); }
.code-file { display: none; flex: 1; min-height: 0; flex-direction: column; }
.code-file.active { display: flex; }
/* The preview's own line: what it runs on, and the button that reloads it. */
.preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-shrink: 0; }
.preview-head .btn { margin-left: auto; flex-shrink: 0; }
/* A small menu behind a button: a <details>, so it opens without JavaScript; app.js closes it. */
.menu-pop { position: relative; }
.menu-pop > summary { list-style: none; }
.menu-pop > summary::-webkit-details-marker { display: none; }
.menu-pop-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 190px; padding: 6px; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.menu-pop-list a { padding: 7px 10px; border-radius: var(--radius); color: var(--ink-2); font-size: .88rem; white-space: nowrap; }
.menu-pop-list a:hover { background: var(--card-2); color: var(--ink); text-decoration: none; }
/* Entries that post a form (opening a tool in a place, adding it to a team) look like the links. */
.menu-pop-list form { display: contents; }
.menu-pop-list button { appearance: none; border: 0; background: none; font: inherit; font-size: .88rem; text-align: left; cursor: pointer;
  padding: 7px 10px; border-radius: var(--radius); color: var(--ink-2); white-space: nowrap; }
.menu-pop-list button:hover:not(:disabled) { background: var(--card-2); color: var(--ink); }
.menu-pop-list button:disabled { color: var(--muted); cursor: default; }
.menu-pop-list button.is-current { color: var(--ink); font-weight: 600; }
.menu-pop-list .menu-pop-note { margin: 4px 0 0; padding: 8px 10px 4px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); white-space: normal; max-width: 36ch; }
/* The builder's status menu: four steps of who can reach a tool, each with a line saying what it means. */
.vis-menu .vis-list { min-width: 300px; max-width: min(380px, calc(100vw - 32px)); }
.vis-menu .vis-item { display: flex; gap: 10px; align-items: flex-start; white-space: normal; width: 100%; }
.vis-menu .vis-item:disabled { color: var(--ink-2); }
.vis-menu .vis-item.is-current { background: var(--card-2); }
.vis-menu .vis-item .small { font-weight: 400; }
.vis-dot { display: inline-block; flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; background: var(--muted); }
summary .vis-dot { margin-top: 0; }
.vis-link { margin-top: 4px; padding: 8px 10px 4px; border-top: 1px solid var(--line); }
.vis-link input { font-size: .8rem; min-width: 0; flex: 1; }
.menu-pop-list .vis-link .btn { border: 1.5px solid var(--ink); background: var(--card); color: var(--ink); font-weight: 600; padding: 6px 12px; }
.vis-link .row { flex-wrap: nowrap; gap: 6px; }
.menu-pop-list .vis-link a { padding: 0; display: inline; white-space: normal; color: var(--accent-ink); }
.vis-menu .menu-pop-note { max-width: none; }
/* On a phone the menu spans the screen below its button, wherever the button landed. */
@media (max-width: 640px) { .vis-menu .vis-list { position: fixed; left: 16px; right: 16px; top: auto; min-width: 0; max-width: none; max-height: 75vh; overflow-y: auto; } }
.vis-is-link .vis-dot { background: #c98a1b; }
.vis-is-public .vis-dot { background: #2f7fb5; }
.vis-is-listed .vis-dot { background: var(--green); }
.vis-is-blocked .vis-dot { background: #c0392b; }
/* A collection's four steps as tiles in its settings (collection.php): the same dots and words as the tool's menu. */
.coll-vis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.coll-vis .vis-tile { display: flex; gap: 10px; align-items: flex-start; text-align: left; white-space: normal; width: 100%;
  padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
.coll-vis .vis-tile:hover:not(:disabled) { border-color: var(--ink); }
.coll-vis .vis-tile:disabled { cursor: default; }
.coll-vis .vis-tile.is-current { border-color: var(--ink); background: var(--card-2); }
.coll-vis .vis-tile .small { font-weight: 400; }
/* A main button with the menu of its other places hanging off its right edge. */
.btn-split { display: inline-flex; align-items: stretch; }
.btn-split > form > .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-split > .menu-pop > summary.btn { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; padding-inline: 10px; height: 100%; display: inline-flex; align-items: center; }
.btn-split > .menu-pop > summary.btn .nav-caret { font-size: 1rem; line-height: 1; opacity: 1; color: inherit; }
.tool-actions { align-items: center; }
.builder-pane.active { display: flex; flex-direction: column; }
.builder-pane textarea.code { flex: 1; width: 100%; min-height: 0; resize: none; background: var(--code-bg); border-radius: var(--radius-lg); }

/* Code editor: a textarea with a coloured copy of the same text painted behind it. The two boxes
   need the same metrics down to the pixel, or the caret drifts away from the letters – so every
   property that decides where a character lands is set on both at once. */
.builder-pane textarea.code, .editor-paint {
  font-family: var(--mono); font-size: 13px; line-height: 1.6; tab-size: 2;
  white-space: pre; letter-spacing: normal; word-spacing: normal;
  padding: 10px 12px; border-width: 1px; border-style: solid; border-radius: var(--radius-lg);
}
.editor { position: relative; flex: 1; min-height: 0; }
.editor > .editor-paint, .editor > textarea.code { position: absolute; inset: 0 0 0 var(--gutter, 0); width: auto; height: 100%; margin: 0;
  border-top-left-radius: 0; border-bottom-left-radius: 0; }
/* Line numbers, left of the code. Same font, line height and top edge as the code, so each number
   sits on its line; the numbers are moved with the code's vertical scroll and are never selected. */
.editor-lines { position: absolute; top: 0; bottom: 0; left: 0; width: var(--gutter, 0); overflow: hidden; box-sizing: border-box;
  font-family: var(--mono); font-size: 13px; line-height: 1.6; white-space: pre; text-align: right;
  padding: 10px .7ch 0 0; border: 1px solid var(--line-2); border-right: 0; border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  background: var(--card-2); color: var(--muted); user-select: none; pointer-events: none; }
/* Border of its own colour would draw twice: the textarea on top carries the visible one, this
   keeps only its width so both content boxes start in the same place. */
.editor-paint { overflow: hidden; background: var(--code-bg); color: var(--ink); border-color: transparent; }
.editor-paint > code { background: none; padding: 0; border-radius: 0; font: inherit; }
.editor > textarea.code { overflow: auto; background: transparent; color: transparent; caret-color: var(--ink); }
/* Translucent, because the letters being selected are painted on the layer underneath:
   an opaque selection would hide both them and their colour. */
.editor > textarea.code::selection { background: rgba(42, 77, 122, .26); color: transparent; }

/* Find (and replace) in the code (code-search.js): a small bar over the top right corner of the
   pane, clear of its scrollbar. The matches are marked on the text as painted, without touching it. */
.find-host { position: relative; }
.find-bar { position: absolute; right: 20px; z-index: 6; display: flex; flex-direction: column; gap: 4px; padding: 5px 6px;
  max-width: calc(100% - 28px); box-sizing: border-box; background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--radius); box-shadow: var(--shadow-soft), 0 6px 18px rgba(22, 20, 15, .12); font-size: .82rem; }
.find-bar[hidden], .find-bar [hidden] { display: none !important; }
.find-row { display: flex; align-items: center; gap: 3px; min-width: 0; }
.find-bar input.find-input { width: 210px; min-width: 60px; flex: 1 1 auto; height: 28px; padding: 3px 8px;
  font-family: var(--mono); font-size: 12.5px; background: var(--surface-hi); }
.find-bar input.find-input:focus { box-shadow: none; }
.find-bar input.find-input.bad { border-color: var(--accent); }
.find-icon, .find-pad { flex: none; width: 22px; text-align: center; line-height: 1; }
.find-pad { width: 26px; }
.find-icon { font-size: .95rem; color: var(--muted); }
.find-count { flex: none; min-width: 9ch; padding: 0 4px; text-align: center; white-space: nowrap; color: var(--muted); font-size: .76rem; }
.find-count.bad { color: var(--accent-ink); }
.find-btn { flex: none; min-width: 26px; height: 26px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--ink-2);
  font: 600 .82rem/1 var(--font); cursor: pointer; }
.find-btn.find-opt { font-family: var(--mono); font-size: .76rem; }
.find-btn.find-word { border-color: var(--line-2); font-weight: 500; white-space: nowrap; }
.find-btn:hover:not(:disabled) { background: var(--card-2); }
.find-btn[aria-pressed="true"] { background: var(--card-2); border-color: var(--ink-2); color: var(--ink); }
.find-btn:disabled { opacity: .4; cursor: default; }
.find-btn.find-toggle { min-width: 20px; padding: 0 3px; font-size: 1rem; }
::highlight(code-find) { background-color: rgba(214, 160, 40, .32); }
::highlight(code-find-current) { background-color: rgba(232, 120, 30, .62); }
/* The code of an earlier version takes the caret too, so Ctrl+F knows to search in it. */
pre.hist-code:focus { outline: none; border-color: var(--ink-2); }
@media (max-width: 600px) {
  .find-bar { left: 8px; right: 8px; max-width: none; }
  .find-bar input.find-input { width: auto; }
  .find-count { min-width: 0; }
}

.token.comment, .token.prolog, .token.doctype, .token.cdata { color: var(--muted); font-style: italic; }
.token.punctuation, .token.operator { color: #8a8375; }
.token.tag, .token.keyword, .token.selector, .token.atrule, .token.rule, .token.symbol { color: var(--accent-ink); }
.token.attr-name, .token.regex, .token.variable, .token.entity, .token.url { color: var(--gold); }
.token.string, .token.attr-value, .token.char, .token.inserted { color: var(--green); }
.token.number, .token.boolean, .token.constant, .token.property, .token.unit { color: var(--blue); }
.token.function, .token.class-name, .token.builtin { color: #6a3f9e; }
.token.deleted { color: var(--accent); }
.token.important, .token.bold { font-weight: 600; }
.token.italic { font-style: italic; }
.builder-pane iframe { flex: 1; width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: #fff; }
.builder-notes { display: flex; flex-direction: column; gap: 10px; flex: 0 1 auto; max-height: 40%; overflow-y: auto; min-height: 0; }
.builder-notes:not(:has(> :not([hidden]))) { display: none; }
.builder-notes > * { flex-shrink: 0; }
/* A note folded to one line: its name, what it is about, and a close button at the far end. */
.notes-box[hidden] { display: none; }
.notes-box > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.notes-box > summary::-webkit-details-marker { display: none; }
.notes-box > summary code { font-size: .78rem; }
.notes-close { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: 0 2px; cursor: pointer; }
.notes-close:hover { color: var(--ink); }
.chat { flex: 1; min-height: 160px; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; padding: 13px; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-lg); }
.msg { padding: 9px 12px; border-radius: var(--radius); font-size: .87rem; white-space: pre-wrap; word-break: break-word; max-width: 100%; }
/* Like a chat: the person's own messages to the right, the assistant's to the left, each leaving
   a margin on the other side. System notes keep the full width. */
.msg-user { background: var(--ink); color: var(--paper); align-self: flex-end; border-bottom-right-radius: 2px; max-width: 86%; margin-left: 14%; }
.msg-ai { background: var(--card-2); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 2px; max-width: 92%; margin-right: 8%; }
.msg-sys { color: var(--accent-ink); background: #fae9e4; border: 1px solid #e5bfb4; font-size: .84rem; }
.chat-form textarea { min-height: 120px; font-size: .9rem; }
/* Build or ask: a question changes nothing, and its bubbles say so with a blue edge. */
.chat-mode { display: inline-flex; gap: 2px; margin-bottom: 0; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--card-2); }
.chat-mode label { display: inline-flex; align-items: center; margin: 0; padding: 4px 10px; border-radius: calc(var(--radius) - 2px); font-size: .8rem; font-weight: 600; cursor: pointer; color: var(--muted); }
.chat-mode input { position: absolute; opacity: 0; pointer-events: none; }
.chat-mode label:has(input:checked) { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chat-mode label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.msg-ask { border-left: 3px solid var(--blue); }
.msg-user.msg-ask { border-left: 0; border-right: 3px solid var(--blue); }
/* Who wrote a message, when several people build the tool together. */
.msg-by { display: block; font-size: .72rem; opacity: .7; margin-bottom: 2px; white-space: normal; }
.msg-fix { display: block; margin-top: 8px; }
.msg-topup { margin-top: 8px; }
.chat-guess { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 6px; padding: 8px 10px; border: 1px solid var(--line-2); border-left: 3px solid var(--blue); border-radius: var(--radius); background: var(--card); font-size: .82rem; }
.chat-guess span { flex-basis: 100%; }
.chat-empty { color: var(--muted); font-size: .87rem; }
.chat-empty ul { padding-left: 0; margin: 10px 0 0; list-style: none; }
.chat-empty li { cursor: pointer; padding: 6px 10px; border: 1px dashed var(--line-2); border-radius: var(--radius); margin-bottom: 6px; color: var(--ink-2); }
.chat-empty li:hover { border-style: solid; background: var(--surface-hi); color: var(--ink); }
.typing::after { content: ''; animation: dots 1.4s steps(4, end) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* attachments in the chat ---------------------------------------------------- */
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.attach-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px 4px 8px;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--card-2); font-size: .78rem; }
.attach-chip.is-pending { opacity: .6; }
.attach-chip.is-error { border-color: #e5bfb4; background: #fae9e4; color: var(--accent-ink); }
.attach-icon { flex: none; }
.attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 11rem; }
.attach-size { color: var(--muted); font-size: .72rem; flex: none; }
.attach-remove { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; padding: 0 2px; }
.attach-remove:hover { color: var(--accent-ink); }
.chat-form.is-dropping textarea { border-color: var(--accent); background: var(--code-bg); }
#attach-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* "still working" bubble ---------------------------------------------------- */
.building { display: block; white-space: normal; min-width: 15rem; }
.building-line { display: flex; align-items: center; gap: 8px; }
.building-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 1.3s ease-in-out infinite; }
.building-time { margin-left: auto; color: var(--muted); font-family: var(--mono); font-size: .74rem; font-variant-numeric: tabular-nums; }
.building-note { color: var(--muted); font-size: .78rem; margin-top: 6px; }
/* What the model is writing right now – the last lines of it, where the administrator shows the stream. */
.building-stream { margin: 9px 0 0; padding: 8px 10px; max-height: 8.6em; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); font-size: .72rem; line-height: 1.45; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.build-progress { display: block; height: 3px; margin-top: 9px; background: var(--line); border-radius: 2px; overflow: hidden; }
.build-progress span { display: block; height: 100%; width: 32%; border-radius: 2px; background: var(--accent); animation: slide 1.7s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(420%); } }
@keyframes pulse { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .building-dot, .build-progress span, .typing::after { animation: none; }
  .build-progress span { width: 100%; opacity: .35; }
}
/* A pane cut into sections (Settings): a list to jump with, and the sections scrolling beside it. */
/* Settings → Versions (inc/history.php): the list on the left, the picked version on the right. */
.hist { display: grid; grid-template-columns: 220px 1fr; gap: 14px; height: min(70vh, 620px); }
.hist-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.hist-msg { padding: 7px 11px; }
.hist-item { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: none; border: 0; border-left: 3px solid transparent; border-radius: var(--radius); padding: 7px 11px; cursor: pointer; color: var(--ink-2); font: inherit; }
.hist-item:hover { background: var(--card-2); color: var(--ink); }
.hist-item.active { background: var(--card-2); border-left-color: var(--accent); color: var(--ink); }
.hist-what { display: flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; }
.hist-view { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.hist-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-shrink: 0; }
.hist-head .btn { margin-bottom: 6px; }
.hist-empty { margin: 12px 0 0; }
.hist-view iframe { flex: 1; width: 100%; min-height: 0; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: #fff; }
.hist-code { flex: 1; min-height: 0; margin: 0; overflow: auto; font-family: var(--mono); font-size: 13px; line-height: 1.6; white-space: pre; }
.hist-code > code { background: none; padding: 0; font: inherit; }
/* Line numbers: in the same scrolling box as the code, so they go along when it scrolls down and
   stay at the left edge when it scrolls sideways. They are not selected along with the code. */
pre.code-block.hist-code { display: flex; align-items: flex-start; padding: 0; }
.hist-code > code { flex: 1; padding: 13px; }
.hist-lines { position: sticky; left: 0; flex-shrink: 0; min-height: 100%; box-sizing: border-box; padding: 13px .7ch 13px 1.2ch; text-align: right;
  background: var(--card-2); color: var(--muted); border-right: 1px solid var(--line-2); user-select: none; }
.hist-lines:empty { display: none; }
.hist-note { margin: 6px 0 0; flex-shrink: 0; }
@media (max-width: 900px) {
  .hist { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; }
  .hist-list { max-height: 30vh; }
  .hist-head { flex-direction: column-reverse; align-items: flex-start; gap: 0; }
  .hist-head .code-files { max-width: 100%; overflow-x: auto; }
  .hist-view iframe, .hist-code { flex: none; height: 55vh; }
}
.section-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(190px, max-content) 1fr; gap: 14px; }
.section-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden; padding-top: 2px; max-width: 250px; }
.section-nav a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; padding: 7px 11px; border-radius: var(--radius); color: var(--ink-2); font-size: .88rem; font-weight: 500; border-left: 3px solid transparent; }
.section-nav a:hover { background: var(--card); text-decoration: none; color: var(--ink); }
.section-nav a.active { background: var(--card); border-left-color: var(--accent); color: var(--ink); font-weight: 600; }
/* Each group of the list starts below a line, its name above its entries. */
.section-nav-group { display: block; flex-shrink: 0; white-space: nowrap; margin-top: 12px; padding: 12px 11px 5px; border-top: 1px solid var(--line-2); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.section-nav-group:first-child { margin-top: 0; padding-top: 4px; border-top: 0; }
.section-body { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding-right: 4px; }
.section-body > form { display: flex; flex-direction: column; gap: 14px; }
.settings-section { scroll-margin-top: 8px; }
.settings-section > h3 { margin-bottom: 4px; }
.settings-section > h3 + p { margin-bottom: 16px; }
.kv-row { margin-bottom: 6px; flex-wrap: nowrap; }
.kv-row input { min-width: 0; }
.settings-danger { border-color: #e5bfb4; }
.settings-danger > h3 { color: var(--accent-ink); }

/* Design tab: the choices on the left, the tool as it will look on the right. */
.design { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 14px; }
.design-panel { display: flex; flex-direction: column; min-height: 0; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-lg); overflow: hidden; }
.design-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0; }
.design-intro { padding: 10px 16px 4px; margin: 0; }
.design-group { border-bottom: 1px solid var(--line); padding: 0 16px; }
.design-group:last-child { border-bottom: 0; }
.design-group > summary { cursor: pointer; list-style: none; padding: 13px 0; font-weight: 600; display: flex; flex-direction: column; gap: 1px; position: relative; padding-right: 22px; }
.design-group > summary::-webkit-details-marker { display: none; }
.design-group > summary::after { content: '▸'; position: absolute; right: 2px; top: 13px; color: var(--muted); transition: transform .15s; }
.design-group[open] > summary::after { transform: rotate(90deg); }
.design-group > summary small { font-weight: 400; color: var(--muted); font-size: .78rem; }
.design-group[open] { padding-bottom: 12px; }
.dfield { margin-bottom: 14px; }
.dfield > label:first-child { font-size: .8rem; }
.dfield[hidden] { display: none; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg label { margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 999px; font-size: .8rem; font-weight: 500; color: var(--ink-2); background: var(--surface-hi); transition: background .12s, color .12s, border-color .12s; }
.seg label:hover span { border-color: var(--ink-2); }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--accent); padding: 0; border: 0; background: none; }
.range-row output { min-width: 4.2em; text-align: right; font-family: var(--mono); font-size: .8rem; color: var(--ink-2); }
.color-row { display: flex; align-items: center; gap: 6px; }
.color-row input[type="color"] { width: 38px; height: 34px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface-hi); cursor: pointer; flex: none; }
.color-row.is-empty input[type="color"] { opacity: .35; background: repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 0 0 / 10px 10px; }
.color-row input[type="text"] { flex: 1; font-family: var(--mono); font-size: .85rem; }
.color-clear { border: 1px solid var(--line-2); background: var(--surface-hi); border-radius: var(--radius); width: 30px; height: 34px; cursor: pointer; color: var(--muted); font-size: 1.05rem; }
.color-clear:hover { color: var(--accent-ink); border-color: var(--accent-ink); }
.color-row.is-empty .color-clear { visibility: hidden; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; font-weight: 500; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { position: relative; width: 36px; height: 20px; flex: none; border-radius: 999px; background: var(--line-2); transition: background .15s; }
.switch-ui::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.preset { display: flex; flex-direction: column; gap: 5px; padding: 5px; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--surface-hi); cursor: pointer; font-family: inherit; text-align: left; }
.preset:hover { border-color: var(--ink-2); }
.preset.active { border-color: var(--ink); box-shadow: 2px 2px 0 var(--shadow-ink); }
.preset-swatch { display: grid; place-items: center; height: 54px; border-radius: 6px; }
.preset-swatch > span { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 5px; font-weight: 700; font-size: .8rem; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.preset-swatch i { display: inline-block; width: 14px; height: 8px; border-radius: 3px; }
.preset-name { font-size: .76rem; font-weight: 600; color: var(--ink-2); padding: 0 2px; }
.design-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { border: 1px dashed var(--line-2); background: var(--surface-hi); border-radius: var(--radius); padding: 5px 9px; font: inherit; font-size: .8rem; color: var(--ink-2); cursor: pointer; text-align: left; }
.chip:hover { border-style: solid; color: var(--ink); }
.design-actions { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line-2); background: var(--card-2); flex-wrap: wrap; }
#design-state { flex: 1; }
.design-actions-break { flex-basis: 100%; height: 0; }
.design-actions .btn { flex: 1; }
.linkish { border: 0; background: none; padding: 0; font-family: inherit; color: var(--accent-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
#design-state.is-dirty { color: var(--gold); font-weight: 600; }
.design-stage { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.design-devices { display: flex; gap: 3px; justify-content: center; }
.design-devices button { background: var(--card); border: 1px solid var(--line-2); color: var(--ink-2); padding: 4px 11px; border-radius: 999px; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
.design-devices button.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.design-frame { flex: 1; min-height: 0; display: flex; justify-content: center; background: repeating-linear-gradient(135deg, var(--card-2) 0 8px, var(--paper) 8px 16px); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 10px; overflow: auto; }
.design-frame iframe { flex: none; width: 100%; height: 100%; min-height: 0; border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; transition: width .25s ease; }
.design-frame[data-device="phone"] iframe { width: 390px; }
.design-frame[data-device="tablet"] iframe { width: 820px; }
/* Side by side as long as the phone preview still fits next to the settings. Below that the two
   are stacked and the tab scrolls as a whole: the settings keep a height of their own (with their
   own scrolling and the save bar at their foot) instead of being squeezed by the preview. */
@media (max-width: 1100px) {
  .design { grid-template-columns: 1fr; align-content: start; overflow-y: auto; }
  .design-panel { height: min(70vh, 640px); }
  .design-stage { min-height: 60vh; }
}
@media (max-width: 760px) {
  .section-layout { grid-template-columns: 1fr; }
  /* One row that scrolls sideways instead of wrapping into four. */
  .section-layout { gap: 8px; }
  .section-body { overflow-y: visible; padding-right: 0; }
  .section-nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding-top: 0; gap: 0; max-width: none; border-bottom: 1px solid var(--line-2); }
  .section-nav a { flex-shrink: 0; white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; padding: 8px 12px; }
  .section-nav a.active { border-bottom-color: var(--accent); }
  .section-nav-group { display: none; }
}
@media (max-width: 640px) {
  /* One row of views on a phone too: it scrolls sideways instead of breaking into two. */
  .builder-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .builder-tabs button { flex-shrink: 0; }
}
@media (max-width: 980px) {
  .builder { grid-template-columns: 1fr; height: auto; }
  /* Without a fixed page height the editor's height would come from flex alone, which Safari
     reads as none: one line tall. Give it its own. */
  .code-file .editor, .code-file > textarea.code { min-height: 62vh; }
  .builder-side { order: 2; }
  .builder-main { min-height: 68vh; }
  /* The chat and its form come first; the notes follow below them instead of pushing them down. */
  .chat { flex: none; min-height: 220px; max-height: 50vh; }
  .builder-notes { order: 3; max-height: none; overflow: visible; }
}
/* On a phone the workspace starts right under the topbar: the tool's name, its state and its
   buttons share as few lines as they can, the save and reload buttons show only their icon, and
   the reload button sits on the preview's corner instead of taking a line of its own. */
@media (max-width: 640px) {
  .builder-page main.page { padding-top: 12px; }
  .builder { gap: 12px; }
  .builder-main { gap: 8px; min-height: 64vh; }
  /* Two rows: title + save state, then the actions with the status menu at the right. */
  .builder-head { gap: 6px 8px; flex-wrap: wrap; }
  .builder-head > .row { display: contents; }
  .builder-head::after { content: ""; order: 2; flex: 0 0 100%; height: 0; }
  .builder-head > .row:first-child { order: 0; }
  .builder-head h2 { order: 0; flex: 0 1 auto; min-width: 0; font-size: 1rem !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .builder-head #save-state { order: 1; margin-left: auto; }
  .builder-head .btn-sm { order: 3; padding: 5px 10px; }
  .builder-head .vis-menu { order: 4; margin-left: auto; }
  .builder-head form { margin-left: auto; }
  .btn-label { display: none; }
  .builder-tabs button { padding: 5px 10px; font-size: .8rem; }
  .builder-pane[data-pane="preview"] { position: relative; }
  .preview-head { margin-bottom: 6px; }
  .preview-head:not(:has(.preview-note)) { margin: 0; height: 0; }
  .preview-head:not(:has(.preview-note)) .btn { position: absolute; top: 8px; right: 8px; z-index: 2; background: var(--card); box-shadow: var(--shadow-soft); }
  .builder-side { gap: 8px; }
  .builder-side .card-sm { padding: 10px 12px; }
  .chat { padding: 10px; }
  .chat-empty ul { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  .chat-empty li { margin: 0; padding: 4px 9px; font-size: .82rem; }
  .chat-form textarea { min-height: 96px; }
}

/* The marketplace (marketplace.php): the tabs and the magnifier share one line over the list,
   and under it the categories stand on the left with the two choices on the right – the choices
   exactly as high as the category buttons, so the line reads as one row. */
.market-bar { display: flex; align-items: stretch; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 16px; }
.market-bar .tabs { flex: 1 1 auto; min-width: 0; border-bottom: 0; margin-bottom: 0; }
.market-bar .search-pop { align-self: center; margin-left: auto; padding-bottom: 4px; }
.market-controls { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 20px; }
.market-controls .chips { flex: 1 1 auto; min-width: 0; margin: 0; }
.market-controls .market-filters { flex: none; flex-wrap: nowrap; gap: 7px; margin: 0 0 0 auto; }
.market-filters select { width: auto; min-width: 0; padding: 5px 30px 5px 11px; font-size: .84rem; line-height: 1.55; border-radius: 3px; background-position: right 11px center; }

/* The marketplace on a phone: a smaller head, the two choices beside each other in one row and
   the categories in one row that scrolls sideways under them, and each tool as a short card with
   its icon beside the name instead of above it. */
@media (max-width: 640px) {
  .market-page main.page { padding-top: 14px; }
  .market-page .hero-small { padding: 0 0 4px; }
  .market-page .hero-small h1 { font-size: 1.6rem; margin-bottom: 2px; }
  .market-page .hero-small p { margin: 0 0 10px; font-size: .86rem; }
  .market-bar { margin-bottom: 12px; }
  .market-controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin-bottom: 0; }
  .market-controls .market-filters { order: -1; }
  .filters.market-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 8px; margin: 0 0 10px; }
  .market-filters select { width: 100%; min-width: 0; font-size: .86rem; padding-block: 8px; padding-left: 10px; padding-right: 30px; border-radius: var(--radius); background-position: right 10px center; }
  .market-page .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 12px; padding: 0 20px; }
  .market-page .chip { flex-shrink: 0; padding: 4px 10px; }
  .market-page .grid-3 { gap: 8px; }
  .market-page .tool-card { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 10px; padding: 10px 12px;
    grid-template-areas: "icon title price" "icon text text" "meta meta meta"; }
  .market-page .tool-card-head { display: contents; }
  .market-page .tool-card .tool-icon { grid-area: icon; width: 40px; height: 40px; font-size: 1.35rem; align-self: start; }
  .market-page .tool-card .tool-icon .tool-icon-img { width: 28px; height: 28px; }
  .market-page .tool-card .tool-price { grid-area: price; font-size: .8rem; align-self: start; }
  .market-page .tool-card h3 { grid-area: title; font-size: 1rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .market-page .tool-card p { grid-area: text; min-height: 0; font-size: .82rem; margin: 2px 0 0; -webkit-line-clamp: 2; }
  .market-page .tool-card-meta { grid-area: meta; margin-top: 6px; gap: 8px; }
  .market-page .tool-card-author { grid-column: 1 / -1; margin-top: 0; }
}

/* The admin on a phone: a smaller head and tabs, the numbers two by two instead of one under the
   other, tighter cards, notices and tables (the wide tables still scroll sideways in their frame). */
@media (max-width: 640px) {
  .admin-page main.page { padding-top: 14px; }
  .admin-page main.page > h1 { font-size: 1.5rem; margin-bottom: 8px; }
  .admin-page .tabs { margin-bottom: 12px; scrollbar-width: none; }
  .admin-page .tabs a, .admin-page .tabs button { padding: 7px 10px; font-size: .84rem; }
  .admin-page .grid:has(> .stat) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .admin-page .stat { padding: 8px 10px; min-width: 0; }
  .admin-page .stat .value { font-size: 1.1rem; overflow-wrap: anywhere; }
  .admin-page .stat .label { font-size: .72rem; line-height: 1.3; }
  .admin-page .card { padding: 12px 14px; }
  .admin-page .flash { padding: 9px 12px; font-size: .84rem; }
  .admin-page h2 { font-size: 1.25rem; } .admin-page h3 { font-size: 1.05rem; }
  .admin-page .mt { margin-top: 16px; } .admin-page .mb { margin-bottom: 16px; }
  .admin-page .table { font-size: .82rem; }
  .admin-page .table th, .admin-page .table td { padding: 7px 8px; }
  .admin-page .filters { gap: 6px; margin-bottom: 10px; }
  .admin-page .filters select { width: auto; max-width: 60%; }
}

/* My tools on a phone: the numbers sit in a 2×2 block, the usage shrinks to the storage bar, and
   the tables turn into one compact card per tool – so the person's own tools start on the first
   screen instead of below five full-width boxes. */
@media (max-width: 640px) {
  .dash-page main.page { padding-top: 16px; }
  .dash-head { gap: 10px; margin-bottom: 14px; }
  .dash-head h1 { font-size: 1.5rem; }
  .dash-head p { font-size: .86rem; }
  .dash-actions { gap: 6px; flex-wrap: nowrap; width: 100%; }
  .dash-actions .btn { padding: 6px 10px; font-size: .82rem; border-width: 1px; }
  .dash-actions .btn-primary { order: -1; }
  .dash-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
  .dash-stats .stat { padding: 7px 8px; min-width: 0; }
  .dash-stats .value { font-size: 1.1rem; }
  .dash-stats .label { font-size: .7rem; line-height: 1.3; overflow-wrap: anywhere; }
  /* "top up" does not fit a quarter of a phone: a plain "+" link stands in for it, like the
     amount beside "sales"; the padding gives the finger more than the one character to hit. */
  .dash-stats .stat-topup { font-size: 0; padding: 4px 6px; margin: -4px -6px; }
  .dash-stats .stat-topup::before { content: '+'; font-size: .8rem; font-weight: 600; }
  .dash-usage { gap: 8px; margin-bottom: 10px; }
  .dash-usage .dash-credits { display: none; }
  .dash-usage .card-sm { padding: 8px 12px; }
  .dash-usage .progress { margin-top: 6px; }
  .dash-page .friend-invites { padding: 8px 12px; margin-bottom: 12px; }
  .dash-page .friend-invites-title { font-size: 1rem; }
  .dash-page #dash-lists h2 { font-size: 1.3rem; margin-bottom: .4em; }
  .dash-page #dash-lists .list-head h2 { margin: 0; }
  .dash-page #dash-lists h2.mt { margin-top: 20px; }
  .table-cards, .table-cards tbody { display: block; }
  .table-cards tr:has(> th), .table-cards .hide-sm { display: none; }
  .table-cards tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .table-cards tr:last-child { border-bottom: 0; }
  .table-cards td { display: block; padding: 0; border: 0; }
  .table-cards td:first-child { flex: 1 0 100%; min-width: 0; }
  .table-cards td:first-child .small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .table-cards td:first-child br { display: none; }
  .table-cards td.dash-price { color: var(--muted); font-size: .8rem; }
  .table-cards td.row { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: nowrap; }
  .table-cards td.row > * { margin: 0; }
  /* The buttons are as low as the status badge beside them. */
  .table-cards td.row .btn-sm, .table-cards td > .badge { display: inline-flex; align-items: center; height: 26px; padding-block: 0; }
  .table-cards td.row .btn-sm { padding-inline: 10px; font-size: .78rem; box-shadow: none; }
}

/* Footer ------------------------------------------------------------------ */
.footer { border-top: 1px solid var(--line-2); padding: 26px 0; color: var(--muted); font-size: .86rem; background: var(--card-2); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 15px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-claim { color: var(--ink-2); font-weight: 600; }

/* A search folded into a magnifier (search_toggle()): the field slides out to the left of the
   button and lies over whatever is there, so the heading beside it keeps its place. Folding needs
   app.js (.is-ready), so without it the field just stands in the row. */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: .5em; }
.list-head > h1, .list-head > h2 { margin: 0; min-width: 0; }
/* A section that folds away under its heading (the widgets on the dashboard): a small caret beside
   the heading, pointing down while open, right while folded (assets/js/app.js, data-fold). */
.fold-head { display: inline-flex; align-items: center; gap: 6px; }
.fold-toggle { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); cursor: pointer; }
.fold-toggle:hover, .fold-toggle:focus-visible { color: var(--ink); background: var(--card-2); }
.fold-toggle .ui-icon { width: 16px; height: 16px; transition: transform .15s; }
.is-folded > .list-head .fold-toggle .ui-icon { transform: rotate(-90deg); }
[dir="rtl"] .is-folded > .list-head .fold-toggle .ui-icon { transform: rotate(90deg); }
.is-folded > .fold-body { display: none; }
.search-pop { position: relative; display: inline-flex; align-items: center; gap: 6px; flex: none; }
.filters > .search-pop, form.row > .search-pop { margin-left: auto; }
.search-pop-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--card); color: var(--ink); cursor: pointer; }
.search-pop-btn:hover, .search-pop.is-open .search-pop-btn { border-color: var(--ink); }
.search-pop-btn .nav-svg { width: 16px; height: 16px; }

.search-pop.has-value:not(.is-open) .search-pop-btn { color: var(--accent); border-color: var(--accent); }
.search-pop:not(.is-ready) input[type=search] { width: min(320px, 60vw); }
/* Folded, the field is no wider than nothing; opening, it grows out of the button to the left
   while it slides in from behind it – width and transform animate in every browser. */
.search-pop.is-ready input[type=search] {
  position: absolute; right: calc(100% + 6px); top: 50%; z-index: 20; margin: 0; height: 34px; padding-block: 0;
  width: 0; min-width: 0; padding-inline: 0; border-color: transparent; box-shadow: none;
  /* It lies over what is beside it (the sort menu on the dashboard): it needs a ground of its own. */
  background: var(--card);
  transform: translate(24px, -50%); opacity: 0; visibility: hidden;
  transition: width .32s cubic-bezier(.2, .8, .2, 1), padding .32s cubic-bezier(.2, .8, .2, 1), transform .32s cubic-bezier(.2, .8, .2, 1),
              opacity .12s ease, border-color .2s ease, box-shadow .2s ease, visibility 0s linear .32s;
}
.search-pop.is-ready.is-open input[type=search] {
  width: min(340px, calc(100vw - 80px)); padding-inline: 12px; border-color: var(--ink); box-shadow: var(--shadow-soft);
  transform: translate(0, -50%); opacity: 1; visibility: visible; transition-delay: 0s;
}
@media (prefers-reduced-motion: reduce) { .search-pop.is-ready input[type=search] { transition: none; } }
/* Results that follow the words (form[data-live]): only an answer that takes a moment dims them. */
[aria-busy="true"]#market-live { opacity: .55; transition: opacity .15s ease .25s; }

/* Misc -------------------------------------------------------------------- */
.hero-small { padding: 18px 0 6px; }
.hero-small h1 { font-size: 2.3rem; }
.breadcrumbs { font-size: .83rem; color: var(--muted); margin-bottom: 12px; }
/* Long addresses (cron links, keys) break instead of pushing the page wider than the screen. */
main code { overflow-wrap: anywhere; }
pre.code-block { background: var(--code-bg); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 13px; overflow-x: auto; font-size: .83rem; }
.progress { height: 7px; background: var(--card-2); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); }
/* Storage: files and the tools' data side by side in one bar, with a key below it. */
.progress-stack { display: flex; }
.progress-stack span + span { background: var(--blue); }
.progress-warn { border-color: var(--gold); }
.progress-legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; background: var(--accent); }
.progress-legend .key-data { margin-left: 10px; }
.progress-legend .key-data::before { background: var(--blue); }
.storage-warn { color: var(--gold); font-weight: 600; }
.filters { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input, .filters select { width: auto; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 20px; }
.chip { padding: 5px 11px; border-radius: 3px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); font-size: .84rem; }
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip:hover { text-decoration: none; border-color: var(--ink); }

/* Guided tour ------------------------------------------------------------- */
.tour-block { position: fixed; inset: 0; z-index: 9000; cursor: default; }
.tour-ring { position: fixed; z-index: 9001; border-radius: var(--radius); pointer-events: none;
  box-shadow: 0 0 0 2px var(--accent), 0 0 0 9999px rgba(22, 20, 15, .58); transition: all .18s ease; }
.tour-ring.is-empty { box-shadow: 0 0 0 9999px rgba(22, 20, 15, .58); }
.tour-pop { position: fixed; z-index: 9002; width: min(340px, calc(100vw - 24px)); background: var(--card);
  border: 1px solid var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 16px 17px 13px; }
.tour-pop h3 { font-size: 1.05rem; margin: 0 0 6px; }
.tour-pop p { margin: 0 0 12px; font-size: .9rem; color: var(--ink-2); }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tour-count { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tour-btns { display: flex; gap: 6px; }
/* .btn sets display, which beats the browser's own rule for [hidden] */
.tour-btns [hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .tour-ring { transition: none; } }

/* Help page --------------------------------------------------------------- */
.help-page { max-width: 820px; margin: 0 auto; }
/* The contents: a card above the sections on a phone, a column beside them that stays in view on
   a wide screen. The section being read is marked (assets/js/app.js, [data-toc]). */
.help-toc { margin-bottom: 24px; scroll-margin-top: 78px; }
.help-toc > h2 { font-size: 1.05rem; margin: 0 0 4px; }
.help-toc-group { margin: 12px 0 4px; font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.help-toc ol { list-style: none; margin: 0; padding: 0; }
.help-toc li a { display: flex; gap: 8px; align-items: baseline; padding: 5px 8px; border-radius: var(--radius); color: var(--ink-2); font-size: .9rem; border-left: 3px solid transparent; }
.help-toc li a:hover { background: var(--card-2); text-decoration: none; color: var(--ink); }
.help-toc li a.active { border-left-color: var(--accent); color: var(--ink); font-weight: 600; }
.help-num { flex: none; min-width: 1.4em; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.help-page section h2 .help-num { display: inline-block; margin-right: 8px; color: var(--accent-ink); }
.help-up { float: right; margin: 4px 0 0 12px; color: var(--muted); }
@media (min-width: 560px) and (max-width: 979px) {
  .help-toc { columns: 2; column-gap: 24px; }
  .help-toc > h2 { column-span: all; }
  .help-toc-group:first-of-type { margin-top: 4px; }
  .help-toc ol { break-inside: avoid; }
}
@media (min-width: 980px) {
  .help-page { max-width: 1120px; }
  .help-page .hero-small { max-width: 820px; }
  .help-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
  .help-toc { position: sticky; top: 78px; max-height: calc(100vh - 96px); overflow-y: auto; margin-bottom: 0; }
  .help-up { display: none; }
}
.help-defs { margin: 0; }
.help-defs dt { font-weight: 600; margin-top: 14px; }
.help-defs dt:first-child { margin-top: 0; }
.help-defs dd { margin: 3px 0 0; color: var(--ink-2); }
.help-steps { margin: 0; padding-left: 20px; }
.help-steps li { margin-bottom: 10px; color: var(--ink-2); }
.help-list { margin: 0; padding-left: 20px; }
.help-list li { margin-bottom: 10px; color: var(--ink-2); }
.help-page section h2 { font-size: 1.35rem; }
.help-page section[id] { scroll-margin-top: 78px; }

/* Feedback on a tool ------------------------------------------------------ */
.fb-form { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 12px; background: var(--card-2); }
.fb-kind { width: 170px; margin: 0; }
.fb-text { flex: 1; min-width: 0; margin: 0; }
@media (max-width: 560px) {
  .fb-form .row { flex-direction: column; align-items: stretch; }
  .fb-kind { width: auto; }
}
.fb-item { display: flex; gap: 14px; align-items: flex-start; border-top: 1px solid var(--line); padding: 14px 0; }
.fb-item.is-done .fb-body { color: var(--muted); }
.fb-item.is-hidden { opacity: .72; }
.fb-vote-form { margin: 0; flex: none; }
.fb-vote { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 50px; padding: 6px 4px;
  border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--card); color: var(--ink-2);
  font-family: inherit; font-weight: 600; cursor: pointer; line-height: 1.1; }
.fb-vote:hover:not(:disabled) { border-color: var(--ink); background: var(--surface-hi); }
.fb-vote:disabled { cursor: default; opacity: .6; }
.fb-vote.is-voted { border-color: var(--accent); color: var(--accent-ink); background: #fbeee9; }
.fb-arrow { font-size: .72rem; }
.fb-count { font-variant-numeric: tabular-nums; font-size: .95rem; }
.fb-main { flex: 1; min-width: 0; }
.fb-body { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; }
.fb-reply { margin-top: 9px; padding: 9px 11px; border-left: 3px solid var(--accent); background: var(--card-2); border-radius: 0 var(--radius) var(--radius) 0; }
.fb-actions { margin-top: 10px; gap: 6px; align-items: flex-start; }
.fb-actions form { margin: 0; }
.fb-actions details { margin: 0; }
.fb-actions summary { display: inline-flex; list-style: none; cursor: pointer; }
.fb-actions summary::-webkit-details-marker { display: none; }
.fb-actions details[open] { width: 100%; }

/* Private beta landing ----------------------------------------------------- */
.beta-page { background: var(--paper); }
.beta-wrap { min-height: 100vh; display: flex; flex-direction: column; max-width: 1280px; margin: 0 auto; padding: 0 22px; }
.beta-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; }
/* Wide: the form beside everything, held in view. Narrow: introduction, form, then the rest. */
.beta-layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "aside" "more"; column-gap: 48px; }
.beta-main { grid-area: main; padding: 36px 0 30px; }
.beta-aside { grid-area: aside; }
.beta-more { grid-area: more; min-width: 0; padding-bottom: 64px; }
@media (min-width: 1040px) {
  .beta-layout { grid-template-columns: minmax(0, 1fr) 390px; grid-template-areas: "main aside" "more aside"; }
  .beta-aside { padding-top: 36px; }
  .beta-aside .beta-request { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow-y: auto; }
  .beta-aside .beta-request-row { grid-template-columns: 1fr; gap: 0; }
}
.beta-intro { position: relative; isolation: isolate; }
.beta-ring { position: absolute; z-index: -1; right: 4%; top: -10px; width: 230px; height: 230px; border-radius: 50%; border: 24px solid var(--accent); opacity: .12; pointer-events: none; }
.beta-more .sc-inner { padding-inline: 0; padding-block: 64px; }
.beta-more .sc-features { border: 1.5px solid var(--ink); border-radius: var(--radius-lg); }
.beta-more .sc-features .sc-inner { padding: 56px 28px; }
.beta-more .sc-marquee { margin: 0; }
.beta-closing { margin: 64px 0 30px; border: 1.5px solid var(--ink); border-radius: var(--radius-lg); padding: 44px 28px; text-align: center; background: var(--card); box-shadow: 6px 6px 0 var(--shadow-ink); }
.beta-closing h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin-bottom: 10px; }
.beta-closing p { color: var(--ink-2); max-width: 32em; margin: 0 auto 22px; }
/* the way back to the form on a phone */
.beta-fab { position: fixed; left: 50%; bottom: 16px; z-index: 40; translate: -50% 0; display: inline-flex; align-items: center; gap: 8px; padding: 13px 24px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 600; border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--shadow-ink); white-space: nowrap;
  transition: opacity .25s, translate .25s; }
.beta-fab::after { content: '↓'; }
.beta-fab:hover { text-decoration: none; color: #fff; }
.beta-fab.away { opacity: 0; translate: -50% 140%; pointer-events: none; }
@media (min-width: 1040px) { .beta-fab { display: none; } }
.beta-kicker { display: inline-block; font-family: var(--mono); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-ink); border-bottom: 2px solid var(--accent); padding-bottom: 3px; margin-bottom: 26px; }
.beta-main h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.04; letter-spacing: -.025em; margin: 0 0 20px; font-weight: 600; }
.beta-lead { font-size: 1.12rem; color: var(--ink-2); max-width: 34em; margin: 0 0 30px; }
.beta-points { list-style: none; margin: 0 0 36px; padding: 0; border-top: 1px solid var(--line); }
.beta-points li { border-bottom: 1px solid var(--line); padding: 13px 0 13px 26px; position: relative; color: var(--ink-2); }
.beta-points li::before { content: '—'; position: absolute; left: 0; color: var(--accent); }
.beta-points strong { color: var(--ink); }
.beta-request { background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius-lg); padding: 24px; scroll-margin-top: 20px; box-shadow: 6px 6px 0 var(--accent); }
.beta-request h2 { font-size: 1.5rem; margin: 0; }
.beta-request textarea { min-height: 96px; }
.beta-request form { margin-top: 20px; }
.beta-request-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.beta-request .field { min-width: 0; }
.beta-request .flash { margin-top: 20px; }
.beta-request a { overflow-wrap: anywhere; }
.beta-note { font-size: .9rem; color: var(--muted); max-width: 40em; margin: 14px 0 0; }
.beta-foot-note { font-size: .88rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 18px; margin: 0 0 60px; }
.beta-bottom { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  border-top: 1px solid var(--line-2); padding: 18px 0 26px; font-size: .84rem; color: var(--muted); }
.beta-bottom a { color: var(--muted); margin-left: 14px; }
@media (max-width: 560px) {
  .beta-request { padding: 18px; }
  .beta-request-row { grid-template-columns: 1fr; gap: 0; }
  .beta-main h1 br { display: none; }
  .beta-bottom a { margin: 0 14px 0 0; }
}

/* Invitations waiting for the signed-in person --------------------------- */
.invite-waiting { border-left: 3px solid var(--accent); }
.invite-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding: 12px 0 0; margin-top: 12px; }
.invite-row form { margin: 0; }
.invite-check { margin-top: 6px; }
.invite-check-user { color: var(--green); }
.invite-check-member { color: var(--gold); }
/* What the owner of a tool keeps for themselves, shown switched off to the people editing it with them. */
fieldset.owner-only { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.owner-only[disabled] > *:not(.owner-only-note) { opacity: .6; }
.owner-only-note { margin: 0 0 8px; padding: 6px 10px; border-left: 3px solid var(--gold); background: var(--card-2); }
.invite-check-unknown { color: var(--accent-ink); }

/* Profiles: pictures, the profile head, the username field and its suggestions -------- */
.avatar { display: inline-block; flex: none; border-radius: 50%; object-fit: cover; vertical-align: middle; background: var(--card-2); }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; letter-spacing: .02em; line-height: 1; user-select: none; }
.avatar-lg { border: 1px solid var(--line-2); }
.tool-card-author { display: flex; align-items: center; gap: 6px; }
.author-link { color: inherit; display: inline-flex; align-items: center; gap: 5px; }
.profile-head { display: flex; gap: 20px; align-items: center; }
@media (max-width: 560px) { .profile-head { flex-direction: column; align-items: flex-start; } }

/* A creator's public page (profile.php): a band in their own colour, their picture standing on its
   edge, the figures of their tools, the one used most, and the list. The hue is the one of their
   initials (avatar_hue()), so the page and the picture belong together. */
.pf { --pf-band: hsl(var(--pf-hue) 45% 42%); --pf-tint: hsl(var(--pf-hue) 40% 94%); }
.pf-hero { position: relative; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 24px; box-shadow: var(--shadow); }
.pf-cover { height: 132px; background-color: var(--pf-band);
  background-image: radial-gradient(rgba(255, 255, 255, .22) 1.2px, transparent 1.6px), radial-gradient(rgba(0, 0, 0, .12) 1.2px, transparent 1.6px);
  background-size: 18px 18px, 18px 18px; background-position: 0 0, 9px 9px; border-bottom: 1px solid rgba(0, 0, 0, .18); }
.pf-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 22px; align-items: end; padding: 0 26px 18px; margin-top: -54px; }
.pf-avatar { width: 120px !important; height: 120px !important; border: 4px solid var(--card); box-shadow: 3px 3px 0 var(--shadow-ink); background: var(--card); }
.pf-avatar.avatar-initials { font-size: 44px !important; }
.pf-id { min-width: 0; padding-top: 62px; }
.pf-id h1 { margin: 0; font-size: 2.2rem; overflow-wrap: anywhere; }
.pf-handle { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.pf-bio { margin: 10px 0 0; max-width: 60ch; font-size: 1.02rem; color: var(--ink-2); }
.pf-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); background: var(--pf-tint); }
.pf-stats > div { padding: 14px 26px; border-left: 1px solid var(--line); min-width: 0; }
.pf-stats > div:first-child { border-left: 0; }
.pf-stats dt { font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pf-stats dd { margin: 2px 0 0; font-family: var(--display); font-size: 1.6rem; font-weight: 600; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-stats dd small { font-family: var(--font); font-size: .78rem; font-weight: 400; color: var(--muted); }
.pf-star { color: var(--gold); }
.pf-spotlight { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; margin-bottom: 28px; padding: 20px 24px;
  background: var(--card); border: 1.5px solid var(--ink); border-left: 8px solid var(--pf-band); border-radius: var(--radius-lg); }
.pf-spot-icon.tool-icon { width: 64px; height: 64px; font-size: 2.1rem; }
.pf-spot-icon .tool-icon-img { width: 46px; height: 46px; }
.pf-kicker { margin: 0 0 2px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pf-band); }
.pf-spot-body h2 { margin: 0 0 2px; font-size: 1.45rem; }
.pf-spot-body h2 a { color: var(--ink); }
.pf-spot-body p { margin: 0 0 6px; }
.pf-tools-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pf-tools-head h2 { margin: 0; }
.pf-sort.tabs { margin: 0; border-bottom: 0; }
.pf-count { opacity: .6; font-variant-numeric: tabular-nums; margin-left: 2px; }
.pf-empty { padding: 28px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius-lg); background: var(--card); }
.pf-empty p { margin: 0 0 12px; }
@media (max-width: 760px) {
  .pf-cover { height: 96px; }
  .pf-head { grid-template-columns: minmax(0, 1fr); margin-top: -50px; padding: 0 18px 16px; }
  .pf-avatar { width: 96px !important; height: 96px !important; }
  .pf-avatar.avatar-initials { font-size: 36px !important; }
  .pf-id { padding-top: 0; }
  .pf-id h1 { font-size: 1.75rem; }
  .pf-actions { justify-content: flex-start; }
  .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-stats > div { padding: 12px 18px; }
  .pf-stats > div:nth-child(3) { border-left: 0; }
  .pf-stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .pf-stats dd { font-size: 1.35rem; white-space: normal; }
  .pf-stats dd small { display: block; }
  .pf-spotlight { grid-template-columns: auto minmax(0, 1fr); padding: 16px; gap: 14px; }
  .pf-spot-btn { grid-column: 1 / -1; }
}
.input-prefix { display: flex; align-items: stretch; }
.input-prefix > span { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--line-2); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--card-2); color: var(--muted); }
.input-prefix > input { flex: 1; min-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.username-check.is-ok { color: var(--green); }
.username-check.is-bad { color: var(--accent-ink); }
.suggest { position: relative; }
.suggest-list { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-soft); max-height: 300px; overflow-y: auto; }
.suggest-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius); cursor: pointer; }
.suggest-list li[aria-selected="true"], .suggest-list li:hover { background: var(--card-2); }
.suggest-list li.is-member { opacity: .55; cursor: default; }
.suggest-list .suggest-name { font-weight: 600; }

/* Trying a paid tool before buying it ------------------------------------- */
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: var(--card-2); border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 10px 14px; font-size: .9rem; }
.preview-bar form { margin: 0; }
.runner-frame.is-preview { border-top-left-radius: 0; border-top-right-radius: 0; }

/* The beta page has no nav, only the sign-in button. */
.beta-top-right { display: inline-flex; align-items: center; gap: 10px; }

/* Icon picker (tool_icon_picker() in inc/tools.php): radio buttons drawn as tiles of the line set. */
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; max-height: 190px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); }
.icon-pick { position: relative; display: block; cursor: pointer; }
.icon-pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.icon-pick span { display: grid; place-items: center; height: 38px; border: 1px solid transparent; border-radius: var(--radius); font-size: 1.3rem; color: var(--ink-2, inherit); }
.icon-pick .ui-icon { width: 22px; height: 22px; }
.icon-pick:hover span { background: var(--card-2); }
.icon-pick input:checked + span { border-color: var(--accent, currentColor); background: var(--card-2); color: var(--accent, inherit); }
.icon-pick input:focus-visible + span { outline: 2px solid var(--accent, currentColor); outline-offset: 1px; }
.icon-upgrade .help { margin-top: 6px; }

/* Pixel editor for a tool's icon (assets/js/pixel-editor.js) */
.pixel-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.pixel-editor .help { margin: 0; }
.pixel-panel { flex-basis: 100%; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); padding: 10px; outline: none; }
.pixel-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pixel-toolbar .btn.is-on { background: var(--ink); color: var(--card); }
.pixel-inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: .85rem; }
.pixel-inline input[type=color] { width: 38px; height: 30px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius); }
.pixel-inline select { width: auto; padding: 4px 6px; }
.pixel-swatches { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; margin: 8px 0; }
.pixel-swatch { width: 22px; height: 22px; border: 1px solid var(--line-2); border-radius: 4px; padding: 0; cursor: pointer; }
.pixel-body { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.pixel-canvas { width: min(100%, 384px); aspect-ratio: 1; image-rendering: pixelated; touch-action: none; cursor: crosshair;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: repeating-conic-gradient(#e9e4d8 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.pixel-side { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 180px; flex: 1; }
.pixel-side p { margin: 0; }
.pixel-previews { display: flex; align-items: flex-end; gap: 10px; }
.pixel-previews img { border: 1px dashed var(--line-2); background: repeating-conic-gradient(#e9e4d8 0 25%, #fff 0 50%) 0 0 / 8px 8px; }
.pixel-side [data-pixel-status].err { color: var(--accent-ink); }
@media (max-width: 640px) { .pixel-toolbar .btn span { display: none; } }

/* ---------------------------------------------------------------------------
   Theme "teal" (Admin → Settings → Appearance)
   A calmer, app-like look: dark petrol header with light type, cool grey-blue
   ground, white cards, soft shadows instead of hard offset ones, sans-serif
   headings. Everything else follows from the variables.
--------------------------------------------------------------------------- */
body.theme-teal {
  --paper: #eef4f5;
  --card: #ffffff;
  --card-2: #e7eff1;
  --ink: #0f2b35;
  --ink-2: #2e4953;
  --muted: #627a83;
  --line: #d9e4e7;
  --line-2: #c6d6da;
  --accent: #d2452b;
  --accent-ink: #a9361f;
  --green: #1d7a55;
  --blue: #1f5f8b;
  --gold: #a5701c;
  --head: #123f4f;
  --head-ink: #ffffff;
  --head-line: rgba(255, 255, 255, .2);
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 6px 20px rgba(15, 43, 53, .14);
  --shadow-soft: 0 2px 10px rgba(15, 43, 53, .08);
  --shadow-ink: var(--ink);
  --display: var(--font);
  --topbar-h: 66px;
}
.theme-teal h1, .theme-teal h2, .theme-teal h3, .theme-teal h4 { font-weight: 700; letter-spacing: -.015em; }

/* Header */
.theme-teal .topbar { background: var(--head); border-bottom: 0; box-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.theme-teal .topbar .brand { color: var(--head-ink); }
/* The normal logo has dark lettering; until a light one is uploaded, flip its lightness but
   keep its hues, so dark type turns white while the coloured mark stays coloured. */
.theme-teal .brand-logo-auto { filter: invert(1) hue-rotate(180deg) saturate(1.3); }
.theme-teal .nav > a, .theme-teal .nav-menu > summary { color: rgba(255, 255, 255, .88); }
.theme-teal .nav > a:hover { color: #fff; background: rgba(255, 255, 255, .09); }
.theme-teal .nav > a.btn { background: rgba(255, 255, 255, .06); border-color: var(--head-line); color: #ff8a5e; }
.theme-teal .nav > a.btn:hover { background: rgba(255, 255, 255, .12); color: #ffa07c; }
.theme-teal .nav > a.nav-credits, .theme-teal .nav-menu > summary { background: transparent; border-color: transparent; }
.theme-teal .nav > a.nav-credits .nav-svg { color: #ff8a5e; }
.theme-teal .nav > a.nav-credits:hover, .theme-teal .nav-menu > summary:hover, .theme-teal .nav-menu[open] > summary { background: rgba(255, 255, 255, .09); border-color: var(--head-line); color: #fff; }
.theme-teal .nav-caret { color: rgba(255, 255, 255, .6); }
.theme-teal .nav-toggle { background: transparent; border-color: var(--head-line); color: #fff; }
@media (max-width: 880px) {
  .theme-teal .nav { top: 66px; background: var(--head); border-bottom: 0; }
  .theme-teal .nav-menu-list a { color: rgba(255, 255, 255, .85); }
  .theme-teal .nav-menu-list a:hover { background: rgba(255, 255, 255, .09); color: #fff; }
}

/* Buttons, fields and surfaces: soft, no hard offset shadows */
.theme-teal .btn { border: 1px solid var(--line-2); background: var(--card); }
.theme-teal .btn:hover { transform: none; box-shadow: var(--shadow-soft); border-color: var(--muted); background: var(--surface-hi); }
.theme-teal .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.theme-teal .btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.theme-teal .btn-ghost { background: transparent; }
.theme-teal .btn-ghost:hover { background: var(--card-2); box-shadow: none; }
.theme-teal .btn-danger { border-color: #e5bfb4; }
.theme-teal .btn-success { border-color: var(--green); background: var(--green); }
.theme-teal input:focus, .theme-teal select:focus, .theme-teal textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 95, 139, .15); }
.theme-teal .card, .theme-teal .stat, .theme-teal .chat { border-color: var(--line); box-shadow: var(--shadow-soft); }
.theme-teal .tool-card:hover, .theme-teal .tool-card:focus-within { transform: translateY(-2px); }
.theme-teal .plan.highlight { border: 1.5px solid var(--accent); }
.theme-teal .badge { border-radius: 6px; }
.theme-teal .badge-success { background: #d8f1e5; color: #17694a; border-color: #b4e2cc; }
.theme-teal .builder-pane textarea.code, .theme-teal .editor-paint, .theme-teal pre.code-block,
.theme-teal .code-files button.active { background: var(--surface-hi); }
/* The editor's textarea lies over the painted copy of the code and must stay see-through. */
.theme-teal .editor > textarea.code { background: transparent; }
.theme-teal .builder-tabs { gap: 4px; border-bottom: 1px solid var(--line); }
.theme-teal .builder-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 12px; color: var(--muted); font-size: .9rem; }
.theme-teal .builder-tabs button:hover { background: none; color: var(--ink); }
.theme-teal .builder-tabs button.active { background: none; color: var(--ink); border-bottom-color: var(--accent); }

/* Quality check (inc/quality.php): the box in the builder and the panel in the review queue. */
.quality-box > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.quality-box > summary::-webkit-details-marker { display: none; }
.quality-list { margin: 0 0 8px; padding-left: 18px; }
.quality-list li { margin-bottom: 5px; }
.quality-box .quality-list li.q-error { color: var(--accent-ink); }
.quality-panel { border-top: 1px solid var(--line); padding-top: 10px; }
.quality-panel .quality-list, .quality-ai-list { list-style: none; padding-left: 0; }
.quality-ai-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* Overlays (<dialog>): a head with the title and ✕, a body that scrolls, a foot with the actions. */
.dialog { border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--card); color: var(--ink); box-shadow: var(--shadow);
          padding: 0; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
.dialog[open] { display: flex; flex-direction: column; }
.dialog::backdrop { background: rgba(20, 18, 14, .45); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 20px 10px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 1.1rem; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dialog-head .badge { font-family: var(--font); }
.quality-ai-head [hidden], .dialog [hidden] { display: none; }
.dialog-body { padding: 14px 20px; overflow-y: auto; flex: 1 1 auto; }
.dialog-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.dialog-foot:empty { display: none; }
.quality-ai-dialog .quality-ai-list li { padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; }
.quality-ai-dialog .quality-ai-list li:last-child { border-bottom: 0; }

/* The scorecard (quality_scorecard_html): a traffic light for the whole tool, one card per area. */
.q-score { margin: 0 0 14px; }
.q-score-head { display: flex; gap: 14px; align-items: center; margin: 0 0 12px; }
.q-score-count { margin-left: 6px; }
.q-lights { display: inline-flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 999px; background: #2a2723; flex: 0 0 auto; }
.q-lights i { width: 14px; height: 14px; border-radius: 50%; background: currentColor; opacity: .22; }
.q-lights .q-l-red { color: #e0563f; } .q-lights .q-l-yellow { color: #e8b339; } .q-lights .q-l-green { color: #4bb36b; }
.q-score-red .q-l-red, .q-score-yellow .q-l-yellow, .q-score-green .q-l-green { opacity: 1; box-shadow: 0 0 6px currentColor; }
.q-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.q-card { border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); padding: 10px 12px; background: var(--card); min-width: 0; }
.q-card.q-is-green { border-left-color: #4bb36b; } .q-card.q-is-yellow { border-left-color: #e8b339; } .q-card.q-is-red { border-left-color: #e0563f; }
.q-card h4 { margin: 0 0 4px; font-size: .95rem; display: flex; flex-wrap: wrap; gap: 6px; justify-content: space-between; align-items: center; font-family: var(--font); }
.q-card p { margin: 0 0 6px; }
.q-card ul { margin: 0; padding-left: 16px; overflow-wrap: anywhere; }
.q-card li { margin-bottom: 4px; }
.q-card li.q-pt-red { color: var(--accent-ink); }
.q-card li.q-pt-note { color: var(--muted, inherit); }
.q-card-ok { color: var(--green); }
.q-score-outdated { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.q-score-review { margin: 8px 0 12px; }
.q-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.q-score-review .q-lights { flex-direction: row; }
.q-score-review .q-score-head { margin-bottom: 8px; }
.quality-ai-sub { margin: 4px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 1rem; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.quality-ai-sub .badge { font-family: var(--font); }

/* My tools, taking a tool off the list: keep the data or delete it (dashboard.php, #dash-forget). */
.dialog.dash-forget { width: min(520px, calc(100vw - 32px)); }
.dash-forget .dialog-body p { margin: 0 0 10px; }
.dash-forget .dialog-foot .row { gap: 8px; }

/* Marketplace overlay (tool_overlay.php): Install on top, then description, screenshots and the tool. */
.dialog.tool-overlay { width: min(980px, calc(100vw - 32px)); }
.tool-overlay-head h2 { font-size: 1.25rem; }
.tool-overlay-head .tool-price { font-size: .8rem; }
.tool-overlay-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tool-overlay-more { margin-left: auto; }
.tool-overlay-desc { font-size: 1.02rem; margin: 0 0 14px; }
.tool-overlay-frame { height: 56vh; min-height: 360px; margin-top: 14px; }
/* Screenshots with their lines: in the overlay, on the tool's page, and in Settings. */
.shot-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0 0 12px; }
.shot-gallery-1 { grid-template-columns: minmax(0, 1fr); }
.shot { margin: 0; }
.shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--card-2); }
.shot-gallery-1 .shot img { aspect-ratio: auto; max-height: 420px; object-fit: contain; }
.shot figcaption { font-size: .86rem; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.shot-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.shot-row img { width: 160px; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border: 1px solid var(--line-2); border-radius: var(--radius); }
.shot-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.shot-row-body textarea { min-height: 0; }
.shot-list > .btn { margin-top: 10px; }
.shot-add { margin-top: 12px; }
.shot-capture-start { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; }
.shot-file-preview { display: block; max-width: 320px; max-height: 200px; margin-top: 8px; border: 1px solid var(--line-2); border-radius: var(--radius); }
.shot-file-preview[hidden] { display: none; }
/* The dialog with the running tool: as wide as the screen allows, the frame scaled into the stage (builder.js). */
.dialog.shot-capture { width: min(1180px, calc(100vw - 32px)); }
.shot-devices { gap: 6px; margin-bottom: 10px; }
.shot-devices .btn.active { background: var(--ink); color: var(--card); border-color: var(--ink); }
.shot-stage { position: relative; overflow: hidden; margin: 0 auto; max-width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; }
.shot-stage iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: #fff; }
@media (max-width: 600px) { .shot-row { flex-direction: column; } .shot-row img { width: 100%; } }

/* Search as you type (assets/js/app.js): a hidden match must stay hidden whatever display a card has. */
[data-find][hidden], [data-find-section][hidden], [data-find-empty][hidden] { display: none !important; }

/* A button that reads as a link, for a small action inside a sentence. */
.btn-link { background: none; border: none; padding: 0; font: inherit; color: var(--accent-ink); text-decoration: underline; cursor: pointer; }

/* Admin → Newsletter: the editor (assets/js/newsletter-editor.js) next to the AI panel. The page
   inside the editor looks like the letter, so what is written is what arrives. */
.nl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
@media (max-width: 960px) { .nl-layout { grid-template-columns: minmax(0, 1fr); } }
.nl-ai { position: sticky; top: 16px; }
.nl-ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.nl-ai-status:empty { display: none; }
.nl-editor { border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; }
.nl-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--card-2); border-radius: var(--radius) var(--radius) 0 0; }
.nl-toolbar button, .nl-toolbar select { font: inherit; font-size: .84rem; min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--ink); cursor: pointer; }
.nl-toolbar button:hover, .nl-toolbar select:hover { background: var(--surface-hi); border-color: var(--line-2); }
.nl-toolbar select { width: auto; margin: 0; padding-right: 26px; background-position: right 8px center; }
.nl-toolbar button[aria-pressed="true"] { background: var(--surface-hi); border-color: var(--ink); }
.nl-toolbar .nl-sep { width: 1px; background: var(--line-2); margin: 4px 4px; }
.nl-surface { min-height: 380px; max-height: 70vh; overflow-y: auto; padding: 22px 26px; outline: none; font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.6; color: #16140f; }
.nl-surface:focus { box-shadow: inset 0 0 0 2px #f6ead2; }
.nl-surface p { margin: 0 0 16px; }
.nl-surface h2 { font-family: inherit; font-size: 22px; line-height: 1.3; margin: 28px 0 12px; }
.nl-surface h3 { font-family: inherit; font-size: 18px; line-height: 1.35; margin: 22px 0 10px; }
.nl-surface ul, .nl-surface ol { margin: 0 0 16px; padding-left: 22px; }
.nl-surface blockquote { margin: 0 0 16px; padding: 4px 0 4px 16px; border-left: 3px solid #ddd6c7; color: #4a443b; }
.nl-surface hr { border: none; border-top: 1px solid #eee6d8; margin: 24px 0; }
.nl-surface img { max-width: 100%; height: auto; display: block; border-radius: 6px; }
.nl-surface a { color: #bf3f26; }
.nl-surface a.nl-button { display: inline-block; background: #16140f; color: #f4f1ea; text-decoration: none; padding: 12px 22px; border-radius: 6px; font-weight: 600; }
.nl-source { width: 100%; min-height: 380px; border: none; border-radius: 0 0 var(--radius) var(--radius); padding: 14px; font-family: 'IBM Plex Mono', monospace; font-size: .84rem; }
.nl-editor.is-visual .nl-source { display: none; }
.nl-editor:not(.is-visual) .nl-surface { display: none; }
.nl-preview { width: 100%; height: 760px; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: #f4f1ea; }
.nl-progress { height: 10px; background: var(--card-2); border-radius: 5px; overflow: hidden; }
.nl-progress span { display: block; height: 100%; background: var(--green); transition: width .4s; }

/* Invites from friends during the beta: a card that folds open, on My tools and the account page. */
.friend-invites > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-right: 22px; position: relative; }
.friend-invites > summary::-webkit-details-marker { display: none; }
.friend-invites > summary::after { content: '▸'; position: absolute; right: 2px; color: var(--muted); transition: transform .15s; }
.friend-invites[open] > summary::after { transform: rotate(90deg); }
.friend-invites-title { font-family: var(--display); font-weight: 600; font-size: 1.2rem; letter-spacing: -.01em; }
.friend-invite-link { flex-wrap: nowrap; }
.friend-invite-link input { flex: 1; min-width: 0; }
.friend-invite-link .btn { flex: none; }

/* Favourites (inc/favorites.php) ------------------------------------------
   The star in the header opens a slim panel under it. Pinned, the panel stands beside the page
   on a wide screen and the page makes room for it; on a phone it opens over the page, full
   width, and is never pinned. Only the list scrolls – about six entries show before it does. */
:root { --fav-w: 264px; --fav-row: 40px; }
.topbar-inner > .nav { margin-inline-start: auto; }
.fav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none;
  margin-inline-start: -12px; padding: 0; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); cursor: pointer; }
.fav-toggle:hover, .fav-toggle[aria-expanded="true"] { border-color: var(--ink); color: var(--ink); }
.fav-toggle[aria-expanded="true"] .nav-svg { fill: var(--gold); stroke: var(--gold); }
.fav-panel { display: none; position: fixed; top: calc(var(--topbar-h) + 6px); inset-inline-end: 20px; z-index: 60; width: var(--fav-w);
  flex-direction: column; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.fav-panel.is-open { display: flex; }
.fav-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 6px 14px; border-bottom: 1px solid var(--line); }
.fav-head strong { flex: 1; font-size: .9rem; }
.fav-pin, .fav-close { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius); background: none; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.fav-pin svg { width: 17px; height: 17px; }
.fav-pin:hover, .fav-close:hover { background: var(--card-2); color: var(--ink); }
.fav-pin[aria-pressed="true"] { color: var(--accent); border-color: var(--line-2); background: var(--card-2); }
.fav-pin[aria-pressed="true"] svg { fill: currentColor; }
/* One scroll for the favourites and every other tool under them. */
.fav-scroll { max-height: calc(var(--fav-row) * 6.5 + 8px); overflow-y: auto; overscroll-behavior: contain; }
.fav-list { list-style: none; margin: 0; padding: 4px 8px; }
.fav-more { padding: 10px 14px 4px; border-top: 1px solid var(--line); font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.fav-others { padding-top: 0; }
.fav-others .fav-link { padding-inline-start: 22px; }   /* in line with the favourites, which have a grip */
.fav-item { display: flex; align-items: center; gap: 2px; height: var(--fav-row); border-radius: var(--radius); }
.fav-item:hover { background: var(--card-2); }
.fav-item.is-current, .fav-item.is-current:hover { background: color-mix(in srgb, var(--blue) 13%, var(--card)); }
/* The list opens with the focus on the open tool: no frame around it, the row shows it. */
.fav-link:focus { outline: none; }
.fav-item:has(.fav-link:focus-visible) { background: var(--card-2); }
.fav-item.is-current:has(.fav-link:focus-visible) { background: color-mix(in srgb, var(--blue) 20%, var(--card)); }
.fav-item.is-dragging { opacity: .55; background: var(--card-2); }
.fav-grip { flex: none; width: 18px; text-align: center; color: var(--line-2); font-size: .8rem; letter-spacing: -2px; cursor: grab; touch-action: none; user-select: none; border-radius: 4px; }
.fav-item:hover .fav-grip, .fav-grip:focus-visible { color: var(--muted); }
.fav-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; height: 100%; padding: 0 4px; color: var(--ink-2); font-size: .9rem; }
.fav-link:hover { color: var(--ink); text-decoration: none; }
.fav-item.is-current .fav-link { color: var(--ink); font-weight: 600; }
.fav-icon { flex: none; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.fav-icon .tool-icon-img { width: 22px; height: 22px; border-radius: 4px; }
.fav-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A tool's rooms in teams (or of other people), beside its name: each opens that room. */
.fav-rooms { flex: none; display: inline-flex; gap: 1px; }
.fav-room { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px; border-radius: var(--radius); color: var(--muted); }
.fav-room-tag { position: absolute; right: 1px; bottom: 1px; min-width: 11px; padding: 0 2px; border-radius: 3px; background: var(--card); font: 700 .58rem/1.25 var(--font); color: var(--ink-2); text-align: center; }
.fav-room svg { width: 17px; height: 17px; }
.fav-room:hover { background: var(--card); color: var(--ink); text-decoration: none; }
.fav-room.is-current { color: var(--accent); background: var(--card); }
.fav-unstar { flex: none; width: 28px; height: 28px; padding: 0; border: 0; background: none; color: var(--gold); font-size: .95rem; cursor: pointer; border-radius: var(--radius); opacity: 0; }
.fav-item:hover .fav-unstar, .fav-unstar:focus-visible { opacity: 1; }
.fav-unstar:hover { background: var(--card); }
.fav-addstar { flex: none; width: 28px; height: 28px; padding: 0; border: 0; background: none; color: var(--muted); font-size: .95rem; cursor: pointer; border-radius: var(--radius); opacity: 0; }
.fav-item:hover .fav-addstar, .fav-addstar:focus-visible { opacity: 1; }
.fav-addstar:hover { background: var(--card); color: var(--gold); }
.fav-empty { margin: 0; padding: 12px 14px 14px; }
@media (hover: none) { .fav-unstar, .fav-addstar { opacity: 1; } .fav-grip { color: var(--muted); } }

/* Pinned: a column of its own at the window's edge, as tall as the window under the header. */
@media (min-width: 1100px) {
  body.fav-pinned { padding-inline-end: var(--fav-w); }
  body.fav-pinned .topbar { margin-inline-end: calc(-1 * var(--fav-w)); }
  body.fav-pinned .fav-panel { display: flex; position: fixed; top: var(--topbar-h); bottom: 0; inset-inline-end: 0;
    border-radius: 0; border-width: 0; border-inline-start: 1px solid var(--line-2); box-shadow: none; }
  body.fav-pinned .fav-scroll { flex: 1; max-height: none; }
}
@media (max-width: 1099px) { .fav-pin { display: none; } }
/* On a phone: under the header, across the whole width. */
@media (max-width: 880px) {
  .fav-toggle { margin-inline-start: auto; margin-inline-end: -8px; }
  .fav-panel { position: fixed; top: var(--topbar-h); inset-inline: 0; width: auto; border-radius: 0; border-width: 0 0 1px; box-shadow: var(--shadow-soft); }
  .fav-scroll { max-height: min(calc(var(--fav-row) * 6.5 + 8px), calc(100vh - var(--topbar-h) - 60px)); }
  .fav-item { --fav-row: 46px; height: 46px; }
}

/* The star on a tool. In the dashboard's lists only the star shows; on a card it sits in its corner. */
.fav-star-icon { padding-inline: 8px; }
.fav-star-icon .fav-star-text { display: none; }
.table td.row:has(> .fav-star-icon) { flex-wrap: nowrap; gap: 6px; }
/* The star is as tall as the buttons beside it, whatever its glyph's own line height. */
.row > .fav-star-icon { align-self: stretch; }
/* My tools: one list, one row per tool. The title's link stretches over the whole row; the labels
   that open a place, the star and the menu (⋯) sit above it, so each is its own way in. */
.dash-list-tools { gap: 8px; flex-wrap: nowrap; }
.dash-sort { width: auto; margin: 0; padding: 6px 30px 6px 10px; font-size: .86rem; height: 34px; }
.dash-list { list-style: none; margin: 0 0 8px; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.dash-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 12px; border-top: 1px solid var(--line); }
.dash-row:first-child { border-top: 0; }
.dash-row[hidden] { display: none; }
.dash-row:hover { background: var(--card-2); }
.dash-row-icon.tool-icon { flex: none; width: 40px; height: 40px; font-size: 1.35rem; }
.dash-row-icon .tool-icon-img { width: 28px; height: 28px; }
.dash-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dash-row-link { color: var(--ink); }
.dash-row-link strong { font-weight: 600; overflow-wrap: anywhere; }
.dash-row-link::after { content: ''; position: absolute; inset: 0; }
.dash-row-link:hover { text-decoration: none; }
.dash-row:hover .dash-row-link strong { text-decoration: underline; }
.dash-row-tagline { font-size: .88rem; color: var(--ink-2); overflow-wrap: anywhere; }
.dash-row-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 2px; }
.dash-row-labels .badge { font-size: .74rem; }
.dash-row-meta { font-size: .8rem; color: var(--muted); margin-left: 4px; }
.dash-row-meta .author-link { position: relative; z-index: 1; }
.dash-row-meta .author-link:hover { color: var(--ink); text-decoration: underline; }
/* A place label that opens the tool there: a label with a way out, above the row's own link. */
.badge-open { position: relative; z-index: 1; color: var(--accent-ink); border-color: currentColor; }
.badge-open:hover { background: var(--card); text-decoration: none; }
.dash-row-side { position: relative; z-index: 1; flex: none; display: flex; align-items: center; }
.dash-row:has(.menu-pop[open]) .dash-row-side { z-index: 5; }
/* The star is a state, not an action: an icon without a frame, gold when it is a favourite. */
.btn.fav-star-plain, .dash-row-more { width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--radius); background: none; color: var(--muted); font-size: 1.2rem; font-weight: 400; line-height: 1; cursor: pointer; }
.btn.fav-star-plain:hover, .dash-row-more:hover, .menu-pop[open] > .dash-row-more { background: var(--card-2); color: var(--ink); box-shadow: none; transform: none; }
.fav-star-plain .fav-star-text { display: none; }
.dash-row-more { display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; letter-spacing: 1px; }
.dash-row .menu-pop-list { min-width: 210px; }
.list-group { margin: 18px 0 10px; font-size: 1rem; }
.list-group .badge { font-size: .8rem; padding: 3px 10px; }
.fav-star .fav-star-text { font-weight: 500; }
.fav-star.is-on > span:first-child { color: var(--gold); }

/* A tool full screen (use.php) ---------------------------------------------
   The tool fills the window. The header waits above it; the tab in the middle of the top edge
   slides it in over the tool, with a line for the tool under the menu. A pinned favourites panel
   stands beside the tool. */
body.shell { overflow: hidden; padding-inline-end: 0; }
body.shell .topbar { position: fixed; top: 0; inset-inline: 0; margin: 0; z-index: 55; transform: translateY(-100%); visibility: hidden;
  transition: transform .18s ease-out, visibility 0s linear .18s; box-shadow: var(--shadow-soft); }
.shell.shell-open .topbar { transform: none; visibility: visible; transition: transform .18s ease-out; }
.shell main.page { padding: 0; min-height: 0; }
.shell .footer { display: none; }
.shell-frame { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.shell-tab { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 56; display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 14px; border: 1px solid var(--line-2); border-top: 0; border-radius: 0 0 var(--radius) var(--radius);
  background: var(--card); color: var(--ink-2); font: 600 .78rem var(--font); cursor: pointer; opacity: .82; box-shadow: var(--shadow-soft);
  transition: top .18s ease-out, opacity .15s; }
.shell-tab:hover, .shell-tab:focus-visible, .shell-open .shell-tab { opacity: 1; color: var(--ink); }
.shell-tab-caret { font-size: .7rem; color: var(--muted); transition: transform .18s; }
.shell-open .shell-tab-caret { transform: rotate(180deg); }
.shell-bar { display: flex; align-items: center; gap: 10px; padding: 8px 20px; border-top: 1px solid var(--line); background: var(--card); }
.shell-bar .tool-icon { width: 30px; height: 30px; font-size: 1.05rem; }
.shell-bar .tool-icon .tool-icon-img { width: 24px; height: 24px; }
.shell-title { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* Where the tool is running: one's own place, or a team's. A team is marked by its colour too, so
   the difference is seen before it is read (docs/05-oeffnen-und-hinzufuegen.md). */
.shell-places { display: inline-flex; align-items: center; min-width: 0; }
.shell-place { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: .74rem; font-weight: 600; letter-spacing: .02em;
  background: var(--card-2); border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }
.shell-place.is-team { background: #ece6f0; color: var(--blue); border-color: #c9d3e2; }
.shell-place-menu > summary { list-style: none; cursor: pointer; }
.shell-place-menu > summary::-webkit-details-marker { display: none; }
.shell-place-menu .nav-caret { font-size: .62rem; }
.shell-place-menu .menu-pop-list { right: auto; left: 0; }
.shell-note { position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 54; margin: 0; padding: 6px 12px; max-width: calc(100% - 32px);
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); font-size: .8rem; color: var(--muted); box-shadow: var(--shadow-soft); }
.shell main .flash { position: fixed; top: 34px; left: 50%; transform: translateX(-50%); z-index: 57; max-width: calc(100% - 32px); box-shadow: var(--shadow-soft); cursor: pointer; transition: opacity .3s; }
.shell main .flash.is-gone { opacity: 0; pointer-events: none; }
@media (min-width: 1100px) {
  body.shell.fav-pinned .shell-frame { inset-inline-end: var(--fav-w); width: calc(100% - var(--fav-w)); }   /* a frame does not stretch between its insets */
  body.shell.fav-pinned .fav-panel { top: 0; }
  /* With the menu open the header keeps the whole width – the menu needs it – and the column starts under it. */
  body.shell.shell-open.fav-pinned .fav-panel { top: var(--shell-head-h, 115px); }
  body.shell.fav-pinned .shell-tab { left: calc(50% - var(--fav-w) / 2); }
}
@media (max-width: 880px) {
  .shell-bar { padding: 8px 16px; flex-wrap: wrap; }
  .shell-bar .fav-star-text { display: none; }
}
/* The favourites star stays in sight while the header is hidden, where the header has its own
   (shell.js and bar.js put it exactly there; this is where it starts). */
.shell-star { position: fixed; z-index: 56; top: calc((var(--topbar-h) - 36px) / 2); inset-inline-end: 20px; margin: 0; box-shadow: var(--shadow-soft); }
.shell-open .shell-star { visibility: hidden; }
/* Out of the tool's way until the pointer comes near or the person scrolls up (shell.js, is-peek). */
.shell-star { transition: opacity .18s, transform .18s; }
.shell-star:not(.is-peek):not([aria-expanded="true"]):not(:focus-visible) { opacity: 0; transform: translateY(-4px); pointer-events: none; }
@media (max-width: 880px) {
  .shell-star { top: 6px; inset-inline-end: calc(10px + env(safe-area-inset-right, 0px)); width: 32px; height: 32px; margin: 0; }
  .shell-star .nav-svg { width: 16px; height: 16px; }
}
.theme-teal .shell-star { background: var(--card); border-color: var(--line-2); color: var(--ink-2); }
.theme-teal .shell-star:hover, .theme-teal .shell-star[aria-expanded="true"] { background: var(--surface-hi); border-color: var(--muted); color: var(--ink); }
.theme-teal .shell-star[aria-expanded="true"] .nav-svg { fill: var(--gold); stroke: var(--gold); }

/* The menu frame on a tool's own address (bar.php): see-through, the tool shows around what is open.
   The frame may be only as wide as the pinned column, so the page around says when the window
   is wide (bar-wide) and the column does not depend on the frame's own width. */
html:has(body.bar-page), body.bar-page { background: transparent; }
.bar-backdrop { position: fixed; inset: 0; z-index: 1; }
.bar-page.bar-wide .fav-pin { display: inline-flex; }
.bar-page.bar-wide .fav-item { --fav-row: 40px; height: 40px; }
.bar-page.bar-wide.fav-pinned .fav-panel { display: flex; position: fixed; top: 0; bottom: 0; inset-inline-start: auto; inset-inline-end: 0; width: var(--fav-w);
  border-radius: 0; border-width: 0; border-inline-start: 1px solid var(--line-2); box-shadow: none; animation: none; }
.bar-page.bar-wide.fav-pinned .fav-scroll { flex: 1; max-height: none; }
.bar-page.bar-wide.fav-pinned.shell-open .fav-panel { top: var(--shell-head-h, 115px); }
.bar-page.bar-wide.fav-pinned .shell-tab { left: calc(50% - var(--fav-w) / 2); }

@media (prefers-reduced-motion: reduce) { .shell .topbar, .shell-tab, .shell-tab-caret, .shell-star { transition: none; } }

.fav-dialog { max-width: 420px; padding: 20px 22px; color: var(--ink); }
.fav-dialog p { margin: 0 0 16px; }
.fav-dialog::backdrop { background: rgba(22, 20, 15, .35); }

.theme-teal .fav-toggle { background: transparent; border-color: transparent; color: rgba(255, 255, 255, .88); }
.theme-teal .fav-toggle:hover, .theme-teal .fav-toggle[aria-expanded="true"] { background: rgba(255, 255, 255, .09); border-color: var(--head-line); color: #fff; }
.theme-teal .fav-toggle[aria-expanded="true"] .nav-svg { fill: #ffc65c; stroke: #ffc65c; }
@media (prefers-reduced-motion: no-preference) { .fav-panel.is-open { animation: fav-in .12s ease-out; } }
@keyframes fav-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------------
   Showcase (inc/showcase.php) – the landing page and the beta page share it.
   Pictures of tools built here, in layers that drift at their own speed
   (assets/js/landing.js sets --p / --px). Printed look: hard edges, flat colour.
--------------------------------------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[data-parallax], [data-parallax-x] { transform: translate3d(var(--px, 0px), var(--p, 0px), 0) rotate(var(--r, 0deg)); will-change: transform; }
.js-motion .reveal { opacity: 0; translate: 0 22px; transition: opacity .7s ease, translate .7s cubic-bezier(.2, .7, .2, 1); }
.js-motion .reveal.in { opacity: 1; translate: 0 0; }
.num { font-family: var(--mono); font-size: .76rem; letter-spacing: .14em; color: var(--accent-ink); text-transform: uppercase; display: block; margin-bottom: 10px; }

.sc-tools, .sc-features { position: relative; overflow: clip; container-type: inline-size; }
.sc-inner { position: relative; max-width: 1120px; margin: 0 auto; padding: 84px 20px; }
.sc-head { max-width: 640px; margin-bottom: 30px; }
.sc-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -.02em; }
.sc-head p { color: var(--ink-2); font-size: 1.04rem; margin: 0; }

/* one tool per scene: text and picture side by side, every other one mirrored */
.sc-scene { position: relative; display: grid; grid-template-columns: 1fr; gap: 26px; align-items: center; padding: 46px 0; }
.sc-scene + .sc-scene { border-top: 1px dashed var(--line-2); }
@container (min-width: 720px) {
  .sc-scene { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; padding: 64px 0; }
  .sc-scene:nth-of-type(even) .sc-copy { order: 2; }
  .sc-bignum { bottom: auto; top: 4px; }
  .sc-scene:nth-of-type(even) .sc-bignum { right: auto; left: 0; }
}
.sc-bignum { position: absolute; bottom: 0; right: 0; font-family: var(--display); font-weight: 700; font-size: clamp(6rem, 22cqi, 13rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px var(--line-2); pointer-events: none; user-select: none; z-index: 0; }
.sc-copy { position: relative; z-index: 1; }
.sc-tag { display: inline-block; font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #fff; background: var(--ink);
  padding: 4px 9px; border-radius: 3px; margin-bottom: 14px; }
.sc-copy h3 { font-size: clamp(1.5rem, 2.8vw, 2rem); letter-spacing: -.02em; margin-bottom: 10px; }
.sc-copy p { color: var(--ink-2); font-size: 1.02rem; }
.sc-copy ul { list-style: none; margin: 0; padding: 0; }
.sc-copy li { position: relative; padding: 7px 0 7px 26px; color: var(--ink-2); font-size: .95rem; border-top: 1px solid var(--line); }
.sc-copy li::before { content: ''; position: absolute; left: 2px; top: 13px; width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

/* the picture */
.sc-stage { position: relative; z-index: 1; min-height: 340px; padding: 26px 8% 30px 4%; }
.sc-win { position: relative; background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius-lg); box-shadow: 6px 6px 0 var(--shadow-ink); overflow: hidden; z-index: 1; }
.sc-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-bottom: 1.5px solid var(--ink); background: var(--card-2); }
.sc-bar i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink); }
.sc-bar i:first-child { background: var(--accent); }
.sc-bar span { margin-left: 8px; font-family: var(--mono); font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-body { padding: 18px; font-size: .85rem; }
.sc-float { position: absolute; z-index: 2; background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius); box-shadow: 4px 4px 0 var(--shadow-ink); padding: 10px 12px; font-size: .8rem; }
.sc-shape { position: absolute; pointer-events: none; z-index: 0; }
.sc-dots { width: 180px; height: 150px; right: 0; top: 0; background-image: radial-gradient(var(--line-2) 1.6px, transparent 1.8px); background-size: 14px 14px; }
.sc-ring { width: 190px; height: 190px; left: -10px; bottom: -10px; border-radius: 50%; border: 22px solid var(--accent); opacity: .16; }

/* forms */
.sc-form-title { display: block; font-family: var(--display); font-size: 1.15rem; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 3px solid var(--accent); }
.sc-q { margin-bottom: 12px; }
.sc-q > span { display: block; font-weight: 600; margin-bottom: 6px; }
.sc-opt { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border: 1px solid var(--line-2); border-radius: var(--radius); margin-bottom: 5px; }
.sc-opt i { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--ink-2); flex: none; }
.sc-opt.on { border-color: var(--ink); background: var(--card-2); }
.sc-opt.on i { border-color: var(--accent); box-shadow: inset 0 0 0 2.5px var(--card), inset 0 0 0 7px var(--accent); }
.sc-input { padding: 7px 9px; border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--ink-2); }
.sc-caret { display: inline-block; width: 1.5px; height: 1em; background: var(--ink); vertical-align: -2px; margin-left: 2px; animation: sc-blink 1s steps(1) infinite; }
@keyframes sc-blink { 50% { opacity: 0; } }
.sc-send { display: inline-block; background: var(--accent); color: #fff; font-weight: 600; padding: 7px 14px; border-radius: var(--radius); border: 1.5px solid var(--ink); }
.sc-f-chart { right: 0; top: 4px; width: 150px; }
.sc-f-chart b, .sc-f-donut b { font-size: .8rem; }
.sc-bars { display: flex; align-items: flex-end; gap: 6px; height: 54px; margin-top: 8px; }
.sc-bars i { flex: 1; height: var(--h); background: var(--blue); border-radius: 2px 2px 0 0; }
.sc-bars i:first-child { background: var(--accent); }
.sc-f-donut { left: 0; bottom: 0; display: flex; align-items: center; gap: 9px; }
.sc-donut { --v: 50; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--accent) calc(var(--v) * 1%), var(--card-2) 0); -webkit-mask: radial-gradient(circle, transparent 46%, #000 48%); mask: radial-gradient(circle, transparent 46%, #000 48%); }
.sc-donut-lg { width: 54px; height: 54px; background: conic-gradient(var(--green) calc(var(--v) * 1%), var(--card-2) 0); }

/* whiteboard */
.sc-canvas { position: relative; height: 270px; padding: 0; background-color: var(--card); background-image: radial-gradient(var(--line) 1.2px, transparent 1.4px); background-size: 16px 16px; }
.sc-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.sc-lines path { fill: none; stroke: var(--ink-2); stroke-width: 1.6; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.sc-sticky { position: absolute; width: 30%; min-width: 96px; padding: 10px; font-size: .78rem; font-weight: 600; line-height: 1.3; color: #16140f;
  border: 1px solid rgba(0, 0, 0, .25); box-shadow: 2px 3px 0 rgba(22, 20, 15, .35); }
.sc-canvas .sc-sticky { transform: rotate(var(--r, 0deg)); }
.sc-sticky.y { background: #f7d65c; } .sc-sticky.b { background: #a9cdf0; } .sc-sticky.g { background: #b7deb0; } .sc-sticky.p { background: #f2b2c0; }
.sc-frame { position: absolute; width: 30%; padding: 8px 10px; border: 1.5px dashed var(--accent); border-radius: var(--radius); font-family: var(--mono); font-size: .7rem; color: var(--accent-ink); }
.sc-f-sticky { position: absolute; width: 130px; right: 0; bottom: 6px; border-radius: 0; padding: 14px 12px; font-size: .85rem; }
.sc-cursor { background: none; border: 0; box-shadow: none; padding: 0; display: flex; align-items: flex-start; gap: 2px; }
.sc-cursor svg { width: 18px; height: 18px; fill: var(--accent); stroke: #fff; stroke-width: 1.2; }
.sc-cursor span { background: var(--accent); color: #fff; font-size: .7rem; font-weight: 600; padding: 2px 7px; border-radius: 4px; margin-top: 12px; }
.sc-cursor-2 svg { fill: var(--blue); } .sc-cursor-2 span { background: var(--blue); }
.sc-f-cur1 { left: 36%; top: 30%; }
.sc-f-cur2 { right: 14%; top: 64px; }

/* OKR */
.sc-obj { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sc-obj b { font-family: var(--display); font-size: 1.08rem; line-height: 1.2; }
.sc-q4 { flex: none; font-family: var(--mono); font-size: .72rem; font-weight: 600; padding: 4px 7px; border-radius: 4px; background: var(--ink); color: var(--on-ink, var(--paper)); }
.sc-kr { padding: 9px 0; border-top: 1px solid var(--line); }
.sc-kr-row { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.sc-kr-row b, .sc-kr-row strong { font-family: var(--mono); font-size: .78rem; white-space: nowrap; }
.sc-prog { height: 9px; border-radius: 5px; background: var(--card-2); border: 1px solid var(--line-2); overflow: hidden; }
.sc-prog i { display: block; height: 100%; width: var(--w); background: var(--green); transform-origin: left; }
.js-motion .reveal .sc-prog i { transform: scaleX(0); transition: transform 1.1s cubic-bezier(.2, .7, .2, 1) .35s; }
.js-motion .reveal.in .sc-prog i { transform: none; }
.sc-f-gauge { right: 0; top: 0; display: flex; align-items: center; gap: 10px; }
.sc-f-gauge b { display: block; font-size: 1.1rem; font-family: var(--display); }
.sc-f-gauge small { color: var(--muted); }
.sc-chip { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; border-radius: 999px; padding: 7px 13px; }
.sc-dot-ok { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(44, 96, 73, .2); }
.sc-f-chip { left: 0; bottom: 4px; }

/* mind map */
.sc-map { position: relative; height: 260px; padding: 0; }
.sc-node { position: absolute; transform: translate(-50%, -50%); background: var(--card); border: 1.5px solid var(--ink); border-radius: 999px; padding: 5px 12px;
  font-size: .76rem; font-weight: 600; white-space: nowrap; }
.sc-node-c { background: var(--accent); color: #fff; font-size: .86rem; padding: 8px 16px; box-shadow: 3px 3px 0 var(--shadow-ink); }
.sc-float.sc-node { transform: translate3d(var(--px, 0px), var(--p, 0px), 0) rotate(var(--r, 0deg)); border-radius: 999px; padding: 6px 13px; }
.sc-node-f { background: #f7d65c; color: #16140f; right: 2%; top: 2px; }
.sc-node-f2 { background: #b7deb0; color: #16140f; left: 2%; bottom: 2px; }

/* time & invoice */
.sc-paper { margin-left: 12%; }
.sc-invoice { padding: 20px 22px 24px; position: relative; }
.sc-inv-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 10px; margin-bottom: 6px; border-bottom: 2px solid var(--ink); }
.sc-inv-head b { font-family: var(--display); font-size: 1.15rem; }
.sc-inv-head span { font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.sc-inv-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.sc-inv-row span:nth-child(2) { font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.sc-inv-row b, .sc-inv-sum b { font-variant-numeric: tabular-nums; text-align: right; }
.sc-inv-sum { display: flex; justify-content: space-between; padding-top: 10px; font-weight: 600; font-size: .95rem; }
.sc-stamp { position: absolute; left: 42%; bottom: 16px; transform: rotate(-12deg); font-family: var(--mono); font-size: .78rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--green); border: 2px solid var(--green); border-radius: 4px; padding: 3px 9px; opacity: .85; }
.sc-scene-time .sc-stage { padding-top: 64px; }
.sc-timer { left: 0; top: 0; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--ink); color: var(--paper); }
.sc-timer small { display: block; color: rgba(255, 255, 255, .7); font-size: .72rem; }
.sc-clock { font-family: var(--mono); font-size: 1.5rem; font-weight: 500; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.sc-rec { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(191, 63, 38, .35); animation: sc-pulse 1.6s ease-in-out infinite; }
@keyframes sc-pulse { 50% { box-shadow: 0 0 0 8px rgba(191, 63, 38, 0); } }

/* "… and much more": two rows of names that slide sideways with the scroll */
.sc-more { padding-top: 40px; }
.sc-more-h { font-family: var(--display); font-size: clamp(1.3rem, 2.4vw, 1.7rem); font-weight: 600; margin-bottom: 18px; }
.sc-marquee { display: flex; flex-direction: column; gap: 12px; margin: 0 -20px; }
.sc-track { display: flex; gap: 12px; width: max-content; margin-left: -40%; }
.sc-track-2 { margin-left: -55%; }
.sc-track span { flex: none; font-weight: 600; font-size: .95rem; padding: 10px 18px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card); white-space: nowrap; }
.sc-track span:nth-child(3n+1) { background: var(--ink); color: var(--paper); }
.sc-track span:nth-child(3n+2) { background: var(--accent); color: #fff; }
.sc-more-cta { margin: 28px 0 0; }

/* features */
.sc-features { background: var(--card-2); border-block: 1px solid var(--line-2); }
.sc-feat-ring { left: auto; right: -60px; top: 40px; bottom: auto; width: 280px; height: 280px; }
.sc-feat-dots { left: -20px; right: auto; top: auto; bottom: 30px; width: 240px; height: 200px; }
.sc-feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.sc-feat { background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius-lg); padding: 22px; transition: box-shadow .2s, transform .2s; }
.sc-feat:hover { box-shadow: 5px 5px 0 var(--shadow-ink); transform: translate(-2px, -2px); }
.sc-feat svg { width: 38px; height: 38px; margin-bottom: 12px; stroke: var(--ink); }
.sc-feat svg .a { stroke: var(--accent); }
.sc-feat h3 { font-size: 1.08rem; margin-bottom: 6px; }
.sc-feat p { color: var(--muted); font-size: .9rem; margin: 0; }

/* Europe: the flag's blue and its twelve golden stars, shown while the AI runs through the EU */
.eu-stars { display: inline-block; flex: none; }
.badge .eu-stars-badge { width: 16px; height: 16px; vertical-align: -3px; }
.eu-section { position: relative; overflow: clip; background: #003399; color: #fff; border-block: 1.5px solid var(--ink); }
.eu-inner { max-width: 1120px; margin: 0 auto; padding: 36px 20px; }
.eu-head { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.eu-head .eu-emblem-svg { width: 72px; height: 72px; flex: none; }
.eu-head .eu-emblem-svg rect { fill: transparent; }
.eu-section .num { color: #ffcc00; }
.eu-head h2 { color: #fff; font-size: clamp(1.35rem, 2.6vw, 1.8rem); letter-spacing: -.02em; margin-bottom: 2px; }
.eu-head p { color: rgba(255, 255, 255, .86); font-size: .95rem; margin: 0; }
.eu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.eu-point { background: rgba(255, 255, 255, .07); border: 1.5px solid rgba(255, 204, 0, .55); border-radius: var(--radius-lg); padding: 14px 16px; }
.eu-point h3 { display: flex; align-items: center; gap: 8px; color: #fff; font-size: .98rem; margin-bottom: 4px; }
.eu-point svg { width: 22px; height: 22px; flex: none; stroke: #fff; }
.eu-point svg .a { stroke: #ffcc00; }
.eu-point p { color: rgba(255, 255, 255, .8); font-size: .86rem; margin: 0; }
.beta-more .eu-section { margin-top: 48px; border: 1.5px solid var(--ink); border-radius: var(--radius-lg); box-shadow: 6px 6px 0 #ffcc00; }
.beta-more .eu-inner { padding: 28px 22px; }
@media (max-width: 820px) {
  .eu-grid { grid-template-columns: 1fr; }
  .eu-head .eu-emblem-svg { width: 52px; height: 52px; }
}

@container (max-width: 520px) {
  .sc-stage { min-height: 300px; padding: 30px 4px 34px; }
  .sc-paper { margin-left: 6%; }
  .sc-f-chart { width: 128px; }
  .sc-sticky { font-size: .7rem; padding: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .sc-caret, .sc-rec { animation: none; }
}

/* ---------------------------------------------------------------------------
   Front doors in edit mode (inc/landing_edit.php, assets/js/landing-edit.js)
--------------------------------------------------------------------------- */
.le-editing { padding-bottom: 64px; }
.le-editing .reveal { opacity: 1 !important; translate: 0 0 !important; }
.le-editing .beta-fab { display: none; }
.lt { outline: 1px dashed transparent; outline-offset: 2px; border-radius: 2px; cursor: text; transition: outline-color .15s, background .15s; }
.le-editing .lt:hover { outline-color: var(--accent); }
.lt[data-lt-own] { background: rgba(191, 63, 38, .08); }
.lt:focus { outline: 2px solid var(--accent); background: var(--card); color: var(--ink); }
.lt.le-busy { opacity: .55; }
.le-list { margin: 14px 0 0; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.le-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 18px;
  background: #16140f; color: #f4f1ea; font-size: .84rem; box-shadow: 0 -2px 0 var(--accent); }
.le-bar strong { font-weight: 600; }
.le-lang { font-family: var(--mono); font-size: .74rem; border: 1px solid rgba(255, 255, 255, .35); border-radius: 4px; padding: 1px 6px; }
.le-hint { color: rgba(244, 241, 234, .72); flex: 1 1 260px; }
.le-toggle { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: inherit; font-weight: 500; cursor: pointer; }
.le-status { font-weight: 600; color: #9fd6b4; min-width: 1em; }
.le-status.bad { color: #ffab91; }
.le-links { display: inline-flex; gap: 14px; }
.le-links a { color: #ffb59c; }
.le-pins { position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 80; }
.le-pin { position: absolute; top: 0; left: 0; padding: 3px 8px; border-radius: 999px; border: 1.5px solid #16140f; background: #f7d65c; color: #16140f;
  font: 600 .72rem/1.2 var(--mono); cursor: pointer; box-shadow: 2px 2px 0 #16140f; white-space: nowrap; }
.le-pin:hover, .le-pin:focus-visible { background: #fff; }
.le-hl, .le-sel { outline: 2px dashed #e0a400 !important; outline-offset: 3px; }
.le-pop { position: fixed; z-index: 95; width: 250px; background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius-lg); box-shadow: 4px 4px 0 var(--shadow-ink); padding: 12px 14px; font-size: .84rem; }
.le-pop-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.le-pop-head output { font: 600 1.2rem var(--mono); }
.le-pop input[type=range] { width: 100%; accent-color: var(--accent); }
.le-pop-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; margin-bottom: 8px; }
.le-pop-row { display: flex; gap: 8px; align-items: center; }
.le-pop-row input { width: 76px; padding: 6px 8px; }

/* The chat on the help page (help.php, assets/js/help-chat.js) --------------------------------
   A round button at the bottom right, and the panel it opens above it. On a phone the panel takes
   the screen. Answers are paper cards, the person's own questions ink on accent. */
.hc { position: fixed; right: 20px; bottom: 20px; z-index: 60; }
.hc-fab { display: inline-flex; align-items: center; gap: 9px; height: 56px; padding: 0 20px 0 16px; border-radius: 999px; border: 1.5px solid var(--accent-ink);
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; box-shadow: 3px 3px 0 var(--shadow-ink); transition: transform .12s, box-shadow .12s; }
.hc-fab:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow-ink); }
.hc-fab:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.hc-fab .hc-dot { fill: var(--accent); }
.hc.is-open .hc-fab { transform: none; box-shadow: 1px 1px 0 var(--shadow-ink); }
.hc-panel { position: absolute; right: 0; bottom: 70px; width: 400px; height: min(620px, calc(100vh - var(--topbar-h) - 110px)); display: flex; flex-direction: column;
  background: var(--paper); border: 1.5px solid var(--ink); border-radius: var(--radius-lg); box-shadow: 5px 5px 0 var(--shadow-ink); overflow: hidden; }
.hc-panel[hidden] { display: none; }
.hc-head { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 14px; background: var(--ink); color: var(--paper); }
.hc-badge { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.hc-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.hc-head-text strong { font-family: var(--display); font-size: 1.05rem; }
.hc-head-text span { font-size: .76rem; opacity: .72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 0; border-radius: var(--radius); background: transparent; color: inherit; cursor: pointer; opacity: .8; }
.hc-icon:hover, .hc-icon:focus-visible { opacity: 1; background: rgba(255, 255, 255, .12); outline: none; }
.hc-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hc-chat[hidden], .hc-contact[hidden] { display: none; }
.hc-log { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.hc-msg { max-width: 88%; font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere; }
.hc-msg p { margin: 0 0 .5em; } .hc-msg p:last-child { margin-bottom: 0; }
.hc-msg ul, .hc-msg ol { margin: 0 0 .5em; padding-left: 1.25em; } .hc-msg li { margin: 2px 0; }
.hc-msg ul:last-child, .hc-msg ol:last-child { margin-bottom: 0; }
.hc-msg code { font-family: var(--mono); font-size: .84em; background: var(--card-2); padding: 1px 4px; border-radius: 3px; }
.hc-msg pre { position: relative; margin: .4em 0; padding: 30px 12px 10px; background: var(--ink); color: var(--paper); border-radius: var(--radius); overflow-x: auto; font-size: .8rem; }
.hc-msg pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.hc-copy { position: absolute; top: 6px; right: 6px; border: 1px solid rgba(255, 255, 255, .3); background: rgba(0, 0, 0, .3); color: inherit; font: inherit; font-size: .7rem; padding: 2px 7px; border-radius: 3px; cursor: pointer; }
.hc-bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line-2); border-radius: 4px 14px 14px 14px; padding: 10px 13px; }
.hc-bot a { text-decoration: underline; text-underline-offset: 2px; }
.hc-me { align-self: flex-end; background: var(--accent); color: #fff; border-radius: 14px 4px 14px 14px; padding: 9px 13px; white-space: pre-wrap; }
.hc-error { border-color: #e5bfb4; background: #fae9e4; color: var(--accent-ink); }
.hc-plain { background: none; border: 0; padding: 0; }
.hc-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.hc-suggest[hidden] { display: none; }
.hc-chip { border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .82rem; cursor: pointer; text-align: left; }
.hc-chip:hover, .hc-chip:focus-visible { border-color: var(--ink); color: var(--ink); outline: none; }
.hc-chip[data-hc-contact] { border-style: dashed; }
.hc-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.hc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: hc-blink 1.2s infinite ease-in-out; }
.hc-typing i:nth-child(2) { animation-delay: .15s; } .hc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes hc-blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .hc-typing i { animation: none; opacity: .6; } .hc-fab { transition: none; } }
.hc-input { display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 10px 12px 6px; border-top: 1px solid var(--line-2); background: var(--card); }
.hc-input textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; font-size: 16px; line-height: 1.4; padding: 10px 12px; }
.hc-send { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1.5px solid var(--accent-ink);
  background: var(--accent); color: #fff; cursor: pointer; }
.hc-send:disabled { opacity: .5; cursor: default; }
.hc-note { margin: 0; padding: 0 12px 10px; background: var(--card); font-size: .72rem; color: var(--muted); }
.hc-contact { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 16px; background: var(--card); }
.hc-contact h3 { margin: 8px 0 2px; }
.hc-contact-head { margin: -2px 0 0 -6px; }
.hc-contact-done { text-align: center; padding: 30px 10px; }
.contact-form-compact .grid-2 { grid-template-columns: 1fr; gap: 0; }
.contact-form-compact .field { margin-bottom: 10px; }
.contact-form .contact-with-chat { margin: -2px 0 12px; }
.contact-form .contact-error { margin: 0 0 10px; }
.contact-form .contact-error[hidden] { display: none; }
.contact-privacy { margin: 10px 0 0; }
@media (max-width: 560px) {
  .hc { right: 14px; bottom: 14px; }
  .hc-fab { width: 56px; padding: 0; justify-content: center; }
  .hc-fab-label { display: none; }
  .hc.is-open .hc-fab { display: none; }
  .hc-panel { position: fixed; inset: 0; width: auto; height: auto; bottom: 0; border-radius: 0; border: 0; box-shadow: none; height: 100dvh; }
  .hc-msg { max-width: 92%; }
}
/* Room for the button under the page's last lines. */
.help-page { padding-bottom: 64px; }

/* The contact page (contact.php) ------------------------------------------------------------ */
.contact-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 36px; align-items: start; max-width: 1020px; margin: 10px auto 0; }
.contact-page .pf-kicker { color: var(--accent); }
.contact-intro h1 { font-size: 2.5rem; margin-bottom: .3em; }
.contact-intro > p { font-size: 1.05rem; max-width: 44ch; }
.contact-links { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.contact-links a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-lg); color: var(--ink); transition: transform .12s, box-shadow .12s; }
.contact-links a:hover { text-decoration: none; transform: translate(-2px, -2px); box-shadow: var(--shadow); }
.contact-links span { color: var(--muted); font-size: .88rem; }
.contact-card { box-shadow: var(--shadow); border-color: var(--ink); }
.contact-card h2 { margin-bottom: .6em; }
.contact-done { text-align: center; padding: 26px 6px; }
.contact-done-mark { display: inline-flex; align-items: center; justify-content: center; width: 58px; height: 58px; margin-bottom: 12px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 1.7rem; font-weight: 700; box-shadow: 3px 3px 0 var(--shadow-ink); }
.contact-done-mark .ui-icon { width: 1em; height: 1em; stroke-width: 2.4; }
@media (max-width: 820px) {
  .contact-page { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .contact-intro h1 { font-size: 2rem; }
}
/* Legal texts (inc/legal.php): the imprint, privacy policy and terms, and the text beside the contact form. */
.legal-page { max-width: 760px; }
.legal-text { overflow-wrap: anywhere; line-height: 1.6; }
.legal-text > :first-child { margin-top: 0; }
.legal-text h2 { font-size: 1.2rem; margin: 1.6em 0 .45em; }
.legal-text h3 { font-size: 1.02rem; margin: 1.3em 0 .4em; }
.legal-text p, .legal-text ul, .legal-text ol { margin: 0 0 .8em; }
.legal-text ul, .legal-text ol { padding-left: 1.3em; }
.legal-text li + li { margin-top: .3em; }
.legal-note { padding: 10px 14px; margin: 0 0 16px; border-radius: var(--radius); background: var(--card-2); color: var(--muted); font-size: .9rem; }
.contact-text .legal-text { color: var(--muted); }
.contact-text .legal-text > p:first-child { font-size: 1.05rem; max-width: 44ch; }
.contact-text .legal-text h3 { color: var(--ink); }
.legal-editor textarea { font-family: var(--mono); font-size: .86rem; line-height: 1.5; min-height: 420px; }
.legal-preview { border-style: dashed; }
.legal-ph td { padding: 3px 10px 3px 0; vertical-align: top; font-size: .86rem; }
.legal-ph code { white-space: nowrap; }
.contact-msg.is-done { opacity: .72; }
.contact-msg-body { margin: 12px 0 0; white-space: normal; overflow-wrap: anywhere; }

/* Admin → Users: a compact table with sortable headers and a column picker */
.users-table th, .users-table td { padding: 5px 8px; vertical-align: middle; }
.users-table .nowrap, .users-table th { white-space: nowrap; }
.users-table .sm { font-size: 13px; padding: 3px 6px; height: auto; min-height: 0; width: auto; }
.users-table select.sm { padding-right: 24px; }
.users-table .progress { margin-top: 2px; height: 4px; }
.users-table .badge { font-size: 11px; padding: 1px 6px; }
.sortlink { color: inherit; text-decoration: none; }
.sortlink:hover, .sortlink.on { color: var(--accent); }
.colpick { position: relative; display: inline-block; margin-left: 8px; }
.colpick summary { cursor: pointer; list-style: none; }
.colpick summary::-webkit-details-marker { display: none; }
.colpick-menu { position: absolute; z-index: 20; top: 100%; left: 0; margin-top: 4px; min-width: 190px; padding: 8px 12px; background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.colpick-menu .check { display: flex; gap: 6px; margin: 4px 0; white-space: nowrap; }

/* ---------------------------------------------------------------------------
   Dark mode
   For everyone whose device is set to "dark" (prefers-color-scheme). Both themes get a dark
   palette through the same variables, so almost every rule above follows on its own; below are
   only the few places that carry a colour of their own. Tools follow too: inc/design.php
   (design_dark_layer) and assets/css/aitools-base.css.
--------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --note-bg: #3a3416; --note-line: #5c5320; --note-ink: #f3ecc8;
    color-scheme: dark;
    --paper: #16140f;
    --card: #1f1c16;
    --card-2: #2a261e;
    --ink: #f1ece1;
    --ink-2: #cfc8b9;
    --muted: #9b9484;
    --line: #332f26;
    --line-2: #4a4437;
    --accent: #d9482b;
    --accent-ink: #ff8f72;
    --green: #62b48b;
    --blue: #86abdf;
    --gold: #dba44c;
    --shadow-ink: #000;
    --shadow-soft: 0 2px 10px rgba(0, 0, 0, .35);
    --on-ink: #16140f;
    --surface-hi: #29251d;
    --code-bg: #1b1913;
  }
  body.theme-teal {
    --paper: #0d1a1f;
    --card: #132731;
    --card-2: #19333f;
    --ink: #e5eff2;
    --ink-2: #b9ced4;
    --muted: #8aa4ad;
    --line: #20404b;
    --line-2: #2d5360;
    --accent: #e0553a;
    --accent-ink: #ff9d83;
    --green: #4fbf8e;
    --blue: #74b3e0;
    --gold: #dca74f;
    --head: #0b2630;
    --head-line: rgba(255, 255, 255, .16);
    --shadow: 0 6px 20px rgba(0, 0, 0, .45);
    --shadow-soft: 0 2px 10px rgba(0, 0, 0, .35);
    --shadow-ink: var(--ink);
    --on-ink: #0d1a1f;
    --surface-hi: #1a3541;
    --code-bg: #0f212a;
  }
  /* the pale status colours become deep ones */
  .badge-success, .flash-success { background: #1b2f25; color: #8fd3ae; border-color: #2d5441; }
  .badge-warn { background: #342a15; color: #e7bd72; border-color: #5a4a25; }
  .badge-danger, .flash-error, .msg-sys, .attach-chip.is-error, .hc-error { background: #3a1e18; color: #ff9d83; border-color: #6a3226; }
  .badge-accent, .shell-place.is-team { background: #272238; color: #a9bff0; border-color: #3d4562; }
  .flash-info { background: var(--card-2); }
  .btn-danger, .settings-danger { border-color: #7c3a2b; }
  .fb-vote.is-voted { background: #3a2019; }
  .theme-teal .badge-success { background: #17382d; color: #8fd8b3; border-color: #28584a; }
  .theme-teal .btn-danger { border-color: #7c3a2b; }
  .theme-teal .btn:hover { border-color: var(--muted); }
  .theme-teal input:focus, .theme-teal select:focus, .theme-teal textarea:focus { box-shadow: 0 0 0 3px rgba(116, 179, 224, .25); }
  .chat-mode label:has(input:checked) { box-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
  .colpick-menu { box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
  .dialog::backdrop, .fav-dialog::backdrop { background: rgba(0, 0, 0, .6); }
  /* the checkerboard behind transparent pictures */
  .pixel-canvas, .pixel-previews img { background-image: repeating-conic-gradient(#2c2820 0 25%, #1f1c16 0 50%); }
  /* code colours */
  .token.punctuation, .token.operator { color: #a79f8d; }
  .token.function, .token.class-name, .token.builtin { color: #c9a5f2; }
  .editor > textarea.code::selection { background: rgba(134, 171, 223, .3); }
}

/* Dashboard widgets (inc/widgets.php): small live views of the person's tools. Each is the tool
   itself in a frame, so the box only gives it a head and a size. The grid has four columns; a
   widget takes one to four of them (widget-c*) or one to four rows (widget-r*) – its frame's height
   is set to match, so rows stay even. Two columns on a tablet, one on a phone. */
.widget-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; grid-auto-flow: dense; align-items: start; }
.widget { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.widget-c2 { grid-column: span 2; }
.widget-c3 { grid-column: span 3; }
.widget-c4 { grid-column: span 4; }
.widget-r2 { grid-row: span 2; }
.widget-r3 { grid-row: span 3; }
.widget-r4 { grid-row: span 4; }
.widget-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 6px 0 8px; border-bottom: 1px solid var(--line); height: 44px; container: whead / inline-size; }
/* What a widget is called beside its tool's name only shows where there is room for it, whole: a cut-off "Nächst…" says nothing. It is always in the tooltip. */
@container whead (max-width: 340px) { .widget-title .muted { display: none; } }
.widget-head form { margin: 0; }
.widget-head .menu-pop-list button { width: 100%; }
/* The handle a widget is dragged by is its icon: the grip shows over the icon while the pointer is on it (or
   the keyboard), so the head carries an icon, a name and the menu and nothing more. On a touch screen, where
   there is no pointer to hover, the grip is not shown and the icon is the handle all the same. The frames take
   no pointer while one is dragged. */
.widget-handle { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: 0; padding: 0;
  border: 0; background: none; color: var(--ink-2); cursor: grab; touch-action: none; border-radius: var(--radius); }
.widget-handle .ui-icon { position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; opacity: 0; transition: opacity .12s ease-out; pointer-events: none; }
.widget-handle .widget-icon { transition: opacity .12s ease-out; }
.widget-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.widget-handle:focus-visible .ui-icon { opacity: 1; }
.widget-handle:focus-visible .widget-icon { opacity: .18; }
@media (hover: hover) {
  .widget-handle:hover .ui-icon { opacity: 1; }
  .widget-handle:hover .widget-icon { opacity: .18; }
}
.widget-grid.is-sorting .widget-handle { cursor: grabbing; }
.widget-grid { position: relative; }
.widget-grid.is-sorting { cursor: grabbing; user-select: none; }
.widget-grid.is-sorting .widget-frame { pointer-events: none; }
/* Dragging: the widget being moved stays where it is, a little pale; a line shows where it will go, and the
   two widgets on either side of the line step a few pixels apart. Nothing moves for real until it is let go. */
.widget { transition: transform .12s ease-out, opacity .12s ease-out; }
.widget.is-dragging { opacity: .45; }
.widget-drop-line { position: absolute; z-index: 5; pointer-events: none; background: var(--accent); border-radius: 2px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
@media (prefers-reduced-motion: reduce) { .widget { transition: none; } }
.widget-search { width: 100%; margin-bottom: 10px; }
.widget-settings { width: min(460px, calc(100vw - 24px)); max-height: min(640px, calc(100dvh - 24px)); padding: 0; }
.widget-settings[open] form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.widget-setup { width: min(560px, calc(100vw - 24px)); }
.widget-setup-frame { display: block; width: 100%; height: min(440px, calc(100dvh - 140px)); border: 0; background: transparent; }
/* Width and height in a widget's ⋯ menu: a row of four buttons for each, the current one filled. A line
   parts them from the entries under them. */
.menu-pop-list .widget-size-menu { display: flex; flex-direction: column; gap: 4px; padding: 4px 4px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu-pop-list .widget-size-row { display: flex; align-items: center; gap: 4px; margin: 0; }
.widget-size-label { flex: 1 1 auto; padding: 0 6px; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.widget-size-menu .widget-size-row button { flex: none; width: 30px; height: 30px; padding: 0; text-align: center; font-variant-numeric: tabular-nums; border: 1px solid var(--line); border-radius: var(--radius); }
.widget-size-menu .widget-size-row button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--card); font-weight: 600; }
.widget-size-menu .widget-size-row button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.widget-setting-multi { border: 0; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 12px; }
.widget-setting-multi legend { grid-column: 1 / -1; font-weight: 600; margin-bottom: 4px; padding: 0; }
.widget-setting-multi .check { min-height: 32px; }
.widget-title { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink); font-size: .9rem; }
.widget-title:hover { text-decoration: none; }
.widget-title:hover strong { text-decoration: underline; }
.widget-title strong, .widget-title .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget-title strong { flex: 0 1 auto; }
.widget-title .muted { flex: 1 1 0; font-size: .82rem; }
.widget-icon.tool-icon { flex: none; width: 28px; height: 28px; font-size: 1rem; }
.widget-icon .tool-icon-img { width: 20px; height: 20px; }
.widget-frame { display: block; width: 100%; border: 0; background: transparent; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
/* The platform's own widgets (dashboard.php): an overview of tools, credits and storage, the sales and a
   notepad. Drawn by the page itself, but like every other widget: the same head, and the standard height
   of their size (the body is set to it inline), so a row of widgets stands even. */
:root { --note-bg: #fff6c9; --note-line: #eadf9a; --note-ink: #3b3410; }
.widget-sys-body { padding: 12px 14px; overflow: hidden; }
.widget-sys .progress { margin-top: 6px; }
.widget-overview { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.ov-row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ov-value { font-family: var(--display); font-size: 1.45rem; font-weight: 600; line-height: 1.1; }
.ov-value-lg { font-size: 2.6rem; }
.ov-label { color: var(--muted); font-size: .85rem; min-width: 0; overflow-wrap: anywhere; }
.ov-storage { border-top: 1px solid var(--line); padding-top: 8px; }
.widget-big { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.widget-sys-notes { background: var(--note-bg); border-color: var(--note-line); color: var(--note-ink); }
.widget-sys-notes .widget-head { border-color: var(--note-line); }
.widget-sys-notes .widget-handle, .widget-sys-notes .dash-row-more { color: var(--note-ink); }
.widget-notes { position: relative; padding: 10px 14px 22px; }
.widget-notes-text { display: block; width: 100%; height: 100%; resize: none; border: 0; background: transparent; color: inherit; font: inherit; font-size: .95rem; line-height: 1.45; padding: 0; outline: 0; }
.widget-notes-text::placeholder { color: inherit; opacity: .5; }
.widget-notes-text:focus-visible { outline: 0; }
.widget-notes-state { position: absolute; right: 12px; bottom: 5px; opacity: .6; }
/* First prompts: a list that scrolls inside the box, each prompt two lines at most (the whole of it is the tooltip). */
.widget-prompts { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px; overflow: hidden; }
.widget-prompts > p { margin: 0; }
.widget-prompts-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.widget-prompts-list a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: inherit; text-decoration: none; font-size: .9rem; line-height: 1.35; }
.widget-prompts-list a:hover, .widget-prompts-list a:focus-visible { border-color: var(--accent); background: var(--accent-soft, transparent); }
/* A tool without a widget: its description and the way in. */
.widget-tile { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px; overflow: hidden; }
.widget-tile p { margin: 0; color: var(--ink-2); font-size: .92rem; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; }
/* "Add widget": a dashed tile closing the grid, the place the next widget will take. */
.widget-add-tile { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 120px; padding: 12px; font: inherit; font-weight: 600; color: var(--muted);
  background: transparent; border: 2px dashed var(--line); border-radius: var(--radius-lg); cursor: pointer; transition: color .12s, border-color .12s, background .12s; }
.widget-add-tile:hover, .widget-add-tile:focus-visible { color: var(--ink); border-color: var(--accent); background: var(--card); }
.widget-add-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.widget-settings-note { margin: 0; padding: 6px 10px 8px; border-top: 1px solid var(--line); }
.widget-grid-builder { margin: 10px 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.widget-grid-builder .widget-c3, .widget-grid-builder .widget-c4 { grid-column: span 2; }
.widget-choices { list-style: none; margin: 0; padding: 0; }
.widget-choices li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.widget-choices li:last-child { border-bottom: 0; }
.widget-choices form { margin: 0 0 0 auto; flex: none; }
.widget-choice-text { display: flex; flex-direction: column; min-width: 0; }
#widget-add { width: min(520px, calc(100vw - 24px)); max-height: min(640px, calc(100dvh - 24px)); padding: 0; }
@media (max-width: 1000px) {
  .widget-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .widget-c3, .widget-c4 { grid-column: span 2; }
}
@media (max-width: 620px) {
  .widget-grid-builder { grid-template-columns: minmax(0, 1fr); }
  .widget-grid-builder [class*="widget-c"] { grid-column: auto; }
  .widget-grid[data-widget-sort] { grid-template-columns: minmax(0, 1fr); }
  .widget-grid[data-widget-sort] [class*="widget-c"] { grid-column: auto; }
}

/* "Ask" sits beside the red build button, clearly secondary: pale, no fill. */
.btn-ask { background: transparent; border-color: transparent; color: var(--muted); font-weight: 500; }
.btn-ask:hover { background: var(--card-2); color: var(--ink-2); }

/* Empty builder chat: only as tall as its starter examples, not a tall blank box. */
.chat:has(.chat-empty) { flex: none; min-height: 0; }
/* The prompt field is the place to type: white and clearly bordered, not grey like a disabled field. */
.chat-form textarea { background: var(--card); border-color: var(--ink-2); }
.chat-form textarea::placeholder { color: var(--ink-2); opacity: .7; }
.chat-form textarea:disabled { background: var(--card-2); border-color: var(--line-2); }

/* Beta landing: the confirmation with the place in the waiting list */
.beta-sent { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.beta-sent .flash { margin: 0; flex: 1; }
.beta-sent-icon { font-size: 2.4rem; line-height: 1; }
.beta-sent-icon .ui-icon { width: 1em; height: 1em; }

/* The beta feedback button (inc/contact.php, assets/js/feedback.js) ---------------------------
   Small and quiet, bottom right; the panel opens above it. On a phone it is a round icon. */
.fb { position: fixed; right: 20px; bottom: 20px; z-index: 55; }
.fb-fab { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px; border-radius: 999px; border: 1.5px solid var(--ink);
  background: var(--paper, #fffdf8); color: var(--ink); font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; box-shadow: 2px 2px 0 var(--shadow-ink); }
/* Compact by default so it stays out of the way: a round icon, the label only on hover or focus. */
.fb-fab { width: 36px; height: 36px; padding: 0; justify-content: center; gap: 0; opacity: .7; transition: opacity .15s, width .15s; overflow: hidden; }
.fb-fab span { max-width: 0; opacity: 0; white-space: nowrap; transition: max-width .15s, opacity .15s; }
.fb-fab:hover, .fb-fab:focus-visible { opacity: 1; width: auto; padding: 0 14px 0 10px; gap: 8px; }
.fb-fab:hover span, .fb-fab:focus-visible span { max-width: 14em; opacity: 1; }
.fb-fab:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--shadow-ink); }
.fb-fab:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.fb.is-open .fb-fab { display: none; }
.fb-panel { position: absolute; right: 0; bottom: 0; width: min(360px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); overflow: auto; padding: 16px;
  background: var(--paper, #fffdf8); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--shadow-ink); }
.fb-panel[hidden], .fb-done[hidden] { display: none; }
.fb-panel header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.fb-panel h2 { margin: 0; font-size: 1.05rem; }
.fb-close { border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: inherit; padding: 0 4px; }
.fb-done { text-align: center; padding: 18px 0 8px; }
.fb .contact-error { margin: 0 0 10px; }
.fb .contact-error[hidden] { display: none; }
@media (max-width: 560px) {
  .fb { right: 12px; bottom: 12px; }
  .fb-fab, .fb-fab:hover, .fb-fab:focus-visible { width: 40px; height: 40px; padding: 0; justify-content: center; gap: 0; }
  .fb-fab span { display: none; }
}
@media print { .fb { display: none; } }

/* About us (about.php) */
.about-page { max-width: 960px; margin: 0 auto; }
.about-intro { margin-bottom: 8px; }
.about-section h2 { margin: 1.8em 0 .6em; }
.about-trailers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; }
.about-trailer { margin: 0; }
.about-trailer video, .about-frame, .about-play { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-lg); background: #111; }
.about-play { cursor: pointer; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; text-align: center; font: inherit; }
.about-play:hover .about-play-icon, .about-play:focus-visible .about-play-icon { transform: scale(1.08); }
.about-play-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--accent, #FF650D); display: grid; place-items: center; font-size: 1.5rem; transition: transform .15s; }
.about-play-note { font-size: .8rem; opacity: .75; max-width: 30ch; }
.about-trailer figcaption { margin-top: 8px; color: var(--muted); font-size: .92rem; }
.about-team { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 18px; }
.about-member { text-align: center; }
.about-member h3 { margin: 12px 0 2px; }
.about-member p { margin: 10px 0 0; color: var(--muted); font-size: .92rem; text-align: left; overflow-wrap: anywhere; }
.about-role { color: var(--accent, #FF650D); font-size: .9rem; font-weight: 600; }
.about-photo { border-radius: 50%; object-fit: cover; }
.about-photo-initials { display: inline-grid; place-items: center; background: var(--card-2); color: var(--muted); font-weight: 700; font-size: 1.6rem; }
.about-row { padding: 12px 0; border-top: 1px solid var(--line-2); }
.about-row:first-of-type { border-top: 0; }
.about-member-edit { display: flex; gap: 16px; align-items: flex-start; }
.about-member-fields { flex: 1; min-width: 0; }
.about-member-photo { flex: 0 0 72px; }
@media (max-width: 560px) { .about-member-edit { flex-direction: column; } }

/* ---- prelaunch: logo, claim, countdown, one field (inc/beta.php → prelaunch_landing) ---- */
.pre-wrap { min-height: calc(100vh - var(--topbar-h, 66px)); display: flex; flex-direction: column; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.pre-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 56px 0 40px; }
.pre-claim { font-size: clamp(2.4rem, 8vw, 4.4rem); line-height: 1.02; letter-spacing: -.03em; font-weight: 600; margin: 0 0 40px; }
.pre-count { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 560px; margin-bottom: 44px; }
.pre-unit { background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius-lg); box-shadow: 4px 4px 0 var(--ink); padding: 16px 6px 12px; display: flex; flex-direction: column; gap: 4px; }
.pre-num { font-family: var(--display); font-size: clamp(1.8rem, 7vw, 3rem); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.pre-label { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); overflow-wrap: anywhere; }
.pre-request { width: 100%; max-width: 520px; scroll-margin-top: 20px; }
.pre-request h2 { font-size: 1.35rem; margin: 0; }
.pre-request form { margin-top: 16px; }
.pre-row { display: flex; gap: 10px; }
.pre-row input { flex: 1; min-width: 0; }
.pre-request .beta-note { margin-inline: auto; }
.pre-request .beta-sent { text-align: start; }
@media (max-width: 480px) {
  .pre-row { flex-direction: column; }
  .pre-count { gap: 8px; }
  .pre-unit { padding: 12px 4px 10px; box-shadow: 3px 3px 0 var(--ink); }
}

/* Checklist on a tool's page: what its code does beyond its own screen (PDF, mail, connectors). */
.ability-list { list-style: none; margin: 12px 0 8px; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.ability-list li { display: flex; gap: 8px; align-items: flex-start; }
.ability-tick { flex: none; display: inline-flex; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; align-items: center; justify-content: center; background: #e4efe6; color: var(--green); border: 1px solid #bcd6c3; }
.ability-tick svg { width: 13px; height: 13px; }
@media (prefers-color-scheme: dark) { .ability-tick { background: #1b2f25; color: #8fd3ae; border-color: #2d5441; } }

/* Stacked columns of the usage page (chart_stacked()). Categorical slots 1-3 of the validated
   reference palette; a 2px gap of surface keeps the segments apart. */
.stackchart { --sc-1: #2a78d6; --sc-2: #eb6834; --sc-3: #1baf7a; margin: 0; position: relative; }
.sc-s1 { background: var(--sc-1); } .sc-s2 { background: var(--sc-2); } .sc-s3 { background: var(--sc-3); }
.sc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--ink-2); margin-bottom: 8px; }
.sc-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.sc-plot { position: relative; height: 180px; margin-left: 46px; border-bottom: 1px solid var(--line-2); }
.sc-axis { position: absolute; left: -46px; width: 40px; text-align: right; font-size: .72rem; color: var(--muted); transform: translateY(-50%); }
.sc-axis-top { top: 0; } .sc-axis-mid { top: 50%; }
.sc-plot::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line-2); opacity: .6; }
.sc-cols { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 3px; }
.sc-col { flex: 1 1 0; min-width: 0; position: relative; display: flex; align-items: flex-end; outline: none; }
.sc-stack { width: 100%; height: 100%; display: flex; flex-direction: column-reverse; gap: 2px; position: relative; }
.sc-seg { display: block; width: 100%; min-height: 2px; flex: none; }
.sc-seg:last-child { border-radius: 4px 4px 0 0; }
.sc-col:hover, .sc-col:focus { background: rgba(0,0,0,.05); }
.sc-tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5; min-width: 150px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; font-size: .78rem; line-height: 1.5;
  box-shadow: 0 4px 14px rgba(0,0,0,.14); pointer-events: none; white-space: nowrap; }
.sc-tip span { display: block; } .sc-tip b { font-weight: 600; float: right; margin-left: 14px; }
.sc-tip .sc-total { border-top: 1px solid var(--line-2); margin-top: 3px; padding-top: 3px; }
.sc-col:hover .sc-tip, .sc-col:focus .sc-tip { display: block; }
.sc-col:first-child .sc-tip { left: 0; transform: none; } .sc-col:last-child .sc-tip { left: auto; right: 0; transform: none; }
.sc-dates { display: flex; justify-content: space-between; margin: 5px 0 0 46px; font-size: .72rem; color: var(--muted); }
.usage-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; margin-top: 14px; }
.usage-charts h4 { margin: 0 0 8px; font-size: .95rem; }
@media (max-width: 760px) { .usage-charts { grid-template-columns: 1fr; } }
