/* Molpia Paste: frosted glass windows over a soft gray room lit with emerald light.
   Translucent panels over a slow glow, one emerald gradient for the main action.
   Corners stay at 4-6px; borders go on all sides or nowhere. */

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  --bg: #121413;                          /* neutral gray room */
  --glass: rgb(255 255 255 / 4.5%);       /* panels */
  --glass-strong: rgb(255 255 255 / 7%);  /* windows, popovers */
  --glass-hover: rgb(255 255 255 / 9%);
  --glass-sunken: rgb(0 0 0 / 22%);       /* inputs inside glass */
  --line: rgb(255 255 255 / 10%);
  --line-strong: rgb(255 255 255 / 17%);
  --highlight: inset 0 1px 0 rgb(255 255 255 / 9%);
  --blur: blur(22px) saturate(150%);
  --solid: #1b1e1c;                       /* fallback and select menus */
  --tint: rgb(255 255 255 / 3%);          /* faint stripes: bars, table heads, open rows */
  --tint-2: rgb(255 255 255 / 5%);        /* list row hover */
  --tint-3: rgb(255 255 255 / 8%);        /* meter tracks */
  --line-hover: rgb(255 255 255 / 26%);
  --scrollbar: rgb(255 255 255 / 18%);
  --code-sunken: rgb(0 0 0 / 18%);        /* the paste text area */
  --btn-shine: rgb(255 255 255 / 35%);
  --header-bg: rgb(24 27 25 / 60%);
  /* Syntax colors (highlight.js classes), tuned for the dark glass */
  --hl-keyword: #c792ea;
  --hl-string: #a5e3b5;
  --hl-number: #f6bd76;
  --hl-comment: #7f8a84;
  --hl-title: #82b8ff;
  --hl-attr: #7fd6e0;
  --hl-type: #f2cf72;
  --hl-meta: #b0b8b4;
  --hl-deletion: #ff8b9b;

  --text: #e8ecea;
  --text-muted: #a3aaa6;
  --text-faint: #8b938e;

  --accent: #10b981;                      /* emerald: the main action, focus and success */
  --accent-2: #34d399;
  --accent-ink: #03130d;                  /* text on the emerald gradient */
  --gradient: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --gradient-hover: linear-gradient(135deg, #22c98f 0%, #5ee0ad 100%);
  --accent-soft: rgb(16 185 129 / 14%);
  --danger: #fb7185;
  --danger-soft: rgb(251 113 133 / 12%);
  --warning: #fbbf24;

  --radius: 6px;
  --page-max: 1180px;
  --page-read-max: 980px;
  --radius-sm: 4px;

  --font-ui: "Geist", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-press: cubic-bezier(0.3, 0, 0.2, 1);

  --shadow-window: var(--highlight), 0 30px 80px -24px rgb(0 0 0 / 75%);
  --shadow-window-focus: var(--highlight), 0 30px 80px -24px rgb(0 0 0 / 75%), 0 24px 70px -28px rgb(16 185 129 / 45%);
  --shadow-pop: var(--highlight), 0 20px 50px -16px rgb(0 0 0 / 80%);
}

/* Light theme, chosen by the visitor (html[data-theme="light"], from the theme cookie).
   Same emerald, same shapes; panels become frosted white over a pale gray room. */
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #eef1ef;
  --glass: rgb(255 255 255 / 66%);
  --glass-strong: rgb(255 255 255 / 84%);
  --glass-hover: rgb(16 24 20 / 6%);
  --glass-sunken: rgb(16 24 20 / 4.5%);
  --line: rgb(16 24 20 / 11%);
  --line-strong: rgb(16 24 20 / 18%);
  --highlight: inset 0 1px 0 rgb(255 255 255 / 85%);
  --solid: #ffffff;
  --tint: rgb(16 24 20 / 3%);
  --tint-2: rgb(16 24 20 / 4.5%);
  --tint-3: rgb(16 24 20 / 9%);
  --line-hover: rgb(16 24 20 / 28%);
  --scrollbar: rgb(16 24 20 / 24%);
  --code-sunken: rgb(16 24 20 / 3.5%);
  --btn-shine: rgb(255 255 255 / 45%);
  --header-bg: rgb(255 255 255 / 72%);
  --hl-keyword: #8a3fbf;
  --hl-string: #17794a;
  --hl-number: #b45309;
  --hl-comment: #6b746f;
  --hl-title: #1d5fbf;
  --hl-attr: #0e7490;
  --hl-type: #9a6700;
  --hl-meta: #555e59;
  --hl-deletion: #c2263f;

  --text: #121614;
  --text-muted: #4a534e;
  --text-faint: #646e68;

  --accent: #047857;
  --accent-2: #10b981;
  --accent-soft: rgb(16 185 129 / 13%);
  --danger: #e11d48;
  --danger-soft: rgb(225 29 72 / 9%);
  --warning: #b45309;

  --shadow-window: var(--highlight), 0 24px 60px -30px rgb(16 24 20 / 28%);
  --shadow-window-focus: var(--highlight), 0 24px 60px -30px rgb(16 24 20 / 28%), 0 24px 70px -30px rgb(16 185 129 / 35%);
  --shadow-pop: var(--highlight), 0 18px 44px -18px rgb(16 24 20 / 30%);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* The scrollbar is always shown (overflow-y: scroll), so a long page and a short one have the
   same width and nothing shifts sideways. It is thin and drawn in the theme's colors. */
html { background: var(--bg); overflow-y: scroll; scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
html::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-track { background: var(--bg); }
html::-webkit-scrollbar-thumb { border: 3px solid var(--bg); border-radius: 6px; background: var(--scrollbar); }
html::-webkit-scrollbar-thumb:hover { background: var(--line-hover); }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  caret-color: var(--accent);
}

/* The aurora: soft fields of coloured light behind every panel, drifting slowly. */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 34% at 22% 22%, rgb(16 185 129 / 20%), transparent 70%),
    radial-gradient(34% 32% at 80% 20%, rgb(200 210 205 / 8%), transparent 70%),
    radial-gradient(40% 36% at 64% 84%, rgb(52 211 153 / 12%), transparent 72%),
    radial-gradient(30% 28% at 16% 88%, rgb(160 170 165 / 7%), transparent 70%);
  animation: aurora 38s ease-in-out infinite alternate;
}

::selection { background: rgb(16 185 129 / 32%); color: var(--text); }

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgb(16 185 129 / 55%);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
  transition: color 160ms var(--ease-out), text-decoration-color 160ms var(--ease-out);
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { margin: 0; font-weight: 650; line-height: 1.1; letter-spacing: -0.03em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 3.8vw, 2.8rem); }
h2 { font-size: 1.15rem; letter-spacing: -0.015em; }
h3 { font-size: 1rem; }
p { margin: 0; }

.icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.18em;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.muted { color: var(--text-muted); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.spaced { margin-top: 20px; }
.spaced-sm { margin-top: 8px; }

/* Shared glass surface */
.glass {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--highlight);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

/* ---------- Page frame ---------- */
.site-header {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(var(--page-max), calc(100% - 24px));
  margin: 12px auto 0;
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--header-bg);
  box-shadow: var(--shadow-pop);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  view-transition-name: site-header;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.brand-logo { display: block; width: 28px; height: 28px; filter: drop-shadow(0 6px 10px rgb(16 185 129 / 40%)); transition: transform 300ms var(--ease-out); }
.brand:hover { color: var(--text); }
.brand:hover .brand-logo { transform: rotate(-8deg) scale(1.06); }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav form { display: contents; }

.page { flex: 1; width: 100%; max-width: var(--page-max); margin: 0 auto; padding: clamp(18px, 2.5vw, 32px) clamp(16px, 3vw, 24px) clamp(20px, 2.5vw, 32px); }
.page-narrow { max-width: 460px; }
.page-read { max-width: var(--page-read-max); }
/* Wide screens: the main column (and the header with it) gets 80px more room. */
@media (min-width: 1560px) {
  :root { --page-max: 1260px; --page-read-max: 1060px; }
}

.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 20px; padding: 18px clamp(16px, 4vw, 32px); color: var(--text-faint); font-size: 0.85rem; text-align: center; }
.footer-link { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--text-muted); font: inherit; text-decoration: none; cursor: pointer; transition: color 160ms var(--ease-out); }
.footer-link[hidden] { display: none; }
.menu-item[hidden] { display: none; }
.footer-link .icon { transition: transform 220ms var(--ease-out); }
.footer-link:hover { color: var(--accent); }
.footer-link:hover .icon { transform: translateY(-1px) rotate(-8deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: 550 0.92rem/1.1 var(--font-ui);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 160ms var(--ease-out),
    border-color 160ms var(--ease-out),
    color 160ms var(--ease-out),
    box-shadow 240ms var(--ease-out),
    transform 160ms var(--ease-press);
}
.btn:hover { color: var(--text); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn .icon { transition: transform 220ms var(--ease-out); }
.btn:hover .icon-nudge { transform: translateX(3px); }

.btn-primary {
  background: var(--gradient);
  color: var(--accent-ink);
  font-weight: 650;
  box-shadow: inset 0 1px 0 var(--btn-shine), 0 10px 28px -10px rgb(16 185 129 / 65%);
}
.btn-primary:hover {
  background: var(--gradient-hover);
  color: var(--accent-ink);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 var(--btn-shine), 0 16px 36px -12px rgb(16 185 129 / 70%);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-secondary { background: var(--glass-strong); border-color: var(--line-strong); box-shadow: var(--highlight); }
.btn-secondary:hover { background: var(--glass-hover); border-color: var(--line-hover); }

.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { background: var(--glass-hover); color: var(--text); }

.btn-danger { border-color: rgb(251 113 133 / 45%); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

.btn-lg { min-height: 44px; padding: 10px 20px; font-size: 0.98rem; }
.btn-block { width: 100%; }
.icon-btn { width: 32px; min-height: 32px; padding: 0; }
.icon-btn.is-danger:hover, .btn-ghost.is-danger:hover { background: var(--danger-soft); color: var(--danger); }

.btn.is-copied { border-color: var(--accent); color: var(--accent); }
.btn-primary.is-copied { background: var(--gradient-hover); color: var(--accent-ink); }
.btn.is-copied .icon { animation: pop 320ms var(--ease-out); }
.btn[aria-busy="true"] { cursor: progress; opacity: 0.8; }
.btn[aria-busy="true"] .icon { animation: spin 900ms linear infinite; }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 0.84rem; font-weight: 550; color: var(--text-muted); }

.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass-sunken);
  color: var(--text);
  font: 400 0.95rem/1.4 var(--font-ui);
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); opacity: 1; }

.select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3aaa6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px;
  cursor: pointer;
}
.select option { background: var(--solid); color: var(--text); }

.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
/* Sign-up: the Terms checkbox, a sentence long, with the box beside its first line */
.check-consent { align-items: flex-start; color: var(--text-muted); font-size: 0.88rem; font-weight: 450; line-height: 1.5; }
.check-consent input { flex: none; margin-top: 3px; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.field-hint { color: var(--text-faint); font-size: 0.8rem; }
.input-prefix { position: relative; display: block; }
.input-prefix-mark { position: absolute; top: 50%; left: 11px; display: inline-flex; color: var(--text-faint); transform: translateY(-50%); pointer-events: none; }
.input-prefix .input { width: 100%; padding-left: 34px; }

/* ---------- Alerts and tags ---------- */
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 auto 16px;
  padding: 12px 14px;
  border: 1px solid rgb(251 113 133 / 40%);
  border-radius: var(--radius);
  background: var(--danger-soft);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  animation: nudge 360ms var(--ease-out);
}
.alert .icon { margin-top: 3px; color: var(--danger); }
.alert p + p { margin-top: 4px; }
.alert-info { border-color: rgb(16 185 129 / 35%); background: var(--accent-soft); animation: none; }
.alert-info .icon { color: var(--accent); }
.alert-warn { border-color: rgb(251 191 36 / 38%); background: rgb(251 191 36 / 9%); animation: none; }
.alert-warn .icon { color: var(--warning); }
.alert-warn a { color: var(--warning); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 550;
  white-space: nowrap;
}
.tag .icon { width: 0.95em; height: 0.95em; }
.tag-accent { border-color: rgb(16 185 129 / 45%); background: var(--accent-soft); color: var(--accent); }
.tag-id { font-family: var(--font-mono); }

/* ---------- Landing hero ---------- */
.hero { max-width: 760px; margin: 0 auto 32px; text-align: center; animation: rise 600ms var(--ease-out) both; }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 3.9rem); font-weight: 700; letter-spacing: -0.045em; }
.hero .lede { max-width: 54ch; margin: 14px auto 0; color: var(--text-muted); font-size: 1.1rem; }
.landing .alert { max-width: 920px; }

/* The hidden attribute always wins over a class that sets display (buttons, alerts, rows). */
[hidden] { display: none !important; }

/* ---------- The editor window ---------- */
.window {
  max-width: 920px;
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--glass-strong);
  box-shadow: var(--shadow-window);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: border-color 260ms var(--ease-out), box-shadow 320ms var(--ease-out), transform 320ms var(--ease-out);
  animation: rise 700ms var(--ease-out) 80ms both;
}
.window:focus-within { border-color: rgb(16 185 129 / 45%); box-shadow: var(--shadow-window-focus); transform: translateY(-2px); }
.window.is-invalid { border-color: var(--danger); animation: nudge 360ms var(--ease-out); }
.desk .window { max-width: none; }

.window-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 10px 12px 10px 16px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--tint);
}
.window-title {
  flex: 1 1 200px;
  min-width: 0;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass-sunken);
  color: var(--text);
  font: 600 0.95rem/1.3 var(--font-ui);
  letter-spacing: -0.01em;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.window-title::placeholder { color: var(--text-faint); font-weight: 500; opacity: 1; }
.window-title:hover { border-color: var(--line-strong); }
.window-title:focus-visible { outline: none; border-color: rgb(16 185 129 / 60%); box-shadow: 0 0 0 3px var(--accent-soft); }
.opt-link[hidden] { display: none; }
.window-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.window-text {
  display: block;
  width: 100%;
  min-height: clamp(240px, 38vh, 430px);
  padding: 16px 18px 18px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 400 0.92rem/1.7 var(--font-mono);
  resize: vertical;
}
.window-text::placeholder { color: var(--text-faint); opacity: 1; font-family: var(--font-ui); font-size: 1rem; }
.window-text:focus-visible { outline: none; }
.compact .window-text { min-height: clamp(220px, 34vh, 380px); }

.window-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px 12px;
  padding: 10px 12px 10px 16px;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--code-sunken);
}
.window-foot .window-actions { margin-left: auto; }
/* The editor's footer: the options row above the row with Open file, Write / Preview, Syntax and Create link. */
.window-foot:has(> .foot-options) { flex-direction: column; align-items: stretch; gap: 10px; }
.foot-options { display: flex; flex-direction: column; gap: 8px; }
.foot-main { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.syntax-wrap { display: inline-flex; align-items: center; gap: 8px; }
.syntax-wrap .opt-lang:not([hidden]) { animation: options-in 200ms var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .syntax-wrap .opt-lang:not([hidden]) { animation: none; } }
.window-note { display: inline-flex; align-items: center; gap: 8px; color: var(--text-faint); font-size: 0.85rem; }
.window-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }

.opt { position: relative; display: inline-flex; align-items: center; }
.opt > .icon { position: absolute; left: 10px; color: var(--text-muted); pointer-events: none; }
.opt .select, .opt .input { min-height: 32px; padding-top: 5px; padding-bottom: 5px; padding-left: 31px; font-size: 0.87rem; }
.opt .select { width: auto; }
.opt .input { width: 180px; }
/* On/off option chips (Show username, Read once, Private). The checkbox is kept for keyboards and
   screen readers but not drawn: the chip itself is gray when off and emerald when on. */
.opt-check { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 5px 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass-sunken); color: var(--text-muted); font-size: 0.87rem; cursor: pointer; user-select: none; transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 120ms var(--ease-out); }
.opt-check:hover { border-color: var(--line-strong); color: var(--text); }
.opt-check input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.opt-check .icon { color: var(--text-faint); transition: color 160ms var(--ease-out); }
.opt-check:has(input:checked) { border-color: rgb(16 185 129 / 60%); background: var(--accent-soft); color: var(--text); }
.opt-check:has(input:checked) .icon { color: var(--accent); }
.opt-check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt-check:active { transform: scale(0.97); }
.opt.is-off, .opt-check.is-off { opacity: 0.45; cursor: not-allowed; transition: opacity 160ms var(--ease-out); }
.opt-check.is-off:active { transform: none; }
/* A blocked option is not sent, so it never looks switched on, even if it was checked before. */
.opt-check.is-off:has(input:checked) { border-color: var(--line); background: var(--glass-sunken); color: var(--text-muted); }
.opt-check.is-off:has(input:checked) .icon { color: var(--text-faint); }
@media (prefers-reduced-motion: reduce) { .opt-check:active { transform: none; } }

.meter { color: var(--text-faint); font-size: 0.84rem; font-variant-numeric: tabular-nums; transition: color 200ms var(--ease-out); }
.meter.is-near { color: var(--warning); }
.meter.is-over { color: var(--danger); font-weight: 650; }
.kbd { display: inline-flex; align-items: center; gap: 3px; color: var(--text-faint); font-size: 0.78rem; }
.kbd kbd { padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--glass); font: 500 0.74rem/1.5 var(--font-ui); color: var(--text-muted); }

.below-window { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 22px; max-width: 920px; margin: 16px auto 0; color: var(--text-muted); font-size: 0.88rem; }
.below-window > span { display: inline-flex; align-items: center; gap: 8px; }
.below-window .icon { color: var(--text-faint); }
.turnstile { min-height: 65px; }

.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 36px auto 0; padding: 0; list-style: none; }
.facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  color: var(--text-muted);
  font-size: 0.86rem;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.facts .icon { color: var(--accent); }

/* ---------- Dashboard: split desk ---------- */
.desk { display: flex; flex-direction: column; gap: 20px; }
.desk-side {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--shadow-window);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
/* The list is opened many times a day, so it is there at once: no entrance motion.
   Search and filter load it in place (app.js): dimmed while loading, and it stops below the
   sticky header when scrolled to. */
.desk-side { scroll-margin-top: 84px; }
.desk-side .side-body { transition: opacity 160ms var(--ease-out); }
.desk-side[aria-busy="true"] .side-body { opacity: 0.55; }
.side-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 14px 16px 12px; }
.side-body { padding: 6px; }
.side-head + .side-body { padding-top: 0; }

.list { margin: 0; padding: 0; list-style: none; }
.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.list-item + .list-item { margin-top: 2px; }
.list-item:hover, .list-item:focus-within { background: var(--tint-2); box-shadow: inset 0 0 0 1px var(--line); }
.list-item:focus-within { box-shadow: inset 0 0 0 1px var(--line-strong); }
.list-title { display: flex; align-items: center; gap: 8px; overflow: hidden; color: var(--text); font-weight: 550; text-decoration: none; white-space: nowrap; }
.list-title span { overflow: hidden; text-overflow: ellipsis; }
.list-title .icon { color: var(--text-faint); transition: color 160ms var(--ease-out); }
.list-item:hover .list-title .icon { color: var(--accent); }
.list-title:hover { color: var(--accent); }
.list-meta { grid-column: 1 / 2; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; color: var(--text-faint); font-size: 0.8rem; }
.list-meta .mono { color: var(--text-muted); }
/* A thin divider between the facts in a row: id | Private | Expires | chars | views */
.list-meta > span + span::before { content: ""; display: inline-block; width: 1px; height: 11px; margin-right: 10px; vertical-align: -1px; background: var(--line-strong); }
.list-actions { grid-row: 1 / 3; grid-column: 2; display: flex; gap: 2px; opacity: 0.8; transition: opacity 160ms var(--ease-out); }
.list-item:hover .list-actions, .list-item:focus-within .list-actions { opacity: 1; }
.list-actions form { display: contents; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 24px;
  color: var(--text-muted);
  text-align: center;
}
.empty .icon { width: 2rem; height: 2rem; color: var(--text-faint); }
.empty.spaced { border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px; color: var(--text-muted); font-size: 0.88rem; }

/* ---------- Link ready ---------- */
.result { max-width: 640px; margin: 0 auto; }
.result-card { padding: clamp(22px, 4vw, 30px); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--glass-strong); box-shadow: var(--shadow-window); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); animation: rise 560ms var(--ease-out) both; }
.result-badge { display: inline-grid; place-items: center; width: 46px; height: 46px; margin-bottom: 16px; border-radius: var(--radius); background: var(--gradient); color: var(--accent-ink); box-shadow: 0 10px 28px -10px rgb(16 185 129 / 70%); }
.result-badge .icon { width: 24px; height: 24px; stroke-width: 2.8; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 600ms var(--ease-out) 300ms forwards; }
.result-card h1 { font-size: clamp(1.6rem, 3vw, 2rem); }
.result-card .lede { margin-top: 8px; color: var(--text-muted); }
.result-link { margin-top: 22px; }
.result-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.copy-row { display: flex; gap: 8px; }
.copy-row .input { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 0.88rem; }
.result-link .input { border-color: rgb(16 185 129 / 45%); animation: glow 1500ms var(--ease-out) 520ms both; }

.secret { display: flex; gap: 14px; margin-top: 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); animation: rise 560ms var(--ease-out) 120ms both; }
.secret > .icon { width: 20px; height: 20px; margin-top: 2px; color: var(--warning); }
.secret-body { flex: 1; min-width: 0; }
.secret-body p { margin-top: 10px; color: var(--text-muted); font-size: 0.88rem; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; animation: rise 560ms var(--ease-out) 240ms both; }

/* ---------- Reading a paste ---------- */
.doc-head { margin-bottom: 18px; animation: rise 500ms var(--ease-out) both; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.doc-window { max-width: none; }
.doc-text {
  display: block;
  width: 100%;
  height: clamp(260px, 56vh, 720px);
  padding: 18px 20px;
  border: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: transparent;
  color: var(--text);
  font: 400 0.92rem/1.7 var(--font-mono);
  resize: vertical;
}
.doc-text:focus-visible { outline: none; }
textarea.doc-text.standalone { border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); }
.doc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.doc-actions form { display: contents; }
.doc-actions .spacer { flex: 1; }
.window-foot.doc-actions { justify-content: flex-start; }
.paste-actions-standalone { margin-top: 14px; }

/* ---------- Panels (auth, small forms, messages) ---------- */
.panel { padding: clamp(22px, 4vw, 30px); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--glass-strong); box-shadow: var(--shadow-window); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); animation: rise 480ms var(--ease-out) both; }
.panel-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: 16px; border-radius: var(--radius); background: var(--gradient); color: var(--accent-ink); box-shadow: 0 10px 26px -12px rgb(16 185 129 / 70%); }
.panel-icon .icon { width: 22px; height: 22px; }
.panel-icon.is-warn { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.panel-icon.is-info { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.panel-icon.is-danger { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.danger-zone { margin-top: 16px; border-color: rgb(251 113 133 / 28%); }
.danger-head { display: flex; gap: 14px; align-items: flex-start; }
.danger-head .panel-icon { flex: none; margin-bottom: 0; }
.danger-head h2 { margin: 0 0 4px; }
.danger-zone .alert { margin: 18px 0 0; }
.danger-zone > :last-child { margin-bottom: 0; }
.danger-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 12px; align-items: end; margin-top: 16px; }
@media (max-width: 640px) { .danger-form { grid-template-columns: 1fr; } }
.panel h1 { font-size: clamp(1.6rem, 3vw, 2rem); }
.panel .lede { margin-top: 8px; color: var(--text-muted); }
.panel form { margin-top: 22px; }
.panel-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 20px; font-size: 0.94rem; }
.panel-compact { max-width: 520px; margin-top: 24px; }
.panel-compact h2 { margin-bottom: 4px; }

/* ---------- Header menus (account) ---------- */
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--glass-hover); border-color: var(--line-hover); }
/* Trigger: "≡ Menu", with the unread count as a red badge on its corner */
.account-trigger { position: relative; gap: 8px; padding: 7px 14px 7px 12px; }
.menu-glyph { color: var(--text-muted); transition: color 160ms var(--ease-out); }
.account-trigger:hover .menu-glyph, .menu[open] .menu-glyph { color: var(--text); }
.menu-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: #e11d48;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
  animation: pop-in 260ms var(--ease-out) both;
}
@media (prefers-reduced-motion: reduce) { .menu-badge { animation: none; } }
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.82rem;
}
.menu-pop {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 40;
  /* A small gap between items, so a hovered row never touches the current one */
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 260px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--solid);
  box-shadow: var(--shadow-pop);
  transform-origin: top right;
  animation: pop-in 200ms var(--ease-out) both;
}
.menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 6px; }
.avatar.avatar-lg { width: 34px; height: 34px; font-size: 0.95rem; }
.menu-who { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.menu-who strong { overflow: hidden; font-size: 0.92rem; text-overflow: ellipsis; white-space: nowrap; }
.menu-email { overflow: hidden; color: var(--text-muted); font-size: 0.85rem; text-overflow: ellipsis; white-space: nowrap; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: 500 0.92rem/1.2 var(--font-ui);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms var(--ease-out), color 140ms var(--ease-out);
}
.menu-item .icon { color: var(--text-faint); transition: color 140ms var(--ease-out), transform 200ms var(--ease-out); }
.menu-item:hover { background: var(--glass-hover); color: var(--text); }
.menu-item:hover .icon { color: var(--accent); transform: translateX(2px); }
.menu-item[aria-current="page"] { background: var(--accent-soft); }
.menu-item[aria-current="page"] .icon { color: var(--accent); }
.menu-item.is-danger:hover { background: var(--danger-soft); color: var(--danger); }
.menu-item.is-danger:hover .icon { color: var(--danger); }
.menu-sep { flex: none; height: 1px; margin: 4px; background: var(--line); }

/* ---------- Pricing ---------- */
.section.is-first { margin-top: 0; }
.plan-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.plan-price strong { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; }
.plan-price span { color: var(--text-muted); font-size: 0.86rem; }
.compare th:not(:first-child), .compare td:not(:first-child) { text-align: center; }
.compare td .icon { color: var(--accent); }
.compare td .icon.is-no { color: var(--text-faint); }
.pricing-note { max-width: 640px; margin: 18px auto 0; color: var(--text-faint); font-size: 0.86rem; text-align: center; }
.section-link { margin-top: 18px; text-align: center; }
.plan-buy { display: flex; flex-direction: column; gap: 8px; }
.checkout-status { margin-top: 14px; color: var(--text-muted); font-size: 0.92rem; }
.billing-facts { margin-top: 18px; }
.billing-note { margin-top: 14px; }

/* ---------- Profile ---------- */
/* Who you are, once: the plan tag here, email and dates in Account */
.profile-head { display: flex; align-items: center; gap: 14px; min-width: 0; margin-bottom: 18px; }
.profile-head .avatar { width: 48px; height: 48px; font-size: 1.3rem; border-radius: var(--radius); }
.profile-head h1 { min-width: 0; overflow: hidden; font-size: clamp(1.4rem, 3vw, 1.9rem); text-overflow: ellipsis; white-space: nowrap; }
.profile-head .tag { flex: none; }
.profile-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-cards h2 { margin-bottom: 12px; }
/* Usage in one line; the counts by kind are filters on Your pastes */
.usage { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); color: var(--text-muted); font-size: 0.93rem; }
.usage strong { color: var(--text); font-weight: 650; }
.usage a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-hover); text-underline-offset: 4px; transition: color 160ms var(--ease-out), text-decoration-color 160ms var(--ease-out); }
.usage a:hover { color: var(--text); text-decoration-color: currentColor; }
/* Default expiry under the plan facts: a setting, set apart by a line */
.plan-expiry { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.plan-expiry .alert { margin-bottom: 12px; }
/* Links like /profile#default-expiry stop below the sticky header */
.panel[id], .panel [id] { scroll-margin-top: 84px; }
.facts-list { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.facts-list div { display: flex; justify-content: space-between; gap: 12px; font-size: 0.93rem; }
.facts-list dt { color: var(--text-muted); }
.facts-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; text-align: right; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.username-form { margin-top: 18px; }
.username-form .alert { margin-bottom: 12px; }
.username-row { display: flex; gap: 8px; }
.username-row .input-prefix { flex: 1; min-width: 0; }
.input:disabled, .btn:disabled { opacity: 0.55; cursor: not-allowed; }
.profile-actions form { display: contents; }

/* ---------- Dialog (feedback) ---------- */
.dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}
.dialog::backdrop { background: rgb(4 6 5 / 62%); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dialog[open] { animation: dialog-in 260ms var(--ease-out) both; }
.dialog[open]::backdrop { animation: fade-in 200ms var(--ease-out) both; }
.dialog-card {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--solid);
  box-shadow: var(--shadow-pop);
}
.dialog-card [hidden] { display: none !important; }
.dialog-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.dialog-head > div { flex: 1; min-width: 0; }
.dialog-head h2 { font-size: 1.2rem; letter-spacing: -0.02em; }
.dialog-head p { margin-top: 2px; font-size: 0.9rem; }
.dialog-icon { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: var(--radius); background: var(--gradient); color: var(--accent-ink); box-shadow: 0 10px 24px -12px rgb(16 185 129 / 70%); }
.dialog-close { margin: -6px -6px 0 0; }
.topic-picker { margin: 0; padding: 0; border: 0; }
.topic-picker legend { margin-bottom: 8px; padding: 0; }
.topic-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.topic-option { position: relative; }
.topic-option input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.topic-option span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 550;
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.topic-option .icon { color: var(--text-faint); transition: color 160ms var(--ease-out), transform 220ms var(--ease-out); }
.topic-option:hover span { border-color: var(--line-strong); color: var(--text); }
.topic-option input:checked + span { border-color: rgb(16 185 129 / 55%); background: var(--accent-soft); color: var(--text); }
.topic-option input:checked + span .icon { color: var(--accent); transform: scale(1.12); }
.topic-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-optional { margin-left: 4px; color: var(--text-faint); font-weight: 500; }
.field-note { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.88rem; }
.field-note .icon { color: var(--accent); }
.dialog-done { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 0 6px; text-align: center; }
.dialog-done h3 { font-size: 1.15rem; }
.dialog-done .btn { margin-top: 10px; }
.done-badge { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); animation: pop 420ms var(--ease-out) both; }
.done-badge .icon { width: 26px; height: 26px; }

/* ---------- Legal pages ---------- */
.legal-head { margin-bottom: 16px; animation: rise 480ms var(--ease-out) both; }
.legal-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.035em; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 14px; }
.legal-nav [aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.legal { padding: clamp(20px, 4vw, 34px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); animation: rise 540ms var(--ease-out) both; }
.legal h2 { margin: 26px 0 8px; font-size: 1.15rem; letter-spacing: -0.02em; }
.legal > h2:first-child { margin-top: 0; }
.legal p, .legal li { color: var(--text-muted); line-height: 1.65; }
.legal p + p { margin-top: 10px; }
.legal ul { margin: 0; padding-left: 20px; }
.legal strong { color: var(--text); }
.legal a { color: var(--accent); }
.legal .table-wrap { margin: 10px 0; }
@media (max-width: 640px) {
  .legal table, .legal tbody, .legal tr, .legal td { display: block; }
  .legal thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .legal tr { padding: 12px 14px; border: 1px solid var(--line); }
  .legal tr + tr { border-top: 0; }
  .legal td { padding: 2px 0; border: 0; }
  .legal td:first-child { color: var(--text); font-weight: 600; }
}

/* ---------- Tables (admin) ---------- */
.table-wrap { overflow-x: auto; margin: 16px 0; border-radius: var(--radius); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--tint); font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
tbody tr { transition: background-color 160ms var(--ease-out); }
tbody tr:hover { background: var(--glass-hover); }
td .actions { display: flex; flex-wrap: wrap; gap: 6px; }
td form { display: inline; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 28px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 20px 0 0; padding: 0; list-style: none; }
.stats li { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); color: var(--text-muted); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.stats strong { display: block; color: var(--text); font-size: 2rem; line-height: 1.1; }
.search-row { max-width: 520px; margin-top: 20px; }
.feedback-list { display: flex; flex-direction: column; gap: 12px; margin: 20px 0 0; padding: 0; list-style: none; }
.feedback-item { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid rgb(16 185 129 / 35%); border-radius: var(--radius); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.feedback-item.is-handled { border-color: var(--line); opacity: 0.72; }
.feedback-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--text-muted); font-size: 0.85rem; }
.feedback-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback-item .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.feedback-item form { display: contents; }
.changelog { display: flex; flex-direction: column; gap: 14px; margin: 20px 0 0; padding: 0; list-style: none; }
.release { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); animation: rise 480ms var(--ease-out) both; }
.release.is-current { border-color: rgb(16 185 129 / 45%); background: var(--glass-strong); }
.release-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.release-head h2 { font-size: 1.15rem; letter-spacing: -0.02em; }
.release-changes { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 0.93rem; }
.release-changes li { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.change-kind { justify-self: start; padding: 1px 7px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text-muted); font-size: 0.75rem; font-weight: 600; }
.change-kind.is-added { border-color: rgb(16 185 129 / 45%); color: var(--accent); }
.change-kind.is-security { border-color: rgb(251 113 133 / 45%); color: var(--danger); }
@media (max-width: 640px) { .release-changes li { grid-template-columns: 1fr; gap: 4px; } }
code { font-family: var(--font-mono); font-size: 0.9em; color: var(--text-muted); }

/* ---------- Cookie notice ---------- */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px 14px;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 12px 12px 16px;
  border: 1px solid rgb(16 185 129 / 65%);
  border-radius: var(--radius);
  background: var(--solid);
  box-shadow: var(--shadow-pop), 0 18px 44px -22px rgb(16 185 129 / 45%);
  animation: slide-up 480ms var(--ease-out) 500ms both;
}
.cookie-banner > .icon { width: 20px; height: 20px; color: var(--text-muted); }
.cookie-banner p { flex: 1 1 auto; color: var(--text-muted); font-size: 0.88rem; }
.cookie-short { display: none; }
.cookie-actions { display: flex; flex: none; gap: 8px; }
body:has(.cookie-banner) .site-footer { padding-bottom: 112px; }

/* ---------- Page transitions (supporting browsers) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 220ms; }

/* ---------- Motion ---------- */
@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(3%, -2%, 0) rotate(4deg); }
  100% { transform: translate3d(-3%, 3%, 0) rotate(-3deg); }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 50% { transform: translateX(3px); } 75% { transform: translateX(-2px); } }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgb(16 185 129 / 0%); } 30% { box-shadow: 0 0 0 4px rgb(16 185 129 / 24%); } 100% { box-shadow: 0 0 0 0 rgb(16 185 129 / 0%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body::before { animation: none; }
  .result-badge .icon { stroke-dashoffset: 0; }
}

/* Without backdrop-filter, glass falls back to a solid tint so text stays readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .window, .panel, .result-card, .desk-side, .site-header, .menu-pop, .cookie-banner { background: var(--solid); }
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .site-header { top: 8px; width: calc(100% - 16px); margin-top: 8px; padding: 6px 6px 6px 10px; }
  .site-nav { gap: 2px; }
  .site-nav > .btn:not(.btn-keep-label) .btn-label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .site-nav > .btn:not(.btn-keep-label) { width: 36px; padding: 0; }
  .btn-keep-label .icon, .label-extra { display: none; }
  .site-nav .btn-keep-label { padding: 0 10px; }
  .hero { margin-bottom: 22px; }
  .hero .lede { font-size: 1rem; }
  .window-text { min-height: 170px; padding: 12px 14px 14px; }
  .compact .window-text { min-height: 160px; }
  .window-actions { width: 100%; justify-content: space-between; }
  .window-actions .btn { flex: 1; }
  .kbd { display: none; }
  .opt .input { width: 100%; }
  .menu-pop { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; }
  .account-label { display: none; }
  .account-trigger { width: 36px; padding: 0; }
  .account-trigger .menu-glyph { display: inline-block; width: 18px; height: 18px; }
  .profile-cards { grid-template-columns: 1fr; }
  .profile-head { gap: 12px; margin-bottom: 14px; }
  .profile-head .avatar { width: 40px; height: 40px; font-size: 1.1rem; }
  .cookie-banner { left: 12px; right: 12px; bottom: 12px; flex-wrap: wrap; padding: 10px 10px 10px 12px; }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; }
  .cookie-banner p { font-size: 0.84rem; }
  .cookie-long { display: none; }
  .cookie-short { display: inline; }
  body:has(.cookie-banner) .site-footer { padding-bottom: 140px; }
  .doc-text { height: clamp(220px, 50vh, 560px); }
}

/* ---------- Landing sections ---------- */
html { scroll-behavior: smooth; }
#editor { scroll-margin-top: 96px; }

.section { max-width: 1040px; margin: clamp(72px, 10vw, 120px) auto 0; }
.section-head { max-width: 620px; margin: 0 auto 28px; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; letter-spacing: -0.035em; }
.section-head .lede { margin-top: 10px; color: var(--text-muted); }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--highlight);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: transform 280ms var(--ease-out), border-color 220ms var(--ease-out), background-color 220ms var(--ease-out), box-shadow 280ms var(--ease-out);
}
.card:hover { transform: translateY(-3px); border-color: var(--line-strong); background: var(--glass-strong); box-shadow: var(--shadow-pop); }
.card-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; margin-bottom: 14px; border: 1px solid rgb(16 185 129 / 30%); border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); transition: transform 280ms var(--ease-out); }
.card:hover .card-icon { transform: rotate(-6deg) scale(1.06); }
.card h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1.02rem; letter-spacing: -0.015em; }
.card p { margin-top: 8px; color: var(--text-muted); font-size: 0.93rem; }

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.plan {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--highlight);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: transform 280ms var(--ease-out), border-color 220ms var(--ease-out);
}
.plan:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.plan.is-featured { border-color: rgb(16 185 129 / 45%); background: var(--glass-strong); box-shadow: var(--highlight), 0 26px 60px -28px rgb(16 185 129 / 50%); }
.plan h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1.1rem; }
.plan-sub { margin-top: -8px; color: var(--text-muted); font-size: 0.9rem; }
.plan-list { flex: 1; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 0.93rem; }
.plan-list li { display: flex; align-items: flex-start; gap: 9px; }
.plan-list .icon { margin-top: 3px; color: var(--accent); }
.btn.is-disabled { opacity: 0.55; cursor: not-allowed; }

.faq { max-width: 760px; margin: 0 auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.faq details { padding: 0 18px; transition: background-color 200ms var(--ease-out); }
.faq details + details { box-shadow: inset 0 1px 0 var(--line); }
.faq details[open] { background: var(--tint); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  transition: color 160ms var(--ease-out);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent); }
.faq-chevron { color: var(--text-faint); transition: transform 260ms var(--ease-out), color 160ms var(--ease-out); }
.faq details[open] .faq-chevron { transform: rotate(90deg); color: var(--accent); }
.faq details p { padding: 0 0 18px; color: var(--text-muted); font-size: 0.95rem; animation: rise 320ms var(--ease-out) both; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media (max-width: 960px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plans { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
}
@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
  .section { margin-top: 64px; }
}

/* Text files dropped on the editor, and the "Open file" button */
.file-pick { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.file-pick[hidden] { display: none; }
.file-note { color: var(--danger); font-size: 0.82rem; }
.window-text.is-dropping { outline: 2px dashed var(--accent); outline-offset: -8px; background: var(--accent-soft); transition: background 160ms var(--ease-out); }

/* QR code: a native disclosure, no script needed */
.qr-pop { position: relative; }
.qr-pop > summary { list-style: none; cursor: pointer; }
.qr-pop > summary::-webkit-details-marker { display: none; }
.qr-box { display: grid; justify-items: center; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); animation: qr-in 180ms var(--ease-out); }
.doc-actions .qr-box { position: absolute; z-index: 40; bottom: calc(100% + 8px); left: 0; width: 220px; border-color: var(--line-strong); background: var(--solid); box-shadow: var(--shadow-pop); }
.qr-inline { margin-top: 12px; }
.qr-inline .qr-box { width: max-content; max-width: 100%; margin: 10px auto 0; padding: 12px 16px; }
.qr-inline .qr-code { width: 140px; height: 140px; }
.qr-code { display: block; width: 180px; height: 180px; padding: 6px; border-radius: 4px; background: #fff; }
.qr-code svg { display: block; width: 100%; height: 100%; }
.qr-box small { color: var(--text-muted); font-size: 0.8rem; text-align: center; }
@keyframes qr-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .qr-box { animation: none; } }

/* Search and filter row above the list of pastes */
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.list-search { flex: 1 1 200px; }
.list-search .input { width: 100%; }
@media (max-width: 640px) {
  .list-tools .opt, .list-tools .btn { flex: 1 1 100%; }
  .list-tools .opt .select { width: 100%; }
}

/* "Share with" row under the editor bar. It slides open when Private is on; the bar above
   never reflows, and the text area moves down smoothly instead of jumping. */
/* The row hides its content while closed (overflow), so the open row keeps room for the 3px focus ring. */

/* Theme switch (menu and footer): a form whose button keeps the look of its row */
.theme-form { display: contents; }
.theme-form button > span { display: inline-flex; align-items: center; gap: inherit; }
.theme-form button > span[hidden] { display: none; }
.footer-link .theme-to-light, .footer-link .theme-to-dark { gap: 6px; }

/* ---------- Numbered lines on the paste page ---------- */
.code {
  max-height: clamp(260px, 62vh, 760px);
  overflow: auto;
  padding: 12px 0;
  border-radius: var(--radius) var(--radius) 0 0;
  font: 400 0.9rem/1.7 var(--font-mono);
  tab-size: 4;
  counter-reset: none;
}
.code-line { position: relative; display: grid; grid-template-columns: max-content minmax(0, 1fr); scroll-margin: 40vh 0; }
.code-num {
  min-width: 3.4em;
  padding: 0 14px 0 16px;
  color: var(--text-faint);
  text-align: right;
  text-decoration: none;
  user-select: none;
  font-variant-numeric: tabular-nums;
  transition: color 120ms var(--ease-out);
}
.code-num:hover { color: var(--accent); }
.code-text { min-width: 0; padding-right: 20px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.code-text:empty::before { content: "\200b"; }
.code-line:hover { background: var(--tint); }
/* The line from the link (#L12): an emerald wash and the number in emerald. */
/* With JavaScript the marked line follows clicks (.is-target); without it, the URL (:target). */
.code-line.is-target, html:not(.js) .code-line:target { background: var(--accent-soft); }
.code-line.is-target .code-num, html:not(.js) .code-line:target .code-num { color: var(--accent); font-weight: 600; }
.line-tools { position: absolute; z-index: 5; top: 50%; right: 10px; display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--solid); box-shadow: var(--shadow-pop); transform: translateY(-50%); animation: line-tools-in 140ms var(--ease-out) both; }
@keyframes line-tools-in { from { opacity: 0; } to { opacity: 1; } }
.btn.btn-sm { min-height: 28px; padding: 3px 9px; gap: 6px; font-size: 0.8rem; }
.btn.btn-sm .icon { width: 14px; height: 14px; }
.line-tools[hidden] { display: none; }
.code-note { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 20px; color: var(--text-faint); font-size: 0.8rem; }
@media (max-width: 640px) {
  .code { font-size: 0.82rem; }
  .code-num { min-width: 2.8em; padding: 0 10px 0 8px; }
  .line-tools { top: auto; bottom: calc(100% + 2px); right: 4px; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .line-tools { animation: none; } }

/* Custom link field: "/p/" stays in front of what you type */
.opt-link .opt-prefix { position: absolute; left: 30px; color: var(--text-faint); font: 500 0.85rem var(--font-mono); pointer-events: none; }
.opt-link .input { width: 250px; padding-left: 56px; font-family: var(--font-mono); font-size: 0.85rem; }

/* ---------- Profile: security and your data ---------- */
.security-panel, .data-panel { margin-top: 16px; }
.security-panel > h2 { margin-bottom: 14px; }
.security-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.security-icon { display: inline-grid; flex: none; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass-sunken); color: var(--text-faint); }
.security-icon.is-on { border-color: rgb(16 185 129 / 45%); background: var(--accent-soft); color: var(--accent); }
.security-text { flex: 1 1 260px; min-width: 0; }
.security-text h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-size: 1rem; letter-spacing: -0.01em; }
.security-off { margin-top: 10px; }
.security-off > summary { list-style: none; cursor: pointer; }
.security-off > summary::-webkit-details-marker { display: none; }
.sessions { margin-top: 26px; }
.sessions-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.sessions-head h3 { margin: 0; font-size: 1rem; letter-spacing: -0.01em; }
.sessions .list-item { padding-left: 4px; padding-right: 4px; }
.data-panel .danger-head { flex-wrap: wrap; align-items: center; }
.data-panel .danger-head > div { flex: 1 1 280px; }
.data-form { margin-left: auto; }
/* Phones: the text beside its icon, not on a row of its own */
@media (max-width: 640px) { .data-panel .danger-head > div { flex-basis: calc(100% - 58px); } }

/* 2FA setup and backup codes */
.setup-steps { display: grid; gap: 18px; margin: 18px 0 8px; padding-left: 20px; }
.setup-steps li::marker { color: var(--accent); font-weight: 650; }
.setup-steps p { margin: 0 0 8px; }
.qr-setup { width: 168px; height: 168px; margin: 4px 0 10px; }
.setup-key { padding: 2px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--glass-sunken); font-family: var(--font-mono); font-size: 0.85rem; overflow-wrap: anywhere; }
.input-code { font-family: var(--font-mono); font-size: 1.15rem; letter-spacing: 0.18em; text-align: center; }
.backup-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 18px 0; padding: 0; list-style: none; }
.backup-codes code { display: block; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--glass-sunken); font: 500 0.95rem var(--font-mono); text-align: center; letter-spacing: 0.06em; }

/* ---------- Confirm dialog (replaces the browser's confirm box) ---------- */
.dialog-confirm .dialog-card { width: min(420px, calc(100vw - 32px)); }
.confirm-body { display: flex; align-items: flex-start; gap: 14px; }
.confirm-body h2 { font-size: 1.15rem; letter-spacing: -0.02em; }
.confirm-body p { margin-top: 4px; font-size: 0.9rem; }
.dialog-icon.is-danger { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.dialog-confirm .alert { margin: 16px 0 0; }
.btn.btn-solid-danger { border-color: transparent; background: var(--danger); color: #fff; }
.btn.btn-solid-danger:hover { background: var(--danger); filter: brightness(1.08); color: #fff; }
.btn.btn-solid-danger:disabled { opacity: 0.6; cursor: progress; }

/* A row deleted from the list fades and folds away */
.list-item.is-leaving { overflow: hidden; animation: row-out 240ms var(--ease-out) forwards; }
@keyframes row-out {
  from { opacity: 1; max-height: 80px; }
  to { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; }
}

/* Signed-in sessions: one card per browser, the facts in labelled columns */
.session-list { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.session { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass-sunken); }
.session.is-current { border-color: rgb(16 185 129 / 40%); }
.session-icon { display: inline-grid; flex: none; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); color: var(--text-muted); }
.session.is-current .session-icon { border-color: rgb(16 185 129 / 35%); background: var(--accent-soft); color: var(--accent); }
.session-main { flex: 1; min-width: 0; }
.session-device { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--text); font-weight: 600; }
.session-facts { display: flex; flex-wrap: wrap; gap: 4px 26px; margin: 0; }
.session-facts div { display: grid; gap: 1px; }
.session-facts dt { color: var(--text-faint); font-size: 0.72rem; letter-spacing: 0.02em; text-transform: uppercase; }
.session-facts dd { margin: 0; color: var(--text-muted); font-size: 0.86rem; }
.session-facts .mono { color: var(--text); font-family: var(--font-mono); }
.session-action { flex: none; }
@media (max-width: 640px) {
  .session { flex-wrap: wrap; }
  .session-action { width: 100%; }
  .session-action .btn { width: 100%; }
}

/* A filled-in option field (password, custom link) is "on": emerald like the toggles */
.opt .input:not(:placeholder-shown):not(:disabled) { border-color: rgb(16 185 129 / 60%); background-color: var(--accent-soft); }
.opt:has(.input:not(:placeholder-shown):not(:disabled)) > .icon { color: var(--accent); }

/* ---------- Syntax highlighting (server-side highlight.js classes) ---------- */
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-built_in, .hljs-doctag { color: var(--hl-keyword); }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-template-tag, .hljs-selector-attr { color: var(--hl-string); }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-variable.constant_ { color: var(--hl-number); }
.hljs-comment, .hljs-quote { color: var(--hl-comment); font-style: italic; }
.hljs-title, .hljs-section, .hljs-title.function_, .hljs-selector-id { color: var(--hl-title); }
.hljs-attr, .hljs-attribute, .hljs-property, .hljs-name, .hljs-tag, .hljs-selector-class, .hljs-template-variable { color: var(--hl-attr); }
.hljs-type, .hljs-title.class_, .hljs-params, .hljs-variable { color: var(--hl-type); }
.hljs-meta, .hljs-punctuation, .hljs-operator, .hljs-subst { color: var(--hl-meta); }
.hljs-deletion { color: var(--hl-deletion); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }
.hljs-link { color: var(--hl-title); text-decoration: underline; }

/* Language picker in the editor footer */
.opt-lang .select { min-width: 150px; }

/* Preview / Source switch for Markdown pastes */
.view-tabs { display: inline-flex; gap: 4px; margin: 0 0 12px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass-sunken); }
.view-tab { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 0.86rem; font-weight: 550; text-decoration: none; transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out); }
.view-tab:hover { color: var(--text); }
.view-tab[aria-current="page"] { background: var(--glass-strong); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.view-tab[aria-current="page"] .icon { color: var(--accent); }

/* ---------- Formatted Markdown ---------- */
.md-body { max-height: clamp(260px, 62vh, 760px); overflow: auto; padding: 22px 26px; color: var(--text); font-size: 0.98rem; line-height: 1.7; overflow-wrap: anywhere; }
.md-body > :first-child { margin-top: 0; }
.md-body > :last-child { margin-bottom: 0; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4, .md-body h5, .md-body h6 { margin: 1.4em 0 0.5em; line-height: 1.25; letter-spacing: -0.02em; }
.md-body h1 { font-size: 1.7rem; }
.md-body h2 { font-size: 1.35rem; }
.md-body h3 { font-size: 1.12rem; }
.md-body h4, .md-body h5, .md-body h6 { font-size: 1rem; }
.md-body p, .md-body ul, .md-body ol, .md-body table, .md-body pre, .md-body blockquote { margin: 0 0 1em; }
.md-body ul, .md-body ol { padding-left: 1.4em; }
.md-body li + li { margin-top: 0.25em; }
.md-body li::marker { color: var(--accent); }
.md-body code { padding: 1px 5px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--glass-sunken); font: 0.88em var(--font-mono); }
.md-body pre { overflow: auto; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--code-sunken); }
.md-body pre code { padding: 0; border: 0; background: none; font-size: 0.88rem; line-height: 1.6; }
.md-body blockquote { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--tint); color: var(--text-muted); }
.md-body blockquote > :last-child { margin-bottom: 0; }
.md-body hr { height: 1px; margin: 1.6em 0; border: 0; background: var(--line-strong); }
.md-body table { display: block; overflow-x: auto; border-collapse: collapse; }
.md-body th, .md-body td { padding: 6px 12px; border: 1px solid var(--line); text-align: left; }
.md-body a { word-break: break-word; }
@media (max-width: 640px) { .md-body { padding: 16px; } }

/* Editor: Write / Preview switch and the preview area */
.editor-tabs { margin: 0; }
.editor-tabs .view-tab { padding: 3px 10px; border: 0; background: none; font: inherit; font-size: 0.84rem; cursor: pointer; }
.editor-tabs .view-tab[aria-selected="true"] { background: var(--glass-strong); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.editor-tabs .view-tab[aria-selected="true"] .icon { color: var(--accent); }
.editor-tabs[hidden] { display: none; }
.window-preview { max-height: 70vh; overflow: auto; }
.window-preview .code { max-height: none; }
.window-preview .md-body { max-height: none; }
.preview-note { margin: 0; padding: 10px 20px 0; color: var(--text-faint); font-size: 0.8rem; }
.preview-note.is-error { padding-bottom: 12px; color: var(--danger); }
.window-text[hidden], .window-preview[hidden] { display: none; }

/* Password: a button until clicked, then the field (app.js) */
.pw-wrap { display: inline-flex; }
.pw-wrap [hidden] { display: none; }
.pw-toggle { font-family: inherit; }
.pw-wrap .opt .input { width: 170px; }

/* Paste count in the list header: plain text, no cards */
.desk-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0; color: var(--text-muted); font-size: 0.88rem; }
.desk-count strong { color: var(--text); font-weight: 650; }
.desk-count-left { color: var(--text-faint); }
.desk-count-left strong { color: var(--text-muted); }
.desk-count-links { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; transition: color 0.15s ease; }
.desk-count-links .icon { width: 13px; height: 13px; align-self: center; }
.desk-count-links:hover, .desk-count-links:hover strong { color: var(--accent); }
.pw-wrap .opt-link .input { width: 210px; }

/* Editor footer: Open file, Write / Preview and the language picker share one look:
   32px tall, the same frame, background and text size. */
.foot-control { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass-sunken); color: var(--text-muted); font-size: 0.87rem; font-weight: 500; cursor: pointer; transition: border-color 160ms var(--ease-out), color 160ms var(--ease-out); }
.foot-control:hover { border-color: var(--line-strong); color: var(--text); }
.foot-control:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.foot-control .icon { width: 16px; height: 16px; color: var(--text-faint); }
.editor-tabs { box-sizing: border-box; height: 32px; padding: 2px; gap: 2px; align-items: stretch; }
.editor-tabs .view-tab { padding: 0 10px; font-size: 0.87rem; font-weight: 500; }
.opt-lang .select { height: 32px; min-height: 32px; padding-top: 0; padding-bottom: 0; border-color: var(--line); background-color: var(--glass-sunken); font-size: 0.87rem; }

/* Small tooltip in our style: <button class="has-tip" data-tip="Ctrl + Enter">. Shown on hover and keyboard focus. */
.has-tip { position: relative; }
.has-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 20;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--solid);
  box-shadow: var(--shadow-pop);
  color: var(--text-muted);
  font: 500 0.75rem/1.4 var(--font-ui);
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 140ms var(--ease-out), transform 140ms var(--ease-out);
}
.has-tip:hover::after, .has-tip:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: 250ms; }
@media (prefers-reduced-motion: reduce) { .has-tip::after { transition: none; } }
@media (hover: none) { .has-tip::after { display: none; } }

/* Search row above the list: Find and Clear as tall as the search field and the filter (32px) */
.list-tools .btn { height: 32px; min-height: 32px; padding: 0 12px; font-size: 0.87rem; }
.list-tools .btn .icon { width: 16px; height: 16px; }

/* Admin menu: the page you are on */
.admin-nav a[aria-current="page"] { border-color: rgb(16 185 129 / 45%); background: var(--accent-soft); color: var(--text); }
.admin-nav a[aria-current="page"] .icon { color: var(--accent); }

/* ---------- Notifications ---------- */
.menu-count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: #e11d48; color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 18px; text-align: center; }
.notice-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.notice { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); }
.notice.is-new { border-color: rgb(16 185 129 / 45%); background: var(--accent-soft); }
.notice-icon { display: inline-grid; flex: none; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass-sunken); color: var(--text-muted); }
.notice.is-new .notice-icon { color: var(--accent); }
.notice-main { flex: 1; min-width: 0; }
.notice-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 4px; color: var(--text); font-weight: 600; }
.notice-body { margin: 0 0 6px; color: var(--text-muted); font-size: 0.92rem; }
.notice-meta { margin: 0; color: var(--text-faint); font-size: 0.8rem; }
.empty-panel { display: flex; align-items: center; gap: 14px; }
.empty-panel .panel-icon { margin-bottom: 0; }
.empty-panel p { margin: 0; color: var(--text-muted); }
@media (max-width: 640px) { .notice { flex-wrap: wrap; } .notice .btn { width: 100%; } }
.links-panel { margin-top: 16px; }
.links-panel > h2 { margin-bottom: 4px; }
.links-panel .session-list { margin-top: 14px; }
.links-empty { margin: 12px 0 0; color: var(--text-faint); font-size: 0.9rem; }
.session-device .mono { font-family: var(--font-mono); }

/* ---------- Phone layout (≤ 640px): editor options, editor footer, paste page buttons ---------- */
@media (max-width: 640px) {
  /* Editor options: an even two-column grid; every option is a full cell, text centered. */
  .window-bar { gap: 8px; padding: 10px; }
  .window-title { flex-basis: 100%; }
  .window-foot:has(> .foot-options) { gap: 8px; padding: 10px; }
  .window-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .window-options > .opt, .window-options > .opt-check, .window-options > .pw-wrap { width: 100%; min-width: 0; }
  .window-options .opt .select, .window-options .opt .input, .pw-wrap .opt, .pw-wrap .opt .input, .pw-wrap .opt-link .input { width: 100%; }
  .window-options .opt-check { justify-content: center; min-height: 38px; }
  .window-options .opt .select, .window-options .opt .input { min-height: 38px; }
  .pw-wrap > * { width: 100%; }

  /* Editor footer, second row: Write / Preview across the width, then Open file and Syntax side by
     side, the language picker under them when Syntax is on, then the count and a full-width Create link. */
  .foot-main { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .foot-main .window-note { grid-column: 1 / -1; }
  .foot-main .editor-tabs { grid-column: 1 / -1; order: -1; height: 38px; }
  .foot-main .editor-tabs .view-tab { flex: 1; justify-content: center; }
  .foot-main .file-pick, .foot-main .file-pick .foot-control { width: 100%; justify-content: center; }
  .foot-main .file-pick .foot-control, .foot-main .opt-lang .select { height: 38px; min-height: 38px; }
  .foot-main .syntax-wrap { display: contents; }
  .foot-main .syntax-chip { justify-content: center; min-height: 38px; }
  .foot-main .opt-lang { grid-column: 1 / -1; }
  .foot-main .opt-lang, .foot-main .opt-lang .select { width: 100%; min-width: 0; }
  .foot-main .window-actions { grid-column: 1 / -1; margin-left: 0; gap: 12px; }
  .foot-main .file-pick { flex-wrap: wrap; }
  .foot-main .file-note { flex-basis: 100%; text-align: center; }

  /* Paste page: Copy text across the width, then Raw · Download · QR code in three equal parts,
     then Report · Delete in two. */
  .doc-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; }
  .doc-actions > .btn-primary { flex: 1 1 100%; }
  .doc-actions > .btn-secondary, .doc-actions > .qr-pop { flex: 1 1 calc((100% - 16px) / 3); min-width: 0; }
  .doc-actions > .qr-pop > summary { width: 100%; justify-content: center; border: 1px solid var(--line); }
  .doc-actions .spacer { display: none; }
  .doc-actions > a.btn-ghost, .doc-actions form .btn-danger { flex: 1 1 calc((100% - 8px) / 2); }
  .doc-actions > a.btn-ghost { border: 1px solid var(--line-strong); }
  .doc-actions > .btn, .doc-actions form .btn { justify-content: center; min-height: 40px; padding-left: 8px; padding-right: 8px; }
  .doc-actions .qr-box { left: 50%; margin-left: -110px; }
}

/* Narrow screens: the editor options fold behind one "Options" button, so the text gets the room.
   Only with JavaScript (html.js); without it every option stays visible. */
.options-toggle { display: none; }
@media (max-width: 640px) {
  .js .options-toggle {
    display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass-sunken);
    color: var(--text); font: 500 0.9rem var(--font-ui); cursor: pointer; text-align: left;
  }
  .js .options-toggle[hidden] { display: none; }
  .options-toggle .icon { flex: none; color: var(--text-faint); }
  .options-summary { flex: 1; min-width: 0; overflow: hidden; color: var(--text-muted); font-size: 0.82rem; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
  .options-chevron { transition: transform 200ms var(--ease-out); }
  .options-toggle[aria-expanded="true"] { border-color: rgb(16 185 129 / 45%); }
  .options-toggle[aria-expanded="true"] .options-chevron { transform: rotate(180deg); color: var(--accent); }
  .js .foot-options:not(.is-open) > .window-options { display: none; }
  .js .foot-options.is-open > .window-options { animation: options-in 200ms var(--ease-out); }
  .window-text { min-height: 240px; }
  .compact .window-text { min-height: 220px; }
}
@keyframes options-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .js .foot-options.is-open > .window-options { animation: none; } .options-chevron { transition: none; } }

/* The QR popover opens below the button when there is no room above it (app.js sets is-below). */
.doc-actions .qr-pop.is-below .qr-box { top: calc(100% + 8px); bottom: auto; }

/* Phones: the QR code opens in the middle of the screen over a dimmed page; a tap outside closes it. */
@media (max-width: 640px) {
  .doc-actions .qr-pop .qr-box,
  .doc-actions .qr-pop.is-below .qr-box {
    position: fixed; inset: 0; z-index: 61; width: 240px; height: fit-content; margin: auto;
    padding: 18px; border-color: var(--line-strong); background: var(--solid); box-shadow: var(--shadow-pop);
  }
  .doc-actions .qr-pop .qr-code { width: 190px; height: 190px; }
  .doc-actions .qr-pop[open]::before { content: ""; position: fixed; inset: 0; z-index: 60; background: rgb(0 0 0 / 55%); }
}
@media (max-width: 640px) {
  /* The glass blur and the entrance animation make the window the frame for fixed elements;
     while the QR code is open they are switched off, so it is centered on the screen itself. */
  .doc-window:has(.qr-pop[open]) { -webkit-backdrop-filter: none; backdrop-filter: none; transform: none; animation: none; }
}

/* ---------- Secure pastes ---------- */
/* Paste page before it is decrypted: what is going on, and a box for the key when the link has none. */
.secure-locked { display: grid; justify-items: center; gap: 10px; padding: 44px 20px; text-align: center; }
.secure-locked-icon { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid rgb(16 185 129 / 45%); border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); animation: secure-pulse 2.4s var(--ease-out) infinite; }
.secure-locked-icon .icon { width: 22px; height: 22px; }
.secure-locked h2 { margin: 0; font-size: 1.1rem; }
.secure-locked p { max-width: 50ch; margin: 0; color: var(--text-muted); font-size: 0.92rem; }
.secure-key-form { width: min(100%, 560px); margin-top: 6px; }
.secure-key-form .input { font-family: var(--font-mono); font-size: 0.85rem; }
.secure-view .code:not([hidden]), .secure-view .doc-text:not([hidden]) { animation: secure-open 360ms var(--ease-out) both; }
@keyframes secure-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgb(16 185 129 / 0%); } 50% { box-shadow: 0 0 0 6px rgb(16 185 129 / 12%); } }
@keyframes secure-open { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .secure-locked-icon, .secure-view .code:not([hidden]), .secure-view .doc-text:not([hidden]) { animation: none; } }

/* "Your link is ready": save the link or the key as a file. */
.secure-save { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.secure-save .field-hint { flex-basis: 100%; margin: 2px 0 0; }
.secure-missing { margin-top: 14px; }
@media (max-width: 640px) {
  .secure-save .btn { flex: 1 1 100%; justify-content: center; }
  .secure-locked { padding: 32px 14px; }
  .secure-key-form { flex-direction: column; }
  .secure-key-form .btn { width: 100%; justify-content: center; }
}
