/*
 * Corectly design system v0.5.
 * One accent (deep teal) with a gold highlight, warm paper neutrals, system
 * fonts only (no web-font download, fast first paint), a serif for text being
 * read, light and dark themes, WCAG 2.2 AA contrast. Motion is short, eased
 * and purposeful, and switches off with prefers-reduced-motion.
 */

/* ---- Tokens ----------------------------------------------------------- */

:root {
  color-scheme: light;

  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-read: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif", serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --bg: #f7f6f2;
  --bg-2: #efede6;
  --surface: #ffffff;
  --surface-2: #f4f2ec;
  --surface-3: #e7e3d9;
  --border: #e0dcd2;
  --border-strong: #8d877a;
  --text: #17201c;
  --muted: #56615c;
  --accent: #0f6b5c;
  --accent-hover: #0b5649;
  --accent-soft: #dcefe9;
  --accent-softer: #eef7f4;
  --on-accent: #ffffff;
  --gold: #f3c969;
  --gold-strong: #a86f00;
  --gold-ink: #7a5200;
  --gold-soft: #fcf1d2;
  --danger: #b3261e;
  --danger-soft: #fbeceb;
  --warning: #8a5a00;
  --warning-soft: #fdf3dc;
  --success: #18794e;
  --success-soft: #e3f3ea;
  --info: #1f5f8b;
  --info-soft: #e7f0f8;
  --exact: #d0492f;
  --near: #b9800f;
  --match-exact: #fbd3ca;
  --match-near: #fdebb5;
  --phrase: #fbd9d3;
  --zone-low: #cfe9e0;
  --zone-mixed: #f7e3a8;
  --zone-high: #f4c9c0;
  --added: rgba(15, 107, 92, 0.16);
  --removed: rgba(179, 38, 30, 0.12);
  --topbar-bg: rgba(247, 246, 242, 0.82);
  --glow-1: rgba(15, 107, 92, 0.16);
  --glow-2: rgba(243, 201, 105, 0.26);
  --grid-line: rgba(23, 32, 28, 0.05);
  --focus: #0f6b5c;
  --toast-bg: #1d2421;
  --toast-text: #f1f4f2;
  --toast-border: rgba(255, 255, 255, 0.06);
  --backdrop: rgba(12, 17, 15, 0.48);

  --shadow-sm: 0 1px 2px rgba(23, 32, 28, 0.06);
  --shadow: 0 1px 2px rgba(23, 32, 28, 0.05), 0 4px 14px rgba(23, 32, 28, 0.06);
  --shadow-lg: 0 2px 4px rgba(23, 32, 28, 0.04), 0 22px 44px -14px rgba(23, 32, 28, 0.2);
  --shadow-accent: 0 10px 24px -12px rgba(15, 107, 92, 0.6);

  --r-xs: 6px;
  --r-sm: 9px;
  --r: 12px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 22px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --wrap: 1180px;
  --wrap-narrow: 760px;
  --topbar-h: 64px;
  --gutter: clamp(16px, 4vw, 32px);

  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --i-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --i-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
  --i-dash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M7 12h10'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101513;
    --bg-2: #131a17;
    --surface: #171d1a;
    --surface-2: #1d2521;
    --surface-3: #28312d;
    --border: #2b3430;
    --border-strong: #6b7570;
    --text: #e8ece9;
    --muted: #a3ada7;
    --accent: #5cc4ae;
    --accent-hover: #7dd3c0;
    --accent-soft: rgba(92, 196, 174, 0.16);
    --accent-softer: rgba(92, 196, 174, 0.08);
    --on-accent: #06120e;
    --gold-strong: #f3c969;
    --gold-ink: #f6d68a;
    --gold-soft: rgba(243, 201, 105, 0.13);
    --danger: #ff8a80;
    --danger-soft: rgba(255, 138, 128, 0.12);
    --warning: #f2c14e;
    --warning-soft: rgba(242, 193, 78, 0.12);
    --success: #6fd49b;
    --success-soft: rgba(111, 212, 155, 0.12);
    --info: #8cc4ef;
    --info-soft: rgba(140, 196, 239, 0.12);
    --exact: #ff8a6b;
    --near: #f2c14e;
    --match-exact: rgba(255, 138, 107, 0.3);
    --match-near: rgba(242, 193, 78, 0.26);
    --phrase: rgba(255, 138, 128, 0.24);
    --zone-low: rgba(92, 196, 174, 0.32);
    --zone-mixed: rgba(242, 193, 78, 0.32);
    --zone-high: rgba(255, 138, 128, 0.32);
    --added: rgba(92, 196, 174, 0.22);
    --removed: rgba(255, 138, 128, 0.16);
    --topbar-bg: rgba(16, 21, 19, 0.8);
    --glow-1: rgba(92, 196, 174, 0.14);
    --glow-2: rgba(243, 201, 105, 0.09);
    --grid-line: rgba(255, 255, 255, 0.035);
    --focus: #7dd3c0;
    --toast-bg: #26302b;
    --toast-text: #eef2ef;
    --toast-border: #37433d;
    --backdrop: rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, 0.65);
    --shadow-accent: 0 10px 26px -12px rgba(92, 196, 174, 0.5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101513;
  --bg-2: #131a17;
  --surface: #171d1a;
  --surface-2: #1d2521;
  --surface-3: #28312d;
  --border: #2b3430;
  --border-strong: #6b7570;
  --text: #e8ece9;
  --muted: #a3ada7;
  --accent: #5cc4ae;
  --accent-hover: #7dd3c0;
  --accent-soft: rgba(92, 196, 174, 0.16);
  --accent-softer: rgba(92, 196, 174, 0.08);
  --on-accent: #06120e;
  --gold-strong: #f3c969;
  --gold-ink: #f6d68a;
  --gold-soft: rgba(243, 201, 105, 0.13);
  --danger: #ff8a80;
  --danger-soft: rgba(255, 138, 128, 0.12);
  --warning: #f2c14e;
  --warning-soft: rgba(242, 193, 78, 0.12);
  --success: #6fd49b;
  --success-soft: rgba(111, 212, 155, 0.12);
  --info: #8cc4ef;
  --info-soft: rgba(140, 196, 239, 0.12);
  --exact: #ff8a6b;
  --near: #f2c14e;
  --match-exact: rgba(255, 138, 107, 0.3);
  --match-near: rgba(242, 193, 78, 0.26);
  --phrase: rgba(255, 138, 128, 0.24);
  --zone-low: rgba(92, 196, 174, 0.32);
  --zone-mixed: rgba(242, 193, 78, 0.32);
  --zone-high: rgba(255, 138, 128, 0.32);
  --added: rgba(92, 196, 174, 0.22);
  --removed: rgba(255, 138, 128, 0.16);
  --topbar-bg: rgba(16, 21, 19, 0.8);
  --glow-1: rgba(92, 196, 174, 0.14);
  --glow-2: rgba(243, 201, 105, 0.09);
  --grid-line: rgba(255, 255, 255, 0.035);
  --focus: #7dd3c0;
  --toast-bg: #26302b;
  --toast-text: #eef2ef;
  --toast-border: #37433d;
  --backdrop: rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, 0.65);
  --shadow-accent: 0 10px 26px -12px rgba(92, 196, 174, 0.5);
}

/* ---- Base ------------------------------------------------------------- */

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 12px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body:has(dialog[open]) {
  overflow: hidden;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent-hover);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  max-width: 100%;
}

code,
pre {
  font-family: var(--font-mono);
}

::selection {
  background: var(--accent-soft);
}

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

:focus:not(:focus-visible) {
  outline: none;
}

/* Headings that take focus when a result appears are not controls: mark them
   with an underline instead of a box. */
h2[tabindex="-1"]:focus-visible,
h3[tabindex="-1"]:focus-visible {
  outline: none;
  text-decoration-line: underline;
  text-decoration-color: var(--focus);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

.clip-helper {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--r);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease-out), opacity 0.2s var(--ease);
}

.skip-link:focus {
  opacity: 1;
  pointer-events: auto;
  transform: none;
  color: var(--on-accent);
}

.noscript {
  margin: 16px auto;
  max-width: var(--wrap-narrow);
  padding: 12px 16px;
  border-radius: var(--r);
  background: var(--warning-soft);
  color: var(--text);
  text-align: center;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wrap.narrow {
  max-width: calc(var(--wrap-narrow) + 2 * var(--gutter));
}

.hint {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--muted);
}

.center {
  text-align: center;
}

/* ---- Icons and logo --------------------------------------------------- */

.ic {
  display: inline-block;
  flex: none;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ic-fill {
  fill: currentColor;
}

.logo {
  display: block;
  width: auto;
  height: 28px;
}

.logo-mark {
  fill: var(--accent);
}

.logo-word {
  fill: var(--text);
}

.theme-sun {
  display: none !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-moon {
    display: none !important;
  }

  :root:not([data-theme="light"]) .theme-sun {
    display: inline-block !important;
  }
}

:root[data-theme="dark"] .theme-moon {
  display: none !important;
}

:root[data-theme="dark"] .theme-sun {
  display: inline-block !important;
}

/* ---- Buttons ---------------------------------------------------------- */

.btn {
  --spin: currentColor;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: transparent;
  color: var(--text);
  font-weight: 650;
  font-size: 0.97rem;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.2s var(--ease), transform 0.15s var(--ease);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  color: var(--on-accent);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -12px rgba(15, 107, 92, 0.6);
}

.btn-soft {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-soft:hover:not(:disabled) {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-ghost {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-lg {
  min-height: 52px;
  padding: 0 24px;
  border-radius: var(--r-md);
  font-size: 1.04rem;
}

.btn-sm {
  min-height: 36px;
  padding: 0 13px;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
}

.btn .ic {
  width: 1.1em;
  height: 1.1em;
  transition: transform 0.25s var(--spring);
}

.btn:hover .ic {
  transform: translateX(1px) scale(1.06);
}

.btn-label {
  white-space: nowrap;
}

/* A spinner takes the icon's place while a request runs. */
.is-busy {
  cursor: progress !important;
}

.btn.is-busy > .ic,
.tool-btn.is-busy > .ic {
  display: none;
}

.btn.is-busy::before,
.tool-btn.is-busy::before {
  content: "";
  flex: none;
  width: 1em;
  height: 1em;
  border: 2px solid var(--spin, currentColor);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.is-busy:disabled {
  opacity: 0.85;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 700;
  font-size: inherit;
  text-decoration: none;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.link-btn .ic {
  transition: transform 0.25s var(--spring);
}

.link-btn:hover .ic {
  transform: translateX(3px);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.15s var(--ease);
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn .ic {
  width: 20px;
  height: 20px;
}

#theme-toggle .ic {
  transition: transform 0.45s var(--spring);
}

#theme-toggle:hover .ic {
  transform: rotate(-24deg) scale(1.08);
}

.tool-btn {
  --spin: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-weight: 650;
  font-size: 0.86rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.15s var(--ease);
}

.tool-btn:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.tool-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.tool-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tool-btn .ic {
  width: 1.05em;
  height: 1.05em;
  transition: transform 0.25s var(--spring);
}

.tool-btn-accent,
.tool-btn[data-act="upload"],
#verify-upload {
  border-color: var(--accent-soft);
  background: var(--accent-softer);
  color: var(--accent);
}

.tool-btn-accent:hover:not(:disabled),
.tool-btn[data-act="upload"]:hover,
#verify-upload:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.tool-btn[data-act="upload"]:hover .ic,
#verify-upload:hover .ic {
  transform: translateY(-2px);
}

.tool-btn[data-act="paste"]:hover .ic,
#verify-paste:hover .ic {
  transform: rotate(-8deg) scale(1.08);
}

.tool-btn[data-act="clear"]:hover,
#verify-clear:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.tool-btn[aria-pressed="true"] {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  color: var(--accent);
}

.is-copied,
.is-copied:hover:not(:disabled) {
  border-color: transparent !important;
  background: var(--success-soft) !important;
  color: var(--success) !important;
}

.is-copied .ic {
  animation: pop 0.35s var(--spring);
}

/* ---- Top bar ---------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.topbar.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  border-radius: var(--r-sm);
  text-decoration: none;
}

.brand .logo {
  transition: transform 0.3s var(--spring);
}

.brand:hover .logo {
  transform: scale(1.03);
}

.nav {
  display: flex;
  gap: 2px;
  margin: 0 auto;
}

.nav a {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav a[aria-current] {
  background: var(--accent-softer);
  color: var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav + .topbar-actions {
  margin-left: 0;
}

.token-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 13px 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.15s var(--ease);
}

.token-pill:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.token-pill:active {
  transform: scale(0.96);
}

.token-pill > .ic {
  width: 1.05em;
  height: 1.05em;
  color: var(--gold-strong);
}

.token-num {
  font-variant-numeric: tabular-nums;
}

.token-sep {
  margin: 0 1px;
  color: var(--muted);
  font-weight: 500;
}

.token-word {
  color: var(--muted);
  font-weight: 600;
}

.token-badge {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--gold);
  color: #3d2c00;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.token-pill.is-low {
  border-color: var(--warning);
}

.token-pill.is-low > .ic {
  color: var(--warning);
}

.token-pill.is-empty {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.token-pill.is-empty > .ic {
  color: var(--danger);
}

.token-pill.is-premium {
  border-color: transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--gold), var(--accent)) border-box;
}

.token-delta {
  position: absolute;
  top: -4px;
  left: 50%;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  pointer-events: none;
  animation: token-delta 1.2s var(--ease-out) forwards;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.lang-switch button {
  min-width: 34px;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* ---- Hero ------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(44px, 7vw, 92px) 0 clamp(48px, 7vw, 88px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  inset: -30% -10% auto;
  height: 820px;
  background: radial-gradient(38% 46% at 18% 30%, var(--glow-1), transparent 70%), radial-gradient(34% 42% at 82% 18%, var(--glow-2), transparent 70%), radial-gradient(28% 36% at 62% 72%, var(--glow-1), transparent 70%);
  pointer-events: none;
  animation: glow-drift 18s ease-in-out infinite alternate;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 13px;
  border: 1px solid var(--accent-soft);
  border-radius: var(--r-pill);
  background: var(--accent-softer);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-ring 2s var(--ease) infinite;
}

.hero h1 {
  margin: 18px 0 16px;
  font-size: clamp(2.15rem, 5.2vw, 3.6rem);
  line-height: 1.07;
  letter-spacing: -0.03em;
  font-weight: 820;
}

.hl {
  color: var(--accent);
  background: linear-gradient(transparent 64%, var(--gold-soft) 64%) no-repeat;
  background-size: 100% 100%;
  animation: hl-in 1s 0.35s var(--ease-out) both;
}

.hero .lead {
  max-width: 36em;
  margin: 0;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 22px;
}

.hero-cta .btn-primary .ic {
  transition: transform 0.3s var(--spring);
}

.hero-cta .btn-primary:hover .ic {
  transform: translateX(4px);
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 550;
}

.hero-proof li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero-proof .ic {
  color: var(--accent);
}

.hero-copy > * {
  animation: rise 0.7s var(--ease-out) both;
}

.hero-copy > :nth-child(2) {
  animation-delay: 0.06s;
}

.hero-copy > :nth-child(3) {
  animation-delay: 0.12s;
}

.hero-copy > :nth-child(4) {
  animation-delay: 0.18s;
}

.hero-copy > :nth-child(5) {
  animation-delay: 0.24s;
}

/* The floating cards sit over the window's empty title bar and below its last
   line, never over its text. */
.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  padding: 46px 0 64px;
}

.demo-window {
  position: relative;
  width: min(100%, 410px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: rise 0.8s 0.15s var(--ease-out) both;
}

.demo-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.demo-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef8f84;
}

.demo-bar i:nth-child(2) {
  background: #f3c969;
}

.demo-bar i:nth-child(3) {
  background: #7fcfa8;
}

.demo-bar b {
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.demo-body {
  display: grid;
  gap: 10px;
  padding: 20px 22px 24px;
}

.demo-tag {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-text {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--r);
  font-family: var(--font-read);
  font-size: 1.02rem;
  line-height: 1.55;
}

.demo-before {
  background: var(--surface-2);
  color: var(--muted);
}

.demo-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 2px 0;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--accent-softer);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 750;
}

.demo-step .ic {
  animation: write-pen 2.4s 1.2s var(--ease) infinite;
}

.demo-after {
  border: 1px solid var(--accent-soft);
  background: var(--accent-softer);
  color: var(--text);
  animation: write 1.4s 0.9s steps(40, end) both;
}

.demo-float {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  animation: rise 0.7s var(--ease-out) both, bob 6s ease-in-out infinite;
}

.demo-float b {
  font-weight: 800;
}

.demo-float small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.demo-plag {
  top: 12px;
  right: 0;
  animation-delay: 0.5s, 1.2s;
}

.demo-plag span {
  display: grid;
  line-height: 1.15;
}

.demo-plag b {
  font-size: 1.15rem;
  color: var(--accent);
}

.demo-ring {
  width: 44px;
  height: 44px;
  transform: rotate(-90deg);
}

.demo-ring .ring-track {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 5;
}

.demo-ring .ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 113.1;
  stroke-dashoffset: 109.7;
  animation: demo-ring 1.6s 0.9s var(--ease-out) both;
}

.demo-ai {
  right: 5%;
  bottom: 6px;
  display: grid;
  gap: 6px;
  width: 172px;
  animation-delay: 0.7s, 2s;
}

.demo-ai b {
  color: var(--accent);
  font-size: 0.85rem;
}

.demo-meter {
  position: relative;
  display: block;
  height: 8px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--zone-low) 0 40%, var(--zone-mixed) 40% 65%, var(--zone-high) 65% 100%);
}

.demo-meter i {
  position: absolute;
  top: 50%;
  left: 18%;
  width: 14px;
  height: 14px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
  transform: translate(-50%, -50%);
  animation: demo-meter 1.6s 1.1s var(--ease-out) both;
}

.demo-cert {
  bottom: 12px;
  left: 2%;
  font-weight: 750;
  animation-delay: 0.9s, 0.4s;
}

.demo-cert .ic {
  width: 22px;
  height: 22px;
  color: var(--gold-strong);
}

/* ---- Sections --------------------------------------------------------- */

.section {
  padding: clamp(56px, 8.5vw, 104px) 0;
  scroll-margin-top: var(--topbar-h);
}

.section-head {
  max-width: 720px;
  margin: 0 auto clamp(28px, 4vw, 48px);
  text-align: center;
}

.section-head .eyebrow {
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-head h2 {
  margin: 10px 0 12px;
  font-size: clamp(1.7rem, 3.4vw, 2.45rem);
  letter-spacing: -0.025em;
  line-height: 1.13;
  font-weight: 800;
}

.section-head p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.section-head.compact {
  margin-bottom: 24px;
}

.reveal {
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}

.reveal-ready .reveal:not(.is-in) {
  opacity: 0;
  transform: translateY(18px);
}

/* ---- Features --------------------------------------------------------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.feature-grid .reveal:nth-child(2) {
  transition-delay: 70ms;
}

.feature-grid .reveal:nth-child(3) {
  transition-delay: 140ms;
}

.feature-grid .reveal:nth-child(4) {
  transition-delay: 210ms;
}

.feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 22px 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  cursor: pointer;
  transition: opacity 0.65s var(--ease-out), transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}

.feature-card:hover {
  border-color: var(--accent-soft);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
  transition: transform 0.35s var(--spring), background-color 0.3s var(--ease);
}

.feature-icon .ic {
  width: 23px;
  height: 23px;
}

.feature-card:hover .feature-icon {
  background: var(--accent);
  color: var(--on-accent);
  transform: rotate(-6deg) scale(1.06);
}

.feature-card h3 {
  margin: 6px 0 0;
  font-size: 1.16rem;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.feature-card ul {
  display: grid;
  gap: 7px;
  margin: 6px 0 10px;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}

.feature-card li {
  position: relative;
  padding-left: 24px;
}

.feature-card li::before {
  content: "";
  position: absolute;
  top: 0.22em;
  left: 0;
  width: 16px;
  height: 16px;
  background: var(--accent);
  -webkit-mask: var(--i-check) center / 13px no-repeat;
  mask: var(--i-check) center / 13px no-repeat;
}

.feature-card .link-btn {
  margin-top: auto;
}

.steps {
  margin-top: 28px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.steps-title {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.steps ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.step-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  box-shadow: 0 0 0 5px var(--accent-softer);
}

.steps b {
  display: block;
  margin: 6px 0 2px;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---- Tools ------------------------------------------------------------ */

.tools-section {
  border-block: 1px solid var(--border);
  background: var(--bg-2);
}

.tools-section:focus {
  outline: none;
}

.tool-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  max-width: 880px;
  margin: 0 auto 20px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.tool-tab {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.tool-tab > .ic {
  width: 21px;
  height: 21px;
  transition: transform 0.35s var(--spring);
}

.tool-tab:hover {
  color: var(--text);
}

.tool-tab:hover > .ic {
  transform: scale(1.1);
}

.tool-tab[aria-selected="true"] {
  color: var(--on-accent);
}

.tool-tabs:not(.has-thumb) .tool-tab[aria-selected="true"] {
  background: var(--accent);
}

.tab-text {
  display: grid;
  text-align: left;
  line-height: 1.2;
}

.tab-text small {
  font-size: 0.74rem;
  font-weight: 650;
  opacity: 0.8;
}

.tab-thumb,
.seg-thumb {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: var(--thumb-w, 0);
  height: var(--thumb-h, 0);
  transform: translate(var(--thumb-x, 0), var(--thumb-y, 0));
  opacity: 0;
  pointer-events: none;
}

.has-thumb > .tab-thumb,
.has-thumb > .seg-thumb {
  opacity: 1;
}

.tab-thumb {
  border-radius: var(--r-md);
  background: var(--accent);
  box-shadow: var(--shadow-accent);
}

.thumbs-ready .tab-thumb,
.thumbs-ready .seg-thumb {
  transition: transform 0.38s var(--ease-out), width 0.38s var(--ease-out), height 0.38s var(--ease-out), opacity 0.2s var(--ease);
}

.tool-panel.is-entering {
  animation: panel-in 0.38s var(--ease-out);
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.option {
  min-width: 0;
}

.option-wide {
  grid-column: 1 / -1;
}

.option-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 10px;
}

.option-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.option-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.87rem;
}

p.option-desc {
  margin-top: 8px;
  min-height: 1.3em;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chip:active {
  transform: scale(0.95);
}

.chip[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-accent);
}

.chip[aria-checked="true"]:not(.locked) {
  animation: pop 0.3s var(--spring);
}

.chip.locked {
  border-style: dashed;
  background: var(--surface-2);
  color: var(--muted);
}

/* app.js puts a lock icon in every style chip, level and variant button;
   it only shows on the ones that are locked. */
.chip-lock {
  width: 0.95em;
  height: 0.95em;
}

:not(.locked) > .chip-lock {
  display: none;
}

.segmented {
  position: relative;
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
}

.segmented button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s var(--ease), opacity 0.2s var(--ease);
}

.segmented button:hover {
  color: var(--text);
}

.segmented button[aria-checked="true"] {
  color: var(--accent);
}

.segmented:not(.has-thumb) button[aria-checked="true"] {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.segmented button.locked {
  opacity: 0.5;
}

.seg-thumb {
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--border);
}

.options.lang-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.select-field {
  position: relative;
  display: grid;
  flex: 1 1 200px;
  gap: 6px;
  min-width: 0;
}

.select-field::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 15px;
  width: 16px;
  height: 16px;
  background: var(--muted);
  -webkit-mask: var(--i-chevron) center / contain no-repeat;
  mask: var(--i-chevron) center / contain no-repeat;
  pointer-events: none;
}

select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 46px;
  padding: 0 42px 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

select:hover {
  border-color: var(--accent);
}

select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.swap-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.swap-btn .ic {
  transition: transform 0.45s var(--spring);
}

.swap-btn:hover .ic {
  transform: rotate(180deg);
}

.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  font-size: 0.92rem;
  animation: rise 0.35s var(--ease-out);
}

.banner > .ic {
  margin-top: 1px;
}

.banner > span {
  flex: 1;
  min-width: 0;
}

.banner .link-btn {
  margin-left: auto;
  white-space: nowrap;
}

.banner-warn {
  border-color: transparent;
  background: var(--warning-soft);
}

.banner-warn > .ic {
  color: var(--warning);
}

.banner-info {
  border-color: transparent;
  background: var(--info-soft);
}

.banner-info > .ic {
  color: var(--info);
}

.banner-error {
  border-color: transparent;
  background: var(--danger-soft);
}

.banner-error > .ic {
  color: var(--danger);
}

.banner-success {
  border-color: transparent;
  background: var(--success-soft);
}

.banner-success > .ic {
  color: var(--success);
}

/* Editor and output panes */

.workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.workspace.stacked {
  grid-template-columns: minmax(0, 1fr);
}

/* Once results are in, the editor keeps its own height and stays in view
   while the results scroll past. */
@media (min-width: 961px) {
  .workspace:has(> .output > .results:not([hidden])) {
    align-items: start;
  }

  .workspace:has(> .output > .results:not([hidden])) > .editor {
    position: sticky;
    top: calc(var(--topbar-h) + 14px);
  }
}

.editor {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.editor:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-softer);
}

.editor-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--border);
}

.editor-title {
  flex: 1 1 auto;
  font-weight: 750;
  font-size: 0.92rem;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.drop {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.editor textarea,
.verify-match textarea {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 280px;
  padding: 16px 18px;
  border: 0;
  outline: 0;
  resize: vertical;
  background: transparent;
  color: var(--text);
  font-family: var(--font-read);
  font-size: 1.05rem;
  line-height: 1.68;
}

.stacked .editor textarea {
  min-height: 220px;
}

.verify-match textarea {
  min-height: 180px;
}

textarea::placeholder,
input::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

.editor.is-doc textarea,
.editor textarea[readonly] {
  background: var(--surface-2);
  color: var(--muted);
  cursor: default;
}

.drop-veil {
  position: absolute;
  inset: 8px;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  border: 2px dashed var(--accent);
  border-radius: var(--r);
  background: var(--accent-softer);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  color: var(--accent);
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
  transition: opacity 0.2s var(--ease), transform 0.25s var(--ease-out);
}

.drop-veil .ic {
  width: 34px;
  height: 34px;
  animation: bob 1.6s ease-in-out infinite;
}

.drop-veil small {
  color: var(--muted);
  font-weight: 600;
}

.is-dragging .drop-veil {
  opacity: 1;
  transform: none;
}

.editor.is-reading .drop::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: reading 1.1s linear infinite;
}

.editor.is-reading textarea {
  opacity: 0.55;
}

.editor-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 16px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  background: var(--surface-2);
}

.counter {
  margin-right: auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.counter.over {
  color: var(--danger);
  font-weight: 750;
}

.counter.short {
  color: var(--warning);
}

.run-btn {
  min-width: 150px;
}

.free-pill {
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 750;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.doc-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 12px 0;
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--accent-soft);
  border-radius: var(--r);
  background: var(--accent-softer);
  animation: rise 0.3s var(--ease-out);
}

.doc-chip > .ic {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.doc-info {
  display: grid;
  flex: 1;
  min-width: 0;
}

.doc-info b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-info small {
  color: var(--muted);
}

.doc-chip .icon-btn {
  width: 34px;
  height: 34px;
}

.output {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.output.wide {
  border: 0;
  background: none;
}

.intro {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 24px;
  text-align: center;
  animation: fade-in 0.4s var(--ease-out);
}

.intro-wide {
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.intro-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  animation: float 4s ease-in-out infinite;
}

.intro-icon .ic {
  width: 26px;
  height: 26px;
}

.intro h3 {
  margin: 4px 0 0;
  font-size: 1.15rem;
}

.intro-steps {
  display: grid;
  gap: 9px;
  max-width: 440px;
  margin: 4px 0 8px;
  padding: 0;
  list-style: none;
  counter-reset: intro;
  text-align: left;
}

.intro-wide .intro-steps {
  max-width: 580px;
}

.intro-steps li {
  position: relative;
  padding-left: 34px;
  color: var(--muted);
  font-size: 0.93rem;
  counter-increment: intro;
}

.intro-steps li::before {
  content: counter(intro);
  position: absolute;
  top: -1px;
  left: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
}

.intro-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Paraphrase and translation results */

.results {
  display: grid;
  gap: 12px;
  padding: 14px;
  animation: fade-in 0.3s var(--ease-out);
}

.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.results-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.pill-cost {
  border-color: var(--accent-soft);
  background: var(--accent-softer);
  color: var(--accent);
}

.diff-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

ins,
del {
  border-radius: 4px;
  padding: 0 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

ins {
  background: var(--added);
  color: inherit;
  text-decoration: none;
}

del {
  background: var(--removed);
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--danger);
}

.variant {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  animation: rise 0.45s var(--ease-out) both;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.variant:hover {
  border-color: var(--accent-soft);
  box-shadow: var(--shadow);
}

.variant:nth-of-type(2) {
  animation-delay: 60ms;
}

.variant:nth-of-type(3) {
  animation-delay: 120ms;
}

.variant:nth-of-type(4) {
  animation-delay: 180ms;
}

.variant:nth-of-type(5) {
  animation-delay: 240ms;
}

.variant-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.variant-title {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 800;
}

.variant-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.variant > .variant-meta {
  margin: 0;
  padding: 0 16px 12px;
}

.variant-text {
  padding: 14px 16px;
  font-family: var(--font-read);
  font-size: 1.04rem;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.variant-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
}

.note {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.86rem;
}

.note.warning {
  border-left-color: var(--warning);
  background: var(--warning-soft);
  color: var(--text);
}

.note.center {
  border-left: 0;
  text-align: center;
}

/* Loading placeholders */

.skeleton-list {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.report > .skeleton-list {
  padding: 0;
}

.skeleton-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  animation: fade-in 0.4s calc(var(--i, 0) * 90ms) var(--ease-out) both;
}

.skeleton-line {
  display: block;
  width: var(--w, 100%);
  height: 12px;
  border-radius: var(--r-xs);
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

.progress-card {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  animation: rise 0.35s var(--ease-out);
}

.progress-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pstep {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.pstep::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background-color 0.3s var(--ease);
}

.pstep.is-active {
  background: var(--accent-softer);
  color: var(--accent);
}

.pstep.is-active::before {
  background: var(--accent);
  animation: pulse-ring 1.4s var(--ease) infinite;
}

.pstep.is-done {
  color: var(--success);
}

.pstep.is-done::before {
  width: 12px;
  height: 12px;
  background: var(--success);
  -webkit-mask: var(--i-check) center / contain no-repeat;
  mask: var(--i-check) center / contain no-repeat;
  border-radius: 0;
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-text {
  margin: 0;
  font-size: 0.9rem;
}

.progress-row .counter {
  margin: 0;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--surface-2);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover), var(--accent));
  background-size: 200% 100%;
  transition: width 0.5s linear;
  animation: shimmer 1.6s linear infinite;
}

/* ---- Reports ---------------------------------------------------------- */

.report {
  display: grid;
  gap: 16px;
  transition: opacity 0.2s var(--ease);
}

.report:empty {
  display: none;
}

.report[aria-busy="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.output.wide .report:not(:empty) {
  margin-top: 0;
}

.report-card {
  min-width: 0;
  padding: clamp(16px, 2.6vw, 24px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  animation: rise 0.45s var(--ease-out) both;
}

.report > .report-card:nth-child(2) {
  animation-delay: 70ms;
}

.report > .report-card:nth-child(3) {
  animation-delay: 140ms;
}

.report > .report-card:nth-child(4) {
  animation-delay: 210ms;
}

.report-card h3 {
  margin: 0 0 12px;
  font-size: 1.06rem;
}

.report-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 26px;
  align-items: center;
}

.verdict-low {
  --verdict: var(--accent);
}

.verdict-mixed {
  --verdict: var(--warning);
}

.verdict-high {
  --verdict: var(--danger);
}

.report-summary[class*="verdict-"] {
  box-shadow: inset 0 3px 0 var(--verdict);
}

.level-low {
  --ring: var(--accent);
}

.level-mid {
  --ring: var(--warning);
}

.level-high {
  --ring: var(--danger);
}

.score-ring {
  position: relative;
  width: 150px;
  height: 150px;
  flex: none;
}

.score-ring-svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring-svg .ring-track {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 10;
}

.score-ring-svg .ring-fill {
  fill: none;
  stroke: var(--ring, var(--accent));
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.1s var(--ease-out);
}

.score-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1.1;
}

.score-value {
  font-size: 2.15rem;
  font-weight: 820;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.score-center small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.summary-info {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.report-heading {
  margin: 0 !important;
  font-size: 1.3rem !important;
}

.split {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.split-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  font-size: 0.82rem;
  font-weight: 750;
}

.split-chip i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.split-exact i {
  background: var(--exact);
}

.split-near i {
  background: var(--near);
}

.facts,
.source-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.86rem;
}

.facts li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.facts li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
}

p.source-facts {
  display: block;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meter {
  display: grid;
  gap: 6px;
}

.meter-track {
  position: relative;
  display: flex;
  height: 10px;
  border-radius: var(--r-pill);
}

.zone {
  height: 100%;
}

.zone.low {
  flex: 40;
  border-radius: var(--r-pill) 0 0 var(--r-pill);
  background: var(--zone-low);
}

.zone.mixed {
  flex: 25;
  background: var(--zone-mixed);
}

.zone.high {
  flex: 35;
  border-radius: 0 var(--r-pill) var(--r-pill) 0;
  background: var(--zone-high);
}

.meter-marker {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  border: 4px solid var(--text);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
  animation: marker-in 0.9s var(--ease-out) both;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
}

.verdict-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.signals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.signal {
  --sig: var(--accent);
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--surface-2);
}

.strength-moderate {
  --sig: var(--warning);
}

.strength-strong {
  --sig: var(--danger);
}

.signal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.signal-name {
  font-weight: 750;
  font-size: 0.92rem;
}

.signal-strength {
  flex: none;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--sig);
  font-size: 0.74rem;
  font-weight: 800;
}

.signal-bar {
  height: 6px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--surface-3);
}

.signal-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--sig);
  transform-origin: left;
  animation: grow 0.9s 0.15s var(--ease-out) both;
}

.signal-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-head h3 {
  margin: 0;
}

.mark-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-size: 0.8rem;
}

.mark-legend mark {
  padding: 2px 9px;
  border-radius: var(--r-xs);
}

.reader {
  max-height: 560px;
  overflow: auto;
  padding: 2px 4px 2px 0;
  font-family: var(--font-read);
  font-size: 1.04rem;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  overscroll-behavior: contain;
}

mark {
  color: var(--text);
}

mark.match,
mark.phrase {
  padding: 1px 0;
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

mark.match {
  background: var(--match-exact);
}

mark.match.near {
  background: var(--match-near);
  text-decoration: underline dotted var(--near);
  text-underline-offset: 0.25em;
}

mark.phrase {
  background: var(--phrase);
}

.ref {
  display: inline-block;
  margin: 0 2px;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 0.68em;
  font-weight: 800;
  line-height: 1.5;
  vertical-align: 0.45em;
  text-decoration: none;
}

.ref:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.source-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.source {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.source:hover,
.source:target {
  border-color: var(--accent-soft);
  box-shadow: var(--shadow);
}

.source-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.source-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 800;
}

.source-main {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.source-title {
  color: var(--text);
  font-weight: 750;
  overflow-wrap: anywhere;
}

a.source-title {
  color: var(--accent);
  text-decoration: none;
}

a.source-title:hover {
  text-decoration: underline;
}

.source-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.source-share {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.source-bar {
  display: flex;
  height: 6px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--surface-2);
}

.seg-exact {
  background: var(--exact);
}

.seg-near {
  background: var(--near);
}

.cite summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 750;
  list-style: none;
  cursor: pointer;
}

.cite summary::-webkit-details-marker {
  display: none;
}

.cite summary::after {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: var(--i-chevron) center / contain no-repeat;
  mask: var(--i-chevron) center / contain no-repeat;
  transition: transform 0.25s var(--ease);
}

.cite[open] summary::after {
  transform: rotate(180deg);
}

.cite[open] > :not(summary) {
  animation: fade-in 0.25s var(--ease-out);
}

.cite .option-label {
  margin-top: 10px;
}

.cite-text {
  margin: 6px 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.cite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}

.next-steps {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--accent-soft);
  border-radius: var(--r);
  background: var(--accent-softer);
  font-size: 0.9rem;
}

.notes {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.disclaimer {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 34px 20px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  animation: pop 0.5s var(--spring);
}

.empty-icon .ic {
  width: 28px;
  height: 28px;
}

.empty-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.caveats ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---- Certificates ----------------------------------------------------- */

.cert-card {
  border-color: rgba(212, 180, 90, 0.55);
  background: radial-gradient(120% 70% at 100% 0%, var(--gold-soft), transparent 60%), var(--surface);
}

.cert-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.cert-head h3 {
  margin: 0 0 2px;
}

.cert-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  background: var(--gold-soft);
  color: var(--gold-strong);
}

.cert-icon .ic {
  width: 24px;
  height: 24px;
}

.cert-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.cert-preview {
  container-type: inline-size;
  perspective: 1200px;
}

/* The preview is paper, so it stays light in the dark theme too. */
.cert-paper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25em;
  aspect-ratio: 1.414 / 1;
  padding: 7% 8% 11%;
  overflow: hidden;
  border: 1px solid #e6dcc2;
  border-radius: 10px;
  background: radial-gradient(circle at 0 0, rgba(15, 107, 92, 0.09), transparent 42%), radial-gradient(circle at 100% 100%, rgba(243, 201, 105, 0.24), transparent 46%), #fffdf7;
  box-shadow: inset 0 0 0 7px #fffdf7, inset 0 0 0 8px #d4b45a, 0 20px 40px -20px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.08);
  color: #1b1f1d;
  font-size: 0.8rem;
  text-align: center;
  transition: transform 0.5s var(--ease-out);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .cert-preview:hover .cert-paper {
    transform: rotateX(4deg) rotateY(-7deg) translateY(-3px);
  }
}

.cert-kicker {
  color: #0f6b5c;
  font-size: 0.62rem;
  font-size: 2.3cqi;
  font-weight: 800;
  letter-spacing: 0.32em;
}

.cert-heading {
  font-family: var(--font-read);
  font-size: 1.35rem;
  font-size: 5.6cqi;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-transform: uppercase;
}

.cert-kind {
  color: #56615c;
  font-size: 0.66rem;
  font-size: 2.5cqi;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cert-score {
  margin-top: 0.15em;
  color: #0f6b5c;
  font-size: 2.1rem;
  font-size: 9cqi;
  font-weight: 820;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.cert-score-note {
  max-width: 80%;
  color: #56615c;
  font-size: 0.62rem;
  font-size: 2.3cqi;
}

.cert-name {
  max-width: 88%;
  margin-top: 0.45em;
  padding: 0 6% 0.15em;
  overflow: hidden;
  border-bottom: 1px solid #d4b45a;
  font-family: var(--font-read);
  font-size: 1.1rem;
  font-size: 4.6cqi;
  font-style: italic;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cert-doc {
  display: -webkit-box;
  max-width: 82%;
  overflow: hidden;
  color: #56615c;
  font-size: 0.66rem;
  font-size: 2.5cqi;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Sample text for a field that is still empty. */
.cert-paper .is-sample {
  opacity: 0.45;
}

.cert-foot {
  position: absolute;
  right: 7%;
  bottom: 6%;
  left: 7%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cert-id {
  color: #56615c;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-size: 2.2cqi;
}

.cert-seal {
  display: grid;
  place-items: center;
  width: 38px;
  width: 11cqi;
  height: 38px;
  height: 11cqi;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f8dc8f, #d9a93a 60%, #b9862a);
  box-shadow: 0 0 0 3px rgba(217, 169, 58, 0.25);
  color: #fff;
}

.cert-seal .ic {
  width: 55%;
  height: 55%;
  stroke-width: 3;
}

.cert-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.cert-form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field input,
.redeem-row input,
.verify-form input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.field input:hover,
.redeem-row input:hover,
.verify-form input:hover {
  border-color: var(--accent);
}

.field input:focus-visible,
.redeem-row input:focus-visible,
.verify-form input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

input[aria-invalid="true"] {
  border-color: var(--danger) !important;
}

.cert-message:empty {
  display: none;
}

.cert-done {
  display: grid;
  gap: 8px;
  animation: rise 0.4s var(--ease-out);
}

.cert-ready {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--success);
  font-weight: 800;
}

.cert-ready .ic {
  width: 24px;
  height: 24px;
  padding: 4px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  stroke-width: 3;
  animation: pop 0.45s var(--spring);
}

.cert-number {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: 0.05em;
}

.cert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- Pricing ---------------------------------------------------------- */

.pricing {
  background: radial-gradient(60% 40% at 50% 0%, var(--accent-softer), transparent 70%);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  padding-top: 12px;
}

.plan-grid .reveal:nth-child(2) {
  transition-delay: 70ms;
}

.plan-grid .reveal:nth-child(3) {
  transition-delay: 140ms;
}

.plan-grid .reveal:nth-child(4) {
  transition-delay: 210ms;
}

.plan {
  position: relative;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 22px 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  transition: opacity 0.65s var(--ease-out), transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

.plan:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.plan header h3 {
  margin: 0;
  font-size: 1.15rem;
}

.plan-tag {
  min-height: 2.6em;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.plan-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 2px 0 0;
}

/* Sized to the card so "Rp199.000 / 365 hari" stays on one line in the
   four-column layout. */
.plan-price b {
  font-size: 2.05rem;
  font-size: min(2.05rem, 13cqi);
  font-weight: 830;
  letter-spacing: -0.025em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.plan-price span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.plan-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

/* A 12px radius reads as a pill on one line and as a soft box if a long
   translation wraps. */
.plan-save {
  display: inline-flex;
  width: fit-content;
  margin: 0;
  padding: 3px 9px;
  border-radius: 12px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 750;
}

.plan-list {
  display: grid;
  gap: 9px;
  margin: 6px 0 10px;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}

.plan-list li {
  position: relative;
  padding-left: 28px;
}

.plan-list li::before {
  content: "";
  position: absolute;
  top: 0.12em;
  left: 0;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--accent-soft);
}

.plan-list li::after {
  content: "";
  position: absolute;
  top: 0.12em;
  left: 0;
  width: 19px;
  height: 19px;
  background: var(--accent);
  -webkit-mask: var(--i-check) center / 12px no-repeat;
  mask: var(--i-check) center / 12px no-repeat;
}

.plan-list li.muted::before {
  background: var(--surface-2);
}

.plan-list li.muted::after {
  background: var(--muted);
  -webkit-mask-image: var(--i-dash);
  mask-image: var(--i-dash);
}

.plan-cta {
  width: 100%;
  margin-top: auto;
}

.plan-featured {
  border: 2px solid var(--accent);
  background: linear-gradient(180deg, var(--accent-softer), var(--surface) 42%);
  box-shadow: 0 24px 50px -28px rgba(15, 107, 92, 0.55);
}

@media (min-width: 1101px) {
  .plan-featured {
    transform: translateY(-8px);
  }

  .plan-featured:hover {
    transform: translateY(-12px);
  }
}

.plan-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  padding: 4px 13px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: var(--shadow-accent);
  transform: translateX(-50%);
}

.plan-badge-gold {
  background: var(--gold);
  color: #3d2c00;
  box-shadow: 0 8px 20px -10px rgba(168, 111, 0, 0.6);
}

.plan.is-current {
  border-color: var(--success);
}

.plan-current {
  display: inline-flex;
  width: fit-content;
  margin: 0;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.8rem;
  font-weight: 750;
}

.pay-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.pay-methods,
.redeem {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.pay-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.pay-title .ic {
  color: var(--accent);
}

.pay-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.pay-list li {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 0.85rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  transition: transform 0.2s var(--spring), border-color 0.2s var(--ease);
}

.pay-list li:first-child {
  border-color: var(--accent-soft);
  background: var(--accent-softer);
  color: var(--accent);
}

.pay-list li:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.redeem {
  display: grid;
  gap: 10px;
  align-content: start;
}

.redeem .option-label {
  color: var(--text);
  font-size: 0.97rem;
  letter-spacing: 0;
  text-transform: none;
}

.redeem .option-label .ic {
  color: var(--accent);
}

.redeem-row {
  display: flex;
  gap: 8px;
}

.redeem-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.redeem-row input::placeholder {
  text-transform: none;
}

.redeem.redeem-inline {
  padding: 0;
  border: 0;
  background: none;
}

.compare {
  margin-top: 28px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.compare h3 {
  margin: 0 0 12px;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

thead th {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

tbody th {
  font-weight: 600;
}

tbody tr:last-child > * {
  border-bottom: 0;
}

th:nth-child(3),
td:nth-child(3) {
  background: var(--accent-softer);
  color: var(--accent);
  font-weight: 750;
}

tbody tr {
  transition: background-color 0.15s var(--ease);
}

tbody tr:hover {
  background: var(--surface-2);
}

/* ---- FAQ -------------------------------------------------------------- */

.faq {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list details {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.faq-list details[open] {
  border-color: var(--accent-soft);
  box-shadow: var(--shadow);
}

.faq-list summary {
  position: relative;
  padding: 16px 52px 16px 18px;
  border-radius: var(--r-md);
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  background: var(--muted);
  -webkit-mask: var(--i-chevron) center / contain no-repeat;
  mask: var(--i-chevron) center / contain no-repeat;
  transition: transform 0.3s var(--ease-out), background-color 0.2s var(--ease);
}

.faq-list details[open] summary::after {
  background: var(--accent);
  transform: rotate(180deg);
}

.faq-list summary:hover {
  color: var(--accent);
}

.faq-list details p {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--muted);
}

.faq-list details[open] p {
  animation: fade-down 0.3s var(--ease-out);
}

/* ---- Footer ----------------------------------------------------------- */

.footer {
  padding: 40px 0 calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px 32px;
  align-items: start;
}

.footer-brand .logo {
  height: 26px;
}

.footer-brand p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 20px;
}

.footer-links a {
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---- Dialogs ---------------------------------------------------------- */

.sheet {
  width: min(560px, calc(100vw - 32px));
  max-height: min(88vh, 780px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--r-xl);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.45);
}

.sheet[open] {
  display: flex;
  flex-direction: column;
  animation: sheet-in 0.32s var(--ease-out);
}

.sheet::backdrop {
  background: var(--backdrop);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: fade-in 0.25s var(--ease-out);
}

.sheet-small {
  width: min(420px, calc(100vw - 32px));
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px 22px;
  border-bottom: 1px solid var(--border);
}

.sheet-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.sheet-body {
  display: grid;
  flex: 1;
  gap: 14px;
  align-content: start;
  padding: 18px 22px;
  overflow: auto;
  overscroll-behavior: contain;
}

.sheet-body h3 {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sheet-body section {
  display: grid;
  gap: 10px;
}

.sheet-body.center {
  justify-items: center;
  padding-top: 30px;
  text-align: center;
}

.sheet-body.center h2 {
  margin: 0;
  font-size: 1.3rem;
}

.sheet-body.center p {
  margin: 0;
  color: var(--muted);
}

.sheet-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 22px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.sheet-foot.stack {
  flex-direction: column;
  align-items: stretch;
  border-top: 0;
  background: none;
}

.sheet-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  animation: pop 0.45s var(--spring);
}

.sheet-icon .ic {
  width: 28px;
  height: 28px;
}

#upsell-dialog .sheet-icon {
  background: var(--gold-soft);
  color: var(--gold-strong);
}

.sheet-icon-paid {
  background: var(--success-soft);
  color: var(--success);
}

.sheet-icon-wait {
  background: var(--info-soft);
  color: var(--info);
}

.sheet-icon-wait .ic {
  animation: spin 3s linear infinite;
}

.sheet-icon-fail {
  background: var(--danger-soft);
  color: var(--danger);
}

.acct-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
}

.acct-ring {
  position: relative;
  flex: none;
  width: 78px;
  height: 78px;
}

.acct-ring svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.acct-ring .ring-track {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 7;
}

.acct-ring .ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 169.65;
  transition: stroke-dashoffset 0.8s var(--ease-out);
}

.acct-ring span {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  line-height: 1.05;
  text-align: center;
}

.acct-ring b {
  font-size: 1.4rem;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.acct-ring small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.acct-status {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.acct-plan {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.acct-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.cost-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cost-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.9rem;
}

.cost-list li:last-child {
  border-bottom: 0;
}

.cost-list b {
  font-weight: 700;
  white-space: nowrap;
}

.cost-list li:last-child b {
  color: var(--success);
}

.acct-access {
  display: grid;
  gap: 10px;
}

.code-box {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  animation: rise 0.35s var(--ease-out);
}

.code-text {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  word-break: break-all;
  user-select: all;
}

.code-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.purchase-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.purchase {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.purchase-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-size: 0.88rem;
}

.status-pill {
  flex: none;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-paid {
  background: var(--success-soft);
  color: var(--success);
}

.status-wait {
  background: var(--info-soft);
  color: var(--info);
}

/* ---- Toasts ----------------------------------------------------------- */

.toasts {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 300;
  display: grid;
  gap: 8px;
  width: min(440px, calc(100vw - 24px));
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border: 1px solid var(--toast-border);
  border-radius: var(--r-md);
  background: var(--toast-bg);
  color: var(--toast-text);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.45);
  font-size: 0.92rem;
  font-weight: 550;
  pointer-events: auto;
  cursor: pointer;
  animation: toast-in 0.36s var(--spring);
}

.toast > .ic {
  margin-top: 1px;
}

.toast-success > .ic {
  color: #6fd49b;
}

.toast-error > .ic {
  color: #ff8a80;
}

.toast-warn > .ic {
  color: #f2c14e;
}

.toast-info > .ic {
  color: #8cc4ef;
}

.toast.is-leaving {
  animation: toast-out 0.26s var(--ease) forwards;
}

/* ---- Verification page ------------------------------------------------ */

.verify-page {
  background: radial-gradient(70% 50% at 50% 0%, var(--accent-softer), transparent 70%), var(--bg);
}

.verify-main {
  display: grid;
  gap: 16px;
  padding-top: clamp(32px, 6vw, 64px);
  padding-bottom: 64px;
}

.verify-head {
  margin-bottom: 8px;
}

.verify-head h1 {
  margin: 16px 0 8px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.025em;
}

.verify-head p {
  margin: 0;
  color: var(--muted);
}

.verify-form {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}

.verify-form input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.verify-form input::placeholder {
  letter-spacing: 0.08em;
}

.verify-form .btn {
  min-height: 52px;
}

.verify-result {
  display: grid;
  gap: 16px;
  transition: opacity 0.2s var(--ease);
}

.verify-result.is-loading {
  opacity: 0.55;
}

.verify-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--success-soft);
}

.verify-badge > .ic {
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  stroke-width: 3;
  animation: pop 0.5s var(--spring);
}

.verify-badge h2 {
  margin: 0;
  font-size: 1.08rem;
}

.verify-badge .cert-number {
  margin-top: 2px;
  font-size: 1.05rem;
}

.verify-score {
  display: grid;
  gap: 4px;
}

#verify-kind {
  order: -1;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#verify-headline {
  display: grid;
  gap: 2px;
}

.verify-big {
  color: var(--accent);
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  font-weight: 830;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.verify-big-label {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.verify-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  margin: 0;
}

.verify-facts div {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.verify-facts .fact-wide {
  grid-column: 1 / -1;
}

.verify-facts dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.verify-facts dd {
  margin: 2px 0 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.verify-facts .is-empty dd {
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
}

.verify-sub {
  margin: 6px 0 10px !important;
  color: var(--muted);
  font-size: 0.78rem !important;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.verify-sources {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.verify-sources li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r);
  background: var(--surface-2);
}

.verify-source-text {
  display: grid;
  min-width: 0;
}

.verify-source-text b {
  overflow-wrap: anywhere;
}

.verify-source-host {
  color: var(--muted);
  font-size: 0.8rem;
}

.verify-source-share {
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.verify-signals {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.verify-hash {
  display: grid;
  gap: 6px;
}

.verify-hash code {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 0.82rem;
  word-break: break-all;
  user-select: all;
}

.verify-match {
  display: grid;
  gap: 12px;
}

.verify-match h2 {
  margin: 0;
  font-size: 1.15rem;
}

.verify-match .banner {
  margin: 0;
}

.verify-foot {
  max-width: 560px;
  margin: 8px auto 0;
  text-align: center;
}

/* ---- Keyframes -------------------------------------------------------- */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

@keyframes reading {
  from {
    background-position: -50% 0;
  }

  to {
    background-position: 150% 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes fade-down {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }

  70% {
    transform: scale(1.08);
    opacity: 1;
  }

  100% {
    transform: scale(1);
  }
}

@keyframes bob {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -8px;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 107, 92, 0.45);
  }

  100% {
    box-shadow: 0 0 0 10px rgba(15, 107, 92, 0);
  }
}

@keyframes glow-drift {
  from {
    transform: translate3d(-2%, 0, 0) scale(1);
  }

  to {
    transform: translate3d(3%, 4%, 0) scale(1.08);
  }
}

@keyframes hl-in {
  from {
    background-size: 0 100%;
  }
}

@keyframes write {
  from {
    clip-path: inset(0 100% 0 0);
  }

  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes write-pen {
  0%,
  100% {
    transform: rotate(0);
  }

  20% {
    transform: rotate(-14deg) translateX(2px);
  }

  40% {
    transform: rotate(6deg);
  }
}

@keyframes demo-ring {
  from {
    stroke-dashoffset: 113.1;
  }
}

@keyframes demo-meter {
  from {
    left: 0;
  }
}

@keyframes marker-in {
  from {
    left: 0;
    opacity: 0;
  }
}

@keyframes grow {
  from {
    transform: scaleX(0);
  }
}

@keyframes token-delta {
  0% {
    opacity: 0;
    transform: translate(-50%, 4px);
  }

  15% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -26px);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
}

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
}

/* ---- Responsive ------------------------------------------------------- */

@media (max-width: 1100px) {
  .feature-grid,
  .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-grid {
    row-gap: 26px;
  }
}

@media (max-width: 960px) {
  .nav {
    display: none;
  }

  .topbar-actions {
    margin-left: auto !important;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-copy {
    text-align: center;
  }

  .hero .lead {
    margin: 0 auto;
  }

  .hero-cta,
  .hero-proof {
    justify-content: center;
  }

  .hero-visual {
    width: min(100%, 480px);
    margin: 0 auto;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .output {
    min-height: 0;
  }

  .pay-row,
  .cert-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .cert-preview {
    max-width: 460px;
  }
}

@media (max-width: 720px) {
  .steps ol {
    grid-template-columns: minmax(0, 1fr);
  }

  .tool-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-tab {
    justify-content: flex-start;
    min-height: 54px;
  }

  .options {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }

  .report-summary {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }

  .report-summary .split,
  .report-summary .facts,
  .report-summary .report-actions {
    justify-content: center;
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-links {
    justify-content: flex-start;
  }

  .verify-facts {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  :root {
    --topbar-h: 58px;
  }

  .topbar-inner {
    gap: 8px;
  }

  .logo {
    height: 24px;
  }

  .token-word {
    display: none;
  }

  .token-pill {
    padding: 0 10px 0 9px;
  }

  .lang-switch button {
    min-width: 30px;
    padding: 0 7px;
  }

  .feature-grid,
  .plan-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .plan-tag {
    min-height: 0;
  }

  /* Two equal, thumb-sized buttons instead of two odd widths. */
  .hero-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 340px);
    margin-inline: auto;
  }

  .demo-ai {
    right: 0;
    width: 150px;
  }

  .demo-float {
    padding: 8px 11px;
    font-size: 0.8rem;
  }

  .editor textarea {
    min-height: 220px;
    font-size: 1rem;
  }

  .editor-foot .run-btn {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .counter {
    flex: 1 1 auto;
  }

  .sheet {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
  }

  .sheet[open] {
    animation: sheet-up 0.36s var(--ease-out);
  }

  .verify-form {
    flex-direction: column;
  }

  /* An access code is 24 characters: give it the whole row on a phone. */
  .redeem-row {
    flex-wrap: wrap;
  }

  .redeem-row input,
  .redeem-row .btn {
    flex: 1 1 100%;
  }
}

@media (max-width: 380px) {
  .lang-switch {
    display: none;
  }
}

@media (hover: none) {
  .feature-card:hover,
  .plan:hover {
    transform: none;
    box-shadow: none;
  }
}

/* ---- Accessibility preferences ---------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }

  .reveal-ready .reveal:not(.is-in) {
    opacity: 1;
    transform: none;
  }

  .hero-glow {
    animation: none;
  }
}

@media (forced-colors: active) {
  .btn,
  .chip,
  .tool-tab,
  .segmented button,
  .editor,
  .output,
  .report-card,
  .plan,
  .sheet,
  .toast,
  .token-pill,
  .icon-btn,
  .tool-btn {
    border: 1px solid CanvasText;
  }

  .tab-thumb,
  .seg-thumb,
  .hero-glow,
  .hero::before {
    display: none;
  }

  .tool-tab[aria-selected="true"],
  .chip[aria-checked="true"],
  .segmented button[aria-checked="true"],
  .lang-switch button[aria-pressed="true"] {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }

  .ring-fill,
  .score-ring-svg .ring-fill {
    stroke: Highlight;
  }

  .skeleton-line,
  .progress-track span,
  .signal-bar span,
  .seg-exact,
  .seg-near {
    background: Highlight;
  }

  mark {
    forced-color-adjust: none;
    background: Mark;
    color: MarkText;
  }

  .logo-mark,
  .logo-word {
    fill: CanvasText;
  }
}

/* ---- Print ------------------------------------------------------------ */

@media print {
  @page {
    margin: 14mm;
  }

  :root {
    color-scheme: light;
  }

  body {
    background: #fff;
    color: #000;
  }

  .topbar,
  .skip-link,
  .hero,
  #fitur,
  .tools-section .section-head,
  .tool-tabs,
  .options,
  .banner,
  .editor,
  .tools-section .hint,
  .progress-card,
  .pricing,
  .faq,
  .footer,
  dialog,
  .toasts,
  .intro,
  .report-actions,
  .results-actions,
  .variant-actions,
  .cert-card,
  .cite-actions,
  .verify-form,
  .verify-match,
  .verify-foot,
  .verify-page .report-actions {
    display: none !important;
  }

  .section {
    padding: 0;
  }

  .tools-section {
    border: 0;
    background: none;
  }

  .workspace {
    display: block;
  }

  .output {
    border: 0;
  }

  .report-card,
  .variant,
  .source {
    break-inside: avoid;
    border: 1px solid #bbb;
    box-shadow: none !important;
    animation: none !important;
  }

  .reader {
    max-height: none;
    overflow: visible;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}
