/* ==========================================================================
   SCRIPTATRON — THEME

   Everything about how it looks is in this one file. Edit, save, refresh.
   No restart, nothing in the Python code changes, and undoing a change always
   puts it back. Start at the SETTINGS block. Spare colour schemes are at the
   very bottom.

   The look, in four rules:
     1. DEPTH    things on top are lighter with a thin highlight along their top
                 edge; things you type into or read out of are darker with a
                 shadow inside them.
     2. TWO      one warm accent for anything you press, one electric colour for
                 edges, glows and live things. Everything else is grey.
     3. EDGES    square-ish corners, hairline rules, corner ticks, and a hard
                 offset shadow under buttons so they read like keys.
     4. LIFE     things lift when you point at them, live things glow and move.
   ========================================================================== */

/* ---------------------------------------------------------------- SETTINGS */
:root {

  /* ---- THE LAYERS  (each step slightly lighter than the one below) ------ */
  --l0: #121013;        /* the page, furthest back                          */
  --l1: #191619;        /* top bar, side rail                               */
  --l2: #201d21;        /* cards                                            */
  --l3: #29252a;        /* hovered rows, raised chips                       */
  --l4: #342f36;        /* menus, anything floating                         */
  --sunken: #0b090c;    /* input boxes and the console (pressed in)         */

  /* ---- COLOURS --------------------------------------------------------- */
  --text:  #ece7e6;     /* main text                                        */
  --muted: #9b9298;     /* labels and secondary text                        */
  --faint: #6a6167;     /* timestamps, disabled                             */

  --accent:     #ff5f3d;  /* the warm one: buttons, active tool, the logo   */
  --accent-ink: #1c0600;  /* text printed on top of the accent              */
  --cyber:      #35e0ff;  /* the electric one: edges, glows, live things    */

  --ok:    #3ddc97;     /* finished                                         */
  --warn:  #f0a63c;     /* stopped                                          */
  --err:   #ff4d6d;     /* failed                                           */

  /* ---- EDGES, SHADOW, TEXTURE ------------------------------------------ */
  --hairline:  rgba(255,255,255,.085);
  --highlight: rgba(255,255,255,.06);
  --key-shadow: 3px 3px 0 rgba(0,0,0,.5);
  --lift:  0 1px 2px rgba(0,0,0,.5), 0 16px 34px -20px rgba(0,0,0,.95);
  --sunk:  inset 0 2px 5px rgba(0,0,0,.55);
  --glow:  0 0 14px -2px color-mix(in srgb, var(--cyber) 55%, transparent);
  --grain: .04;         /* film grain, 0 turns it off                       */
  --hatch: .012;        /* diagonal hatch on the page, 0 turns it off       */
  --scan:  .5;          /* scanlines in the console, 0 turns them off       */
  --motion: 1;          /* 0 stops the glowing / moving bits                */

  /* ---- SHAPE & SPACE --------------------------------------------------- */
  --radius:  7px;
  --radius-small: 5px;
  --rail: 266px;
  --gap: 24px;

  /* ---- TEXT ------------------------------------------------------------ */
  --font: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-size: 14px;
  --console-size: 12.5px;
  --speed: .15s;
}

/* =========================== end of settings ============================= */


/* ------------------------------------------------------------------ base -- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0; color: var(--text);
  font: var(--font-size)/1.55 var(--font);
  background-color: var(--l0);
  background-image:
    radial-gradient(900px 420px at 88% -12%,
      color-mix(in srgb, var(--cyber) 7%, transparent), transparent 70%),
    radial-gradient(760px 380px at -8% 108%,
      color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255,255,255,var(--hatch)) 0 1px, transparent 1px 7px);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
body::after {           /* grain — keeps the dark from looking like plastic */
  content: ""; position: fixed; inset: 0; z-index: 300; pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

a { color: var(--accent); text-underline-offset: 3px; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--l3); border: 3px solid transparent;
                            background-clip: content-box; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--l4); background-clip: content-box; }

.hidden { display: none !important; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.eyebrow {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
}
.eyebrow::before {
  content: ""; width: 5px; height: 5px; flex: none; transform: rotate(45deg);
  background: var(--cyber); box-shadow: 0 0 8px var(--cyber);
}
.eyebrow::after { content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--cyber) 30%, transparent), transparent 60%); }


/* ------------------------------------------------------------------ logo -- */
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 26px; height: 26px; flex: none; display: block;
        filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 45%, transparent)); }
.logo .body { fill: var(--accent); }
.logo .fold { fill: #000; opacity: .3; }
.logo .pins rect { fill: var(--cyber); }
.logo .trace { fill: none; stroke: var(--accent-ink); stroke-width: 5;
               stroke-linecap: square; stroke-linejoin: miter; }
.logo .node { fill: var(--accent-ink); }
.logo .node.dim { opacity: .45; }
.logo .caret { fill: none; stroke: var(--accent-ink); stroke-width: 2.6;
               stroke-linecap: round; opacity: .5; }
.entry-card .logo { width: 34px; height: 34px; }

.wordmark { font-weight: 700; font-size: 15.5px; letter-spacing: -.005em; white-space: nowrap; }
.entry-card .wordmark { font-size: 18px; }


/* ----------------------------------------------------------------- shell -- */
.shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.topbar {
  display: flex; align-items: center; gap: 16px; height: 54px; padding: 0 18px; flex: none;
  background: linear-gradient(var(--l1), color-mix(in srgb, var(--l1) 84%, #000));
  border-bottom: 1px solid var(--hairline);
  box-shadow: 0 1px 0 rgba(0,0,0,.6), 0 10px 24px -22px var(--cyber);
  position: relative; z-index: 30;
}
.topbar::after {        /* a thin live edge under the bar */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent,
    color-mix(in srgb, var(--cyber) 45%, transparent) 18%,
    color-mix(in srgb, var(--accent) 45%, transparent) 55%, transparent);
  opacity: calc(.8 * var(--motion));
}
.topbar .sp { flex: 1; }
.topbar a.link { color: var(--muted); text-decoration: none; font-size: 12.5px;
                 padding: 7px 11px; border-radius: var(--radius-small);
                 transition: color var(--speed), background var(--speed); }
.topbar a.link:hover { color: var(--text); background: var(--l2); }
.topbar a.link.on { color: var(--accent); }
.topbar .who {
  display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 10px;
  background: var(--l2); border: 1px solid var(--hairline); border-radius: 5px;
  box-shadow: inset 0 1px 0 var(--highlight); font-size: 12.5px;
}
.topbar .who .avatar {
  width: 21px; height: 21px; border-radius: 4px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--l4), var(--l3));
  border: 1px solid var(--hairline);
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
}
.topbar .role {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .13em; text-transform: uppercase;
  font-weight: 700; padding: 3px 6px; border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.main { flex: 1; display: flex; overflow: hidden; }


/* ------------------------------------------------------------------ rail -- */
.side {
  width: var(--rail); flex: 0 0 var(--rail); display: flex; flex-direction: column;
  background: var(--l1); border-right: 1px solid var(--hairline); position: relative;
}
.side::after {          /* faint vertical light along the rail edge */
  content: ""; position: absolute; top: 0; bottom: 0; right: -1px; width: 1px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cyber) 35%, transparent),
              transparent 40%);
  opacity: var(--motion);
}
.side .search { padding: 14px 14px 10px; }
.tools { flex: 1; overflow-y: auto; padding: 0 12px 10px; }
.tools .eyebrow { padding: 14px 2px 9px; }

.tool {
  position: relative; display: flex; gap: 11px; align-items: center;
  padding: 9px 11px; cursor: pointer; border-radius: var(--radius-small);
  border: 1px solid transparent;
  transition: background var(--speed), transform var(--speed), box-shadow var(--speed);
}
.tool::after {          /* the growing edge line on hover */
  content: ""; position: absolute; left: 0; top: 50%; height: 0; width: 2px;
  background: var(--cyber); transform: translateY(-50%);
  transition: height var(--speed); border-radius: 2px;
}
.tool:hover { background: var(--l2); transform: translateX(2px); }
.tool:hover::after { height: 60%; box-shadow: 0 0 8px var(--cyber); }
.tool.active {
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 16%, var(--l3)), var(--l3) 60%);
  box-shadow: inset 0 1px 0 var(--highlight), 0 6px 18px -14px var(--accent);
}
.tool.active::after { height: 70%; background: var(--accent);
                      box-shadow: 0 0 10px var(--accent); }
/* corner ticks */
.tool.active::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(var(--accent), var(--accent)) top left    / 8px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top left    / 1px 8px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom right/ 8px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom right/ 1px 8px no-repeat;
  opacity: .8;
}
.tool .ic { width: 19px; text-align: center; flex: none; font-size: 15px; }
.tool .nm { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool.broken .nm { color: var(--err); }
.tool .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--warn); flex: none;
             box-shadow: 0 0 7px var(--warn); }

.runs { border-top: 1px solid var(--hairline); padding: 4px 12px 10px;
        max-height: 200px; overflow-y: auto; }
.runs .eyebrow { padding: 12px 2px 8px; }
.run { display: flex; gap: 9px; align-items: center; padding: 6px 8px; cursor: pointer;
       border-radius: 4px; font-size: 12px; color: var(--muted);
       transition: background var(--speed), color var(--speed); }
.run:hover { background: var(--l2); color: var(--text); }
.run .d { width: 5px; height: 5px; border-radius: 50%; flex: none; }
.run .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run .t { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }

.side-foot { border-top: 1px solid var(--hairline); padding: 11px 14px;
             display: flex; align-items: center; gap: 9px; }
.side-foot .count { font-family: var(--font-mono); font-size: 10.5px;
                    letter-spacing: .12em; text-transform: uppercase;
                    color: var(--faint); margin-right: auto; }


/* ------------------------------------------------------------------ work -- */
.work { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.banner { padding: 9px var(--gap); font-size: 12.5px; border-bottom: 1px solid var(--hairline);
          background: color-mix(in srgb, var(--warn) 13%, var(--l1)); color: var(--warn); }
.banner code { background: rgba(0,0,0,.35); padding: 1px 6px; border-radius: 3px;
               font-family: var(--font-mono); font-size: 11.5px; }

.head { padding: 19px var(--gap) 17px; border-bottom: 1px solid var(--hairline);
        display: flex; align-items: flex-start; gap: 14px;
        background: linear-gradient(var(--l1), color-mix(in srgb, var(--l1) 92%, #000)); }
.head .txt { flex: 1; min-width: 0; }
.head h2 { margin: 0 0 3px; font-size: 19.5px; font-weight: 700; letter-spacing: -.02em; }
.head p { margin: 0; color: var(--muted); font-size: 12.5px; }

.split { flex: 1; display: flex; overflow: hidden; }
.pane-form { width: 42%; min-width: 320px; max-width: 560px; overflow-y: auto;
             padding: var(--gap); border-right: 1px solid var(--hairline); }
.pane-out { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--l0); }


/* ---------------------------------------------------------------- fields -- */
.field { margin-bottom: 17px; }
.field > label { display: block; font-size: 12.5px; margin-bottom: 7px; font-weight: 600; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.req { color: var(--cyber); margin-left: 4px; }

input[type=text], input[type=number], input[type=password], input[type=email], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 13.5px; color: var(--text);
  background: var(--sunken); border: 1px solid var(--hairline);
  border-radius: var(--radius-small); box-shadow: var(--sunk);
  transition: border-color var(--speed), box-shadow var(--speed);
}
textarea { min-height: 90px; resize: vertical; font-family: var(--font-mono); font-size: 12.5px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: color-mix(in srgb, var(--cyber) 65%, transparent);
  box-shadow: var(--sunk), 0 0 0 3px color-mix(in srgb, var(--cyber) 16%, transparent),
              0 0 18px -6px var(--cyber);
}
input::placeholder, textarea::placeholder { color: var(--faint); }

input[type=file] {
  width: 100%; padding: 14px; font-size: 12.5px; color: var(--muted); cursor: pointer;
  background: var(--sunken); border-radius: var(--radius-small); box-shadow: var(--sunk);
  border: 1px dashed color-mix(in srgb, var(--muted) 38%, transparent);
  transition: border-color var(--speed), color var(--speed);
}
input[type=file]:hover { border-color: var(--cyber); color: var(--text); }
input[type=file]::file-selector-button {
  font: inherit; font-size: 12px; font-weight: 700; margin-right: 12px; padding: 6px 12px;
  cursor: pointer; border: 1px solid var(--hairline); border-radius: 4px;
  background: var(--l3); color: var(--text); box-shadow: inset 0 1px 0 var(--highlight);
}
select { appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 15px center, right 10px center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.check { display: flex; align-items: center; gap: 10px; }
.check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.check label { margin: 0; font-size: 13px; cursor: pointer; }


/* --------------------------------------------------------------- buttons -- */
button {
  position: relative; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  letter-spacing: .01em; padding: 9px 17px; border-radius: var(--radius-small);
  border: 1px solid var(--hairline); background: var(--l3); color: var(--text);
  box-shadow: inset 0 1px 0 var(--highlight), var(--key-shadow);
  transition: filter var(--speed), transform var(--speed), box-shadow var(--speed),
              border-color var(--speed);
}
button:hover:not(:disabled) { filter: brightness(1.14);
  border-color: color-mix(in srgb, var(--cyber) 40%, var(--hairline)); }
button:active:not(:disabled) { transform: translate(2px, 2px);
  box-shadow: inset 0 1px 0 var(--highlight), 1px 1px 0 rgba(0,0,0,.5); }
button:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }

.btn-primary { background: linear-gradient(160deg,
                 color-mix(in srgb, var(--accent) 88%, #fff), var(--accent));
               color: var(--accent-ink); border-color: transparent;
               box-shadow: inset 0 1px 0 rgba(255,255,255,.45), var(--key-shadow); }
.btn-primary:hover:not(:disabled) {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), var(--key-shadow),
              0 0 20px -4px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-quiet { background: transparent; box-shadow: none; color: var(--muted); font-weight: 600; }
.btn-quiet:hover { color: var(--text); background: var(--l2); }
.btn-quiet:active:not(:disabled) { transform: none; box-shadow: none; }
.btn-danger { background: transparent; color: var(--err); box-shadow: none;
              border-color: color-mix(in srgb, var(--err) 42%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--err) 13%, transparent);
                    border-color: var(--err); }
.btn-small { padding: 6px 11px; font-size: 11.5px; }
.btn-big { padding: 12px 28px; font-size: 14px; }

.actions { display: flex; gap: 12px; align-items: center; margin-top: 22px; padding: 14px 0;
           position: sticky; bottom: 0;
           background: linear-gradient(to top, var(--l0) 58%, transparent); }
.kbd { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint);
       border: 1px solid var(--hairline); border-radius: 4px; padding: 3px 7px;
       background: var(--l1); }


/* --------------------------------------------------------------- console -- */
.out-head { position: relative; display: flex; align-items: center; gap: 11px;
            padding: 10px 16px; flex: none; background: var(--l1);
            border-bottom: 1px solid var(--hairline); font-size: 12px; }
.out-head::after {      /* sweeps while something is running */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyber), transparent);
  background-size: 40% 100%; background-repeat: no-repeat; opacity: 0;
}
.out-head:has(.pill.running)::after {
  opacity: calc(.9 * var(--motion)); animation: sweep 1.8s linear infinite;
}
@keyframes sweep { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.out-head .sp { flex: 1; }
.out-head .note { color: var(--muted); font-family: var(--font-mono); font-size: 11px; }

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 4px;
        font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .13em;
        text-transform: uppercase; border: 1px solid transparent; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
                box-shadow: 0 0 8px currentColor; }
.pill.idle { background: var(--l2); color: var(--faint); border-color: var(--hairline); }
.pill.idle::before { box-shadow: none; }
.pill.running { background: color-mix(in srgb, var(--cyber) 15%, transparent); color: var(--cyber);
                border-color: color-mix(in srgb, var(--cyber) 40%, transparent); }
.pill.running::before { animation: blip calc(1.1s / var(--motion, 1)) ease-in-out infinite; }
.pill.finished { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok);
                 border-color: color-mix(in srgb, var(--ok) 34%, transparent); }
.pill.failed, .pill.timeout { background: color-mix(in srgb, var(--err) 15%, transparent);
                 color: var(--err); border-color: color-mix(in srgb, var(--err) 34%, transparent); }
.pill.stopped { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn);
                border-color: color-mix(in srgb, var(--warn) 34%, transparent); }
@keyframes blip { 50% { opacity: .2; } }

.console {
  position: relative; flex: 1; overflow-y: auto; padding: 16px 18px 16px 20px;
  white-space: pre-wrap; word-break: break-word; font-family: var(--font-mono);
  font-size: var(--console-size); line-height: 1.62;
  background: var(--sunken); box-shadow: var(--sunk);
  border-left: 2px solid color-mix(in srgb, var(--cyber) 22%, transparent);
}
.console::before {      /* scanlines */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(rgba(255,255,255,.028) 0 1px, transparent 1px 3px);
  opacity: var(--scan);
}
.console .sys { color: var(--faint); }
.console .err { color: var(--err); }
.console .hit { color: var(--cyber); }
.console .empty { color: var(--faint); font-family: var(--font); }

.files { flex: none; border-top: 1px solid var(--hairline); background: var(--l1);
         padding: 12px 16px; max-height: 165px; overflow-y: auto; }
.files .eyebrow { margin-bottom: 10px; }
.files a { display: inline-flex; align-items: center; gap: 8px; margin: 0 8px 8px 0;
           padding: 7px 12px; border-radius: 4px; font-size: 12px; text-decoration: none;
           color: var(--text); background: var(--l3); border: 1px solid var(--hairline);
           box-shadow: inset 0 1px 0 var(--highlight);
           transition: border-color var(--speed), transform var(--speed), box-shadow var(--speed); }
.files a:hover { border-color: var(--cyber); transform: translateY(-1px);
                 box-shadow: inset 0 1px 0 var(--highlight), var(--glow); }
.files a .sz { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }


/* ----------------------------------------------------------------- cards -- */
.sheet { padding: var(--gap); overflow-y: auto; flex: 1; }
.card {
  position: relative; background:
    linear-gradient(color-mix(in srgb, var(--cyber) 3%, transparent), transparent 90px),
    var(--l2);
  border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 var(--highlight), var(--lift);
  padding: 20px 22px; margin: 0 auto 18px; max-width: 1120px;
  transition: border-color var(--speed), box-shadow var(--speed);
}
.card::before {         /* corner ticks, top-left and bottom-right */
  content: ""; position: absolute; inset: 6px; pointer-events: none; border-radius: 3px;
  background:
    linear-gradient(var(--cyber), var(--cyber)) top left     / 10px 1px no-repeat,
    linear-gradient(var(--cyber), var(--cyber)) top left     / 1px 10px no-repeat,
    linear-gradient(var(--cyber), var(--cyber)) bottom right / 10px 1px no-repeat,
    linear-gradient(var(--cyber), var(--cyber)) bottom right / 1px 10px no-repeat;
  opacity: .28;
}
.card:hover { border-color: color-mix(in srgb, var(--cyber) 22%, var(--hairline)); }
.card > h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 700; letter-spacing: -.01em;
             display: flex; align-items: center; gap: 9px; }
.card > h3::before { content: ""; width: 5px; height: 5px; transform: rotate(45deg);
                     background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.card > .sub { margin: 0 0 18px; color: var(--muted); font-size: 12.5px; }
/* Form rows line up across columns: label, box and hint each sit on their own
   shared row, so a two-line label never shoves its box out of line. */
/* No align-items here on purpose: a subgrid child has to stretch across its
   three rows, or a two-line hint spills out over whatever comes next. */
.row { display: grid; gap: 16px 16px;
       grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.row > .field { display: grid; grid-template-rows: subgrid; grid-row: span 3;
                margin-bottom: 0; min-width: 0; }
.row > .field > label { align-self: end; }
.row > .field > .hint { align-self: start; }
/* Three rows is the shape: label, box, hint. A field with more parts than that
   opts out rather than stacking its last two on top of each other. */
.row > .field:has(> :nth-child(4)) { display: block; }
.row > .field:has(> :nth-child(4)) > label { margin-bottom: 7px; }
@supports not (grid-template-rows: subgrid) {
  .row > .field { display: block; }
  .row > .field > label { min-height: 2.6em; }
}
/* wider fields when a row only holds one or two */
.row.wide { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.fieldrow { display: grid; gap: 10px 12px; align-items: end; padding: 13px; margin-bottom: 10px;
            grid-template-columns: 1.6fr 1fr 74px 74px auto; background: var(--l1);
            border: 1px solid var(--hairline); border-radius: var(--radius-small);
            transition: border-color var(--speed); }
.fieldrow:hover { border-color: color-mix(in srgb, var(--cyber) 25%, var(--hairline)); }
.fieldrow label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .13em;
                  text-transform: uppercase; color: var(--faint); display: block;
                  margin-bottom: 5px; font-weight: 700; }
.fieldrow .mini { display: flex; gap: 5px; }
.fieldrow .mini button { padding: 8px 9px; font-size: 12px; }
@media (max-width: 820px) { .fieldrow { grid-template-columns: 1fr 1fr; } }

.notes { background: color-mix(in srgb, var(--warn) 11%, transparent);
         border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn);
         border-radius: var(--radius-small); padding: 12px 15px; font-size: 12.5px;
         margin-bottom: 16px; }
.notes div + div { margin-top: 6px; }
.notes.good { background: color-mix(in srgb, var(--ok) 10%, transparent); color: var(--ok);
              border-color: color-mix(in srgb, var(--ok) 28%, transparent); }

.pickitem { display: flex; align-items: center; gap: 11px; padding: 11px 13px; cursor: pointer;
            background: var(--l1); border: 1px solid var(--hairline);
            border-radius: var(--radius-small); margin-bottom: 8px;
            transition: border-color var(--speed), transform var(--speed), background var(--speed); }
.pickitem:hover { border-color: var(--cyber); background: var(--l3); transform: translateX(3px); }
.pickitem .pi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
                     white-space: nowrap; }
.pickitem .pi-size { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }
.pickitem .pi-del { flex: none; width: 26px; height: 26px; padding: 0; font-size: 12px;
                    line-height: 1; color: var(--faint); background: transparent;
                    border: 1px solid transparent; border-radius: 4px; box-shadow: none;
                    cursor: pointer; opacity: 0; transition: all var(--speed); }
.pickitem:hover .pi-del { opacity: 1; }
.pickitem .pi-del:hover { color: var(--err); border-color: var(--err);
                          background: color-mix(in srgb, var(--err) 12%, transparent); }
.pickitem .pi-del:disabled { opacity: .18; cursor: not-allowed; }
.pickitem .pi-del:disabled:hover { color: var(--faint); border-color: transparent;
                                   background: transparent; }

.empty-state { padding: 66px 30px; text-align: center; color: var(--muted); }
.empty-state b { color: var(--text); }


/* ----------------------------------------------------------------- admin -- */
/* tabs that sit up out of the bar and join the sheet below them */
.tabs { display: flex; gap: 3px; padding: 8px var(--gap) 0; background: var(--l1);
        border-bottom: 1px solid var(--hairline); flex: none; position: relative; z-index: 2; }
.tabs button {
  position: relative; background: transparent; border: 1px solid transparent;
  border-bottom: none; box-shadow: none;
  border-radius: var(--radius-small) var(--radius-small) 0 0;
  color: var(--muted); padding: 11px 15px 12px; font-size: 12.5px; font-weight: 600;
  transition: color var(--speed), background var(--speed);
}
.tabs button:hover { color: var(--text); background: color-mix(in srgb, var(--l2) 70%, transparent);
                     filter: none; }
.tabs button:active { transform: none; }
.tabs button.on {
  color: var(--text); background: var(--l0); border-color: var(--hairline);
  margin-bottom: -1px; padding-bottom: 13px;
  box-shadow: 0 -6px 16px -12px var(--cyber);
}
.tabs button.on::before {   /* lit edge along the top of the active tab */
  content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--cyber));
  border-radius: 2px 2px 0 0;
}
.tabs .badge { display: inline-block; margin-left: 7px; min-width: 17px; padding: 1px 5px;
               border-radius: 3px; background: var(--accent); color: var(--accent-ink);
               font-family: var(--font-mono); font-size: 10px; font-weight: 700; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; padding: 9px 12px; font-family: var(--font-mono); font-size: 9.5px;
     letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 700;
     border-bottom: 1px solid var(--hairline); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; }
td:first-child { white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--speed); }
tbody tr:hover { background: color-mix(in srgb, var(--cyber) 4%, transparent); }
td .sub { color: var(--faint); font-size: 11.5px; }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 4px;
       font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .1em;
       text-transform: uppercase; background: var(--l3); color: var(--muted);
       border: 1px solid var(--hairline); }
.tag.active { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok);
              border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.tag.pending { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
               border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.tag.suspended, .tag.declined { background: color-mix(in srgb, var(--err) 14%, transparent);
                                color: var(--err); }
.tag.admin { background: color-mix(in srgb, var(--cyber) 14%, transparent); color: var(--cyber);
             border-color: color-mix(in srgb, var(--cyber) 30%, transparent); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; cursor: pointer;
        border-radius: 4px; font-size: 12px; user-select: none; background: var(--l1);
        border: 1px solid var(--hairline); color: var(--muted);
        transition: all var(--speed); }
.chip:hover { border-color: var(--cyber); color: var(--text); transform: translateY(-1px); }
.chip.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
           border-color: color-mix(in srgb, var(--accent) 45%, transparent);
           box-shadow: 0 0 16px -6px var(--accent); }
.chip input { display: none; }

.ip { font-family: var(--font-mono); font-size: 12px; }
.stack { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.bar { height: 8px; border-radius: 3px; background: var(--sunken); box-shadow: var(--sunk);
       overflow: hidden; display: flex; }
.bar span { display: block; height: 100%; box-shadow: 0 0 10px -2px currentColor; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 7px; }
.stat { display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 18px; }
.stat div b { display: block; font-family: var(--font-mono); font-size: 22px; font-weight: 700;
              letter-spacing: -.02em; }
.stat div span { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .14em;
                 text-transform: uppercase; color: var(--faint); }

.preview { border-left: 3px solid var(--accent); background: var(--l1); border-radius: 4px;
           padding: 14px 16px; font-size: 13px; box-shadow: var(--sunk); }
.preview .ptitle { font-weight: 700; margin-bottom: 8px; }
.preview .pbody { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted);
                  background: var(--sunken); padding: 10px 12px; border-radius: 4px;
                  white-space: pre-wrap; }
.preview .pmeta { display: flex; gap: 22px; margin-top: 11px; font-size: 11.5px; }
.preview .pmeta b { display: block; font-family: var(--font-mono); font-size: 9.5px;
                    letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
                    margin-bottom: 2px; }
.preview .pfoot { margin-top: 11px; font-size: 11px; color: var(--faint); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 400;
         background: var(--l4); border: 1px solid color-mix(in srgb, var(--cyber) 35%, var(--hairline));
         box-shadow: var(--lift), var(--glow);
         padding: 11px 18px; border-radius: 5px; font-size: 13px; }
.toast.bad { border-color: var(--err); color: var(--err); box-shadow: var(--lift); }


/* ----------------------------------------------------------------- entry -- */
.entry { min-height: 100vh; display: grid; place-items: center; padding: 30px 20px; }
.entry-card { position: relative; width: 380px; max-width: 100%;
              background: linear-gradient(color-mix(in srgb, var(--cyber) 4%, transparent),
                          transparent 120px), var(--l2);
              border: 1px solid var(--hairline); border-radius: var(--radius);
              box-shadow: inset 0 1px 0 var(--highlight), var(--lift); padding: 32px; }
.entry-card::before {
  content: ""; position: absolute; left: 20px; right: 20px; top: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--cyber), transparent);
  border-radius: 2px; opacity: .85;
}
.entry-card .brandline { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.entry-card .lead { margin: 0 0 22px; color: var(--muted); font-size: 12.5px; }
.entry-card button { width: 100%; margin-top: 4px; }
.entry-card .alt { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hairline);
                   font-size: 12.5px; color: var(--muted); text-align: center; }
.msg { border-radius: var(--radius-small); padding: 11px 14px; font-size: 12.5px; margin-bottom: 16px; }
.msg.bad { background: color-mix(in srgb, var(--err) 13%, transparent); color: var(--err);
           border: 1px solid color-mix(in srgb, var(--err) 30%, transparent); }
.msg.good { background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok);
            border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }


/* ---------------------------------------------------------------- mobile -- */
/* A phone is about 390px across. Anything that would rather wrap than fit -
   the row of links, the two panes, the wide tables - folds instead.          */

/* the two buttons that only exist on a small screen */
.icon-btn { display: none; flex: none; width: 38px; height: 34px; padding: 0;
            flex-direction: column; align-items: center; justify-content: center; gap: 4px;
            background: var(--l2); border: 1px solid var(--hairline);
            border-radius: var(--radius-small); box-shadow: inset 0 1px 0 var(--highlight);
            cursor: pointer; }
.menu-btn { font-family: var(--font-mono); font-size: 13px; font-weight: 700;
            color: var(--text); letter-spacing: 0; }
.menu-btn[aria-expanded="true"] { background: color-mix(in srgb, var(--accent) 18%, var(--l2));
                                  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
                                  color: var(--accent); }
.icon-btn span { display: block; width: 16px; height: 2px; border-radius: 2px;
                 background: var(--text); transition: transform var(--speed), opacity var(--speed); }
.icon-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.icon-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.icon-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.topnav { display: flex; align-items: center; gap: 6px; }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.55);
         backdrop-filter: blur(2px); }

@media (max-width: 900px) {
  .shell { height: auto; min-height: 100vh; }
  .main { flex-direction: column; overflow: auto; }

  /* --- the bar ------------------------------------------------------- */
  /* The bar stays put. Without this it scrolls away and the drawer, which is
     pinned below it, is left hanging in mid-air. */
  .topbar { padding: 0 11px; gap: 10px; height: 52px; z-index: 70;
            position: sticky; top: 0; }
  .icon-btn { display: flex; }
  .brand { min-width: 0; }
  .wordmark { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; }
  .topbar .logo { width: 23px; height: 23px; }

  /* the links become a panel that drops out of the button */
  .topnav {
    position: absolute; top: calc(100% + 7px); right: 10px; left: auto; z-index: 60;
    display: none; flex-direction: column; align-items: stretch; gap: 2px;
    min-width: 208px; padding: 8px;
    background: var(--l4); border: 1px solid var(--hairline);
    border-radius: var(--radius); box-shadow: var(--lift), var(--glow);
  }
  .topnav.open { display: flex; }
  .topnav a.link { padding: 11px 12px; font-size: 14px; border-radius: var(--radius-small); }
  .topnav a.link.out { color: var(--err); }
  .topnav .who { order: -1; margin-bottom: 6px; padding: 9px 11px;
                 border-radius: var(--radius-small); }
  .topnav .who .label { display: inline; }

  /* --- the tool rail becomes a drawer -------------------------------- */
  .side {
    position: fixed; top: 52px; bottom: 0; left: 0; z-index: 50;
    width: min(84vw, 320px); flex: none;
    border-right: 1px solid var(--hairline); border-bottom: none;
    transform: translateX(-102%); transition: transform .18s ease;
    box-shadow: 18px 0 40px -24px #000;
    overscroll-behavior: contain;      /* scrolling the drawer stops at its ends */
  }
  .scrim { top: 52px; }                /* the bar stays lit above it */
  .side.open { transform: none; }
  .side::after { display: none; }
  .tools { max-height: none; }
  .runs { max-height: 30vh; }

  /* --- the work area ------------------------------------------------- */
  .work { overflow: visible; }
  .head { padding: 15px 16px 13px; }
  .head h2 { font-size: 17.5px; }
  .split { flex-direction: column; }
  .grip { display: none; }
  .pane-form { width: 100% !important; flex: none !important; max-width: none !important;
               border-right: none; border-bottom: 1px solid var(--hairline);
               padding: 17px 16px; }
  .pane-out { min-height: 62vh; }
  .console { font-size: 12px; }

  /* --- everything else ----------------------------------------------- */
  :root { --gap: 16px; }
  .tabs { overflow-x: auto; padding: 8px 12px 0; -webkit-overflow-scrolling: touch;
          scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; flex: none; }
  .row { grid-template-columns: 1fr; }
  .card { padding: 16px 15px; }
  .stat { gap: 20px; }
  .sheet { padding: 16px 14px; }
  .fieldrow { grid-template-columns: 1fr 1fr; }
  .actions { flex-wrap: wrap; }
  .table-wrap, .card > table { display: block; overflow-x: auto; }
  input, select, textarea { font-size: 16px; }   /* stops iOS zooming on focus */
}

@media (max-width: 460px) {
  .topbar { gap: 8px; }
  .wordmark { max-width: 42vw; }
  .fieldrow { grid-template-columns: 1fr; }
  .head { padding: 13px 14px 11px; }
  :root { --gap: 13px; }
}

/* --------------------------------------------------------- the divider -- */
.grip { flex: 0 0 7px; cursor: col-resize; position: relative; background: transparent;
        border-right: 1px solid var(--hairline); margin-left: -1px; }
.grip::before {                      /* the little handle you aim at */
  content: ""; position: absolute; top: 50%; left: 50%; width: 3px; height: 34px;
  transform: translate(-50%, -50%); border-radius: 3px; background: var(--l4);
  transition: background var(--speed), height var(--speed);
}
.grip:hover, .grip:focus-visible { border-right-color: var(--cyber); outline: none; }
.grip:hover::before, .grip:focus-visible::before { background: var(--cyber); height: 54px;
                                                   box-shadow: 0 0 12px -2px var(--cyber); }
body.dragging { cursor: col-resize; user-select: none; }
body.dragging .grip { border-right-color: var(--accent); }
body.dragging .grip::before { background: var(--accent); height: 60px; }
body.dragging iframe { pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}


/* ==========================================================================
   SPARE COLOUR SCHEMES
   Copy a block over THE LAYERS + COLOURS values in SETTINGS above.
   ==========================================================================

   ── Cold steel (ice blue on gunmetal) ──
   --l0:#0f1317; --l1:#151b21; --l2:#1b232a; --l3:#232d36; --l4:#2e3a45; --sunken:#090c0f;
   --text:#e4ecf2; --muted:#8d9aa6; --faint:#5d6a76;
   --accent:#59c2ff; --accent-ink:#04121c; --cyber:#7cf7d2;

   ── Toxic (acid green, heavy cyber) ──
   --l0:#0d1110; --l1:#131917; --l2:#19211e; --l3:#212b27; --l4:#2b3733; --sunken:#080b0a;
   --text:#e4f0e9; --muted:#8b9c94; --faint:#5c6b64;
   --accent:#b6ff3a; --accent-ink:#0a1500; --cyber:#00e0b8;

   ── Ultraviolet ──
   --l0:#110f18; --l1:#171420; --l2:#1e1a29; --l3:#272134; --l4:#332c43; --sunken:#0a0810;
   --text:#e9e4f2; --muted:#9990ab; --faint:#6a6280;
   --accent:#c07cff; --accent-ink:#12061f; --cyber:#4ce0ff;

   ── Daylight (light theme) ──
   --l0:#eff0f2; --l1:#f9f9fa; --l2:#ffffff; --l3:#f0f1f4; --l4:#ffffff; --sunken:#f5f6f8;
   --text:#1b1a1d; --muted:#5e5a62; --faint:#8c8790;
   --accent:#e0431a; --accent-ink:#ffffff; --cyber:#0091b3;
   --hairline:rgba(0,0,0,.12); --highlight:rgba(255,255,255,.9);
   --key-shadow:2px 2px 0 rgba(0,0,0,.13); --sunk:inset 0 1px 3px rgba(0,0,0,.09);
   --grain:.02; --hatch:.025; --scan:.15;
   ========================================================================== */

/* --------------------------------------------------- the Look tab swatches */
.swatches { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.swatch { display: flex; align-items: center; gap: 11px; padding: 9px 11px; cursor: pointer;
          background: var(--l1); border: 1px solid var(--hairline);
          border-radius: var(--radius-small); transition: border-color var(--speed); }
.swatch:hover { border-color: color-mix(in srgb, var(--cyber) 35%, var(--hairline)); }
.swatch input[type=color] { width: 34px; height: 30px; padding: 0; border-radius: 4px;
          border: 1px solid var(--hairline); background: none; cursor: pointer; box-shadow: none; }
.swatch span { font-size: 12.5px; line-height: 1.3; }
.swatch b { display: block; font-size: 10.5px; color: var(--faint); font-weight: 500;
            font-family: var(--font-mono); }
input[type=range] { width: 100%; accent-color: var(--accent); background: none;
                    box-shadow: none; border: none; padding: 0; }


/* ------------------------------------------------------- extra tidiness -- */
.card + .card { margin-top: 0; }
.card > h3 + .sub { margin-top: 2px; }
.card .actions:last-child { margin-bottom: 0; padding-bottom: 0; }
.field:last-child { margin-bottom: 0; }
.hint { line-height: 1.45; }

/* section divider inside a card */
.rule { height: 1px; margin: 20px 0; border: 0;
        background: linear-gradient(90deg, var(--hairline), transparent); }

/* compact key/value strip used for status lines */
.facts { display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 12.5px; }
.facts div { display: flex; gap: 8px; align-items: baseline; }
.facts b { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em;
           text-transform: uppercase; color: var(--faint); font-weight: 700; }

/* list of things you can switch on and off */
.toggles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.toggle { display: flex; gap: 11px; align-items: flex-start; padding: 11px 13px; cursor: pointer;
          background: var(--l1); border: 1px solid var(--hairline);
          border-radius: var(--radius-small); transition: border-color var(--speed); }
.toggle:hover { border-color: color-mix(in srgb, var(--cyber) 35%, var(--hairline)); }
.toggle.on { border-color: color-mix(in srgb, var(--accent) 45%, transparent);
             background: color-mix(in srgb, var(--accent) 8%, var(--l1)); }
.toggle input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.toggle > span { min-width: 0; }
.toggle .t { display: block; font-size: 12.5px; font-weight: 600; }
.toggle .d { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px;
             line-height: 1.4; }

/* the person cards on the access screen */
.person-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.person-head .who-mail { color: var(--faint); font-size: 12px; font-weight: 400; }


/* ==========================================================================
   1.1.0 — locked ("ask once") fields, icon picker, log table, webhook preview
   ========================================================================== */

/* a value the script asks for once and then keeps ------------------------- */
.lockchip { display: inline-block; margin-left: 8px; padding: 2px 7px; border-radius: 3px;
            font-family: var(--font-mono); font-size: 9px; font-weight: 700;
            letter-spacing: .12em; text-transform: uppercase;
            background: color-mix(in srgb, var(--cyber) 14%, transparent); color: var(--cyber);
            border: 1px solid color-mix(in srgb, var(--cyber) 30%, transparent);
            vertical-align: middle; }
.locked { display: flex; gap: 8px; align-items: stretch; }
.locked input { flex: 1 1 auto; min-width: 0; }
.locked input:disabled { color: var(--muted); background: var(--sunken);
                         box-shadow: var(--sunk); cursor: default;
                         border-style: dashed; opacity: 1; }
.locked button { flex: none; white-space: nowrap; align-self: stretch; }
.locked.editing input { border-color: color-mix(in srgb, var(--accent) 55%, var(--hairline)); }
.locked.editing { position: relative; }

/* choosing an emoji or an image for a tool -------------------------------- */
.iconpick { display: flex; gap: 9px; align-items: center; }
.iconpick input { flex: 1 1 auto; min-width: 0; }
.iconprev { flex: none; width: 40px; height: 40px; display: grid; place-items: center;
            font-size: 19px; line-height: 1; overflow: hidden;
            background: var(--l1); border: 1px solid var(--hairline);
            border-radius: var(--radius-small); box-shadow: var(--sunk); }
.iconprev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.emojis { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.emoji { padding: 5px 7px; font-size: 15px; line-height: 1; cursor: pointer;
         background: var(--l1); border: 1px solid var(--hairline);
         border-radius: 4px; box-shadow: none; transition: all var(--speed); }
.emoji:hover { border-color: var(--cyber); transform: translateY(-1px); }

/* tool icons that are images --------------------------------------------- */
.tool .ic.img { width: 19px; height: 19px; border-radius: 4px; object-fit: cover; display: block; }
.head-ico { width: 22px; height: 22px; border-radius: 5px; object-fit: cover;
            vertical-align: -4px; margin-right: 9px; }
.head-ico-emoji { margin-right: 9px; }
.head-ico-emoji:empty { display: none; }

/* the security log — long detail wraps, everything else stays on one line -- */
table.log { table-layout: fixed; }
table.log th:nth-child(1) { width: 15%; }
table.log th:nth-child(2) { width: 15%; }
table.log th:nth-child(3) { width: 17%; }
table.log th:nth-child(5) { width: 14%; }
td.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.wrap   { white-space: normal; word-break: break-word; overflow-wrap: anywhere;
            line-height: 1.45; }
table.log td:first-child { white-space: nowrap; }
@media (max-width: 900px) { table.log { table-layout: auto; } }

/* the Discord preview, with the mark and the download link ---------------- */
.preview .pauthor { display: flex; align-items: center; gap: 8px; margin-bottom: 9px;
                    font-size: 12px; font-weight: 600; color: var(--muted); }
.preview .pauthor img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.preview .plink { margin-top: 11px; font-size: 12.5px; font-weight: 600; color: #00a8fc; }
.preview .pfoot { display: flex; align-items: center; gap: 7px; }
.preview .pfoot img { width: 15px; height: 15px; border-radius: 50%; object-fit: cover; }


/* ==========================================================================
   1.2.0 — drop zone, emoji picker, collapsible groups
   ========================================================================== */

/* ------------------------------------------------------- drag a file in -- */
.drop { position: relative; display: grid; place-items: center; cursor: pointer;
        padding: 30px 18px; text-align: center;
        background: var(--sunken); box-shadow: var(--sunk);
        border: 1.5px dashed color-mix(in srgb, var(--cyber) 26%, var(--hairline));
        border-radius: var(--radius); transition: all var(--speed); }
.drop:hover { border-color: color-mix(in srgb, var(--cyber) 55%, transparent); }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--sunken));
             box-shadow: var(--sunk), 0 0 26px -8px var(--accent); }
.drop-in { display: flex; flex-direction: column; align-items: center; gap: 5px; pointer-events: none; }
.drop-in .linkish { pointer-events: auto; }
.drop-ico { font-size: 26px; line-height: 1; margin-bottom: 3px; }
.drop-in b { font-size: 14px; }
.drop-name { font-family: var(--font-mono); font-size: 11.5px; color: var(--cyber); min-height: 16px; }
.drop.over .drop-ico { transform: scale(1.12); }
.linkish { background: none; border: none; box-shadow: none; padding: 0; cursor: pointer;
           color: var(--accent); font: inherit; text-decoration: underline;
           text-underline-offset: 3px; }

/* ---------------------------------------------- anything floating on top -- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
         padding: 20px; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
.modal-card { background: var(--l2); border: 1px solid var(--hairline);
              border-radius: var(--radius); box-shadow: var(--lift), var(--glow);
              max-width: 100%; overflow: hidden; }

/* ------------------------------------------------------- the emoji list -- */
.emoji-picker { width: 448px; display: flex; flex-direction: column;
                max-height: min(600px, calc(100vh - 48px)); }
.ep-head { display: flex; align-items: center; gap: 10px; flex: none;
           padding: 13px 14px 0; }
.ep-head h4 { flex: 1; margin: 0; font-size: 14px; font-weight: 700; }
.ep-x { flex: none; width: 30px; height: 30px; padding: 0; font-size: 15px; line-height: 1;
        color: var(--muted); background: transparent; border: 1px solid var(--hairline);
        border-radius: var(--radius-small); box-shadow: none; cursor: pointer;
        transition: all var(--speed); }
.ep-x:hover { color: var(--text); border-color: var(--cyber); background: var(--l3); }
.ep-search { flex: none; padding: 11px 14px 12px; }
.ep-search input { width: 100%; }

.ep-tabs { flex: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
           gap: 2px; padding: 0 10px 9px; border-bottom: 1px solid var(--hairline); }
.ep-tabs button { padding: 7px 0 8px; font-size: 17px; line-height: 1; cursor: pointer;
                  background: transparent; border: none; border-bottom: 2px solid transparent;
                  border-radius: 5px 5px 0 0; box-shadow: none; opacity: .55;
                  transition: opacity var(--speed), background var(--speed); }
.ep-tabs button:hover { opacity: 1; background: var(--l3); }
.ep-tabs button.on { opacity: 1; border-bottom-color: var(--accent);
                     background: color-mix(in srgb, var(--accent) 12%, transparent); }

.ep-body { flex: 1 1 auto; min-height: 150px; overflow-y: auto; overscroll-behavior: contain;
           padding: 11px 10px 13px; }
.ep-grid { display: grid; gap: 2px; grid-template-columns: repeat(9, 1fr); }
.ep-cell { aspect-ratio: 1; display: grid; place-items: center; font-size: 21px; line-height: 1;
           cursor: pointer; background: transparent; border: 1px solid transparent;
           border-radius: 6px; box-shadow: none; padding: 0; }
.ep-cell:hover, .ep-cell:focus-visible {
  outline: none; background: var(--l3);
  border-color: color-mix(in srgb, var(--cyber) 55%, transparent); transform: scale(1.1); }
.ep-none { padding: 26px 14px; text-align: center; color: var(--muted); font-size: 12.5px; }

.ep-foot { flex: none; padding: 9px 14px; border-top: 1px solid var(--hairline);
           background: var(--l1); font-size: 11.5px; color: var(--muted);
           overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 34px;
           display: flex; align-items: center; }

/* emoji should be drawn by the device, so an iPhone shows Apple's artwork */
.iconprev, .tool .ic, .head-ico-emoji, .ep-cell, .ep-tabs button {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font); }

@media (max-width: 560px) {
  .modal { padding: 0; }
  .emoji-picker { width: 100%; max-height: 100vh; height: 100vh; border-radius: 0;
                  border-left: none; border-right: none; }
  .ep-grid { grid-template-columns: repeat(7, 1fr); }
}

/* ----------------------------------------------- folding the tool groups -- */
.eyebrow.group { width: 100%; padding: 14px 2px 9px; cursor: pointer; text-align: left;
                 background: none; border: none; box-shadow: none; }
.eyebrow.group:hover { color: var(--muted); }
.eyebrow.group .caret { width: 0; height: 0; flex: none; margin-left: 1px;
                        border-left: 4px solid currentColor;
                        border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent;
                        transform: rotate(90deg); transition: transform var(--speed); }
.eyebrow.group.shut .caret { transform: none; }
.eyebrow.group .n { order: 3; font-size: 9.5px; opacity: .7; padding-left: 6px; }
.eyebrow.group::after { order: 2; }
.groupitems { display: flex; flex-direction: column; gap: 2px; }

/* a bar with its number beside it, used by the health page */
.meter { display: flex; align-items: center; gap: 11px; }
.meter .bar { flex: 1; min-width: 0; }
.meter b { flex: none; font-family: var(--font-mono); font-size: 12px; font-weight: 700;
           font-variant-numeric: tabular-nums; }


/* ==========================================================================
   1.3.0 — the mailbox
   ========================================================================== */

/* -------------------------------- the pinned block at the top of the rail -- */
/* This never scrolls and never reorders. Whatever the tool list does below,
   these stay exactly where they are. */
.pinned { flex: none; display: flex; flex-direction: column; gap: 3px;
          padding: 11px 12px 4px; border-bottom: 1px solid var(--hairline);
          background: linear-gradient(var(--l1), color-mix(in srgb, var(--l1) 94%, #000)); }
.pin { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px;
       cursor: pointer; text-align: left; font: inherit; font-size: 13.5px;
       color: var(--muted); background: transparent; border: 1px solid transparent;
       border-radius: var(--radius-small); box-shadow: none;
       transition: color var(--speed), background var(--speed), border-color var(--speed); }
.pin:hover { color: var(--text); background: var(--l2); }
.pin.on { color: var(--text); background: var(--l3);
          border-color: color-mix(in srgb, var(--accent) 40%, transparent);
          box-shadow: inset 2px 0 0 var(--accent); }
.pin-ico { width: 18px; text-align: center; flex: none; font-size: 14px; }
.pin-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-badge { flex: none; min-width: 18px; padding: 1px 6px; border-radius: 9px;
             background: var(--accent); color: var(--accent-ink);
             font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-align: center; }

/* ------------------------------------------- accounts and folders below it -- */
.mailrail { flex: 1; overflow-y: auto; padding: 0 12px 10px; }
.mailrail .eyebrow { padding: 14px 2px 8px; }
.mailacc, .mailfold, .mailadd {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  margin-bottom: 2px; cursor: pointer; text-align: left; font: inherit; font-size: 12.5px;
  color: var(--muted); background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-small); box-shadow: none;
  transition: color var(--speed), background var(--speed); }
.mailacc:hover, .mailfold:hover, .mailadd:hover { color: var(--text); background: var(--l2); }
.mailacc.on, .mailfold.on { color: var(--text); background: var(--l3);
                            border-color: color-mix(in srgb, var(--cyber) 35%, transparent); }
.ma-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--faint); }
.mailacc.on .ma-dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.ma-nm, .mf-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
                 white-space: nowrap; }
.mf-ico { width: 17px; text-align: center; flex: none; font-size: 12.5px; }
.mailadd { color: var(--accent); font-size: 12px; }

/* ------------------------------------------------------------- the panel -- */
.mailview { flex: 1; display: flex; flex-direction: column; overflow: hidden;
            background: var(--l0); }
.mailview .card { margin: var(--gap); }
.mail-setup { max-width: 720px; }

.mailbar { flex: none; display: flex; align-items: center; gap: 9px;
           padding: 11px var(--gap); border-bottom: 1px solid var(--hairline);
           background: var(--l1); }
.msearch { flex: 0 1 300px; }
.msearch input { width: 100%; padding: 7px 11px; font-size: 12.5px; }
.mcount { font-family: var(--font-mono); font-size: 11px; color: var(--faint);
          font-variant-numeric: tabular-nums; white-space: nowrap; }

.mactions { flex: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
            padding: 9px var(--gap); border-bottom: 1px solid var(--hairline);
            background: color-mix(in srgb, var(--accent) 9%, var(--l1)); font-size: 12.5px; }

.mlist { flex: 1; overflow-y: auto; }
.mrow { display: grid; align-items: center; gap: 12px; padding: 10px var(--gap);
        grid-template-columns: 26px 7px minmax(110px, 1.1fr) minmax(0, 3fr) auto 62px;
        border-bottom: 1px solid rgba(255,255,255,.04); cursor: pointer; font-size: 13px;
        transition: background var(--speed); }
.mrow:hover { background: color-mix(in srgb, var(--cyber) 5%, transparent); }
.mrow.picked { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.mpick { display: grid; place-items: center; cursor: pointer; }
.mpick input { width: 15px; height: 15px; accent-color: var(--accent); }
.mdot { width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.mrow.unread .mdot { background: var(--cyber); box-shadow: 0 0 8px var(--cyber); }
.mfrom, .msub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mfrom { color: var(--muted); }
.msub { color: var(--muted); }
.mrow.unread .mfrom, .mrow.unread .msub { color: var(--text); font-weight: 600; }
.msize, .mwhen { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint);
                 white-space: nowrap; text-align: right; }
.mempty { padding: 40px var(--gap); color: var(--muted); font-size: 13px; text-align: center; }
.mfoot { flex: none; padding: 8px var(--gap); border-top: 1px solid var(--hairline);
         background: var(--l1); font-size: 11px; color: var(--faint); }

/* ------------------------------------------------------- one message open -- */
.mread { flex: 1; overflow-y: auto; padding: var(--gap); }
.msubject { margin: 0 0 14px; font-size: 20px; font-weight: 700; letter-spacing: -.02em;
            line-height: 1.3; overflow-wrap: anywhere; }
.mmeta { display: grid; gap: 7px 26px; margin-bottom: 18px; font-size: 12.5px;
         grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.mmeta > div { display: flex; gap: 9px; align-items: baseline; min-width: 0; }
.mmeta b { flex: none; width: 42px; font-family: var(--font-mono); font-size: 9.5px;
           letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.mmeta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbody { margin: 16px 0 0; padding: 17px 19px; font-family: var(--font-mono);
         font-size: 12.5px; line-height: 1.65; color: var(--text);
         background: var(--sunken); box-shadow: var(--sunk); border-radius: var(--radius);
         white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.mfiles { margin-top: 20px; }
.mfile { display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin-top: 7px;
         background: var(--l1); border: 1px solid var(--hairline);
         border-radius: var(--radius-small); font-size: 12.5px; }
.mf-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .mailview { overflow: visible; }
  .mailrail { flex: none; max-height: 40vh; }
  .mailbar { flex-wrap: wrap; padding: 10px 14px; }
  .msearch { flex: 1 1 100%; order: -1; }
  .mrow { grid-template-columns: 24px 7px 1fr auto; gap: 9px; padding: 11px 14px; }
  .mrow .msub { grid-column: 3 / -1; grid-row: 2; }
  .mrow .mpick { grid-row: 1 / span 2; }
  .mrow .mdot { grid-row: 1 / span 2; }
  .msize { display: none; }
  .msubject { font-size: 17px; }
  .mbody { padding: 13px 14px; font-size: 12px; }
}
.mscope { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted);
          cursor: pointer; white-space: nowrap; }
.mscope input { width: 14px; height: 14px; accent-color: var(--accent); }

/* While a drawer or the menu is open the page behind it must not scroll -
   otherwise the drawer appears to slide off the top of the screen. */
body.locked { overflow: hidden; }


/* ==========================================================================
   1.4.0 — order tracking
   ========================================================================== */
.ochips { display: flex; gap: 8px; flex-wrap: wrap; }
.ochip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px;
         border-radius: 20px; font-size: 11.5px; color: var(--muted);
         background: var(--l2); border: 1px solid var(--hairline); white-space: nowrap; }
.ochip b { font-family: var(--font-mono); font-size: 12px; color: var(--text); }
.mailbar .btn-quiet.on { color: var(--accent);
                         border-color: color-mix(in srgb, var(--accent) 45%, transparent);
                         background: color-mix(in srgb, var(--accent) 12%, transparent); }

.olist { flex: 1; overflow-y: auto; }
.orow { display: grid; align-items: center; gap: 12px; padding: 11px var(--gap);
        grid-template-columns: 26px minmax(90px, 1fr) minmax(90px, 1.1fr) 130px 84px 66px auto;
        border-bottom: 1px solid rgba(255,255,255,.04); cursor: pointer; font-size: 13px;
        transition: background var(--speed); }
.orow:hover { background: color-mix(in srgb, var(--cyber) 5%, transparent); }
.ost { font-size: 15px; text-align: center;
       font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font); }
.oshop { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oref { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted);
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ostage { font-size: 12px; color: var(--muted); white-space: nowrap; }
.orow .ost.out_for_delivery + .oshop + .oref + .ostage { color: var(--cyber); }
.orow .ost.returned + .oshop + .oref + .ostage { color: var(--err); }
.orow .ost.delivered + .oshop + .oref + .ostage { color: var(--ok); }
.ocour, .owhen { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint);
                 white-space: nowrap; }
.oacts { display: flex; justify-content: flex-end; }

.osheet { flex: none; max-height: 62vh; overflow-y: auto; border-top: 1px solid var(--hairline);
          background: var(--l0); padding: var(--gap) var(--gap) 4px; }
.otrail { margin-top: 10px; }
.oevent { display: grid; gap: 11px; align-items: baseline; padding: 8px 0;
          grid-template-columns: 20px 128px 1fr auto;
          border-bottom: 1px solid rgba(255,255,255,.04); font-size: 12.5px; }
.oe-ico { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font); }
.oe-stage { font-weight: 600; }
.oe-sub { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oe-when { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint);
           white-space: nowrap; }

.oshops { display: flex; flex-direction: column; gap: 8px; }
.oshop-row { display: grid; gap: 10px; align-items: center;
             grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) minmax(150px, 1.4fr) auto; }
.oshop-row input { padding: 7px 10px; font-size: 12.5px; }

/* somebody's own Discord settings */
.mydiscord { width: 520px; max-width: 100%; display: flex; flex-direction: column;
             max-height: min(680px, calc(100vh - 48px)); }
.dm-body { flex: 1; overflow-y: auto; padding: 4px 16px 16px; }

@media (max-width: 900px) {
  .orow { grid-template-columns: 24px 1fr auto; gap: 9px; padding: 11px 14px; }
  .orow .oref { grid-column: 2 / -1; grid-row: 2; }
  .orow .ostage { grid-column: 2; grid-row: 3; }
  .orow .ocour { grid-column: 3; grid-row: 3; text-align: right; }
  .orow .ost { grid-row: 1 / span 3; }
  .orow .oacts { grid-row: 1; }
  .osheet { max-height: none; }
  .oevent { grid-template-columns: 20px 1fr; }
  .oevent .oe-sub, .oevent .oe-when { grid-column: 2; }
  .oshop-row { grid-template-columns: 1fr; }
  .mydiscord { width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; }
}
.ma-tag { flex: none; padding: 1px 6px; border-radius: 3px; font-family: var(--font-mono);
          font-size: 9px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700;
          color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent);
          border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
/* The Discord mark. White artwork, so opacity alone reads as grey -> white and
   it sits at the same weight as the glyphs above it. */
.pin-svg { width: 18px; height: 18px; display: block; margin: 0 auto; opacity: .62;
           transition: opacity var(--speed); }
.pin:hover .pin-svg { opacity: .9; }
.pin.on .pin-svg { opacity: 1;
                   filter: drop-shadow(0 0 6px color-mix(in srgb, var(--cyber) 55%, transparent)); }
.dm-result { line-height: 1.5; text-align: right; }
.mydiscord .ep-foot { align-items: center; }
