/* Mehrnet Tools — shared Mehrnet shell, neutral tools accent */

:root {
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "Roboto Mono", Menlo, Monaco, Consolas, monospace;
  --text-xs: .7rem;
  --text-sm: .78rem;
  --text-base: .88rem;
  --text-md: 1rem;
  --text-lg: 1.2rem;
  --text-xl: 1.5rem;
  --text-2xl: clamp(2rem, 4vw, 3.35rem);
  --space-1: .2rem;
  --space-2: .35rem;
  --space-3: .5rem;
  --space-4: .75rem;
  --space-5: 1rem;
  --space-6: 1.25rem;
  --space-7: 1.5rem;
  --space-8: 2rem;
  --space-9: 2.5rem;
  --space-10: 3rem;
  --radius-xs: .35rem;
  --radius-sm: .4rem;
  --radius-md: .55rem;
  --radius-lg: .7rem;
  --radius-xl: 1rem;
  --radius-full: 999rem;
  --duration-fast: .15s;
  --duration-base: .22s;
  --ease-out: cubic-bezier(0, 0, .2, 1);
}

[data-theme="dark"] {
  --bg-primary: #0f1417;
  --bg-secondary: #171e23;
  --bg-card: #1b242a;
  --bg-card-hover: #222d34;
  --glass-bg: rgba(23, 30, 35, .78);
  --text-primary: #f5f6f7;
  --text-secondary: #a2adb3;
  --text-muted: #6f7b82;
  --border: rgba(255, 255, 255, .09);
  --border-subtle: rgba(255, 255, 255, .045);
  --border-hover: rgba(255, 255, 255, .19);
  --accent: #aab5bd;
  --accent-hover: #d4dbe0;
  --accent-rgb: 170, 181, 189;
  --accent-subtle: rgba(170, 181, 189, .13);
  --accent-text: #d4dbe0;
  --success: #4ade80;
  --success-subtle: rgba(74, 222, 128, .13);
  --warning: #fbbf24;
  --warning-subtle: rgba(251, 191, 36, .13);
  --danger: #f87171;
  --danger-subtle: rgba(248, 113, 113, .13);
  --shadow-sm: 0 .0625rem .125rem rgba(0, 0, 0, .35);
  --shadow-md: 0 .5rem 1.5rem rgba(0, 0, 0, .22);
  --shadow-lg: 0 1.25rem 3.5rem rgba(0, 0, 0, .34);
}

[data-theme="black"] {
  --bg-primary: #000;
  --bg-secondary: #0c0d0e;
  --bg-card: #131516;
  --bg-card-hover: #1c1e20;
  --glass-bg: rgba(10, 10, 10, .82);
  --text-primary: #fff;
  --text-secondary: #a0a0a0;
  --text-muted: #626568;
  --border: rgba(255, 255, 255, .13);
  --border-subtle: rgba(255, 255, 255, .06);
  --border-hover: rgba(255, 255, 255, .25);
  --accent: #cbd5e1;
  --accent-hover: #f1f5f9;
  --accent-rgb: 203, 213, 225;
  --accent-subtle: rgba(203, 213, 225, .15);
  --accent-text: #e2e8f0;
  --success: #4ade80;
  --success-subtle: rgba(74, 222, 128, .14);
  --warning: #facc15;
  --warning-subtle: rgba(250, 204, 21, .14);
  --danger: #f87171;
  --danger-subtle: rgba(248, 113, 113, .14);
  --shadow-sm: 0 .0625rem .125rem rgba(0, 0, 0, .8);
  --shadow-md: 0 .5rem 1.5rem rgba(0, 0, 0, .62);
  --shadow-lg: 0 1.25rem 3.5rem rgba(0, 0, 0, .9);
}

[data-theme="light"] {
  --bg-primary: #f5f7f8;
  --bg-secondary: #fff;
  --bg-card: #fff;
  --bg-card-hover: #edf1f3;
  --glass-bg: rgba(255, 255, 255, .84);
  --text-primary: #172027;
  --text-secondary: #53616a;
  --text-muted: #89959c;
  --border: rgba(23, 32, 39, .1);
  --border-subtle: rgba(23, 32, 39, .055);
  --border-hover: rgba(23, 32, 39, .2);
  --accent: #475569;
  --accent-hover: #334155;
  --accent-rgb: 71, 85, 105;
  --accent-subtle: rgba(71, 85, 105, .1);
  --accent-text: #334155;
  --success: #15803d;
  --success-subtle: rgba(21, 128, 61, .1);
  --warning: #b45309;
  --warning-subtle: rgba(180, 83, 9, .11);
  --danger: #b91c1c;
  --danger-subtle: rgba(185, 28, 28, .1);
  --shadow-sm: 0 .0625rem .125rem rgba(15, 23, 42, .07);
  --shadow-md: 0 .5rem 1.5rem rgba(15, 23, 42, .08);
  --shadow-lg: 0 1.25rem 3.5rem rgba(15, 23, 42, .12);
}

*, *::before, *::after { box-sizing: border-box; }
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }

html {
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { margin: 0; height: 100%; background: var(--bg-primary); }
body, button, input { font-family: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
.mono { font-family: var(--font-mono); }
.container { width: min(100%, 76rem); margin: 0 auto; padding-inline: var(--space-6); }
.icon { display: inline-block; width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-xs { width: .78rem; height: .78rem; }

.page {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 32rem;
  overflow: hidden;
  isolation: isolate;
}

.page::before, .page::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}
.page::before {
  inset: 3.75rem 0 2.75rem;
  opacity: .6;
  background-image: linear-gradient(var(--border-subtle) 1px, transparent 1px), linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 4rem 4rem;
  mask-image: linear-gradient(to bottom, black, transparent 76%);
}
.page::after {
  top: 4rem;
  left: 50%;
  width: 44rem;
  height: 20rem;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, var(--accent-subtle), transparent 68%);
  opacity: .55;
  filter: blur(1.5rem);
}

.nav {
  position: relative;
  z-index: 10;
  flex: 0 0 3.75rem;
  display: flex;
  align-items: center;
  background: var(--glass-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(.85rem);
  -webkit-backdrop-filter: blur(.85rem);
}
.nav-container { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.nav-brand { justify-self: start; display: inline-flex; align-items: center; gap: .6rem; }
.brand-mark-icon { display: grid; width: 2rem; height: 2rem; place-items: center; color: var(--accent); background: var(--bg-secondary); border: 1px solid var(--border-hover); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.brand-mark-icon svg { width: 1.22rem; height: 1.22rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-size: .94rem; font-weight: 800; letter-spacing: -.025em; }
.brand-name span { color: var(--accent); }
.brand-sub { margin-top: .18rem; color: var(--text-muted); font-size: .52rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.nav-center { display: flex; align-items: center; gap: .9rem; }
.nav-link { display: inline-flex; align-items: center; gap: .45rem; color: var(--text-secondary); font-size: var(--text-sm); font-weight: 650; transition: color var(--duration-fast), background var(--duration-fast); }
.nav-link:hover, .nav-link.active { color: var(--text-primary); }
.nav-link.active { color: var(--accent-text); }
.nav-link.muted { color: var(--text-muted); font-weight: 550; }
.nav-link.muted:hover { color: var(--text-secondary); }
.nav-link-dot { width: .34rem; height: .34rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 .5rem rgba(var(--accent-rgb), .75); }
.nav-divider { width: 1px; height: 1.1rem; background: var(--border); }
.nav-right { justify-self: end; display: flex; align-items: center; gap: .75rem; }
.protocol-badge { display: inline-flex; align-items: center; gap: .38rem; color: var(--text-muted); font-family: var(--font-mono); font-size: .61rem; font-weight: 700; letter-spacing: .08em; }
.status-dot { width: .38rem; height: .38rem; border-radius: 50%; background: var(--success); box-shadow: 0 0 .45rem rgba(74, 222, 128, .65); }
.icon-button { display: inline-grid; width: 2rem; height: 2rem; place-items: center; padding: 0; background: transparent; border: 1px solid transparent; border-radius: var(--radius-md); color: var(--text-secondary); cursor: pointer; transition: border-color var(--duration-fast), background var(--duration-fast), color var(--duration-fast); }
.icon-button:hover, .icon-button[aria-expanded="true"] { background: var(--accent-subtle); border-color: var(--border-hover); color: var(--text-primary); }
.theme-picker { position: relative; }
.theme-menu { position: absolute; z-index: 20; top: calc(100% + .55rem); right: 0; width: 10.5rem; padding: .45rem; background: var(--bg-card); border: 1px solid var(--border-hover); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.theme-menu[hidden] { display: none; }
.menu-label { display: block; padding: .35rem .55rem .3rem; color: var(--text-muted); font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.theme-menu button { display: flex; align-items: center; width: 100%; gap: .55rem; padding: .5rem .55rem; background: transparent; border: 0; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: var(--text-sm); text-align: left; cursor: pointer; }
.theme-menu button:hover, .theme-menu button.active { background: var(--bg-card-hover); color: var(--text-primary); }
.theme-swatch { width: .72rem; height: .72rem; border: 1px solid var(--border-hover); border-radius: 50%; }
.swatch-dark { background: #39444b; } .swatch-black { background: #000; } .swatch-light { background: #f2f5f7; }
.theme-check { margin-left: auto; color: var(--accent); opacity: 0; }
.theme-menu button.active .theme-check { opacity: 1; }

.content { flex: 1; min-height: 0; overflow-y: auto; padding: clamp(2rem, 7vh, 5rem) var(--space-6) var(--space-8); }
.content:focus { outline: none; }
.workspace { display: grid; grid-template-columns: minmax(15rem, .76fr) minmax(25rem, 1.24fr); align-items: start; gap: clamp(2rem, 7vw, 7rem); width: min(100%, 68rem); margin: 0 auto; }
.intro-panel { padding-top: 1.1rem; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1rem; color: var(--accent-text); font-family: var(--font-mono); font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 1.65rem; height: 1px; background: var(--accent); }
h1, h2, p { margin: 0; }
h1 { max-width: 16ch; color: var(--text-primary); font-size: var(--text-2xl); font-weight: 780; letter-spacing: -.055em; line-height: 1.05; }
.intro-copy { max-width: 31rem; margin-top: 1.35rem; color: var(--text-secondary); font-size: var(--text-md); line-height: 1.75; }
.intro-copy strong { color: var(--text-primary); font-weight: 650; }
.protocol-note { display: flex; gap: .8rem; max-width: 27rem; margin-top: 2rem; padding: .95rem 1rem; border: 1px solid var(--border); border-left: 2px solid var(--accent); border-radius: var(--radius-md); background: rgba(var(--accent-rgb), .035); }
.protocol-note-icon { display: grid; flex: 0 0 1.5rem; width: 1.5rem; height: 1.5rem; place-items: center; color: var(--accent-text); background: var(--accent-subtle); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: .68rem; font-weight: 800; }
.protocol-note p { color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.6; }
.protocol-note code { color: var(--accent-text); font-family: var(--font-mono); font-size: .72rem; }
.direct-route { display: inline-flex; align-items: center; gap: .45rem; margin-top: 2rem; color: var(--text-muted); font-family: var(--font-mono); font-size: .65rem; }
.direct-route code { max-width: 17rem; overflow: hidden; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; }
.route-chip { padding: .2rem .38rem; border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--accent-text); font-size: .58rem; letter-spacing: .06em; }
.direct-example { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; margin-top: .55rem; color: var(--text-muted); font-family: var(--font-mono); font-size: .65rem; }
.direct-example code { color: var(--text-secondary); }

.tool-card { overflow: hidden; background: color-mix(in srgb, var(--bg-card) 95%, var(--accent) 5%); border: 1px solid var(--border-hover); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
.tool-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--border); }
.tool-card-title { display: flex; align-items: center; gap: .7rem; }
.tool-icon { display: grid; width: 2rem; height: 2rem; place-items: center; color: var(--accent-text); background: var(--accent-subtle); border: 1px solid rgba(var(--accent-rgb), .24); border-radius: var(--radius-md); }
.tool-icon svg { width: 1.08rem; height: 1.08rem; }
.tool-title-copy { display: flex; flex-direction: column; gap: .1rem; }
.tool-title-copy strong { font-size: var(--text-md); font-weight: 720; }
.tool-title-copy span { color: var(--text-muted); font-family: var(--font-mono); font-size: .6rem; letter-spacing: .05em; text-transform: uppercase; }
.local-label { display: inline-flex; align-items: center; gap: .32rem; color: var(--success); font-family: var(--font-mono); font-size: .6rem; font-weight: 700; letter-spacing: .08em; }
.local-label .status-dot { width: .3rem; height: .3rem; }
.tool-card-body { padding: 1.25rem; }
.field-label { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .5rem; color: var(--text-secondary); font-size: var(--text-sm); font-weight: 650; }
.field-hint { color: var(--text-muted); font-family: var(--font-mono); font-size: .62rem; font-weight: 500; }
.secret-field { position: relative; display: flex; align-items: center; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); transition: border-color var(--duration-fast), box-shadow var(--duration-fast); }
.secret-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.secret-field.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-subtle); }
.secret-field input { min-width: 0; flex: 1; height: 3rem; padding: .1rem .8rem; background: transparent; border: 0; outline: 0; color: var(--text-primary); font-family: var(--font-mono); font-size: .78rem; letter-spacing: .045em; }
.secret-field input::placeholder { color: var(--text-muted); letter-spacing: 0; }
.field-actions { display: flex; align-items: center; gap: .15rem; padding-right: .35rem; }
.field-action { display: inline-grid; width: 2rem; height: 2rem; place-items: center; padding: 0; background: transparent; border: 0; border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer; transition: background var(--duration-fast), color var(--duration-fast); }
.field-action:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.field-action svg { width: .95rem; height: .95rem; }
.feedback { min-height: 1.2rem; padding-top: .45rem; color: var(--danger); font-size: .68rem; }
.feedback:empty { padding-top: 0; min-height: .25rem; }
.helper-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .25rem; color: var(--text-muted); font-size: .66rem; }
.helper-row span:first-child { display: inline-flex; align-items: center; gap: .35rem; }
.helper-row svg { width: .78rem; height: .78rem; color: var(--accent); }
.text-action { padding: .2rem .25rem; background: none; border: 0; color: var(--text-secondary); font-size: .67rem; cursor: pointer; }
.text-action:hover { color: var(--accent-text); }
.primary-action { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; width: 100%; height: 2.8rem; margin-top: 1rem; padding: 0 1rem; background: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius-md); color: #11161b; font-size: var(--text-sm); font-weight: 750; cursor: pointer; transition: background var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast), box-shadow var(--duration-fast); }
[data-theme="light"] .primary-action { color: #fff; }
.primary-action:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 .4rem 1.1rem rgba(var(--accent-rgb), .2); transform: translateY(-1px); }
.primary-action:active { transform: translateY(0); }
.primary-action svg { width: .95rem; height: .95rem; }

.code-panel { position: relative; margin-top: 1.25rem; padding: 1.15rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.code-panel::before { position: absolute; top: 0; left: 1.15rem; width: 3.2rem; height: 2px; content: ""; background: var(--accent); }
.code-panel-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.code-label { color: var(--text-muted); font-family: var(--font-mono); font-size: .61rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.code-state { display: inline-flex; align-items: center; gap: .32rem; color: var(--text-muted); font-family: var(--font-mono); font-size: .6rem; }
.code-state.live { color: var(--success); }
.code-state .status-dot { width: .3rem; height: .3rem; }
.code-value { min-height: 4.3rem; margin: .65rem 0 .8rem; color: var(--text-primary); font-family: var(--font-mono); font-size: clamp(2.6rem, 7vw, 4rem); font-weight: 760; letter-spacing: .11em; line-height: 1.05; text-align: center; text-indent: .11em; }
.code-value.placeholder { color: var(--text-muted); font-size: 2.4rem; letter-spacing: .18em; opacity: .45; }
.code-value.is-refreshing { animation: code-refresh .22s ease-out; }
@keyframes code-refresh { from { opacity: .35; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.code-bottom { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .85rem; border-top: 1px solid var(--border-subtle); }
.code-meta { display: flex; align-items: center; gap: .5rem; color: var(--text-muted); font-family: var(--font-mono); font-size: .61rem; }
.meta-divider { color: var(--border-hover); }
.copy-code { display: inline-flex; align-items: center; gap: .4rem; padding: .42rem .62rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); font-size: .67rem; font-weight: 650; cursor: pointer; transition: border-color var(--duration-fast), color var(--duration-fast), background var(--duration-fast); }
.copy-code:hover:not(:disabled) { color: var(--text-primary); background: var(--bg-card-hover); border-color: var(--border-hover); }
.copy-code:disabled { cursor: not-allowed; opacity: .4; }
.copy-code svg { width: .8rem; height: .8rem; }
.timer-row { display: flex; align-items: center; justify-content: center; gap: .65rem; margin-top: .9rem; color: var(--text-muted); font-family: var(--font-mono); font-size: .64rem; }
.timer-ring { position: relative; display: inline-grid; width: 1.4rem; height: 1.4rem; place-items: center; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 2.5; }
.timer-ring .track { stroke: var(--border-hover); }
.timer-ring .progress { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 31.4; stroke-dashoffset: var(--timer-offset, 0); transition: stroke-dashoffset .35s linear, stroke var(--duration-fast); }
.timer-ring span { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-secondary); font-size: .5rem; }
.security-strip { display: flex; align-items: flex-start; gap: .65rem; margin-top: 1rem; padding: .8rem .9rem; background: var(--warning-subtle); border: 1px solid rgba(251, 191, 36, .18); border-radius: var(--radius-md); color: var(--text-secondary); font-size: .68rem; line-height: 1.55; }
.security-strip svg { flex: 0 0 auto; width: .9rem; height: .9rem; margin-top: .12rem; color: var(--warning); }
.security-strip strong { color: var(--text-primary); font-weight: 700; }
.security-strip code { color: var(--warning); font-family: var(--font-mono); font-size: .64rem; }
.advanced { margin-top: 1rem; border-top: 1px solid var(--border); }
.advanced summary { display: flex; align-items: center; justify-content: space-between; padding-top: .9rem; color: var(--text-secondary); font-size: .7rem; font-weight: 650; cursor: pointer; list-style: none; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after { content: "+"; color: var(--text-muted); font-family: var(--font-mono); font-size: 1rem; font-weight: 400; }
.advanced[open] summary::after { content: "–"; }
.advanced-content { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; padding-top: .8rem; }
.meta-cell { min-width: 0; padding: .62rem .7rem; background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }
.meta-cell-label { display: block; margin-bottom: .22rem; color: var(--text-muted); font-size: .59rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.meta-cell-value { display: block; overflow: hidden; color: var(--text-secondary); font-family: var(--font-mono); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }

.footer { flex: 0 0 2.75rem; border-top: 1px solid var(--border-subtle); color: var(--text-muted); font-size: .62rem; }
.footer-inner { display: flex; align-items: center; height: 100%; gap: .55rem; }
.footer-separator { color: var(--border-hover); }
.footer-spacer { flex: 1; }
.footer a { color: var(--text-secondary); transition: color var(--duration-fast); }
.footer a:hover { color: var(--accent-text); }
.toast-container { position: fixed; z-index: 100; right: 1.25rem; bottom: 1.25rem; display: flex; flex-direction: column; gap: .5rem; width: min(22rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: .55rem; padding: .75rem .85rem; background: var(--bg-card); border: 1px solid var(--border-hover); border-left: 2px solid var(--accent); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); color: var(--text-secondary); font-size: .72rem; pointer-events: auto; animation: toast-in .2s var(--ease-out); }
.toast.success { border-left-color: var(--success); } .toast.error { border-left-color: var(--danger); }
.toast svg { flex: 0 0 auto; width: .9rem; height: .9rem; margin-top: .1rem; color: var(--accent); } .toast.success svg { color: var(--success); } .toast.error svg { color: var(--danger); }
.toast-message { flex: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(.4rem); } to { opacity: 1; transform: translateY(0); } }

button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#top-loading-bar { position: fixed; z-index: 999; top: 0; left: 0; right: 0; height: 2px; opacity: 0; pointer-events: none; overflow: hidden; }
#top-loading-bar span { display: block; width: 38%; height: 100%; background: var(--accent); transform: translateX(-110%); }
#top-loading-bar.running { opacity: 1; } #top-loading-bar.running span { animation: top-load 1.1s linear infinite; }
@keyframes top-load { to { transform: translateX(300%); } }

@media (max-width: 54rem) {
  .workspace { grid-template-columns: 1fr; gap: 1.75rem; width: min(100%, 42rem); }
  .intro-panel { padding-top: 0; }
  h1 { max-width: 20ch; }
  .protocol-note { margin-top: 1.4rem; }
  .direct-route { margin-top: 1.2rem; }
}
@media (max-width: 38rem) {
  .container { padding-inline: 1rem; }
  .nav { flex-basis: 3.5rem; }
  .nav-container { grid-template-columns: 1fr auto; }
  .nav-center { display: none; }
  .protocol-badge { display: none; }
  .content { padding: 1.8rem 1rem 2rem; }
  .tool-card-body { padding: 1rem; }
  .tool-card-head { padding: .95rem 1rem; }
  .tool-card { border-radius: var(--radius-lg); }
  .field-hint { display: none; }
  .secret-field input { font-size: .68rem; }
  .field-action, .theme-picker .icon-button { width: 2.75rem; height: 2.75rem; }
  .text-action { min-width: 2.75rem; min-height: 2.75rem; padding: .5rem .65rem; }
  .theme-menu button { min-height: 2.75rem; }
  .code-panel { padding: .9rem; }
  .code-panel::before { left: .9rem; }
  .code-value { min-height: 3.7rem; margin: .65rem 0 .7rem; font-size: clamp(2.2rem, 13vw, 3.3rem); }
  .code-bottom { align-items: flex-end; }
  .code-meta { flex-wrap: wrap; row-gap: .15rem; max-width: 12rem; line-height: 1.35; }
  .advanced-content { grid-template-columns: 1fr 1fr; }
  .footer { flex-basis: 2.5rem; }
  .footer-separator, .footer-spacer, .footer a { display: none; }
  .footer-inner { justify-content: center; }
  .toast-container { right: 1rem; bottom: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
