:root {
  --bg-root: #0B0B0C;
  --bg-card: #121214;
  --bg-surface: #18181B;
  --bg-hover: #202025;
  --border: #232326;
  --border-strong: #34343A;
  --text-primary: #F4F4F5;
  --text-secondary: #8E8E93;
  --text-muted: #5A5A62;
  --accent: #FF9000;
  --accent-dim: rgba(255, 144, 0, 0.14);
  --accent-border: rgba(255, 144, 0, 0.45);
  --stab-green: #16A34A;
  --stab-yellow: #EAB308;
  --stab-orange: #F97316;
  --stab-red: #EF4444;
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --font-scale: 1;
  --btn-scale: 1;
}

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

html {
  font-size: calc(14px * var(--font-scale));
}

html,
body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg-root);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.45;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

[hidden] {
  display: none !important;
}

.mono {
  font-family: var(--font-mono);
}

.bold {
  font-weight: 700;
}

.muted {
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.accent-text {
  color: var(--accent);
}

.mt-sm {
  margin-top: 0.65rem;
}

.mt-md {
  margin-top: 0.85rem;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

/* Geometric colored indicators (no icons) */
.geo-dot,
.stab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
  flex-shrink: 0;
}

.geo-dot.accent {
  background: var(--accent);
}

.geo-dot.ok {
  background: var(--stab-green);
}

.geo-dot.warn {
  background: var(--stab-yellow);
}

.geo-dot.err {
  background: var(--stab-red);
}

.geo-sq {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--border-strong);
  display: inline-block;
  flex-shrink: 0;
}

.geo-sq.accent {
  background: var(--accent);
}

.geo-sq.ok {
  background: var(--stab-green);
}

.geo-toggle {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 1.5px solid var(--text-secondary);
  background: transparent;
  display: inline-block;
  flex-shrink: 0;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.expanded > .rank-match-header .geo-toggle,
.expanded > .node-summary .geo-toggle,
.rank-item.expanded .rank-item-row .geo-toggle {
  background: var(--accent);
  border-color: var(--accent);
}

.stab-dot.green {
  background: var(--stab-green);
}

.stab-dot.yellow {
  background: var(--stab-yellow);
}

.stab-dot.orange {
  background: var(--stab-orange);
}

.stab-dot.red {
  background: var(--stab-red);
}

/* Circular info button & floating popover */
.info-btn {
  width: calc(17px * var(--btn-scale));
  height: calc(17px * var(--btn-scale));
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: calc(0.68rem * var(--btn-scale));
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.info-btn:hover,
.info-btn.open {
  border-color: var(--accent);
  color: #0B0B0C;
  background: var(--accent);
}

.info-popover {
  position: fixed;
  z-index: 200;
  max-width: min(290px, calc(100vw - 24px));
  background: #16161A;
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  color: var(--text-primary);
  font-size: 0.78rem;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
}

/* Sticky Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(11, 11, 12, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.topbar-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 26px;
  width: auto;
  display: block;
  object-fit: contain;
}

.tab-bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.2rem;
  min-width: 0;
}

.tab-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 6px;
  padding: calc(0.34rem * var(--btn-scale)) calc(0.85rem * var(--btn-scale));
  font-size: calc(0.82rem * var(--btn-scale));
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

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

.tab-btn.active {
  background: var(--accent);
  color: #0B0B0C;
  font-weight: 700;
}

.status-pills {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex-shrink: 0;
}

.pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill.ok {
  border-color: rgba(22, 163, 74, 0.4);
  color: var(--text-primary);
}

.pill.pack-active {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Workspace & Desktop 2-Column Split */
.workspace {
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
  padding: 0.9rem 1rem 2rem;
  flex: 1;
  min-width: 0;
}

.tab-pane {
  display: none;
  min-width: 0;
}

.tab-pane.active {
  display: block;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 0.9rem;
  align-items: start;
  min-width: 0;
}

.col-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  min-width: 0;
  max-width: 100%;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
  min-width: 0;
}

.panel-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

/* Buttons, Segmented Controls, Chips */
.btn-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  min-width: 0;
}

.seg-group {
  display: inline-flex;
  background: var(--bg-root);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.seg-group .btn {
  border: none;
  background: transparent;
  padding: calc(0.2rem * var(--btn-scale)) calc(0.5rem * var(--btn-scale));
}

.seg-group .btn.active {
  background: var(--accent);
  color: #0B0B0C;
}

.btn {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: calc(0.32rem * var(--btn-scale)) calc(0.65rem * var(--btn-scale));
  font-family: var(--font-sans);
  font-size: calc(0.78rem * var(--btn-scale));
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  white-space: nowrap;
  user-select: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

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

.btn-xs {
  padding: calc(0.22rem * var(--btn-scale)) calc(0.5rem * var(--btn-scale));
  font-size: calc(0.74rem * var(--btn-scale));
  border-radius: 5px;
}

.btn.primary {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #0B0B0C;
}

.btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0B0B0C;
  font-weight: 700;
}

.btn.danger {
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

.btn.danger:hover:not(:disabled) {
  border-color: var(--stab-red);
  background: rgba(239, 68, 68, 0.18);
}

.sync-toggle-btn {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-secondary);
}

.sync-toggle-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--text-primary);
}

.sync-toggle-btn .sync-ind {
  background: var(--text-muted);
}

.sync-toggle-btn.active .sync-ind {
  background: var(--accent);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
  min-width: 0;
}

.chip-row.scroll-x {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.chip {
  font-family: var(--font-mono);
  font-size: calc(0.73rem * var(--btn-scale));
  font-weight: 600;
  padding: calc(0.2rem * var(--btn-scale)) calc(0.5rem * var(--btn-scale));
  border-radius: 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

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

.chip.active {
  border-color: var(--accent);
  color: #0B0B0C;
  background: var(--accent);
  font-weight: 700;
}

/* Inputs & Textareas */
textarea,
input[type="text"],
input[type="number"],
select {
  width: 100%;
  min-width: 0;
  background: var(--bg-root);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.55rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  outline: none;
  transition: border-color 0.14s ease;
}

textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: var(--accent);
}

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

textarea {
  min-height: 148px;
  resize: vertical;
  line-height: 1.45;
}

textarea.compact-ta {
  min-height: 104px;
}

.meta-strip {
  margin-top: 0.5rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stego-strip.has-hidden {
  border-color: var(--accent-border);
  background: var(--accent-dim);
  color: var(--text-primary);
}

.target-count-badge {
  border-color: var(--accent-border);
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  padding: 0.1rem 0.42rem;
  font-size: 0.69rem;
}

.target-aim-row {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
}

.target-aim-row input,
.target-aim-row .target-aim-ta {
  flex: 1;
  min-width: 0;
}

textarea.target-aim-ta {
  min-height: 34px;
  max-height: 98px;
  resize: none;
  overflow-y: auto;
  padding: 0.42rem 0.62rem;
  line-height: 1.42;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.target-aim-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding-top: 2px;
}

/* Rank Match Pinned Card */
.rank-match-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

.rank-match-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.52rem 0.7rem;
  background: linear-gradient(90deg, rgba(255, 144, 0, 0.12), rgba(24, 24, 27, 0.6));
  cursor: pointer;
  user-select: none;
  min-width: 0;
}

.rank-match-header:hover {
  background: linear-gradient(90deg, rgba(255, 144, 0, 0.18), rgba(32, 32, 37, 0.8));
}

.rank-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.12rem 0.42rem;
  border-radius: 5px;
  background: var(--accent);
  color: #0B0B0C;
  flex-shrink: 0;
}

.rank-top-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-pct {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.badge-raw {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.1rem 0.36rem;
  border-radius: 4px;
  background: rgba(142, 142, 147, 0.16);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  text-transform: lowercase;
  flex-shrink: 0;
}

.rank-match-body {
  max-height: 280px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-root);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) var(--bg-root);
}

.rank-match-body::-webkit-scrollbar {
  width: 6px;
}

.rank-match-body::-webkit-scrollbar-track {
  background: var(--bg-root);
}

.rank-match-body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

.rank-item {
  border-bottom: 1px solid var(--border);
}

.rank-item:last-child {
  border-bottom: none;
}

.rank-item-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  min-width: 0;
  transition: background 0.1s ease;
}

.rank-item-row:hover {
  background: var(--bg-surface);
}

.rank-item-text {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-item-pct {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.rank-item-detail {
  display: none;
  padding: 0.55rem 0.7rem 0.65rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.rank-item.expanded > .rank-item-detail {
  display: block;
}

/* Toolbar Strip */
.toolbar-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  background: var(--bg-root);
  border: 1px solid var(--border);
  border-radius: 7px;
  margin-bottom: 0.65rem;
  min-width: 0;
}

.depth-group {
  display: flex;
  align-items: center;
  gap: 0.22rem;
  flex-wrap: wrap;
  min-width: 0;
}

.strip-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 0.2rem;
}

.depth-custom-input {
  width: 56px;
  padding: calc(0.18rem * var(--btn-scale)) 0.35rem;
  font-size: calc(0.74rem * var(--btn-scale));
  border-radius: 5px;
  text-align: center;
  flex-shrink: 0;
}

/* Results List & Tree */
.results-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.empty-state {
  padding: 0.85rem;
  border-radius: 7px;
  border: 1px dashed var(--border);
  background: var(--bg-root);
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
}

.node-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

.node-card.target-hit {
  border-color: var(--accent);
}

.node-card.raw-hit {
  border-color: var(--border-strong);
}

.node-card.top-hit {
  border-color: rgba(22, 163, 74, 0.5);
}

.node-summary {
  padding: 0.48rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
  min-width: 0;
}

.node-summary:hover {
  background: var(--bg-hover);
}

.badge-depth {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 700;
  padding: 0.1rem 0.36rem;
  border-radius: 4px;
  background: var(--bg-root);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.badge-op {
  font-family: var(--font-mono);
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-target {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 800;
  padding: 0.1rem 0.36rem;
  border-radius: 4px;
  background: var(--accent);
  color: #0B0B0C;
  flex-shrink: 0;
}

.badge-conf {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.38rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.conf-high {
  background: rgba(22, 163, 74, 0.16);
  color: #4ADE80;
}

.conf-mid {
  background: rgba(234, 179, 8, 0.16);
  color: #FACC15;
}

.conf-warn {
  background: rgba(249, 115, 22, 0.16);
  color: #FB923C;
}

.conf-low {
  background: rgba(142, 142, 147, 0.14);
  color: var(--text-secondary);
}

.node-preview-inline {
  font-family: var(--font-mono);
  font-size: 0.77rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.target-highlight {
  background: rgba(255, 144, 0, 0.28);
  color: #FFCC80;
  padding: 0.02rem 0.18rem;
  border-radius: 3px;
  font-weight: 700;
}

.node-details {
  display: none;
  padding: 0.6rem 0.7rem;
  background: var(--bg-root);
  border-top: 1px solid var(--border);
  min-width: 0;
}

.node-card.expanded > .node-details {
  display: block;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
  min-width: 0;
}

.chain-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.16rem 0.45rem;
  border-radius: 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.explain-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.1rem 0.38rem;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.explain-tag.match {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
  font-weight: 700;
}

.full-preview-box {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.tree-children {
  margin-left: 0.85rem;
  padding-left: 0.6rem;
  border-left: 1px solid var(--border-strong);
  margin-top: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

/* Codec Catalog */
.codec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 0.38rem;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 0.55rem;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.codec-item {
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.codec-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.codec-item.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.codec-item-id {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codec-item.selected .codec-item-id {
  color: var(--accent);
}

.codec-item-name {
  font-size: 0.69rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codec-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  min-width: 0;
}

.codec-item.codec-item-stego {
  border: 1px dashed rgba(168, 85, 247, 0.58);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.11), rgba(255, 144, 0, 0.08));
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.12), inset 0 0 0 1px rgba(255, 144, 0, 0.05);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.14s ease;
}

.codec-item.codec-item-stego:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.19), rgba(255, 144, 0, 0.16));
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.24), 0 0 8px rgba(255, 144, 0, 0.2);
  transform: translateY(-1px);
}

.codec-item.codec-item-stego.selected {
  border: 1px solid var(--accent);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(255, 144, 0, 0.22));
  box-shadow: 0 0 18px rgba(255, 144, 0, 0.24), 0 0 10px rgba(168, 85, 247, 0.22);
}

.codec-stego-badge {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.06rem 0.28rem;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.28), rgba(255, 144, 0, 0.28));
  border: 1px solid rgba(192, 132, 252, 0.45);
  color: #E9D5FF;
  flex-shrink: 0;
}

#codecCatStegoBtn {
  border-style: dashed;
  border-color: rgba(168, 85, 247, 0.55);
  color: #D8B4FE;
}

#codecCatStegoBtn.active {
  border-style: solid;
  border-color: var(--accent);
  color: #0B0B0C;
}

.param-box {
  margin-top: 0.65rem;
  padding: 0.65rem;
  border-radius: 7px;
  background: var(--bg-root);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.form-row label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Recipe */
.recipe-chips-box {
  max-height: 120px;
  overflow-y: auto;
  padding: 0.2rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.section-subhead {
  margin-top: 0.7rem;
  margin-bottom: 0.4rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pipeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.step-card.needs-param {
  border-color: var(--accent-border);
}

.step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  min-width: 0;
}

.step-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.step-param-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  min-width: 0;
}

.step-param-row input {
  flex: 1;
  min-width: 90px;
  padding: 0.34rem 0.55rem;
  font-size: 0.78rem;
}

.step-hint {
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.cyberchef-frame {
  width: 100%;
  height: 500px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-root);
}

/* Packs */
.pack-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: 7px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.pack-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.dropzone {
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  padding: 1.4rem 0.85rem;
  text-align: center;
  background: var(--bg-root);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.drop-sq {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.drop-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.pack-log {
  min-height: 180px;
  margin-bottom: 0;
}

/* Settings Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  width: 100%;
  max-width: 390px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 0.95rem 1rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: var(--bg-root);
  border: 1px solid var(--border);
}

.settings-row.col {
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}

.settings-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.scale-slider {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.settings-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.15rem;
}

.toggle-pill {
  min-width: 54px;
}

/* X-ray Invisible Character Inspector */
.xray-box {
  min-height: 92px;
  max-height: 260px;
  line-height: 1.75;
  margin-bottom: 0;
}

.xray-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
  min-width: 0;
}

.xray-stat-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  white-space: nowrap;
}

.xray-token {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #0B0B0C;
  background: var(--accent);
  border-radius: 4px;
  padding: 0.02rem 0.3rem;
  margin: 0 1px;
  vertical-align: baseline;
  line-height: 1.35;
}

/* Plugin Store Cards (Packs Tab) */
.plugin-store-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}

.plugin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  transition: border-color 0.14s ease;
}

.plugin-card.enabled {
  border-color: var(--accent-border);
}

.plugin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

.plugin-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
  flex: 1;
}

.plugin-card-title-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  min-width: 0;
}

.plugin-card-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}

.plugin-card-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.plugin-status-pill {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 700;
  padding: 0.12rem 0.42rem;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--bg-root);
  color: var(--text-secondary);
  white-space: nowrap;
}

.plugin-status-pill.enabled {
  border-color: rgba(22, 163, 74, 0.45);
  background: rgba(22, 163, 74, 0.14);
  color: #4ADE80;
}

.plugin-status-pill.disabled {
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

.plugin-status-pill.update-avail {
  border-color: var(--accent-border);
  background: var(--accent-dim);
  color: var(--accent);
}

.plugin-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* EXIF Metadata Field Cards */
.exif-field-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.exif-field-card.eof-hit {
  border-color: var(--accent-border);
}

.exif-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
  min-width: 0;
}

.exif-field-key {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
}

.exif-group-badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 800;
  padding: 0.08rem 0.34rem;
  border-radius: 4px;
  background: var(--bg-root);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.exif-field-card.eof-hit .exif-group-badge {
  background: var(--accent);
  border-color: var(--accent);
  color: #0B0B0C;
}

.exif-field-val {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--bg-root);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.4rem 0.55rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-height: 140px;
  overflow-y: auto;
}

/* Toast Popup */
.toast {
  position: fixed;
  bottom: 1.1rem;
  right: 1.1rem;
  background: var(--accent);
  color: #0B0B0C;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.52rem 0.92rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.97);
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 260;
  max-width: min(360px, calc(100vw - 24px));
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.toast-ok {
  background: var(--stab-green);
  color: #052E16;
}

.toast.toast-warn {
  background: #27272A;
  color: var(--text-primary);
  border-color: var(--accent-border);
}

/* Responsive Tablet & Mobile (iPhone Safari Portrait Lock) */
@media (max-width: 1023px) {
  .split-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-inner {
    flex-wrap: wrap;
    padding: 0.4rem 0.65rem;
    gap: 0.4rem;
  }

  .brand-logo-img {
    height: 20px;
  }

  .tab-bar {
    order: 3;
    width: 100%;
    display: flex;
    overflow-x: auto;
    padding: 2px;
    gap: 2px;
    scrollbar-width: none;
  }

  .tab-bar::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex: 1 0 auto;
    padding: calc(0.32rem * var(--btn-scale)) 0.45rem;
    font-size: calc(0.76rem * var(--btn-scale));
    text-align: center;
  }

  .status-pills {
    order: 2;
    gap: 0.26rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .pill {
    font-size: 0.68rem;
    padding: 0.16rem 0.38rem;
  }

  #scorerStatusPill {
    display: none;
  }

  .workspace {
    padding: 0.6rem 0.65rem 1.5rem;
  }

  .panel {
    padding: 0.68rem;
  }
}

@media (max-width: 639px) {
  textarea,
  input[type="text"],
  input[type="number"],
  select {
    font-size: 16px;
  }

  textarea {
    min-height: 112px;
  }

  textarea.target-aim-ta {
    min-height: 38px;
    max-height: 112px;
  }

  .toolbar-strip {
    padding: 0.4rem 0.45rem;
    gap: 0.4rem;
  }

  .depth-group {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .depth-custom-input {
    width: 58px;
    padding: 0.16rem 0.25rem;
  }

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

  .node-summary {
    padding: 0.44rem 0.5rem;
    gap: 0.35rem;
  }

  .rank-match-header {
    padding: 0.46rem 0.55rem;
    gap: 0.35rem;
  }

  .toast {
    left: 0.65rem;
    right: 0.65rem;
    bottom: 0.75rem;
    text-align: center;
  }
}

/* ==========================================================
   About & Donate Tab (Linear / Raycast Black-Orange Theme)
   ========================================================== */
.about-container {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.about-panel,
.donate-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.about-hero {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.about-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.about-wordmark {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.about-wordmark .brand-vyyx {
  color: #F4F4F5;
  margin-right: 4px;
}

.about-wordmark .brand-crypt {
  background: var(--accent);
  color: #0B0B0C;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 900;
  display: inline-block;
  line-height: 1.15;
}

.about-desc-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.about-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.about-os-tag {
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
}

.about-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.2rem 0;
}

.about-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  transition: border-color 0.15s ease;
}

.about-stat-card:hover {
  border-color: var(--border-strong);
}

.stat-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.stat-lbl {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* About Interactive Link Cards */
.about-links-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.45rem;
}

.about-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
  cursor: pointer;
  width: 100%;
  text-align: left;
  min-width: 0;
}

.about-link-card:hover {
  border-color: var(--accent-border);
  background: var(--bg-hover);
}

.about-link-card.is-button {
  font-family: inherit;
  font-size: inherit;
  border-style: solid;
}

.link-card-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.link-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.link-card-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-card-sub {
  font-size: 0.73rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.link-card-arrow {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  flex-shrink: 0;
  transition: color 0.15s ease, transform 0.15s ease;
}

.about-link-card:hover .link-card-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.link-card-pill {
  flex-shrink: 0;
  font-size: 0.72rem;
  padding: 0.18rem 0.55rem;
  transition: all 0.15s ease;
}

/* Donate Block */
.donate-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  padding: 0.3rem 0;
}

.qr-frame-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.qr-white-card {
  background: #FFFFFF;
  padding: 0.65rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  max-width: 100%;
  aspect-ratio: 1/1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 6px;
}

.qr-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donate-info-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.donate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  min-width: 0;
}

.donate-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.donate-copy-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.donate-val {
  font-size: 0.84rem;
  color: var(--text-primary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .about-container {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
  }

  .about-wordmark {
    font-size: 1.3rem;
  }

  .qr-white-card {
    width: 190px;
    height: 190px;
    padding: 0.5rem;
  }

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

@media (max-width: 480px) {
  .donate-row {
    padding: 0.45rem 0.6rem;
  }
}

