/* ==========================================================================
   tark-pass: Anti-Slop High-Craft Design System
   Spatial discipline, zero emojis, zero translucency, rigid CSS grid parity.
   ========================================================================== */

:root {
  color-scheme: dark;
  /* 90/10 Balance Canvas Neutrals (Strictly Solid Opaque Zinc / Obsidian) */
  --bg-canvas: #09090b; /* Canvas base */
  --bg-surface: #121215; /* Elevated panels & sidebars */
  --bg-elevated: #18181b; /* Cards, containers & modal dialogs */
  --bg-subtle: #1e1e24; /* Grouped containers & inset boxes */
  --bg-input: #0e0e11; /* Solid form inputs */
  --bg-hover: #222226; /* Solid hover transition */
  --bg-active: #27272a; /* Solid pressed / active state */

  /* Hairline Solid Borders (Zero Translucency Hex Tokens) */
  --border-subtle: #27272a; /* 1px hairline divider / card border */
  --border-medium: #323238; /* Interactive control border */
  --border-strong: #3f3f46; /* Active border / badge boundary */
  --border-focus: #2563eb; /* Royal Cobalt focus indicator */

  /* Typographic Hierarchy & Contrast */
  --text-primary: #f4f4f5; /* 100% crisp white */
  --text-secondary: #a1a1aa; /* ~65% readable neutral */
  --text-muted: #71717a; /* ~45% metadata & hint labels */
  --text-inverse: #09090b; /* High contrast text on solid light/accent */

  /* Single Tint Interactive Accent (10% Max - Royal Cobalt) */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-active: #1e40af;
  --accent-surface: #1e3a8a;
  --accent-text: #ffffff;

  /* Semantic Solid Colors */
  --success: #10b981;
  --success-bg: #064e3b;
  --warning: #f59e0b;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-surface: #450a0a;

  /* Solid Badges & Capsules */
  --badge-bg: #27272a;
  --badge-text: #d4d4d8;
  --badge-border: #3f3f46;

  /* Typography Stacks */
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Helvetica,
    Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  /* Proportional Corner Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Snappy Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 120ms var(--ease);
  --transition-normal: 160ms var(--ease);

  /* Diffused Hairline Shadows */
  --shadow-sm: 0 1px 2px #00000066;
  --shadow-md: 0 4px 14px #00000073, 0 1px 3px #00000040;
  --shadow-lg: 0 16px 36px #00000099, 0 2px 6px #0000004d;
}

/* ==========================================================================
   Base & CSS Reset
   ========================================================================== */

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

html,
body {
  width: 100%;
  max-width: 100%;
  height: 100%;
  overflow-x: hidden;
  position: relative;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
  width: 100%;
  max-width: 100%;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

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

/* Neutralize WebKit & Standard Autofill Color Hijacking */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
input:autofill,
input:autofill:hover,
input:autofill:focus,
input:autofill:active {
  -webkit-text-fill-color: var(--text-primary) !important;
  -webkit-box-shadow: 0 0 0px 1000px var(--bg-surface) inset !important;
  box-shadow: 0 0 0px 1000px var(--bg-surface) inset !important;
  transition: background-color 5000s ease-in-out 0s;
  caret-color: var(--text-primary) !important;
}

/* Enforce 16px font-size targeting all coarse touch devices to eliminate iOS/mobile auto-zoom */
@media (hover: none) and (pointer: coarse) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

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

.hidden {
  display: none !important;
}

/* ==========================================================================
   Application Master Layout
   ========================================================================== */

.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

/* Top Navigation Header */
.app-header {
  height: 60px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  user-select: none;
}

.brand-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lock-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.header-separator {
  width: 1px;
  height: 24px;
  background-color: var(--border-subtle);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Main Viewport */
.main-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Buttons & Interactive Controls (Standard Sizing 40px - 44px)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
  user-select: none;
}

.btn:focus-visible {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--border-focus);
}

.btn-primary {
  background-color: var(--accent);
  color: var(--accent-text);
  border: 1px solid var(--accent);
}

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

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

.btn-secondary {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

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

.btn-outline {
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
  border: 1px solid var(--danger);
}

.btn-danger:hover {
  background-color: var(--danger-hover);
  border-color: var(--danger-hover);
}

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

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn-block {
  width: 100%;
}

.btn-text-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: none;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast);
}

.btn-text-action:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

/* ==========================================================================
   Form Controls & Inputs
   ========================================================================== */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-row-split {
  display: flex;
  gap: 12px;
}

.flex-1 {
  flex: 1;
}
.flex-2 {
  flex: 2;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.label-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition:
    border-color var(--transition-fast),
    background-color var(--transition-fast);
}

.form-input {
  height: 42px;
  padding: 0 14px;
}

.form-input.has-icon {
  padding-left: 42px;
}

.form-input.has-toggle {
  padding-right: 44px;
}

.form-select {
  height: 42px;
  padding: 0 14px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

.form-textarea {
  padding: 12px 14px;
  resize: vertical;
  min-height: 84px;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  background-color: var(--bg-surface);
}

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

.btn-toggle-pw {
  position: absolute;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast);
}

.btn-toggle-pw:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

/* Password Strength Meter */
.meter-wrapper {
  height: 4px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  margin-top: 6px;
  overflow: hidden;
}

.strength-meter-bar {
  height: 100%;
  width: 0%;
  background-color: var(--danger);
  transition:
    width 200ms ease,
    background-color 200ms ease;
}

.meter-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 12px;
}

.field-hint {
  color: var(--text-muted);
}

.field-req {
  color: var(--text-muted);
}

.security-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.security-notice svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

/* ==========================================================================
   Auth Section (Unlock & Register)
   ========================================================================== */

.auth-section {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(32px, 7vh, 80px) 20px 60px;
  overflow-y: auto;
}

.auth-panel {
  width: 100%;
  max-width: 440px;
}

.auth-masthead {
  text-align: center;
  margin-bottom: 20px;
}

.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--accent);
  margin-bottom: 12px;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.auth-desc {
  font-size: 14px;
  color: var(--text-muted);
}

.auth-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

/* Segmented Control Tabs */
.segmented-control {
  display: flex;
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: 24px;
}

.seg-btn {
  flex: 1;
  height: 36px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.seg-btn.active {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  font-weight: 600;
}

.seg-btn:hover:not(.active) {
  color: var(--text-primary);
}

.auth-form {
  display: flex;
  flex-direction: column;
}

/* --- 2-Step Authentication & Hardcoded Keypad --- */
.auth-step-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.auth-step-panel.hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.pin-step-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 6px;
}

.pin-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  margin-bottom: 8px;
}

.pin-user-badge svg {
  color: var(--text-muted);
}

.pin-step-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.pin-step-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.pin-slots-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin: 2px 0 12px 0;
}

.pin-slot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background-color: var(--bg-canvas);
  border: 1.5px solid var(--border-medium);
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.pin-slot.filled {
  background-color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.12);
}

.pin-slots-container.shake {
  animation: dpPinShake 320ms ease-in-out;
}

.pin-slots-container.shake .pin-slot {
  border-color: var(--danger);
  background-color: var(--danger);
}

@keyframes dpPinShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-8px);
  }
  40%,
  80% {
    transform: translateX(8px);
  }
}

.pin-keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 216px;
  margin: 0 auto 12px auto;
}

.pin-btn {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-mono);
  cursor: pointer;
  user-select: none;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform 60ms ease-out;
}

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

.pin-btn:active {
  background-color: var(--bg-active);
  transform: scale(0.96);
}

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

.pin-btn-action {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-sans);
}

.pin-btn-action svg {
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.pin-btn-action:hover svg {
  color: var(--text-primary);
}

.pin-step-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.pin-back-btn {
  height: 38px;
  font-size: 13px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast);
}

.pin-back-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

/* ==========================================================================
   Vault Workspace Layout (Sidebar & Main Data View)
   ========================================================================== */

.vault-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);
  overflow: hidden;
}

/* Sidebar */
.vault-sidebar {
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding-left: 8px;
}

.category-filters {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.filter-lead {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.filter-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.filter-item:hover .filter-icon {
  color: var(--text-primary);
}

.filter-item.active {
  background-color: var(--bg-elevated);
  border-color: var(--border-subtle);
  color: var(--text-primary);
  font-weight: 600;
}

.filter-item.active .filter-icon {
  color: var(--accent);
}

/* Count Badge (Solid Opaque Capsule) */
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-xs);
  background-color: var(--badge-bg);
  border: 1px solid var(--badge-border);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--badge-text);
  line-height: 1;
}

.count-badge.is-zero {
  opacity: 0.35;
}

/* Vault Health Sidebar Widget (Inset Grouped Surface) */
.sidebar-health {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.health-card {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    background-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.health-card:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-strong);
}

.health-card.active {
  border-color: var(--accent);
  background-color: var(--bg-elevated);
  box-shadow: 0 0 0 1px var(--accent);
}

.health-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.health-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.health-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.health-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.health-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.health-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.health-stat-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Vault Security Audit Health Distribution Graph */
.health-graph-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.health-graph-bar {
  display: flex;
  height: 6px;
  width: 100%;
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.health-graph-seg {
  height: 100%;
  transition: width var(--transition-normal);
}

.health-graph-seg.is-strong {
  background-color: #10b981;
}

.health-graph-seg.is-reused {
  background-color: #f59e0b;
}

.health-graph-seg.is-weak {
  background-color: #ef4444;
}

.health-graph-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.health-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.is-strong {
  background-color: #10b981;
}

/* ==========================================================================
   Main Content Area (Toolbar & Data Table Grid)
   ========================================================================== */

.vault-content {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-canvas);
  height: 100%;
  overflow-y: auto;
  min-height: 0;
}

/* Content Toolbar */
.content-toolbar {
  height: 60px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 20;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 420px;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 40px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 38px 0 40px;
  font-size: 13.5px;
  color: var(--text-primary);
  transition:
    border-color var(--transition-fast),
    background-color var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  background-color: var(--bg-surface);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  position: absolute;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

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

.toolbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-status {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ==========================================================================
   Data Table (Strict CSS Grid Layout & Jitter-Free Alignment)
   ========================================================================== */

.items-view {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Header & Row CSS Grid Columns are 100% IDENTICAL */
.items-header,
.item-row {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) 260px minmax(180px, 1.5fr) 88px;
  align-items: center;
  padding: 0 24px;
}

/* Bookmark Folders Bar & File Explorer (Solid Anti-Slop Discipline) */
.folder-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 24px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}

.folder-filter-bar::-webkit-scrollbar {
  display: none;
}

.folder-explorer-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

.folder-explorer-nav::-webkit-scrollbar {
  display: none;
}

.folder-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.folder-nav-btn:hover {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.folder-nav-btn svg {
  color: var(--text-muted);
}

.folder-nav-btn:hover svg {
  color: var(--text-primary);
}

.folder-nav-sep {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
}

.folder-nav-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 4px;
  white-space: nowrap;
}

.folder-nav-current svg {
  color: var(--primary);
}

.btn-folder-add {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.btn-folder-add:hover {
  background-color: var(--bg-surface);
  border-color: var(--primary);
  color: var(--primary);
}

.folder-bar-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* File Explorer Folder Row (In Table Grid) */
.item-row.is-folder-row {
  cursor: pointer;
  user-select: none;
  border-left: 3px solid transparent;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.item-row.is-folder-row:hover {
  background-color: var(--bg-surface);
  border-left-color: var(--primary);
}

.item-row.is-folder-row.drag-over {
  background-color: #1e3a8a !important;
  border-color: #60a5fa !important;
  border-left-color: #3b82f6 !important;
  box-shadow: inset 0 0 0 1px #3b82f6;
}

.row-folder-icon-pill {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}

.item-row.is-folder-row:hover .row-folder-icon-pill {
  background-color: var(--bg-elevated);
  border-color: var(--primary);
}

.folder-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 9999px;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.draggable-bookmark,
.item-row.is-folder-row {
  cursor: grab;
}

.draggable-bookmark:active,
.item-row.is-folder-row:active {
  cursor: grabbing;
}

.draggable-bookmark.is-dragging,
.item-row.is-folder-row.is-dragging {
  opacity: 0.4;
  background-color: var(--bg-elevated);
}

.folder-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  font-size: 10px;
  font-family: var(--font-mono);
  border-radius: 9999px;
  background-color: var(--bg-surface);
  color: var(--text-muted);
}

.folder-pill.active .folder-pill-count {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.row-folder-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.row-folder-badge svg {
  color: var(--text-muted);
}

.items-header {
  height: 44px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  user-select: none;
}

.items-header .col-actions {
  text-align: right;
}

.items-grid {
  display: flex;
  flex-direction: column;
}

/* Row Styling */
.item-row {
  min-height: 62px;
  padding-top: 10px;
  padding-bottom: 10px;
  background-color: var(--bg-canvas);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-fast);
}

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

/* Column 1: Item Identity & Favicon */
.col-lead-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  padding-right: 12px;
}

.row-icon-pill {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.row-icon-pill svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.site-favicon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.row-title-wrap {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-account {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Column 2: Secret (Jitter-Proof Monospace & Fixed Action Container) */
.col-secret-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 260px;
  padding-right: 16px;
  overflow: hidden;
}

.secret-value {
  flex: 1 1 0;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.secret-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}

.btn-row-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  background-color: transparent;
  border: 1px solid transparent;
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast),
    border-color var(--transition-fast);
}

.btn-row-action:hover {
  color: var(--text-primary);
  background-color: var(--bg-elevated);
  border-color: var(--border-subtle);
}

/* Column 3: Website URL Link */
.col-meta-cell {
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-right: 12px;
}

.website-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition-fast);
}

.website-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.website-link svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.note-preview-text {
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Column 4: Row Edit / Delete Actions */
.col-actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.empty-icon-box {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 400px;
  margin-bottom: 20px;
}

/* ==========================================================================
   Modals & Dialogs (Zero Translucency, 100% Solid Opaque Surfaces)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: #000000cc; /* Dim dark scrim */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fadeIn 140ms ease-out forwards;
}

.modal-card {
  width: 100%;
  max-width: 540px;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleIn 140ms var(--ease) forwards;
}

.modal-card-sm {
  max-width: 440px;
}

.modal-header {
  height: 56px;
  padding: 0 20px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header-lead {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-favicon-preview {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  overflow: hidden;
}

.modal-favicon-preview svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.modal-favicon-preview img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

.modal-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.modal-body-padding {
  padding: 20px;
}

.confirm-message {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-footer {
  padding: 16px 20px;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Export Modal Form Wrap & Notice Card (Solid Opaque Surfaces, Zero Translucency) */
.modal-form-wrap {
  display: flex;
  flex-direction: column;
}

.export-notice-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notice-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.notice-header svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.notice-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.export-confirm-wrap {
  margin-top: 4px;
  margin-bottom: 4px;
}

.export-confirm-wrap .custom-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.export-confirm-wrap .checkbox-box {
  margin-top: 2px;
}

.export-confirm-wrap .checkbox-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ==========================================================================
   Password Generator Modal Inner Layout
   ========================================================================== */

.gen-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gen-output-box {
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 12px;
}

.gen-result-input {
  flex: 1;
  height: 48px;
  background: transparent;
  border: none;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  outline: none;
}

.gen-output-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gen-entropy-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.entropy-bar-track {
  height: 5px;
  background-color: var(--bg-input);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.entropy-bar-fill {
  height: 100%;
  background-color: var(--success);
  transition: width 150ms ease;
}

.entropy-score {
  font-size: 12px;
  color: var(--text-muted);
}

.gen-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 8px;
}

.slider-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider-val-badge {
  font-size: 13px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  background-color: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--text-primary);
}

.range-slider {
  width: 100%;
  height: 6px;
  appearance: none;
  background-color: var(--bg-input);
  border-radius: var(--radius-xs);
  outline: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--accent);
  border: 2px solid var(--bg-elevated);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.checkbox-fieldset {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-box {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-xs);
  background-color: var(--bg-input);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast);
}

.custom-checkbox input:checked ~ .checkbox-box {
  background-color: var(--accent);
  border-color: var(--accent);
}

.custom-checkbox input:checked ~ .checkbox-box::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.checkbox-label {
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* ==========================================================================
   Global Alert Toast (Solid Surface, Bounded Width)
   ========================================================================== */

.alert-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 380px;
  padding: 12px 18px;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  z-index: 120;
  animation: toastIn 180ms var(--ease) forwards;
}

.alert-toast.alert-success {
  border-left: 3px solid var(--success);
}

.alert-toast.alert-error {
  border-left: 3px solid var(--danger);
}

/* Mobile-only components hidden by default on desktop */
.mobile-header-controls,
.mobile-category-bar,
.mobile-bottom-dock,
.mobile-only {
  display: none;
}

/* ==========================================================================
   Responsive Adaptations (Mobile < 768px)
   Anti-Slop Craft: Larger touch targets, iOS auto-zoom prevention,
   bottom-sheet modals, zero translucency, thumb-accessible dock.
   ========================================================================== */

@media (max-width: 768px) {
  /* 1. Prevent Mobile Auto-Zoom on Input Focus */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  /* 2. Base Touch Targets & Body Scaling */
  body {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  .btn {
    height: 44px;
    min-height: 44px;
    font-size: 14px;
    padding: 0 16px;
    border-radius: var(--radius-md);
  }

  .btn-sm {
    height: 40px;
    min-height: 40px;
    font-size: 13px;
    padding: 0 12px;
  }

  /* 3. Header Adaptations */
  .app-header {
    height: 56px;
    padding: 0 16px;
  }

  .brand-name {
    font-size: 16px;
  }

  .header-status,
  .header-separator,
  .header-actions {
    display: none !important;
  }

  .mobile-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
  }

  .mobile-quick-lock-btn,
  .mobile-more-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition:
      background-color var(--transition-fast),
      color var(--transition-fast);
  }

  .mobile-quick-lock-btn:active,
  .mobile-more-btn:active {
    background-color: var(--bg-active);
    color: var(--text-primary);
  }

  /* 4. Auth Section on Mobile */
  .auth-section {
    padding: clamp(20px, 4vh, 36px) 16px 32px;
    width: 100%;
    max-width: 100%;
  }

  .auth-panel {
    width: 100%;
    max-width: 400px;
    min-width: 0;
  }

  .auth-masthead {
    margin-bottom: 16px;
  }

  .auth-brand-mark {
    width: 46px;
    height: 46px;
    margin-bottom: 10px;
  }

  .auth-title {
    font-size: 22px;
    margin-bottom: 4px;
  }

  .auth-desc {
    font-size: 13px;
  }

  .auth-box {
    padding: 18px 16px;
    border-radius: var(--radius-lg);
  }

  .segmented-control {
    padding: 3px;
    margin-bottom: 16px;
  }

  .seg-btn {
    height: 38px;
    font-size: 13px;
    font-weight: 600;
  }

  .form-input {
    height: 44px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    font-size: 16px;
  }

  .form-input.has-icon {
    padding-left: 44px;
  }

  .form-input.has-toggle {
    padding-right: 46px;
  }

  .input-icon {
    left: 14px;
    width: 16px;
    height: 16px;
  }

  .btn-toggle-pw {
    width: 44px;
    height: 44px;
    right: 0;
  }

  .btn-toggle-pw svg {
    width: 18px;
    height: 18px;
  }

  .form-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
  }

  .form-group {
    margin-bottom: 14px;
  }

  .security-notice {
    padding: 10px 12px;
    font-size: 12px;
    margin-bottom: 16px;
  }

  /* 5. Vault Workspace Layout */
  .vault-workspace {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    overflow: visible;
    width: 100%;
    max-width: 100vw;
  }

  .vault-sidebar {
    display: none !important; /* Replaced by mobile category chips and sticky bottom dock */
  }

  .vault-content {
    height: auto;
    overflow: visible;
    min-height: calc(100vh - 56px);
    padding-bottom: 84px; /* Space for fixed bottom action dock */
    width: 100%;
    max-width: 100vw;
    min-width: 0;
  }

  /* 6. Content Toolbar & Search Input */
  .content-toolbar {
    height: auto;
    min-height: 64px;
    padding: 12px 16px 8px 16px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
  }

  .search-wrap {
    max-width: 100%;
    width: 100%;
  }

  .search-input {
    height: 48px;
    min-height: 48px;
    padding: 0 46px 0 46px;
    border-radius: var(--radius-md);
  }

  .search-icon {
    left: 15px;
    width: 20px;
    height: 20px;
  }

  .search-clear {
    width: 44px;
    height: 44px;
    right: 2px;
  }

  .search-clear svg {
    width: 18px;
    height: 18px;
  }

  .toolbar-meta {
    display: none;
  }

  /* 7. Mobile Horizontal Category Filter Chips */
  .mobile-category-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 16px 12px 16px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mobile-category-bar::-webkit-scrollbar {
    display: none;
  }

  .mobile-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    transition:
      background-color var(--transition-fast),
      border-color var(--transition-fast),
      color var(--transition-fast);
  }

  .mobile-cat-pill:hover,
  .mobile-cat-pill:active {
    background-color: var(--bg-hover);
    color: var(--text-primary);
  }

  .mobile-cat-pill.active {
    background-color: var(--bg-elevated);
    border-color: var(--accent);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 0 0 1px var(--accent);
  }

  .mobile-cat-pill .count-badge {
    min-width: 20px;
    height: 20px;
    font-size: 11px;
    padding: 0 6px;
  }

  .mobile-cat-pill.mobile-cat-vuln {
    border-color: #b45309;
    color: #f59e0b;
  }

  .mobile-cat-pill.mobile-cat-vuln .count-badge {
    background-color: #451a03;
    color: #fde68a;
    border-color: #b45309;
  }

  /* 8. Items View & Editorial Stacked Card Grid */
  .items-header {
    display: none !important;
  }

  .items-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .item-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "lead actions"
      "secret secret"
      "meta meta";
    gap: 12px 10px;
    padding: 16px;
    margin: 0;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    min-height: auto;
    transition: border-color var(--transition-fast);
  }

  .item-row:hover,
  .item-row:active {
    border-color: var(--border-medium);
  }

  /* Lead Column: Icon + Title + Account */
  .col-lead-cell {
    grid-area: lead;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 0;
  }

  .col-lead-cell .row-icon-pill {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: var(--radius-md);
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .col-lead-cell .row-icon-pill svg {
    width: 22px;
    height: 22px;
  }

  .col-lead-cell .row-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
  }

  .col-lead-cell .row-account {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.3;
  }

  /* Row Actions: Edit + Delete */
  .col-actions-cell {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
  }

  .col-actions-cell .btn-row-action {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .col-actions-cell .btn-row-action svg {
    width: 19px;
    height: 19px;
  }

  .col-actions-cell .btn-row-action:active {
    background-color: var(--bg-hover);
    color: var(--text-primary);
  }

  .col-actions-cell .btn-del:active {
    background-color: var(--danger-surface);
    color: var(--danger);
    border-color: var(--danger);
  }

  /* Password / Secret Container */
  .col-secret-cell {
    grid-area: secret;
    width: 100%;
    min-height: 48px;
    padding: 4px 6px 4px 14px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
  }

  .col-secret-cell .secret-value {
    font-size: 15px;
    font-family: var(--font-mono);
    letter-spacing: 2px;
    color: var(--text-primary);
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .col-secret-cell .note-preview-text {
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
    letter-spacing: normal;
  }

  .col-secret-cell .secret-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 10px;
  }

  .col-secret-cell .secret-actions .btn-row-action {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .col-secret-cell .secret-actions .btn-row-action svg {
    width: 19px;
    height: 19px;
  }

  .col-secret-cell .secret-actions .btn-row-action:active {
    background-color: var(--bg-hover);
    color: var(--text-primary);
  }

  /* Website & Meta Row */
  .col-meta-cell {
    grid-area: meta;
    width: 100%;
    padding: 0;
  }

  .col-meta-cell .website-link {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    font-size: 14px;
    color: var(--accent);
    padding: 8px 12px;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    width: 100%;
    overflow: hidden;
  }

  .col-meta-cell .website-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }

  .col-meta-cell .website-link span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 9. Empty State on Mobile */
  .empty-state {
    padding: 56px 16px;
  }

  .empty-icon-box {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
  }

  .empty-title {
    font-size: 20px;
  }

  .empty-desc {
    font-size: 15px;
    margin-bottom: 24px;
  }

  #btn-empty-add {
    min-height: 48px;
    padding: 0 20px;
    font-size: 15px;
  }

  /* 10. Sticky Bottom Action Dock */
  .mobile-bottom-dock {
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 50;
    box-shadow: 0 -4px 18px #00000080;
  }

  .mobile-dock-btn-main {
    flex: 1;
    height: 48px;
    min-height: 48px;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius-md);
  }

  .mobile-dock-btn-main svg {
    width: 20px;
    height: 20px;
  }

  .mobile-dock-btn-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition:
      background-color var(--transition-fast),
      color var(--transition-fast);
  }

  .mobile-dock-btn-icon svg {
    width: 20px;
    height: 20px;
  }

  .mobile-dock-btn-icon:active {
    background-color: var(--bg-active);
    color: var(--text-primary);
  }

  /* 11. Modals Adapted to Bottom Sheets */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: #000000d0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    z-index: 100;
  }

  .modal-card {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    border: 1px solid var(--border-subtle);
    border-bottom: none;
    max-height: 92vh;
    overflow-y: auto;
    background-color: var(--bg-elevated);
    animation: slideUpSheet 200ms var(--ease) forwards;
  }

  .modal-card-sm {
    max-width: 100%;
  }

  .modal-card::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background-color: var(--border-strong);
    margin: 10px auto 4px auto;
    flex-shrink: 0;
  }

  .modal-header {
    height: 56px;
    padding: 0 20px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
  }

  .modal-title {
    font-size: 17px;
    font-weight: 600;
  }

  .modal-close {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
  }

  .modal-close svg {
    width: 20px;
    height: 20px;
  }

  .modal-form {
    padding: 16px 20px 24px;
  }

  .form-row-split {
    flex-direction: column;
    gap: 14px;
  }

  .form-select,
  .form-textarea {
    border-radius: var(--radius-md);
  }

  .form-select {
    height: 48px;
    min-height: 48px;
    padding: 0 16px;
  }

  .form-textarea {
    min-height: 96px;
    padding: 12px 16px;
  }

  .modal-footer {
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    gap: 12px;
  }

  .modal-footer .btn {
    flex: 1;
    height: 44px;
    min-height: 44px;
    font-size: 14px;
    font-weight: 600;
  }

  .btn-text-action {
    font-size: 13px;
    padding: 4px 8px;
    min-height: 36px;
  }

  /* 12. Password Generator Controls on Mobile */
  .gen-body {
    padding: 16px 20px;
    gap: 18px;
  }

  .gen-output-box {
    height: 52px;
    padding: 0 14px;
  }

  .gen-result-input {
    height: 52px;
    font-size: 17px;
  }

  .gen-output-actions .btn-icon {
    width: 44px;
    height: 44px;
  }

  .range-slider {
    height: 8px;
  }

  .range-slider::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
  }

  .custom-checkbox {
    min-height: 44px;
    padding: 4px 0;
    gap: 12px;
  }

  .checkbox-box {
    width: 22px;
    height: 22px;
  }

  .checkbox-label {
    font-size: 15px;
  }

  /* 13. Mobile Utilities Bottom Sheet */
  .mobile-menu-body {
    padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .mobile-user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
  }

  .user-avatar-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
  }

  .user-name-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
  }

  .user-lock-status {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
    display: block;
  }

  .mobile-health-card {
    padding: 16px;
    border-radius: var(--radius-md);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition:
      background-color var(--transition-fast),
      border-color var(--transition-fast);
  }

  .mobile-health-card:active {
    background-color: var(--bg-hover);
    border-color: var(--border-strong);
  }

  .mobile-health-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }

  .mobile-health-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
  }

  .mobile-health-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }

  .mobile-health-stat {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .stat-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
  }

  .stat-lbl {
    font-size: 12px;
    color: var(--text-muted);
  }

  .mobile-health-tap-hint {
    font-size: 12px;
    color: var(--accent);
    display: block;
  }

  .mobile-menu-actions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mobile-menu-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    width: 100%;
    transition: background-color var(--transition-fast);
    text-align: left;
  }

  .mobile-menu-action-btn:active {
    background-color: var(--bg-hover);
  }

  .mobile-menu-action-btn svg {
    color: var(--text-secondary);
    flex-shrink: 0;
  }

  .mobile-menu-action-danger {
    color: var(--danger);
    border-color: #7f1d1d60;
    background-color: #450a0a20;
  }

  .mobile-menu-action-danger svg {
    color: var(--danger);
  }

  /* 14. Toast Notifications on Mobile */
  .alert-toast {
    bottom: 84px;
    left: 16px;
    right: 16px;
    max-width: none;
    justify-content: center;
    font-size: 14px;
    padding: 14px 18px;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideUpSheet {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   My Flow Workspace & Cross-Device Stream
   Anti-Slop Strict Zero-Translucency Standard (100% Solid Surfaces)
   ========================================================================== */

.flow-workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: calc(100vh - 56px);
  overflow: hidden;
  background-color: var(--bg-canvas);
  position: relative;
}

.flow-workspace.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -8px;
}

/* Flow Header (Strict alignment with vault lead identity) */
.flow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 10px 24px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.flow-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Stream Messages Feed */
.flow-feed-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
}

/* Flow Chat Stream (Opera GX Style) */
.flow-web-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px;
  overflow-y: auto;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

.flow-gx-row {
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
}

.flow-gx-time-pill {
  display: none;
}

.flow-gx-bubble-wrap {
  display: flex;
  width: 100%;
}

.flow-gx-bubble-wrap.flow-gx-sent {
  justify-content: flex-end;
}

.flow-gx-bubble-wrap.flow-gx-received {
  justify-content: flex-start;
}

.flow-gx-bubble {
  position: relative;
  width: 350px;
  max-width: 100%;
  background-color: #202024;
  border: 1px solid #2e2e33;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}

.flow-gx-bubble:hover {
  border-color: #3f3f46;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.flow-gx-hover-tools {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  align-items: center;
  gap: 4px;
  background-color: #18181b;
  border: 1px solid #27272a;
  border-radius: 6px;
  padding: 2px 4px;
  z-index: 10;
}

.flow-gx-bubble:hover .flow-gx-hover-tools {
  display: flex;
}

.flow-gx-tool-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #a1a1aa;
  cursor: pointer;
  transition: background-color 0.1s, color 0.1s;
}

.flow-gx-tool-btn:hover {
  background-color: #27272a;
  color: #f4f4f5;
}

.flow-gx-tool-del:hover {
  background-color: #7f1d1d;
  color: #fca5a5;
}

.flow-gx-body {
  padding: 14px 16px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flow-gx-title {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.flow-gx-desc {
  font-size: 13px;
  color: #9e9ea7;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.flow-gx-domain {
  font-size: 12px;
  color: #71717a;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-gx-favicon {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
  object-fit: contain;
}

.flow-gx-img-wrap {
  position: relative;
  width: 100%;
  height: 190px;
  background-color: #09090b;
  overflow: hidden;
  border-bottom-left-radius: 7px;
  border-bottom-right-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow-gx-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.flow-gx-playbutton {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background-color: rgba(9, 9, 11, 0.85);
  border: 1px solid #3f3f46;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.flow-gx-playbutton svg {
  margin-left: 3px;
}

.flow-gx-bubble:hover .flow-gx-playbutton {
  transform: translate(-50%, -50%) scale(1.08);
  background-color: #18181b;
  border-color: #52525b;
}

.flow-gx-text {
  padding: 12px 16px 4px 16px;
  font-size: 14px;
  line-height: 1.55;
  color: #f4f4f5;
  white-space: pre-wrap;
  word-break: break-word;
}

.flow-gx-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px 8px 16px;
}

.flow-gx-body .flow-gx-meta {
  padding: 4px 0 0 0;
  justify-content: space-between;
}

.flow-gx-time {
  font-size: 11px;
  color: #71717a;
  line-height: 1;
  letter-spacing: 0.02em;
  user-select: none;
  white-space: nowrap;
  margin-left: auto;
}

.flow-gx-caption {
  padding: 8px 14px 10px 14px;
  font-size: 13px;
  color: #a1a1aa;
  line-height: 1.4;
}

/* Image Media Card */
.flow-web-img-container {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  max-width: 520px;
}

.flow-web-img {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  background-color: #000000;
  display: block;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.flow-web-img:hover {
  opacity: 0.95;
}

.flow-web-caption {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 4px;
}

/* Flow Empty State (Refined Editorial Anti-Slop Presentation) */
.flow-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  max-width: 620px;
  width: 100%;
  margin: auto;
  text-align: center;
  user-select: none;
  animation: fadeIn 140ms ease-out forwards;
}

.flow-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.flow-empty-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.flow-empty-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 auto 24px auto;
}

.flow-empty-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 580px;
}

.flow-empty-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 8px;
  padding: 14px 16px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
  color: inherit;
}

.flow-empty-card:hover {
  background-color: var(--bg-elevated);
  border-color: var(--border-medium);
}

.flow-empty-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.flow-empty-card-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.flow-empty-card-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.flow-empty-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.flow-empty-card-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Flow Composer Dock */
.flow-composer-dock {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 12px 24px;
  flex-shrink: 0;
}

.flow-web-attach-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 820px;
  margin: 0 auto 8px auto;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

.flow-web-attach-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.flow-web-attach-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.flow-web-attach-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flow-web-attach-size {
  color: var(--success);
}

.flow-web-form {
  max-width: 820px;
  margin: 0 auto;
}

.flow-input-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  min-height: 48px;
  transition: border-color var(--transition-fast);
}

.flow-input-container:focus-within {
  border-color: var(--border-focus);
}

.flow-action-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  flex-shrink: 0;
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
}

.flow-action-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-elevated);
  border-color: var(--border-subtle);
}

.flow-web-textarea {
  flex: 1;
  min-width: 0;
  height: 36px;
  min-height: 36px;
  max-height: 120px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  padding: 7px 8px;
  box-sizing: border-box;
}

.flow-web-textarea::placeholder {
  color: var(--text-muted);
}

.flow-web-submit-btn {
  height: 36px;
  min-height: 36px;
  padding: 0 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.flow-web-submit-btn > * {
  pointer-events: none;
}

/* Image Viewer Modal */
.flow-img-modal-dialog {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.flow-img-modal-body {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000000;
  overflow: hidden;
}

.flow-img-modal-body img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-xs);
}

/* Mobile Responsiveness for Flow */
@media (max-width: 768px) {
  .flow-workspace {
    height: calc(100vh - 56px - 64px); /* Subtract top bar and bottom dock */
  }

  .flow-header {
    padding: 10px 14px;
  }

  .flow-feed-scroll {
    padding: 12px 14px;
    gap: 12px;
  }

  .flow-composer-dock {
    padding: 8px 12px;
  }

  .flow-input-container {
    gap: 6px;
    padding: 4px 6px;
  }

  .flow-web-textarea {
    font-size: 16px !important; /* iOS prevent auto-zoom */
    min-height: 38px;
    height: 38px;
  }

  .flow-action-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }

  .flow-web-submit-btn {
    height: 36px;
    padding: 0 10px;
  }

  .flow-web-submit-btn span {
    display: none;
  }

  .flow-empty-state {
    padding: 24px 14px;
  }

  .flow-empty-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    max-width: 100%;
  }

  .flow-empty-card {
    flex-direction: row;
    align-items: center;
    padding: 12px 14px;
    gap: 12px;
    min-height: 48px;
  }

  .flow-empty-card-icon {
    flex-shrink: 0;
  }
}
