/* =========================================================
   轻码工具箱 — Base64
   A small, dependency-free interface for everyday encoding.
   ========================================================= */

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

:root {
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Code", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f4f1ea;
  --bg-soft: #eeebe3;
  --surface: #fffdfa;
  --surface-2: #f8f5ef;
  --surface-3: #efebe2;
  --ink: #17231f;
  --ink-soft: #3d4a44;
  --muted: #5f6b63;
  --faint: #717d76;
  --line: #e4dfd4;
  --line-strong: #d3ccbe;
  --accent: #c8481d;
  --accent-strong: #a93a14;
  --on-accent: #fffdfa;
  --accent-soft: #fbe9e1;
  --accent-faint: #fdf5f0;
  --green: #237a5d;
  --green-soft: #e7f2ec;
  --blue: #3d6f9f;
  --blue-soft: #eaf0f6;
  --danger: #ae3d2c;
  --danger-soft: #fbeae6;
  --danger-line: #f0cdc4;
  --focus-halo: rgba(200, 72, 29, 0.12);

  --sidebar-bg: #14231e;
  --sidebar-bg-deep: #0f1b17;
  --sidebar-text: #f3f1e9;
  --sidebar-muted: #96a49c;
  --sidebar-faint: #7f8f87;
  --sidebar-line: rgba(255, 255, 255, 0.08);
  --sidebar-hover: rgba(255, 255, 255, 0.05);
  --topbar-bg: rgba(244, 241, 234, 0.82);

  --shadow-card: 0 1px 2px rgba(23, 35, 31, 0.03), 0 26px 70px -42px rgba(23, 35, 31, 0.3);
  --shadow-float: 0 2px 7px rgba(23, 35, 31, 0.09);
  --sidebar-width: 280px;
  --content-max: 1240px;
  --page-edge: clamp(20px, 3.2vw, 42px);
  --radius-card: 22px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d1412;
  --bg-soft: #111a17;
  --surface: #141d19;
  --surface-2: #18231e;
  --surface-3: #202c27;
  --ink: #eef2ed;
  --ink-soft: #c8d1cb;
  --muted: #96a39b;
  --faint: #829088;
  --line: #27342e;
  --line-strong: #37463f;
  --accent: #ff8a5f;
  --accent-strong: #ffa17f;
  --on-accent: #24120b;
  --accent-soft: rgba(255, 138, 95, 0.12);
  --accent-faint: rgba(255, 138, 95, 0.055);
  --green: #6bcda6;
  --green-soft: rgba(92, 196, 154, 0.12);
  --blue: #88b9e7;
  --blue-soft: rgba(120, 170, 220, 0.12);
  --danger: #ff9b87;
  --danger-soft: rgba(255, 123, 99, 0.1);
  --danger-line: rgba(255, 139, 118, 0.26);
  --focus-halo: rgba(255, 138, 95, 0.16);

  --sidebar-bg: #09110e;
  --sidebar-bg-deep: #070d0a;
  --sidebar-text: #f3f1e9;
  --sidebar-muted: #9aa79f;
  --sidebar-faint: #7f8f87;
  --sidebar-line: rgba(255, 255, 255, 0.08);
  --sidebar-hover: rgba(255, 255, 255, 0.055);
  --topbar-bg: rgba(13, 20, 18, 0.82);

  --shadow-card: 0 1px 1px rgba(0, 0, 0, 0.25), 0 30px 80px -46px rgba(0, 0, 0, 0.9);
  --shadow-float: 0 3px 10px rgba(0, 0, 0, 0.32);
  color-scheme: dark;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 560px at 102% -8%, rgba(200, 72, 29, 0.09), transparent 62%),
    radial-gradient(900px 520px at 18% 4%, rgba(35, 122, 93, 0.055), transparent 62%);
  background-attachment: fixed;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] body {
  background-image:
    radial-gradient(1100px 560px at 102% -8%, rgba(255, 138, 95, 0.085), transparent 62%),
    radial-gradient(900px 520px at 18% 4%, rgba(92, 196, 154, 0.04), transparent 62%);
}

body.nav-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

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

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

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

[hidden] {
  display: none !important;
}

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

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  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;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 9px;
  color: var(--bg);
  background: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 0.18s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.noscript-banner {
  position: relative;
  z-index: 300;
  padding: 11px 20px;
  color: #4d250f;
  background: #ffe8c7;
  border-bottom: 1px solid #e9c58d;
  font-size: 13px;
  text-align: center;
}

/* ------------------------------------------------------------------
   Sidebar
   ------------------------------------------------------------------ */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 24px 18px 18px;
  overflow: hidden;
  color: var(--sidebar-text);
  background:
    radial-gradient(440px 300px at -10% -8%, rgba(232, 93, 47, 0.19), transparent 68%),
    linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-deep) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.055);
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.07) 24%, rgba(255, 255, 255, 0.03) 80%, transparent);
  pointer-events: none;
}

.sidebar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 10px;
}

.brand-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 39px;
  height: 39px;
  color: #fffaf6;
  background: linear-gradient(145deg, #f68154 0%, #e65426 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 8px 24px -10px rgba(232, 93, 47, 0.8);
}

.brand-mark .icon {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.brand-name {
  overflow: hidden;
  color: var(--sidebar-text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-sub {
  color: var(--sidebar-faint);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.145em;
  line-height: 1.2;
}

.sidebar-close {
  display: none;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  padding: 0;
  color: var(--sidebar-muted);
  background: transparent;
  border: 1px solid var(--sidebar-line);
  border-radius: 9px;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.sidebar-close:hover {
  color: var(--sidebar-text);
  background: var(--sidebar-hover);
}

.sidebar-close .icon {
  width: 16px;
  height: 16px;
}

.sidebar-intro {
  max-width: 225px;
  margin: 20px 2px 16px;
  color: var(--sidebar-muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.search-field {
  position: relative;
  height: 40px;
  flex: none;
  margin-bottom: 22px;
  background: rgba(255, 255, 255, 0.048);
  border: 1px solid var(--sidebar-line);
  border-radius: 10px;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.search-field:focus-within {
  background: rgba(255, 255, 255, 0.068);
  border-color: rgba(255, 138, 96, 0.52);
  box-shadow: 0 0 0 3px rgba(255, 138, 96, 0.12);
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--sidebar-faint);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 100%;
  padding: 0 64px 0 36px;
  color: var(--sidebar-text);
  background: transparent;
  border: 0;
  border-radius: inherit;
  outline: none;
  font-size: 12.5px;
}

.search-field input::placeholder {
  color: var(--sidebar-faint);
}

.search-field input::-webkit-search-cancel-button,
.search-field input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-kbd {
  position: absolute;
  top: 50%;
  right: 9px;
  padding: 3px 5px;
  color: var(--sidebar-faint);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  color: var(--sidebar-muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  transform: translateY(-50%);
}

.search-clear:hover {
  color: var(--sidebar-text);
  background: var(--sidebar-hover);
}

.search-clear .icon {
  width: 14px;
  height: 14px;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  margin-right: -9px;
  padding-right: 9px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(255, 255, 255, 0.13) transparent;
  scrollbar-width: thin;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.13);
  border-radius: 99px;
}

.nav-group {
  margin-bottom: 22px;
}

.nav-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 9px 8px;
  color: var(--sidebar-faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.11em;
}

.nav-group-count {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.03em;
  opacity: 0.7;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  gap: 10px;
  padding: 8px 10px;
  color: var(--sidebar-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  text-align: left;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.nav-item-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--sidebar-faint);
  transition: color 0.16s ease;
}

.nav-item-icon .icon {
  width: 17px;
  height: 17px;
}

.nav-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 450;
  line-height: 1.4;
  letter-spacing: 0.002em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-active-dot {
  width: 5px;
  height: 5px;
  flex: none;
  background: #ff8659;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 134, 89, 0.11);
}

.nav-item.is-soon {
  color: var(--sidebar-faint);
}

.nav-item.is-soon .nav-item-label {
  opacity: 0.82;
}

.nav-item:hover {
  color: #e4ebe5;
  background: var(--sidebar-hover);
}

.nav-item:hover .nav-item-icon {
  color: var(--sidebar-muted);
}

.nav-item.is-active {
  color: #fffdf8;
  background: linear-gradient(90deg, rgba(232, 93, 47, 0.2), rgba(255, 255, 255, 0.045));
  border-color: rgba(255, 255, 255, 0.055);
}

.nav-item.is-active .nav-item-icon {
  color: #ff976f;
}

.nav-item.is-soon:hover .nav-item-icon {
  color: var(--sidebar-faint);
}

.nav-empty {
  margin: 12px 8px;
  padding: 20px 12px;
  color: var(--sidebar-muted);
  border: 1px dashed var(--sidebar-line);
  border-radius: 10px;
  text-align: center;
}

.nav-empty p {
  margin: 0 0 9px;
  font-size: 11.5px;
}

.nav-empty button {
  padding: 5px 10px;
  color: var(--sidebar-text);
  background: var(--sidebar-hover);
  border: 1px solid var(--sidebar-line);
  border-radius: 6px;
  font-size: 10.5px;
}

.nav-empty button:hover {
  background: rgba(255, 255, 255, 0.09);
}

.sidebar-footer {
  flex: none;
  margin-top: 15px;
  padding: 15px 2px 0;
  border-top: 1px solid var(--sidebar-line);
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--sidebar-muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.status-pulse {
  position: relative;
  width: 5px;
  height: 5px;
  flex: none;
  background: #75c9a8;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(117, 201, 168, 0.1);
}

.status-pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid rgba(117, 201, 168, 0.3);
  border-radius: 50%;
  animation: pulse-ring 2.8s ease-out infinite;
}

.sidebar-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  color: var(--sidebar-faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.015em;
}

.sidebar-backdrop {
  display: none;
}

/* ------------------------------------------------------------------
   Layout & top bar
   ------------------------------------------------------------------ */

.content-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  gap: 18px;
  padding-inline: max(var(--page-edge), calc((100% - var(--content-max)) / 2 + var(--page-edge)));
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
}

.topbar-left {
  min-width: 0;
  gap: 12px;
}

.topbar-actions {
  flex: none;
  gap: 9px;
}

.menu-button {
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.menu-button:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.menu-button .icon {
  width: 17px;
  height: 17px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.breadcrumb-chevron {
  width: 11px;
  height: 11px;
  color: var(--faint);
  stroke-width: 2;
}

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

.crumb-current {
  overflow: hidden;
  color: var(--ink);
  font-weight: 600;
  text-overflow: ellipsis;
}

.mobile-page-title {
  display: none;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.privacy-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 29px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10.5px;
  white-space: nowrap;
}

.privacy-dot {
  width: 5px;
  height: 5px;
  flex: none;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--green-soft);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.icon-button:active {
  transform: scale(0.96);
}

.icon-button .icon {
  width: 16px;
  height: 16px;
}

.theme-icon {
  grid-area: 1 / 1;
}

:root[data-theme="light"] .theme-icon-sun,
:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

.main-content {
  width: 100%;
  max-width: var(--content-max);
  flex: 1;
  margin: 0 auto;
  padding: 0 var(--page-edge) 34px;
}

/* ------------------------------------------------------------------
   Page hero
   ------------------------------------------------------------------ */

.page-hero {
  position: relative;
  padding: 36px 0 24px;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 740px;
  animation: rise-in 0.52s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.145em;
  line-height: 1;
}

.eyebrow-line {
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.eyebrow-index {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 18px;
  padding: 0 4px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.03em;
}

.page-hero h1 {
  margin: 13px 0 12px;
  color: var(--ink);
  font-size: clamp(34px, 4.25vw, 52px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.hero-title-main {
  position: relative;
  z-index: 0;
  white-space: nowrap;
}

.hero-title-main::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -0.005em;
  bottom: 0.08em;
  left: 0.01em;
  height: 0.16em;
  background: var(--accent);
  border-radius: 999px;
  opacity: 0.26;
}

.hero-title-sub {
  color: var(--ink-soft);
  font-size: 0.64em;
  font-weight: 500;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.hero-description {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
}

.hero-examples {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.examples-label {
  margin-right: 2px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.example-chip {
  height: 27px;
  padding: 0 10px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.example-chip:hover {
  color: var(--accent-strong);
  background: var(--accent-faint);
  border-color: rgba(200, 72, 29, 0.32);
  transform: translateY(-1px);
}

.example-chip:active {
  transform: translateY(0);
}

.examples-hint {
  margin-left: 2px;
  color: var(--faint);
  font-size: 9.5px;
}

.hero-mark {
  position: absolute;
  top: 16px;
  right: -5px;
  z-index: 0;
  color: transparent;
  font-family: var(--font-mono);
  font-size: clamp(136px, 16vw, 205px);
  font-weight: 700;
  letter-spacing: -0.12em;
  line-height: 0.85;
  opacity: 0.64;
  pointer-events: none;
  user-select: none;
  -webkit-text-stroke: 1px var(--line-strong);
  transform: rotate(-5deg);
}

/* ------------------------------------------------------------------
   Tool card
   ------------------------------------------------------------------ */

.tool-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  scroll-margin-top: 84px;
  animation: rise-in 0.55s 0.06s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.tool-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  left: 24px;
  width: 48px;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 2px 2px;
}

.tool-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.mode-switch {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.mode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 32px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.mode-button:hover {
  color: var(--ink);
}

.mode-button.is-active {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 1px 3px rgba(23, 35, 31, 0.08);
}

.tool-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.select-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-label {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-wrap select {
  height: 32px;
  min-width: 116px;
  padding: 0 29px 0 10px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  appearance: none;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.select-wrap select:hover {
  border-color: var(--line-strong);
}

.select-wrap select:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-halo);
}

.select-chevron {
  position: absolute;
  right: 8px;
  width: 12px;
  height: 12px;
  color: var(--faint);
  pointer-events: none;
}

.option-divider {
  width: 1px;
  height: 17px;
  background: var(--line);
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

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

.switch-track {
  position: relative;
  width: 31px;
  height: 18px;
  flex: none;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(23, 35, 31, 0.18);
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.switch-input:checked + .switch-track {
  background: var(--accent);
  border-color: var(--accent);
}

.switch-input:checked + .switch-track .switch-knob {
  background: #fffdfa;
  transform: translateX(13px);
}

.switch-input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.switch-control:hover .switch-track {
  border-color: var(--muted);
}

.switch-input:checked + .switch-track,
.switch-control:hover .switch-input:checked + .switch-track {
  border-color: var(--accent);
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
  align-items: stretch;
  padding: 20px;
}

.editor-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 342px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.editor-panel:focus-within {
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px var(--focus-halo);
}

.output-panel {
  background:
    linear-gradient(180deg, var(--accent-faint) 0, transparent 92px),
    var(--surface-2);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 49px;
  flex: none;
  gap: 8px;
  padding: 0 11px 0 15px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.panel-kicker {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1;
}

.output-kicker {
  color: var(--accent-strong);
}

.panel-title h3 {
  overflow: hidden;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-actions {
  display: flex;
  align-items: center;
  flex: none;
  gap: 2px;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 27px;
  gap: 5px;
  padding: 0 7px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 10.5px;
  line-height: 1;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.mini-button .icon {
  width: 13px;
  height: 13px;
}

.mini-button:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-3);
  border-color: var(--line);
}

.mini-button.is-copied {
  color: var(--green);
  background: var(--green-soft);
  border-color: transparent;
}

.icon-button-small {
  width: 27px;
  height: 27px;
  background: transparent;
  border-color: transparent;
  border-radius: 6px;
}

.icon-button-small .icon {
  width: 14px;
  height: 14px;
}

.mini-button:disabled,
.icon-button-small:disabled {
  color: var(--faint);
  background: transparent;
  border-color: transparent;
  opacity: 0.45;
  cursor: not-allowed;
}

.text-button {
  padding: 3px 4px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 10px;
  transition: color 0.16s ease, background-color 0.16s ease;
}

.text-button:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-3);
}

.text-button:disabled {
  color: var(--faint);
  opacity: 0.55;
  cursor: not-allowed;
}

.textarea-shell {
  display: flex;
  flex: 1;
  min-height: 254px;
}

.textarea-shell textarea {
  display: block;
  width: 100%;
  min-height: 100%;
  flex: 1;
  margin: 0;
  padding: 15px 16px 17px;
  overflow: auto;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: none;
  resize: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: -0.002em;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
  tab-size: 2;
}

.textarea-shell textarea::placeholder {
  color: var(--faint);
  opacity: 0.85;
}

.textarea-shell textarea::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.textarea-shell textarea::-webkit-scrollbar-track {
  background: transparent;
}

.textarea-shell textarea::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 2px solid transparent;
  border-radius: 99px;
  background-clip: padding-box;
}

#outputText {
  color: var(--ink-soft);
}

.output-panel.is-stale #outputText {
  opacity: 0.54;
}

.output-panel.is-fresh {
  animation: result-flash 0.55s ease-out;
}

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 37px;
  flex: none;
  gap: 8px;
  padding: 0 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: -0.01em;
}

.panel-stat {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.output-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 9.5px;
  letter-spacing: 0;
  white-space: nowrap;
}

.status-dot {
  width: 4px;
  height: 4px;
  flex: none;
  background: currentColor;
  border-radius: 50%;
}

.output-status.is-success {
  color: var(--green);
}

.output-status.is-stale {
  color: var(--accent-strong);
}

.output-status.is-error {
  color: var(--danger);
}

.swap-column {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swap-line {
  position: absolute;
  top: 19px;
  bottom: 19px;
  left: 50%;
  border-left: 1px dashed var(--line-strong);
  transform: translateX(-50%);
}

.swap-button {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  padding: 0;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow-float);
  transition: color 0.22s ease, border-color 0.22s ease, transform 0.32s ease, background-color 0.22s ease;
}

.swap-button .icon {
  width: 14px;
  height: 14px;
}

.swap-button:hover:not(:disabled) {
  color: var(--accent);
  background: var(--accent-faint);
  border-color: rgba(200, 72, 29, 0.4);
  transform: rotate(180deg);
}

.swap-button:disabled {
  color: var(--faint);
  background: var(--surface-2);
  box-shadow: none;
  opacity: 0.5;
  cursor: not-allowed;
}

.error-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -5px 20px 15px;
  padding: 11px 12px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  border-radius: 10px;
  animation: slide-in 0.22s ease-out both;
}

.error-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 21px;
  height: 21px;
  margin-top: 1px;
  color: var(--danger);
  background: var(--surface);
  border-radius: 50%;
}

.error-icon .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

.error-copy {
  min-width: 0;
  flex: 1;
}

.error-copy strong {
  display: block;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.55;
}

.error-copy p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.error-dismiss {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: -2px -2px 0 2px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
}

.error-dismiss:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
}

.error-dismiss .icon {
  width: 13px;
  height: 13px;
}

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 14px 20px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.action-hint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.shortcut-hint,
.local-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.shortcut-hint .icon {
  width: 13px;
  height: 13px;
  color: var(--faint);
}

.local-hint .icon {
  width: 12px;
  height: 12px;
  color: var(--green);
}

.action-hint kbd {
  display: inline-block;
  padding: 2px 4px;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.25;
}

.shortcut-plus {
  margin: 0 2px;
}

.hint-separator {
  width: 1px;
  height: 13px;
  background: var(--line);
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 39px;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.button-secondary {
  color: var(--ink-soft);
  background: var(--surface);
  border-color: var(--line);
}

.button-secondary:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.button-primary {
  min-width: 123px;
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 10px 22px -12px rgba(200, 72, 29, 0.65);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 13px 25px -12px rgba(200, 72, 29, 0.72);
}

.button-primary:active:not(:disabled) {
  transform: translateY(0);
}

.button-primary .icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.button-primary:hover:not(:disabled) .icon {
  transform: translateX(2px);
}

.button:disabled {
  color: var(--faint);
  background: var(--surface-2);
  border-color: var(--line);
  box-shadow: none;
  opacity: 0.62;
  cursor: not-allowed;
}

.button:focus-visible {
  outline-offset: 3px;
}

/* ------------------------------------------------------------------
   Info cards & footer
   ------------------------------------------------------------------ */

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-top: 24px;
}

.info-card {
  min-height: 151px;
  padding: 18px 18px 19px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  animation: rise-in 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.info-card:nth-child(1) {
  animation-delay: 0.12s;
}

.info-card:nth-child(2) {
  animation-delay: 0.17s;
}

.info-card:nth-child(3) {
  animation-delay: 0.22s;
}

.info-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  margin-bottom: 14px;
  border-radius: 9px;
}

.info-icon .icon {
  width: 15px;
  height: 15px;
}

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

.info-icon-orange {
  color: var(--accent);
  background: var(--accent-soft);
}

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

.info-card h2 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.005em;
}

.info-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 25px;
  padding-top: 17px;
  color: var(--faint);
  border-top: 1px solid var(--line);
  font-size: 9.5px;
  line-height: 1.7;
}

.page-footer span span {
  margin: 0 3px;
  opacity: 0.65;
}

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

.clipboard-helper {
  position: fixed;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.toast-region {
  position: fixed;
  z-index: 180;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: min(330px, calc(100vw - 32px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  max-width: 100%;
  gap: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 34px -15px rgba(23, 35, 31, 0.35);
  font-size: 11.5px;
  line-height: 1.55;
  animation: toast-in 0.24s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.toast.is-leaving {
  animation: toast-out 0.2s ease-in both;
}

.toast-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 19px;
  height: 19px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 50%;
}

.toast.is-error .toast-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.toast.is-info .toast-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.toast-icon .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2;
}

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

@media (max-width: 1180px) {
  .hero-mark {
    display: none;
  }

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

  .info-card:last-child {
    grid-column: 1 / -1;
    min-height: auto;
  }
}

@media (max-width: 1040px) {
  .tool-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .tool-options {
    width: 100%;
    justify-content: flex-start;
  }

  .action-hint .local-hint,
  .action-hint .hint-separator {
    display: none;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: min(298px, 88vw);
    visibility: hidden;
    transform: translateX(-104%);
    transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s linear 0.28s;
    box-shadow: 22px 0 60px -30px rgba(0, 0, 0, 0.65);
  }

  .sidebar.is-open {
    visibility: visible;
    transform: translateX(0);
    transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s;
  }

  .sidebar-close {
    display: grid;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    visibility: hidden;
    background: rgba(5, 11, 8, 0.5);
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }

  .sidebar-backdrop.is-open {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.25s ease, visibility 0s;
  }

  .content-shell {
    margin-left: 0;
  }

  .menu-button {
    display: grid;
  }

  .main-content {
    padding-bottom: 28px;
  }

  .page-hero {
    padding-top: 30px;
  }
}

@media (max-width: 820px) {
  .editor-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 16px;
  }

  .editor-panel {
    min-height: 0;
  }

  .textarea-shell {
    min-height: 220px;
  }

  .swap-column {
    height: 46px;
    flex: none;
  }

  .swap-line {
    top: 50%;
    bottom: auto;
    right: 18px;
    left: 18px;
    border-top: 1px dashed var(--line-strong);
    border-left: 0;
    transform: translateY(-50%);
  }

  .swap-button {
    width: 31px;
    height: 31px;
  }

  .swap-button .icon {
    transform: rotate(90deg);
  }

  .swap-button:hover:not(:disabled) {
    transform: rotate(180deg);
  }

  .action-bar {
    align-items: stretch;
    flex-direction: column;
    padding: 13px 16px;
  }

  .action-buttons {
    justify-content: flex-end;
  }

  .action-hint {
    gap: 8px;
  }

  .action-hint .local-hint,
  .action-hint .hint-separator {
    display: inline-flex;
  }

  .error-banner {
    margin-right: 16px;
    margin-left: 16px;
  }
}

@media (max-width: 700px) {
  .topbar {
    height: 60px;
    gap: 12px;
  }

  .breadcrumb {
    display: none;
  }

  .mobile-page-title {
    display: block;
  }

  .privacy-chip {
    height: 28px;
    padding: 0 9px;
    font-size: 10px;
  }

  .main-content {
    padding-bottom: 24px;
  }

  .page-hero {
    padding: 26px 0 21px;
  }

  .page-hero h1 {
    margin-top: 11px;
    font-size: clamp(31px, 8.7vw, 39px);
    line-height: 1.12;
  }

  .hero-title-sub {
    font-size: 0.62em;
  }

  .hero-description {
    font-size: 12.5px;
    line-height: 1.8;
  }

  .hero-examples {
    gap: 6px;
    margin-top: 13px;
  }

  .example-chip {
    height: 26px;
    padding: 0 9px;
    font-size: 10px;
  }

  .examples-hint {
    display: none;
  }

  .tool-card {
    border-radius: 18px;
  }

  .tool-toolbar {
    padding: 13px;
  }

  .mode-switch {
    width: 100%;
  }

  .mode-button {
    flex: 1;
  }

  .tool-options {
    align-items: center;
    gap: 10px 12px;
  }

  .option-divider {
    display: none;
  }

  .editor-grid {
    padding: 13px;
  }

  .panel-head {
    padding: 0 9px 0 13px;
  }

  .textarea-shell {
    min-height: 204px;
  }

  .textarea-shell textarea {
    padding: 13px 14px 15px;
    font-size: 12px;
  }

  .action-bar {
    gap: 10px;
    padding: 12px 13px;
  }

  .action-hint {
    font-size: 9.5px;
  }

  .action-hint .local-hint,
  .action-hint .hint-separator {
    display: none;
  }

  .action-buttons {
    width: 100%;
  }

  .action-buttons .button {
    flex: 1;
  }

  .button-primary {
    min-width: 0;
  }

  .info-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 18px;
  }

  .info-card,
  .info-card:last-child {
    grid-column: auto;
    min-height: auto;
    padding: 16px;
  }

  .info-card {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
  }

  .info-icon {
    grid-row: 1 / span 2;
    margin-bottom: 0;
  }

  .info-card h2 {
    align-self: center;
    margin: 0 0 3px;
  }

  .info-card p {
    grid-column: 2;
    font-size: 11.5px;
    line-height: 1.72;
  }

  .page-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    margin-top: 20px;
    padding-top: 14px;
  }

  .toast-region {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 430px) {
  .select-control {
    width: 100%;
    justify-content: space-between;
  }

  .select-wrap {
    flex: 1;
    max-width: 165px;
  }

  .select-wrap select {
    width: 100%;
    min-width: 0;
  }

  .tool-options {
    justify-content: space-between;
  }

  .switch-control {
    font-size: 10px;
  }

  .eyebrow {
    font-size: 8.5px;
  }

  .hero-examples .examples-label {
    width: 100%;
    margin-bottom: 1px;
  }

  .page-footer {
    font-size: 9px;
  }
}

@media (max-width: 360px) {
  .privacy-chip {
    padding: 0 8px;
    font-size: 9.5px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .action-hint {
    display: none;
  }
}

/* ------------------------------------------------------------------
   Motion & accessibility preferences
   ------------------------------------------------------------------ */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-ring {
  0% {
    opacity: 0.7;
    transform: scale(0.8);
  }
  65%,
  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

@keyframes result-flash {
  0% {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--focus-halo);
  }
  100% {
    border-color: var(--line);
    box-shadow: none;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(4px) scale(0.985);
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .action-bar,
  .swap-column,
  .page-hero,
  .info-grid,
  .page-footer,
  .toast-region {
    display: none !important;
  }

  .content-shell {
    margin: 0;
  }

  .main-content {
    max-width: none;
    padding: 0;
  }

  .tool-card {
    border: 0;
    box-shadow: none;
  }

  .editor-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .editor-panel {
    min-height: 300px;
  }
}
