/* OD-LAYOUT-PRIMITIVES v1 */
@layer od-layout {
  [hidden]:not([hidden="until-found" i]) { display: none !important; }
  dialog:not([open]) { display: none !important; }
  :where(.od-stack,.od-row,.od-row-top,.od-cluster,.od-grid,.od-field,.od-stat,.od-cell,.od-tile) > :where(*) { min-width: 0; }
  .od-stack   { display: flex; flex-direction: column; gap: var(--od-gap, 8px); }
  .od-row     { display: flex; align-items: center; gap: var(--od-gap, 8px); }
  .od-row-top { display: flex; align-items: flex-start; gap: var(--od-gap, 8px); }
  .od-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-gap, 8px); }
  .od-fill    { flex: 1 1 0; min-width: 0; }
  .od-fixed   { flex: none; }
  .od-grid    { display: grid; gap: var(--od-gap, 12px); grid-template-columns: repeat(var(--od-cols, 3), minmax(0, 1fr)); }
  .od-stat, .od-field, .od-cell { display: grid; gap: var(--od-gap, 2px); }
  :where(.od-stat,.od-field,.od-cell) > :where(*) { display: block; }
  .od-tile { display: grid; grid-template-rows: auto 1fr; }
  :where(.od-tile) > :where(*) { display: block; }
  .od-media { display: block; width: 100%; height: auto; aspect-ratio: var(--od-ratio, auto); }
  .od-media-cover { object-fit: cover; }
  .od-icon { display: inline-block; inline-size: var(--od-icon-size, 1em); block-size: var(--od-icon-size, 1em); flex: none; }
  .od-truncate { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .od-clamp-2, .od-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .od-clamp-2 { -webkit-line-clamp: 2; }
  .od-clamp-3 { -webkit-line-clamp: 3; }
  .od-lines-2 { min-height: calc(2 * 1.4em); }
  .od-nowrap  { white-space: nowrap; }
  .od-keep    { word-break: keep-all; overflow-wrap: anywhere; }
  .od-screen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
  .od-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
  .od-rail { display: flex; gap: var(--od-gap, 8px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
             padding-inline: var(--od-rail-pad, 16px); scroll-padding-inline: var(--od-rail-pad, 16px); }
  .od-rail::-webkit-scrollbar { display: none; }
  :where(.od-rail) > :where(*) { flex: none; scroll-snap-align: start; }
  :where(.od-rail) > :where(:last-child) { margin-inline-end: var(--od-rail-pad, 16px); }
  .od-spacer { flex: none; visibility: hidden; pointer-events: none; }
  .od-touch  { min-width: 44px; min-height: 44px; }
}
:root [hidden]:where(:not([hidden="until-found" i])) { display: none; }
/* /OD-LAYOUT-PRIMITIVES v1 */

:root {
  color-scheme: dark;
  --bg: #070a0b;
  --bg-soft: #090d0e;
  --panel: #0d1213;
  --panel-2: #111719;
  --panel-3: #151e20;
  --line: #1c2729;
  --line-strong: #2b3a3c;
  --text: #dfe9e5;
  --text-strong: #f2faf7;
  --muted: #98a8a3;
  --subtle: #788883;
  --accent: #4de5c6;
  --accent-strong: #7cf2da;
  --accent-ink: #04120e;
  --green: #87e99e;
  --amber: #f2bd6d;
  --red: #ff9494;
  --rose: #f4aaa1;
  --blue: #86d9f4;
  --font-ui: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  height: 100vh;
  height: 100dvh;
  min-width: 320px;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
input[type="search"]::-webkit-search-cancel-button { display: none; }
::selection { background: rgba(77, 229, 198, 0.24); color: var(--text-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #263335; border: 3px solid transparent; border-radius: 999px; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #354649; background-clip: content-box; }

.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.od-icon { vertical-align: -0.15em; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  flex: none; display: flex; align-items: center; gap: 20px;
  min-height: 62px; padding: 0 22px;
  background: #080c0d; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid rgba(77,229,198,.34); border-radius: 8px;
  background: #0c1716; color: var(--accent);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-copy { display: grid; gap: 0; }
.brand-name { color: var(--text-strong); font-family: var(--font-mono); font-size: 15px; font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; }
.brand-sub { color: var(--subtle); font-size: 9.5px; line-height: 1.35; letter-spacing: 0.1em; white-space: nowrap; }

.top-search { position: relative; flex: 1; max-width: 620px; min-width: 180px; margin: 0 auto; }
.top-search > .search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--subtle); --od-icon-size: 14px; pointer-events: none; }
.search-input {
  width: 100%; height: 36px; padding: 7px 78px 7px 34px;
  border: 1px solid var(--line-strong); border-radius: 7px;
  background: #0b1112; color: var(--text);
  font-size: 12px; line-height: 1.4;
  transition: border-color 160ms ease-out, background 160ms ease-out;
}
.search-input::placeholder { color: #6b7b77; }
.search-input:hover { border-color: #3b4b4e; }
.search-input:focus { outline: none; border-color: var(--accent); background: #0a1011; box-shadow: 0 0 0 3px rgba(77,229,198,.09); }
.search-kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  min-width: 20px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px;
  color: var(--subtle); font-family: var(--font-mono); font-size: 9.5px; line-height: 1.5; text-align: center;
  transition: opacity 150ms ease-out;
}
.top-search:focus-within .search-kbd { opacity: 0; }
.search-clear {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; display: grid; place-items: center;
  border: 0; border-radius: 4px; background: transparent; color: var(--subtle);
}
.search-clear:hover { color: var(--text); background: var(--panel-3); }
.search-clear .od-icon { --od-icon-size: 13px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.mode-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 30px; padding: 3px 9px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: #0c1314; color: var(--muted);
  font-size: 10.5px; white-space: nowrap;
}
.mode-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.mode-chip.is-cloud .dot { background: var(--blue); }
.settings-btn {
  min-height: 34px; padding: 5px 10px;
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 6px;
  background: #0d1314; color: var(--muted); font-size: 11.5px;
}
.settings-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--panel-2); }
.settings-btn .od-icon { --od-icon-size: 14px; }

.main {
  flex: 1; min-height: 0; width: 100%; max-width: 1800px;
  margin: 0 auto; padding: 18px 22px calc(20px + env(safe-area-inset-bottom));
  overflow: hidden;
}
.workspace { height: 100%; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.workspace-head { flex: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0; color: var(--accent); font-size: 9.5px; font-weight: 600; letter-spacing: 0.14em; line-height: 1.5; text-transform: uppercase; }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.ws-title { margin: 0; color: var(--text-strong); font-size: clamp(24px, 2.3vw, 30px); font-weight: 600; line-height: 1.35; letter-spacing: 0; }
.scope-pill {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 24px; padding: 2px 7px;
  border: 1px solid var(--line); border-radius: 4px;
  color: var(--muted); background: #0b1112;
  font-family: var(--font-mono); font-size: 10px; line-height: 1.4;
}
.scope-pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.scope-pill.type-project { color: var(--green); border-color: rgba(135,233,158,.2); }
.scope-pill.type-server { color: var(--amber); border-color: rgba(242,189,109,.2); }
.scope-pill.type-public { color: var(--accent); border-color: rgba(77,229,198,.2); }
.scope-crumb { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.crumb { display: inline-flex; align-items: center; gap: 5px; color: var(--subtle); font-family: var(--font-mono); font-size: 10px; line-height: 1.4; white-space: nowrap; }
.crumb .dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.crumb.is-current { color: var(--text); }
.crumb-arrow { color: #4e5d59; }
.crumb-arrow .od-icon { --od-icon-size: 10px; }
.head-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.memory-note { display: inline-flex; align-items: center; gap: 5px; color: var(--subtle); font-size: 10px; white-space: nowrap; }
.memory-note .od-icon { --od-icon-size: 12px; color: var(--green); }
.scope-stats { color: var(--subtle); font-size: 10.5px; line-height: 1.5; white-space: nowrap; }
.scope-stats strong { color: var(--text); font-family: var(--font-mono); font-weight: 500; }

.paste-zone {
  flex: none; display: flex; align-items: flex-start; gap: 10px;
  padding: 7px 8px 7px 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 160ms ease-out;
}
.paste-zone:focus-within { border-color: rgba(77,229,198,.32); }
.paste-icon { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--subtle); margin-top: 2px; }
.paste-icon .od-icon { --od-icon-size: 14px; }
.paste-input-wrap { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 8px; }
.paste-input {
  flex: 1; min-width: 0; min-height: 32px; max-height: 112px; padding: 5px 0;
  resize: none; overflow-y: auto;
  border: 0; background: transparent; color: var(--text);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.6;
}
.paste-input::placeholder { color: #687873; }
.paste-input:focus { outline: none; }
.paste-submit {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 6px;
  background: #11191a; color: var(--muted);
  transition: background 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out;
}
.paste-submit:hover:not(:disabled) { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.paste-submit:disabled { opacity: 0.35; cursor: not-allowed; }
.paste-submit .od-icon { --od-icon-size: 14px; }
.paste-note { flex: none; color: var(--subtle); font-size: 10px; line-height: 1.55; padding-top: 8px; white-space: nowrap; }

.paste-result {
  flex: none; display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  min-height: 34px; padding: 6px 10px;
  border: 1px solid rgba(135,233,158,.2); border-radius: 7px;
  background: rgba(135,233,158,.045);
  color: var(--muted); font-size: 10.5px; line-height: 1.4;
}
.paste-result.is-error { border-color: rgba(255,148,148,.2); background: rgba(255,148,148,.045); }
.paste-result > .od-icon { color: var(--green); --od-icon-size: 13px; }
.paste-result.is-error > .od-icon { color: var(--red); }
.paste-result strong { color: var(--text); font-weight: 500; }
.paste-result .result-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 6px; border: 1px solid var(--line); border-radius: 3px;
  background: #0b1112; color: var(--muted); font-family: var(--font-mono); font-size: 9.5px;
}
.paste-result .result-chip.is-overwrite { color: var(--amber); border-color: rgba(242,189,109,.2); }
.paste-result .text-action { margin-left: auto; border: 0; background: none; color: var(--accent); font-size: 10.5px; text-decoration: underline; text-underline-offset: 3px; }
.paste-result .text-action:hover { color: var(--accent-strong); }

.workspace-grid {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: 224px minmax(0, 1fr) 342px;
  gap: 10px; align-items: stretch;
}
.panel { min-width: 0; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

.tree-panel { display: flex; flex-direction: column; overflow: hidden; }
.panel-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 13px 10px; border-bottom: 1px solid var(--line); }
.panel-heading { display: grid; gap: 1px; min-width: 0; }
.panel-kicker { color: var(--subtle); font-size: 9px; font-weight: 500; letter-spacing: 0.12em; line-height: 1.4; text-transform: uppercase; }
.panel-title { color: var(--text-strong); font-size: 12px; font-weight: 600; line-height: 1.4; }
.badge-count { color: var(--subtle); font-family: var(--font-mono); font-size: 9.5px; }
.tree-body { flex: 1; min-height: 0; overflow: auto; padding: 8px; }
.tree-section + .tree-section { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.tree-label { padding: 0 8px 6px; color: var(--subtle); font-size: 9px; font-weight: 500; letter-spacing: 0.12em; line-height: 1.4; text-transform: uppercase; }
.scope-item {
  width: 100%; display: flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 6px 7px; margin-bottom: 2px;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text); text-align: left;
  transition: background 150ms ease-out, border-color 150ms ease-out;
}
.scope-item:hover { background: #121a1c; }
.scope-item.is-active { background: #101d1b; border-color: rgba(77,229,198,.2); }
.scope-icon { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: #0b1112; color: var(--subtle); }
.scope-icon .od-icon { --od-icon-size: 12px; }
.scope-icon.type-public { color: var(--accent); }
.scope-icon.type-server { color: var(--amber); }
.scope-icon.type-project { color: var(--green); }
.scope-item.is-active .scope-icon { border-color: currentColor; }
.scope-copy { flex: 1; min-width: 0; display: grid; gap: 0; }
.scope-name { display: block; color: var(--text); font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.scope-name.is-cjk { font-family: var(--font-ui); font-size: 12px; }
.scope-sub { display: block; color: var(--subtle); font-size: 9.5px; line-height: 1.4; }
.scope-count { flex: none; color: var(--subtle); font-family: var(--font-mono); font-size: 9px; }
.scope-item.is-active .scope-count { color: var(--accent); }
.tree-group-head {
  width: 100%; display: flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 5px 7px; margin-bottom: 1px;
  border: 0; border-radius: 5px; background: transparent;
  color: var(--subtle); font-size: 9.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; text-align: left;
}
.tree-group-head:hover { color: var(--text); background: #121a1c; }
.tree-group-head .od-icon { --od-icon-size: 11px; transition: transform 160ms ease-out; }
.tree-group-head.is-collapsed .od-icon { transform: rotate(-90deg); }
.tree-group-head span:nth-child(2) { flex: 1; }
.tree-group-head .group-count { color: var(--subtle); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0; }
.tree-children[hidden] { display: none; }
.vault-note { flex: none; margin: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: #0a1011; }
.vault-note-head { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 10.5px; font-weight: 500; line-height: 1.4; }
.vault-note-head .od-icon { color: var(--green); --od-icon-size: 12px; }
.vault-note p { margin: 3px 0 0; color: var(--subtle); font-size: 9.5px; line-height: 1.55; }
.vault-code { display: block; margin-top: 5px; color: #61716c; font-family: var(--font-mono); font-size: 8.5px; line-height: 1.4; }

.vars-panel { display: flex; flex-direction: column; overflow: hidden; }
.vars-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 9px; border-bottom: 1px solid var(--line); }
.vars-heading { display: flex; align-items: center; gap: 7px; color: var(--text); font-size: 11.5px; font-weight: 500; }
.vars-heading .count { color: var(--subtle); font-family: var(--font-mono); font-size: 9.5px; font-weight: 400; }
.vars-hint { color: var(--subtle); font-size: 9.5px; line-height: 1.4; text-align: right; }
.table-wrap { flex: 1; min-height: 0; overflow: auto; }
.var-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.var-table thead { position: sticky; top: 0; z-index: 3; background: var(--panel); }
.var-table th { padding: 8px 9px; border-bottom: 1px solid var(--line); color: var(--subtle); font-size: 9px; font-weight: 500; letter-spacing: 0.09em; line-height: 1.4; text-align: left; text-transform: uppercase; white-space: nowrap; }
.var-table td { padding: 8px 9px; border-bottom: 1px solid rgba(28,39,41,.72); vertical-align: middle; }
.var-table tbody tr { transition: background 140ms ease-out; }
.var-table tbody tr.var-row:hover { background: #11191a; }
.var-table tbody tr.var-row.is-selected { background: rgba(77,229,198,.028); }
.var-table tbody tr.var-row.is-override { box-shadow: inset 2px 0 0 rgba(135,233,158,.32); }
.col-check { width: 36px; }
.col-value { width: 146px; }
.col-type { width: 74px; }
.col-source { width: 122px; }
.col-actions { width: 42px; }
.check-cell { text-align: center; }
.checkbox { appearance: none; width: 15px; height: 15px; margin: 0; position: relative; flex: none; border: 1px solid #425456; border-radius: 3px; background: #0a0f10; cursor: pointer; }
.checkbox:hover { border-color: #5a706e; }
.checkbox:checked { background: var(--accent); border-color: var(--accent); }
.checkbox:checked::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 3px; height: 7px; border-right: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: rotate(42deg); }
.checkbox:indeterminate { background: var(--accent); border-color: var(--accent); }
.checkbox:indeterminate::after { content: ""; position: absolute; left: 2.5px; top: 5.5px; width: 8px; height: 2px; background: var(--accent-ink); }
.key-cell { min-width: 0; }
.var-key { display: block; color: var(--text-strong); font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.var-note { display: block; margin-top: 1px; color: var(--subtle); font-size: 9.5px; line-height: 1.45; overflow-wrap: anywhere; }
.value-cell { min-width: 0; }
.value-toggle {
  max-width: 100%; display: flex; align-items: center; gap: 3px;
  padding: 0; border: 0; background: none; color: var(--subtle);
  font-family: var(--font-mono); font-size: 10.5px; line-height: 1.5; text-align: left;
}
.value-toggle:hover { color: var(--text); }
.value-toggle .value-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.value-toggle .value-text.is-revealed { color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
.value-toggle .od-icon { --od-icon-size: 12px; flex: none; opacity: 0; transition: opacity 150ms ease-out; }
.value-toggle:hover .od-icon, .value-toggle:focus-visible .od-icon { opacity: 1; }
.type-cell { white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 4px; min-height: 20px; padding: 1px 6px; border: 1px solid transparent; border-radius: 4px; font-size: 9.5px; font-weight: 500; line-height: 1.35; white-space: nowrap; }
.badge .od-icon { --od-icon-size: 10px; }
.badge-secret { color: var(--rose); background: rgba(244,170,161,.07); border-color: rgba(244,170,161,.17); }
.badge-plain { color: var(--muted); background: #141c1e; border-color: var(--line); }
.badge-public { color: #82efd8; background: rgba(77,229,198,.075); border-color: rgba(77,229,198,.19); }
.badge-server { color: #f5c578; background: rgba(242,189,109,.075); border-color: rgba(242,189,109,.19); }
.badge-project { color: #9cefaa; background: rgba(135,233,158,.075); border-color: rgba(135,233,158,.2); }
.source-cell { min-width: 0; }
.source-cell .badge { display: inline-flex; }
.source-sub { display: block; margin-top: 2px; color: var(--subtle); font-family: var(--font-mono); font-size: 8.5px; line-height: 1.35; overflow-wrap: anywhere; }
.shadow-row { background: #0b1011; }
.shadow-row td { color: #64736f; padding-top: 5px; padding-bottom: 5px; border-bottom-color: rgba(28,39,41,.48); }
.shadow-row .shadow-dash { display: block; width: 10px; height: 1px; margin: 0 auto; background: #344441; }
.shadow-key { display: block; color: #83928d; font-family: var(--font-mono); font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.shadow-note { display: block; margin-top: 1px; color: #5f6e69; font-size: 8.5px; line-height: 1.4; }
.shadow-value { color: #5f6e69; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; }
.shadow-type { color: #687873; font-size: 9px; }
.shadow-row .badge { opacity: 0.55; filter: saturate(.45); }
.shadow-status { display: block; margin-top: 2px; color: #65746f; font-size: 8.5px; line-height: 1.35; }
.action-cell { text-align: right; }
.row-menu-btn {
  width: 26px; height: 26px; display: inline-grid; place-items: center;
  border: 1px solid transparent; border-radius: 4px;
  background: transparent; color: var(--subtle);
}
.row-menu-btn:hover, .row-menu-btn[aria-expanded="true"] { color: var(--text); background: var(--panel-3); border-color: var(--line); }
.row-menu-btn .od-icon { --od-icon-size: 15px; }
.empty-row td { padding: 0; }
.empty-state { display: grid; justify-items: center; gap: 6px; padding: 34px 16px; text-align: center; }
.empty-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--subtle); background: #0a1011; }
.empty-icon .od-icon { --od-icon-size: 16px; }
.empty-state strong { color: var(--text); font-size: 11.5px; font-weight: 500; }
.empty-state p { margin: 0; max-width: 32ch; color: var(--subtle); font-size: 10.5px; line-height: 1.65; }
.text-action { border: 0; background: none; color: var(--accent); font-size: 10.5px; text-decoration: underline; text-underline-offset: 3px; }
.text-action:hover { color: var(--accent-strong); }
.table-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 11px; border-top: 1px solid var(--line); }
.table-foot span { color: var(--subtle); font-size: 9px; line-height: 1.45; }
.table-foot .lock-note { display: inline-flex; align-items: center; gap: 4px; }
.table-foot .lock-note .od-icon { --od-icon-size: 11px; color: var(--green); }

.output-panel { display: flex; flex-direction: column; overflow: hidden; }
.output-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 12px 12px 10px; border-bottom: 1px solid var(--line); }
.output-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.output-title strong { color: var(--text-strong); font-size: 12px; font-weight: 500; }
.flow-badge { display: inline-flex; align-items: center; gap: 4px; min-height: 20px; padding: 1px 6px; border: 1px solid rgba(135,233,158,.18); border-radius: 999px; color: var(--green); background: rgba(135,233,158,.05); font-size: 9px; white-space: nowrap; }
.flow-badge .dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.output-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.icon-btn { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--subtle); }
.icon-btn:hover:not(:disabled) { color: var(--text); background: var(--panel-3); border-color: var(--line); }
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.icon-btn .od-icon { --od-icon-size: 14px; }
.output-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 9px; padding: 10px 11px 11px; }
.output-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--subtle); font-size: 9.5px; line-height: 1.4; }
.output-meta strong { color: var(--text); font-family: var(--font-mono); font-weight: 500; }
.code-shell { flex: 1; min-height: 170px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #080c0d; }
.code-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; padding: 4px 8px; border-bottom: 1px solid var(--line); background: #0b1011; }
.code-file { color: var(--subtle); font-family: var(--font-mono); font-size: 9px; line-height: 1.4; overflow-wrap: anywhere; }
.code-state { color: #5e6e69; font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.08em; white-space: nowrap; }
.code-scroll { flex: 1; min-height: 0; overflow: auto; padding: 9px 10px; }
.code-scroll pre { margin: 0; color: #cfe1db; font-family: var(--font-mono); font-size: 9.5px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
.code-empty { height: 100%; min-height: 150px; display: grid; place-items: center; padding: 20px 12px; text-align: center; }
.code-empty .empty-state { padding: 0; }
.copy-bar { flex: none; display: grid; gap: 5px; }
.copy-split { display: grid; grid-template-columns: minmax(0, 1fr) 38px; overflow: hidden; border: 1px solid var(--accent); border-radius: 6px; }
.copy-main {
  min-height: 36px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; background: var(--accent); color: var(--accent-ink);
  font-size: 11.5px; font-weight: 600; line-height: 1.2;
}
.copy-main:hover:not(:disabled) { background: var(--accent-strong); }
.copy-main:disabled { opacity: 0.45; cursor: not-allowed; }
.copy-main .od-icon { --od-icon-size: 14px; }
.copy-toggle { min-height: 36px; display: grid; place-items: center; border: 0; border-left: 1px solid rgba(4,18,14,.22); background: var(--accent); color: var(--accent-ink); }
.copy-toggle:hover { background: var(--accent-strong); }
.copy-toggle .od-icon { --od-icon-size: 14px; }
.copy-hint { color: var(--subtle); font-size: 9px; line-height: 1.45; }
.ai-composer { flex: none; display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.ai-row { display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 7px; border: 1px solid var(--line); border-radius: 6px; background: #0a1011; }
.ai-row:focus-within { border-color: rgba(77,229,198,.32); }
.ai-row > .od-icon { color: var(--accent); --od-icon-size: 13px; flex: none; }
.ai-input { flex: 1; min-width: 0; height: 32px; border: 0; background: transparent; color: var(--text); font-size: 10.5px; line-height: 1.4; }
.ai-input::placeholder { color: #687873; }
.ai-input:focus { outline: none; }
.ai-send { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--subtle); }
.ai-send:hover:not(:disabled) { color: var(--accent); background: rgba(77,229,198,.07); border-color: rgba(77,229,198,.16); }
.ai-send:disabled { opacity: 0.4; cursor: not-allowed; }
.ai-send .od-icon { --od-icon-size: 13px; }
.ai-note { display: flex; align-items: center; gap: 5px; margin: 0; color: #687873; font-size: 8.5px; line-height: 1.4; }
.ai-note .od-icon { color: var(--green); --od-icon-size: 10px; }
.spinner { width: 12px; height: 12px; border: 2px solid rgba(4,18,14,.22); border-top-color: var(--accent-ink); border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.floating-menu {
  position: fixed; z-index: 80; min-width: 176px; max-width: min(250px, calc(100vw - 16px));
  padding: 4px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: #11191a; box-shadow: var(--shadow);
}
.menu-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--text); font-size: 11.5px; line-height: 1.4; text-align: left; }
.menu-item:hover, .menu-item:focus-visible { background: var(--panel-3); outline: none; }
.menu-item.is-danger { color: var(--red); }
.menu-item .od-icon { color: var(--subtle); --od-icon-size: 13px; }
.menu-item.is-danger .od-icon { color: currentColor; }
.menu-item .menu-check { margin-left: auto; color: var(--accent); }
.menu-item .menu-check .od-icon { color: var(--accent); }
.menu-sep { height: 1px; margin: 4px 5px; background: var(--line); }
.format-menu { min-width: 194px; }
.format-menu .menu-item { font-family: var(--font-mono); font-size: 10.5px; }
.format-menu .menu-item .format-desc { margin-left: auto; color: var(--subtle); font-family: var(--font-ui); font-size: 8.5px; }

.settings-drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0;
  width: min(620px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden;
  border: 0; border-left: 1px solid var(--line-strong); border-radius: 0;
  background: #0b1012; color: var(--text);
}
.settings-drawer[open] { animation: drawer-in 200ms ease-out both; }
@keyframes drawer-in { from { opacity: 0.55; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.settings-drawer::backdrop { background: rgba(2,4,5,.76); }
.drawer-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.drawer-title { margin: 3px 0 0; color: var(--text-strong); font-size: 20px; font-weight: 600; line-height: 1.35; }
.drawer-sub { margin: 4px 0 0; color: var(--subtle); font-size: 10.5px; line-height: 1.55; }
.drawer-close { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--subtle); }
.drawer-close:hover { color: var(--text); background: var(--panel-3); }
.drawer-close .od-icon { --od-icon-size: 16px; }
.drawer-body { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px 28px; display: grid; gap: 24px; align-content: start; }
.settings-section { display: grid; gap: 11px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.section-kicker { margin: 0; color: var(--accent); font-size: 8.5px; font-weight: 600; letter-spacing: 0.13em; line-height: 1.4; text-transform: uppercase; }
.section-title { margin: 2px 0 0; color: var(--text-strong); font-size: 14px; font-weight: 600; line-height: 1.4; }
.first-run { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 1px 7px; border: 1px solid rgba(135,233,158,.18); border-radius: 999px; color: var(--green); background: rgba(135,233,158,.04); font-size: 9px; white-space: nowrap; }
.first-run .od-icon { --od-icon-size: 10px; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.mode-option {
  display: grid; gap: 2px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 7px;
  background: #0a1011; color: var(--text); text-align: left;
}
.mode-option:hover { border-color: var(--line-strong); background: #101819; }
.mode-option[aria-pressed="true"] { border-color: rgba(77,229,198,.4); background: rgba(77,229,198,.05); }
.mode-option strong { font-size: 11.5px; font-weight: 500; }
.mode-option small { color: var(--subtle); font-size: 9px; line-height: 1.45; }
.mode-desc { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.mode-desc strong { color: var(--text); font-weight: 500; }
.cloud-form { display: grid; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: #0a1011; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--text); font-size: 10.5px; font-weight: 500; line-height: 1.4; }
.field-hint { color: var(--subtle); font-size: 9px; font-weight: 400; }
.input, .textarea, .select {
  width: 100%; min-height: 36px; padding: 7px 9px;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: #080d0e; color: var(--text);
  font-size: 12px; line-height: 1.5;
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}
.textarea { min-height: 74px; resize: vertical; font-family: var(--font-mono); font-size: 11px; line-height: 1.65; }
.select { appearance: none; padding-right: 30px; }
.select-wrap { position: relative; }
.select-wrap::after { content: ""; position: absolute; right: 11px; top: 50%; width: 5px; height: 5px; border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: translateY(-72%) rotate(45deg); pointer-events: none; }
.input::placeholder, .textarea::placeholder { color: #61716c; }
.input:hover, .textarea:hover, .select:hover { border-color: #3b4c4e; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(77,229,198,.09); }
.field-error { margin: 0; color: var(--red); font-size: 10px; line-height: 1.5; }
.field-note { margin: 0; color: var(--subtle); font-size: 9.5px; line-height: 1.55; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 11px; border: 1px solid transparent; border-radius: 6px; font-size: 11.5px; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.btn .od-icon { --od-icon-size: 13px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-secondary { background: var(--panel-2); border-color: var(--line-strong); color: var(--text); }
.btn-secondary:hover { background: var(--panel-3); border-color: #3b4c4e; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--panel-3); }
.btn-danger { background: rgba(255,148,148,.07); border-color: rgba(255,148,148,.24); color: var(--red); }
.btn-danger:hover { background: rgba(255,148,148,.12); border-color: rgba(255,148,148,.4); }
.token-list { display: grid; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.token-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; padding: 10px 11px; border-bottom: 1px solid var(--line); background: #0a1011; }
.token-card:last-child { border-bottom: 0; }
.token-main { display: grid; gap: 2px; min-width: 0; }
.token-title-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.token-name { color: var(--text); font-family: var(--font-mono); font-size: 11px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.token-status { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-size: 9px; white-space: nowrap; }
.token-status .status-dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.token-status.is-expiring { color: var(--amber); }
.token-status.is-expired { color: var(--subtle); }
.token-status.is-revoked { color: var(--red); }
.token-scope { color: var(--subtle); font-family: var(--font-mono); font-size: 9px; line-height: 1.4; overflow-wrap: anywhere; }
.token-meta-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--subtle); font-size: 9px; line-height: 1.45; }
.token-perm { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.token-perm .od-icon { --od-icon-size: 10px; }
.token-revoke { align-self: start; padding: 3px 6px; border: 1px solid rgba(255,148,148,.22); border-radius: 4px; background: transparent; color: var(--red); font-size: 9.5px; line-height: 1.4; white-space: nowrap; }
.token-revoke:hover { background: rgba(255,148,148,.08); }
.token-dead { align-self: start; color: var(--subtle); font-size: 9px; line-height: 1.4; padding-top: 4px; }
.section-note { margin: 0; color: var(--subtle); font-size: 9.5px; line-height: 1.6; }
.audit-wrap { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.audit-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.audit-table th { padding: 7px 8px; border-bottom: 1px solid var(--line); color: var(--subtle); font-size: 8px; font-weight: 500; letter-spacing: 0.08em; text-align: left; text-transform: uppercase; }
.audit-table td { padding: 7px 8px; border-bottom: 1px solid rgba(28,39,41,.7); vertical-align: middle; }
.audit-table tr:last-child td { border-bottom: 0; }
.audit-time { display: block; color: var(--muted); font-family: var(--font-mono); font-size: 8.5px; line-height: 1.4; white-space: nowrap; }
.audit-token { display: block; color: var(--text); font-family: var(--font-mono); font-size: 8.5px; line-height: 1.4; overflow-wrap: anywhere; }
.audit-scope { display: block; color: var(--subtle); font-family: var(--font-mono); font-size: 8px; line-height: 1.4; overflow-wrap: anywhere; }
.audit-key { color: var(--text); font-family: var(--font-mono); font-size: 8.5px; line-height: 1.4; overflow-wrap: anywhere; }
.audit-action { color: var(--muted); font-size: 8.5px; line-height: 1.4; white-space: nowrap; }
.audit-result { display: inline-flex; align-items: center; gap: 3px; font-size: 8.5px; white-space: nowrap; }
.audit-result.success { color: var(--green); }
.audit-result.denied { color: var(--amber); }
.audit-result .od-icon { --od-icon-size: 9px; }
.audit-table th:nth-child(1) { width: 16%; }
.audit-table th:nth-child(2) { width: 25%; }
.audit-table th:nth-child(3) { width: 25%; }
.audit-table th:nth-child(4) { width: 19%; }
.audit-table th:nth-child(5) { width: 15%; }

.modal {
  width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 44px);
  padding: 0; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--panel); box-shadow: var(--shadow);
}
.modal[open] { animation: dialog-in 180ms ease-out both; }
.modal::backdrop { background: rgba(2,4,5,.8); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-small { width: min(430px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 18px 13px; border-bottom: 1px solid var(--line); }
.modal-title-wrap { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.modal-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 1px solid rgba(77,229,198,.23); border-radius: 7px; background: rgba(77,229,198,.05); color: var(--accent); }
.modal-icon .od-icon { --od-icon-size: 16px; }
.modal-title { margin: 0; color: var(--text-strong); font-size: 15px; font-weight: 600; line-height: 1.4; }
.modal-subtitle { margin: 2px 0 0; color: var(--subtle); font-size: 10.5px; line-height: 1.55; }
.modal-close { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: var(--subtle); }
.modal-close:hover { color: var(--text); background: var(--panel-3); }
.modal-close .od-icon { --od-icon-size: 15px; }
.modal-body { padding: 16px 18px; overflow: auto; max-height: calc(100vh - 210px); }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding: 12px 18px; border-top: 1px solid var(--line); }
.scope-readonly { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: #0a1011; color: var(--muted); font-family: var(--font-mono); font-size: 10px; overflow-wrap: anywhere; }
.scope-readonly .od-icon { color: var(--green); --od-icon-size: 12px; }
.confirm-copy { display: flex; align-items: flex-start; gap: 10px; }
.confirm-copy .modal-icon { border-color: rgba(255,148,148,.22); background: rgba(255,148,148,.05); color: var(--red); }
.confirm-copy p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.confirm-copy strong { color: var(--text); font-weight: 500; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 95; display: flex; flex-direction: column; gap: 7px; width: min(360px, calc(100vw - 28px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 8px; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 7px; background: #11191a; box-shadow: var(--shadow); animation: toast-in 200ms ease-out both; pointer-events: auto; }
.toast .od-icon { color: var(--green); --od-icon-size: 14px; margin-top: 2px; }
.toast.is-error .od-icon { color: var(--red); }
.toast p { margin: 0; color: var(--text); font-size: 10.5px; line-height: 1.55; }
.toast.is-out { animation: toast-out 160ms ease-in both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(4px); } }

@media (max-width: 1380px) {
  .workspace-grid { grid-template-columns: 210px minmax(0, 1fr) 326px; }
  .col-value { width: 134px; }
  .col-source { width: 114px; }
}
@media (max-width: 1220px) {
  body { height: auto; overflow: auto; }
  .app { height: auto; min-height: 100vh; }
  .main { overflow: visible; }
  .workspace { height: auto; }
  .workspace-grid { flex: none; grid-template-columns: 220px minmax(0, 1fr); }
  .tree-panel, .vars-panel { height: 620px; }
  .output-panel { grid-column: 1 / -1; height: 560px; }
}
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 0 16px; min-height: 0; padding: 10px 16px 0; }
  .brand { min-height: 36px; }
  .top-actions { min-height: 36px; }
  .top-search { order: 3; flex-basis: 100%; max-width: none; margin: 8px 0 10px; }
  .workspace-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .head-meta { align-items: flex-start; flex-direction: row; gap: 12px; flex-wrap: wrap; }
  .main { padding: 14px 16px calc(22px + env(safe-area-inset-bottom)); }
  .paste-note { display: none; }
}
@media (max-width: 760px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .tree-panel { height: auto; }
  .tree-body { overflow: visible; max-height: none; }
  .vars-panel { height: auto; }
  .output-panel { grid-column: auto; height: auto; min-height: 500px; }
  .table-wrap { overflow: visible; }
  .var-table thead { display: none; }
  .var-table, .var-table tbody { display: block; width: 100%; }
  .var-table tr.var-row {
    display: grid; grid-template-columns: 24px minmax(0, 1fr) auto;
    grid-template-areas: "check key actions" "check value actions" "check type actions" "check source actions";
    gap: 4px 8px; padding: 10px 12px; border-bottom: 1px solid var(--line);
  }
  .var-table tr.var-row:hover { background: transparent; }
  .var-table tr.var-row td { padding: 0; border: 0; display: block; }
  .var-table tr.var-row .c-check { grid-area: check; padding-top: 2px; }
  .var-table tr.var-row .c-key { grid-area: key; }
  .var-table tr.var-row .c-value { grid-area: value; }
  .var-table tr.var-row .c-type { grid-area: type; }
  .var-table tr.var-row .c-source { grid-area: source; }
  .var-table tr.var-row .c-actions { grid-area: actions; align-self: start; }
  .var-table tr.var-row .c-source .source-sub { display: inline; margin-left: 4px; }
  .var-table tr.shadow-row {
    display: grid; grid-template-columns: 24px minmax(0, 1fr) auto;
    grid-template-areas: "check key key" "check value type" "check source source";
    gap: 3px 8px; padding: 7px 12px 8px; border-bottom: 1px solid var(--line);
  }
  .var-table tr.shadow-row td { padding: 0; border: 0; display: block; }
  .var-table tr.shadow-row .c-check { grid-area: check; }
  .var-table tr.shadow-row .c-key { grid-area: key; }
  .var-table tr.shadow-row .c-value { grid-area: value; }
  .var-table tr.shadow-row .c-type { grid-area: type; justify-self: end; }
  .var-table tr.shadow-row .c-source { grid-area: source; }
  .var-table tr.shadow-row .c-actions { display: none; }
  .value-toggle { min-height: 30px; font-size: 10.5px; }
  .value-toggle .od-icon { opacity: 1; }
  .row-menu-btn { width: 38px; height: 38px; }
  .table-foot { flex-wrap: wrap; }
  .empty-row { display: block; }
  .empty-row td { display: block; padding: 0 !important; border: 0 !important; }
  .paste-zone { align-items: center; }
  .paste-icon { margin-top: 0; }
  .paste-input { min-height: 28px; }
  .paste-result .text-action { margin-left: 0; }
  .settings-drawer { width: 100vw; border-left: 0; }
  .drawer-body { padding: 16px 16px 24px; }
  .drawer-head { padding: 15px 16px 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .audit-table thead { display: none; }
  .audit-table, .audit-table tbody { display: block; width: 100%; }
  .audit-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; padding: 9px 10px; border-bottom: 1px solid var(--line); }
  .audit-table tr:last-child { border-bottom: 0; }
  .audit-table td { display: block; padding: 0; border: 0; }
  .audit-table td::before { content: attr(data-label); display: block; color: var(--subtle); font-size: 8px; line-height: 1.4; }
  .audit-table td.a-token, .audit-table td.a-key { grid-column: 1 / -1; }
  .audit-table td.a-result { justify-self: end; }
  .modal { width: calc(100vw - 24px); }
  .modal-small { width: calc(100vw - 24px); }
}
@media (max-width: 560px) {
  .brand-sub { display: none; }
  .mode-chip { display: none; }
  .settings-btn .label { display: none; }
  .settings-btn { width: 36px; justify-content: center; padding: 0; }
  .topbar { padding-inline: 12px; }
  .main { padding-inline: 12px; }
  .ws-title { font-size: 24px; }
  .head-meta { font-size: 9px; }
  .scope-pill { font-size: 9px; }
  .title-row { gap: 7px; }
  .paste-zone { padding-left: 8px; }
  .paste-icon { display: none; }
  .paste-input { font-size: 11px; }
  .output-head { padding: 10px 10px 9px; }
  .output-body { padding: 9px 9px 10px; }
  .code-scroll { padding: 8px; }
  .copy-split { grid-template-columns: minmax(0, 1fr) 42px; }
  .copy-main, .copy-toggle { min-height: 44px; }
  .ai-row { min-height: 42px; }
  .ai-input { height: 40px; font-size: 10px; }
  .ai-send { width: 30px; height: 30px; }
  .token-card { grid-template-columns: 1fr; }
  .token-revoke { justify-self: start; min-height: 32px; padding-inline: 10px; }
  .mode-switch { grid-template-columns: 1fr; }
  .drawer-title { font-size: 18px; }
  .toast-region { right: 10px; bottom: 10px; width: calc(100vw - 20px); }
}
@media (max-width: 380px) {
  .settings-btn { width: 34px; min-height: 32px; }
  .mode-chip { font-size: 9.5px; }
  .copy-bar { gap: 4px; }
  .copy-hint { font-size: 8.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

.head-actions { display: flex; align-items: center; gap: 4px; }
.mono { font-family: var(--font-mono); }
.scope-item-row { position: relative; }
.scope-item-row .scope-mini {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: none; gap: 2px; z-index: 1;
}
.scope-item-row:hover .scope-mini,
.scope-item-row:focus-within .scope-mini { display: flex; }
.scope-mini .icon-btn { width: 24px; height: 24px; background: #101819; border-color: var(--line); }
.icon-btn.is-danger:hover { color: var(--red); border-color: rgba(255,148,148,.35); }
.vars-heading .icon-btn { width: 26px; height: 26px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cloud-placeholder {
  display: grid; gap: 4px; padding: 11px 12px;
  border: 1px dashed var(--line-strong); border-radius: 7px;
  background: #0a1011; color: var(--muted); font-size: 11px; line-height: 1.6;
}
.cloud-placeholder strong { color: var(--text); font-weight: 500; }
.token-empty {
  padding: 16px 12px; color: var(--subtle); font-size: 11px; line-height: 1.55;
  background: #0a1011;
}
.empty-state .btn { margin-top: 4px; }
.input.mono, .textarea.mono { font-family: var(--font-mono); }
.modal-medium { width: min(560px, calc(100vw - 32px)); }
.foot-note { margin-right: auto; color: var(--subtle); font-size: 10px; line-height: 1.45; }
.token-display {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #080d0e;
}
.token-display code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 11px; color: var(--text); }
.token-reveal-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 10px; color: var(--subtle); font-size: 10.5px; line-height: 1.55; }
.token-reveal-note .od-icon { color: var(--amber); --od-icon-size: 13px; margin-top: 2px; }
