:root {
  color-scheme: dark;
  --bg: #1b1d1f; --raised: #232629; --line: #3b4145; --text: #f5f1e6; --muted: #abb1b4;
  --paper: #f5f1e6; --ink: #2b2a26; --ink-dim: #646052; --cyan: #64f5e8;
  --focus: #92e6b3; --danger: #ff8f9a; --accent: #1f7a4d;
  font-family: 'JetBrains Mono', monospace;
}
body.girlfriend-theme {
  --bg: #281923; --raised: #35222e; --line: #715066;
  --text: #fff0f7; --muted: #e4b7cf; --paper: #ffe4f0;
  --ink: #3c2130; --ink-dim: #79516a; --focus: #ffa3ce;
  --accent: #bd348b; --cyan: #ffa3ce;
}
body.girlfriend-theme input,
body.girlfriend-theme select,
body.girlfriend-theme textarea { background: #301e2a; }
body.girlfriend-theme input::placeholder,
body.girlfriend-theme textarea::placeholder { color: #dda9c5; }
body.girlfriend-theme input[type=checkbox] { accent-color: #c73f78; }
body.girlfriend-theme .primary { background: #bd348b; border-color: #bd348b; color: #fff; }
body.girlfriend-theme .primary:hover:not(:disabled) { background: #a63770; border-color: #a63770; }
body.girlfriend-theme .bulk-bar { background: #42253a; }
body.girlfriend-theme .brand h1::after { background: repeating-linear-gradient(90deg, #ff91c0 0 4px, transparent 4px 7px); }
body.girlfriend-theme .clip { border-color: #e0a9c5; border-left-color: var(--card-color); }
body.girlfriend-theme .clip.selected { outline-color: #d76b96; }
body.girlfriend-theme .clip button.copied { background: #a63770; border-color: #a63770; }
body.girlfriend-theme .clip :focus-visible { outline-color: #bd348b; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; height: 100vh; height: 100dvh; background: var(--bg); color: var(--text); overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, select { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button, input, select, textarea { border-radius: 6px; }
button { min-height: 44px; padding: 9px 12px; color: inherit; background: transparent; border: 1px solid var(--line); font-size: 14px; }
button:hover:not(:disabled) { background: #ffffff0c; border-color: #77818a; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
input, select, textarea { background: #17191b; color: var(--text); border: 1px solid var(--line); min-height: 44px; padding: 10px 12px; font-size: 16px; min-width: 0; }
input::placeholder, textarea::placeholder { color: #a1a8ad; }
input[type=checkbox] { accent-color: #1f7a4d; width: 20px; height: 20px; min-height: 20px; padding: 0; }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.workspace { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.app-header { border-bottom: 1px solid var(--line); background: var(--bg); flex: none; }
.header-inner, .toolbar, .composer, .board, .bulk-inner { width: min(100%, 1440px); margin: auto; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: max(16px, env(safe-area-inset-top)) 24px 14px; }
.brand { min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 18px; row-gap: 4px; }
.brand h1, .brand h2 { font-family: 'Space Grotesk', sans-serif; font-size: 26px; letter-spacing: .09em; margin: 0; line-height: 1.2; }
.brand h1::after { content: ''; display: inline-block; width: 28px; height: 5px; margin: 0 0 5px 12px; background: repeating-linear-gradient(90deg, #82c39a 0 4px, transparent 4px 7px); }
.subtitle { color: var(--muted); font-size: 12px; }
.connection { display: flex; align-items: center; gap: 7px; font-size: 12px; white-space: nowrap; color: var(--muted); }
.connection::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #e3ad61; }
.connection.online::before { background: #8bd7a4; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 24px 16px; }
.search { flex: 1 1 240px; }
.search input { width: 100%; }
.toolbar select { font-size: 14px; max-width: 150px; }
.toolbar .view-toggle { white-space: nowrap; }
.primary { background: #347e50; border-color: #347e50; color: #fff; font-weight: 700; }
.primary:hover:not(:disabled) { background: #3d915d; border-color: #3d915d; }
.bulk-bar { flex: none; border-bottom: 1px solid var(--line); background: #2b3330; }
.bulk-inner { padding: 8px 24px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.selection-count { font-size: 14px; margin-right: auto; }
.board-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
.board { padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 26px; }
.board-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.group { min-width: 0; border-radius: 8px; scroll-margin-block: 12px; }
.group-heading { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 14px; padding-bottom: 7px; }
.group-toggle { display: flex; gap: 10px; align-items: center; border: 0; min-width: 0; text-align: left; padding-inline: 2px; font-family: 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 600; }
.group-name { overflow-wrap: anywhere; }
.group-dot { width: 10px; height: 10px; background: var(--group-color, #8d969d); border-radius: 2px; flex: none; }
.chevron { font-size: 14px; transition: transform .16s; color: var(--muted); }
.group.collapsed .chevron { transform: rotate(-90deg); }
.group-count { padding: 3px 7px; font-size: 12px; color: var(--muted); background: #ffffff08; border: 1px solid var(--line); border-radius: 5px; }
.group-menu { margin-left: auto; flex: none; }
.group-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; gap: 18px; min-height: 52px; }
.board[data-layout=list] .group-items { grid-template-columns: minmax(0, 1fr); }
.board[data-layout=list] .clip-content { max-height: 160px; }
.drop-empty { grid-column: 1 / -1; margin: 0; padding: 20px; border: 1px dashed var(--line); border-radius: 8px; font-size: 14px; color: var(--muted); text-align: center; }
.empty-state { padding: 46px 16px; margin: 0 auto; text-align: center; max-width: 430px; }
.empty-state strong { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 600; margin-bottom: 12px; }
.empty-state p { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 0; }
.clip { --card-color: #1f7a4d; background: var(--paper); color: var(--ink); border: 1px solid #ddd8ca; border-left: 4px solid var(--card-color); border-radius: 7px 7px 3px 3px; padding: 12px 14px 14px; position: relative; min-width: 0; box-shadow: 0 4px 12px #00000026; animation: emerge .22s ease-out; }
.clip::after { content: ''; position: absolute; left: 0; right: 0; bottom: -5px; height: 7px; background: radial-gradient(circle at 5px 0, transparent 3px, var(--paper) 3.5px) repeat-x; background-size: 10px 7px; pointer-events: none; }
.clip.selected { outline: 3px solid #82c39a; outline-offset: 2px; }
.clip-top { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.clip button { color: var(--ink); border-color: #bfb9aa; }
.clip button:hover:not(:disabled) { background: #00000009; border-color: #777263; }
.clip :focus-visible { outline-color: #1f7a4d; }
.clip-top button { padding: 6px 8px; }
.drag-handle { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; width: 32px; min-width: 32px; font-size: 21px; border-color: transparent !important; padding: 2px !important; }
.drag-handle:active { cursor: grabbing; }
.tag { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.timer, .kept-date { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-dim); margin-right: auto; }
.timer.warn { color: #943f16; }
.timer.danger { color: #a32020; font-weight: 700; }
.pin-mark { font-size: 12px; color: var(--ink-dim); }
.clip-selector { display: flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; cursor: pointer; }
.clip-actions { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px dashed #bfb9aa; margin-top: 12px; padding-top: 10px; }
.clip-actions button { flex: 1; font-size: 14px; padding: 8px 10px; }
.clip-actions .more-button { flex: 0 0 44px; }
.clip button.copied { background: #1f7a4d; color: white; border-color: #1f7a4d; }
.clip-content { font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 224px; overflow: hidden; transition: opacity .5s; }
.clip-content.expanded { max-height: none !important; }
.clip-content a { color: #24548d; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.clip-content .compact-link { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; line-height: 1.4; }
.clip-content img { max-width: 100%; max-height: 260px; object-fit: contain; display: block; border-radius: 4px; }
.clip-content.expanded img { max-height: none; }
.expand-button { margin-top: 8px; border: 0 !important; padding-inline: 0; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.vheader { margin-bottom: 12px; }
.vheader-button { width: 100%; display: flex; gap: 8px; align-items: flex-start; text-align: left; border: 0 !important; border-bottom: 1px dashed #bfb9aa !important; border-radius: 0; padding: 3px 0 8px; }
.vheader-text { flex: 1; min-width: 0; font: 600 18px/1.4 'Space Grotesk', sans-serif; overflow-wrap: anywhere; }
.vheader-edit { font-size: 12px; color: var(--ink-dim); padding-top: 3px; }
.vheader-button.is-empty { min-height: 32px; color: var(--ink-dim); }
.is-empty .vheader-text { font: 14px/1.5 'JetBrains Mono', monospace; }
.vheader-editor label { font-size: 14px; display: block; margin-bottom: 8px; }
.vheader-input { width: 100%; background: #fffdf6; color: var(--ink); border-color: #a9a395; }
.vheader-help, .vheader-status { font-size: 12px; color: var(--ink-dim); line-height: 1.6; }
.vheader-controls { display: flex; gap: 8px; }
.progress-track { height: 3px; background: #00000010; margin-top: 14px; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--card-color); transform-origin: left; }
.composer-footer { border-top: 1px solid var(--line); background: var(--raised); flex: none; }
.composer { padding: 12px 24px max(12px, env(safe-area-inset-bottom)); }
.composer textarea { resize: none; min-height: 48px; max-height: 140px; width: 100%; line-height: 1.5; }
.composer-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.composer-row label { font-size: 12px; color: var(--muted); }
.composer-row select { font-size: 14px; max-width: 220px; flex: 0 1 220px; }
.composer-hint { font-size: 12px; color: var(--muted); margin-left: auto; }
.composer-row .primary { margin-left: auto; }
.image-button { display: flex; align-items: center; justify-content: center; width: 44px; flex: none; }
.image-button svg { width: 21px; height: 21px; }
#vault { position: fixed; inset: 0; z-index: 500; --bg: #070b0e; --raised: #0d1519; --line: #2b494c; --muted: #91b9b8; --text: #dafdf9; --focus: var(--cyan); background: var(--bg); color: var(--text); }
#vault .brand h2 { color: var(--cyan); }
#vault .subtitle { color: #93b9b5; }
#vault .board-scroll { background-image: linear-gradient(#64f5e805 1px, transparent 1px), linear-gradient(90deg, #64f5e805 1px, transparent 1px); background-size: 32px 32px; }
#vault .clip { --paper: #101a20; --ink: #dafdf9; --ink-dim: #a1bdc3; border-color: #29444b; border-left-color: var(--card-color); border-radius: 5px; }
#vault .clip::after { display: none; }
#vault .clip button, #vault .clip-actions, #vault .vheader-button { border-color: #385960 !important; }
#vault .clip-content a { color: #c5ec7c; }
#vault .vheader-input { background: #070b0e; color: #dafdf9; border-color: #42676e; }
#vault .clip :focus-visible { outline-color: var(--cyan); }
#vault .primary { background: #74e3d5; color: #05201c; border-color: #74e3d5; }
#vault .clip.selected { outline-color: var(--cyan); }
#vault .bulk-bar { background: #132f30; }
#vaultExit { flex: none; }
/* Ten-second TTY scene: one text node types on each animation frame when needed. */
#unlockPopup {
  position: fixed; inset: 0; z-index: 4000; visibility: hidden;
  pointer-events: none; overflow: hidden; background: #000; color: #c9d5c9;
  font-family: 'Courier New', Courier, monospace;
}
#unlockPopup.show { visibility: visible; will-change: transform; animation: tty-curtain 10s linear both; }
body.vault-breaching #mainWorkspace { animation: tty-cut .08s steps(1,end) both; }
.tty-header { position: absolute; z-index: 2; left: 14px; top: 10px; font-size: clamp(12px,1.1vw,15px); background: #000; }
.tty-window { position: absolute; inset: 40px 14px 15px; overflow: hidden; scrollbar-width: none; }
.tty-source[hidden] { display: none; }
.tty-output {
  margin: 0; color: #c9d5c9; white-space: pre;
  font: 500 clamp(11px,1.2vw,16px)/1.25 'Courier New', Courier, monospace;
}
.tty-caret { color: #baffc2; }
#unlockPopup.show .tty-caret { animation: tty-blink .55s steps(1,end) infinite; }
.tty-final {
  position: absolute; z-index: 3; inset: 0; display: flex; flex-direction: column; justify-content: center;
  gap: 13px; padding: clamp(16px,4vw,55px); overflow: hidden; white-space: nowrap;
  background: #000; color: #d5e5d5; font: 500 clamp(12px,1.8vw,22px)/1.4 'Courier New', Courier, monospace;
  opacity: 0;
}
#unlockPopup.show .tty-final { animation: tty-final-life 10s steps(1,end) both; }
.tty-final div { overflow: hidden; text-overflow: clip; }
.tty-final div:nth-child(2) { color: #7cc98b; }
.tty-cursor { color: #baffc2; }
#unlockPopup.show .tty-cursor { animation: tty-blink .65s steps(1,end) 8.7s 2; }
#vault.vault-entering { animation: tty-vault-arrive .8s ease-out both; }
@keyframes tty-cut { to { opacity: 0; } }
@keyframes tty-final-life { 0%,79% { opacity: 0; } 80%,100% { opacity: 1; } }
@keyframes tty-blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
@keyframes tty-curtain { 0%,92% { transform: translate3d(0,0,0); } 100% { transform: translate3d(0,-105%,0); visibility: hidden; } }
@keyframes tty-vault-arrive { from { opacity: 0; transform: translate3d(0,12px,0); } to { opacity: 1; transform: translate3d(0,0,0); } }
#actionDialog { padding: 0; color: #f5f1e6; background: #22272b; border: 1px solid #56626b; border-radius: 14px; width: min(520px, calc(100% - 32px)); max-height: 88vh; max-height: 88dvh; overflow-y: auto; }
#actionDialog::backdrop { background: #000a; backdrop-filter: blur(3px); }
.dialog-header { position: sticky; top: 0; background: #22272b; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; z-index: 1; }
.dialog-header h2 { font: 600 22px 'Space Grotesk', sans-serif; margin: 0; }
.dialog-body { padding: 4px 20px 20px; }
.dialog-body > p { font-size: 14px; color: #b9c3c9; line-height: 1.7; }
.field { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; font-size: 14px; }
.field input, .field select { width: 100%; }
.check-field { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 10px; }
.swatch { width: 44px; height: 44px; min-height: 44px; border: 2px solid #66717a; padding: 0; border-radius: 50%; background: var(--swatch) !important; color: white; }
.swatch[aria-pressed=true] { outline: 2px solid white; outline-offset: 3px; }
.swatch[aria-pressed=true]::after { content: '✓'; font-size: 21px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #485057; }
.dialog-actions .primary { margin-left: auto; }
.dialog-error { color: #ffadb5; font-size: 14px; line-height: 1.6; }
.danger-button { color: #ffadb5; border-color: #aa6870; }
.move-buttons { display: flex; gap: 8px; }
.move-buttons button { flex: 1; }
.dialog-help { font-size: 12px !important; }
#toast { position: fixed; z-index: 3000; bottom: max(22px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 24px); padding: 10px 14px; background: #edf9f1; border: 1px solid #8dc5a3; color: #17321f; box-shadow: 0 8px 40px #0008; border-radius: 10px; font-size: 14px; }
#toast button { color: #17321f; border-color: #75a686; flex: none; }
.dragging { opacity: .4; }
.drag-ghost { position: fixed; pointer-events: none; z-index: 2500; padding: 12px 16px; max-width: 260px; border: 1px solid #a7eabd; border-radius: 8px; background: #203a2d; color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; box-shadow: 0 10px 40px #0008; }
.drop-target { outline: 2px dashed var(--focus); outline-offset: 5px; }
.drop-before { box-shadow: 0 -5px 0 0 #8ae5b1; }
.drop-after { box-shadow: 0 5px 0 0 #8ae5b1; }
body.is-dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }
body.image-drop-ready::after {
  content: 'Drop images to upload';
  position: fixed;
  inset: 12px;
  z-index: 10000;
  display: grid;
  place-items: center;
  border: 3px dashed var(--focus);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  color: var(--text);
  font-size: clamp(20px, 4vw, 38px);
  font-weight: 750;
  letter-spacing: -.02em;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
@keyframes emerge { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Compact desktop workspace. Keep touch targets roomy on phones and tablets. */
@media (min-width: 900px) and (pointer: fine) {
  .header-inner, .toolbar, .composer, .board, .bulk-inner { width: 100%; }
  .header-inner { padding: 10px 16px 8px; }
  .brand h1, .brand h2 { font-size: 22px; }
  .toolbar { padding: 0 16px 10px; gap: 6px; }
  .toolbar button, .toolbar select, .toolbar input { min-height: 34px; padding: 6px 9px; }
  .toolbar .search { flex-basis: 200px; }
  .toolbar input { font-size: 14px; }
  .bulk-inner { padding: 6px 16px; }
  .bulk-inner button { min-height: 30px; padding: 4px 8px; }
  .board { padding: 12px 16px 24px; gap: 14px; }
  .group-heading { margin-bottom: 8px; padding-bottom: 2px; }
  .group-toggle, .group-menu { min-height: 28px; padding-block: 4px; }
  .group-toggle { font-size: 16px; }
  .group-items { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; min-height: 36px; }
  .drop-empty { padding: 12px; }
  .clip { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 6px; padding: 8px 10px; }
  .clip-top { grid-column: 1; grid-row: 1; min-width: 0; gap: 4px; margin: 0; }
  .clip-top button { min-height: 28px; }
  .drag-handle { width: 24px; min-width: 24px; font-size: 18px; }
  .clip-selector { min-width: 28px; height: 28px; }
  .clip-actions { grid-column: 2; grid-row: 1; align-self: start; flex-wrap: nowrap; gap: 4px; border-top: 0; margin: 0; padding: 0; }
  .clip-actions button { min-height: 28px; padding: 3px 4px; }
  .clip-actions .more-button { flex-basis: 28px; }
  .vheader { grid-column: 1 / -1; grid-row: 2; margin: 4px 0; }
  .vheader-button { min-height: 28px; padding: 0 0 3px; }
  .vheader-button.is-empty { min-height: 24px; padding: 0; }
  .vheader-text { font-size: 16px; line-height: 1.35; }
  .vheader-controls button { min-height: 32px; padding: 5px 10px; }
  .clip-content { grid-column: 1 / -1; grid-row: 3; line-height: 1.4; max-height: 4.2em; }
  .clip-content:not(.expanded) img { max-height: 104px; }
  .clip-content:has(img):not(.expanded) { max-height: 104px; }
  .expand-button { grid-column: 1 / -1; grid-row: 4; justify-self: start; min-height: 24px; margin: 2px 0 0; padding: 0; }
  .progress-track { grid-column: 1 / -1; grid-row: 5; height: 2px; margin-top: 6px; }
  .board[data-layout=list] .clip { grid-template-columns: minmax(140px, 190px) minmax(0, 1fr) auto; column-gap: 12px; }
  .board[data-layout=list] .clip-top { grid-column: 1; grid-row: 1 / 4; align-self: start; }
  .board[data-layout=list] .vheader { grid-column: 2; grid-row: 1; margin: 0 0 3px; }
  .board[data-layout=list] .clip-content { grid-column: 2; grid-row: 2; max-height: 2.8em; }
  .board[data-layout=list] .clip-content:has(img):not(.expanded) { max-height: 56px; }
  .board[data-layout=list] .clip-content:not(.expanded) img { max-height: 56px; }
  .board[data-layout=list] .expand-button { grid-column: 2; grid-row: 3; }
  .board[data-layout=list] .clip-actions { grid-column: 3; grid-row: 1 / 4; align-self: center; }
  .board[data-layout=list] .progress-track { grid-row: 4; }
  .composer { display: grid; grid-template-columns: minmax(200px, 1fr) auto; align-items: end; gap: 8px; padding: 8px 16px max(8px, env(safe-area-inset-bottom)); }
  .composer textarea { min-height: 40px; max-height: 112px; padding: 8px 10px; line-height: 1.35; }
  .composer-row { gap: 6px; margin-top: 0; }
  .composer-row label, .composer-hint { display: none; }
  .composer-row button, .composer-row select { min-height: 40px; padding-block: 6px; }
  .composer-row select { flex: none; width: 150px; padding-inline: 8px; }
  .composer-row .primary { white-space: nowrap; }
  .image-button { width: 40px; }
}
@media (max-width: 700px) {
  .header-inner { padding: max(12px, env(safe-area-inset-top)) 14px 12px; gap: 10px; }
  .brand { display: block; }
  .brand h1, .brand h2 { font-size: 22px; }
  .subtitle { display: block; margin-top: 5px; font-size: 12px; }
  .toolbar { padding: 0 14px 12px; gap: 7px; }
  .search { flex-basis: calc(100% - 88px); }
  .toolbar .new-group { order: 0; }
  .toolbar select { flex: 1; max-width: none; width: 0; padding-inline: 8px; font-size: 14px; }
  .toolbar .view-toggle, .toolbar .select-toggle { padding-inline: 10px; }
  .toolbar .view-toggle { font-size: 0; width: 44px; padding: 0; }
  .toolbar .view-toggle::after { content: '▦'; font-size: 22px; }
  .toolbar .view-toggle[aria-label="Use list layout"]::after { content: '☰'; }
  .board { padding: 14px 14px 28px; gap: 20px; }
  .board-heading .drag-hint { display: none; }
  .group-items { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .bulk-inner { padding: 8px 14px; gap: 6px; }
  .bulk-inner button { font-size: 14px; padding: 8px 10px; }
  .selection-count { flex-basis: 100%; }
  .clip { padding: 10px 12px 12px; }
  .composer { padding: 10px 14px max(10px, env(safe-area-inset-bottom)); }
  .composer-hint { display: none; }
  .composer-row select { flex: 1; width: 0; max-width: none; }
  .composer-row label { display: none; }
  .composer-row .primary { margin: 0; }
  #actionDialog { margin: auto 0 0; width: 100%; max-width: none; border-radius: 16px 16px 0 0; max-height: 90dvh; padding-bottom: env(safe-area-inset-bottom); }
  .dialog-header, .dialog-body { padding-left: 18px; padding-right: 18px; }
  #vaultStatus { margin-left: auto; }
  #vault .header-inner { flex-wrap: wrap; }
  #vault .brand { flex: 1 1 150px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .header-inner { padding-block: 8px; }
  .subtitle { display: none; }
  .toolbar { padding-bottom: 8px; }
  .composer { padding-top: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  body:not(.vault-breaching) *, body:not(.vault-breaching) *::before, body:not(.vault-breaching) *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Image batches stay together, with originals available in the collection viewer. */
.image-collection { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; width: 100%; padding: 0; border: 0; }
.clip-content .image-collection img { width: 100%; height: 94px; object-fit: cover; }
.collection-count { display: block; font-size: 11px; margin-top: 6px; }
.gallery-item { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.gallery-item img { display: block; max-width: 100%; max-height: 50vh; object-fit: contain; margin-bottom: 8px; }
.gallery-item img[data-index] { min-height: 120px; width: 100%; background: #182127; }
.gallery-item button { margin-right: 8px; }

/* Vault worksheet: shared column tracks keep every group aligned. */
#vaultScroll { overflow: auto; }
#vaultBoard { --sheet-columns: 86px minmax(180px, 1.1fr) minmax(260px, 2fr) 100px 140px 164px; min-width: 960px; width: 100%; max-width: none; padding: 18px 24px 36px; gap: 20px; }
#vault .group { border: 1px solid var(--line); border-radius: 6px; }
#vault .group-heading { padding: 4px 12px; margin: 0; background: #0d1519; }
#vault .sheet-columns { display: grid; grid-template-columns: var(--sheet-columns); position: sticky; top: 0; z-index: 3; background: #13262b; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 11px; }
#vault .sheet-columns span { padding: 12px 10px; border-right: 1px solid var(--line); }
#vault .group.collapsed .sheet-columns { display: none; }
#vault .group-items { display: block; min-height: 0; }
#vault .clip { display: grid; grid-template-columns: var(--sheet-columns); column-gap: 0; align-items: stretch; padding: 0; border: 0; border-bottom: 1px solid #29444b; border-radius: 0; box-shadow: none; }
#vault .clip:last-child { border-bottom: 0; }
#vault .clip:nth-of-type(even) { background: #0d171d; }
#vault .clip:hover { background: #14282e; }
#vault .clip.selected { background: #173437; outline: 1px solid var(--cyan); outline-offset: -1px; }
#vault .clip > * { min-width: 0; margin: 0; padding: 10px; border-right: 1px solid #29444b; }
#vault .clip > * { grid-row: 1; grid-column: auto; }
#vault .clip > .sheet-index { grid-column: 1; }
#vault .clip > .vheader { grid-column: 2; }
#vault .clip > .sheet-preview { grid-column: 3; }
#vault .clip > .sheet-type { grid-column: 4; }
#vault .clip > .kept-date { grid-column: 5; }
#vault .clip > .clip-actions { grid-column: 6; }
#vault .sheet-index { display: flex; flex-wrap: wrap; align-content: center; align-items: center; justify-content: center; gap: 0; border-left: 3px solid var(--card-color); padding: 4px; }
#vault .row-number { font-size: 11px; color: var(--muted); width: 100%; text-align: center; }
#vault .sheet-index .clip-selector { min-width: 32px; }
#vault .sheet-index .drag-handle { width: 28px; min-width: 28px; }
#vault .vheader { display: flex; align-items: center; }
#vault .vheader-button { border: 0 !important; padding: 4px 0; align-items: center; }
#vault .vheader-text { font-size: 14px; }
#vault .vheader-edit { display: none; }
#vault .vheader-editor { width: 100%; }
#vault .sheet-preview { align-self: stretch; }
#vault .clip-content { max-height: 52px; font-size: 13px; }
#vault .sheet-type { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
#vault .kept-date { display: flex; align-items: center; font-size: 11px; }
#vault .clip-actions { display: flex; align-items: center; flex-wrap: nowrap; border-top: 0; gap: 5px; }
#vault .clip-actions button { padding: 5px 8px; font-size: 12px; }
#vault .clip-actions .more-button { flex-basis: 36px; }
#vault .expand-button { font-size: 11px; margin: 2px 0 0; padding: 0; min-height: 26px; }
#vault .clip-content .image-collection { display: flex; width: auto; gap: 4px; min-height: 0; }
#vault .clip-content .image-collection img { width: 44px; height: 34px; object-fit: cover; }
#vault .collection-count { margin-top: 0; font-size: 10px; }
#vault .clip-content > img { height: 52px; }
#vault .clip-content.expanded > img { height: auto; max-height: 400px; }
#vaultBoard[data-layout=comfortable] .clip > * { padding-block: 18px; }
#vaultBoard[data-layout=comfortable] .clip-content { max-height: 110px; }
#vault .drop-empty { border: 0; border-radius: 0; }
@media (max-width: 700px) { #vaultBoard { padding-inline: 12px; } }

/* Security gate: animate only composited transforms/opacity; no canvas or frame loop. */
.keep-hold { position: relative; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.keep-hold::before { content: ''; position: absolute; inset: 0; background: #64f5e833; transform: scaleX(0); transform-origin: left; pointer-events: none; }
.keep-hold.keep-holding::before { animation: keep-charge 3s linear forwards !important; }
@keyframes keep-charge { to { transform: scaleX(1); } }
#keepWarning { padding: 0; width: min(540px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; border: 1px solid #ff4e79; border-radius: 6px; color: #dafdf9; background: #090e16; box-shadow: 0 0 0 5px #ff1f7810, 0 16px 70px #000b; }
#keepWarning::backdrop { background: #02050cde; }
.warning-shell { position: relative; isolation: isolate; overflow: hidden; padding: 32px; background: linear-gradient(125deg, #ff1f7812, transparent 50%, #00fff213); }
.warning-shell::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: repeating-linear-gradient(0deg, transparent 0 4px, #64f5e808 4px 5px); }
#keepWarningClose { position: absolute; right: 10px; top: 10px; z-index: 3; min-width: 44px; min-height: 44px; font-size: 25px; color: #dafdf9; border-color: #ff4e7960; background: #101a20; }
.warning-code { padding-right: 36px; color: #91b9b8; font-size: 10px; letter-spacing: .12em; }
.warning-sigil { margin: 28px 0 18px; display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid #ff4e79; color: #ff4e79; font-size: 34px; background: #ff1f780c; }
.warning-eyebrow { font-size: 11px; letter-spacing: .18em; color: #ff7b98; }
#keepWarningTitle { position: relative; font: 700 clamp(23px, 6.5vw, 38px)/1.2 'Space Grotesk', sans-serif; letter-spacing: .03em; margin: 10px 0 14px; color: #f5f1e6; }
#keepWarningTitle::after { content: attr(data-text); position: absolute; inset: 0; color: #64f5e8; clip-path: inset(42% 0 32%); opacity: 0; pointer-events: none; }
#keepWarningDescription { font-size: 13px; line-height: 1.7; color: #ffb3c3; }
.warning-terminal { border-left: 2px solid #64f5e8; padding: 13px 12px; margin: 22px 0; background: #02080c; font-size: clamp(9px, 2.45vw, 12px); color: #91b9b8; line-height: 2; white-space: nowrap; }
.warning-terminal > span { display: block; }
.warning-terminal > span:last-child { color: #64f5e8; }
.warning-instruction { font-size: 12px; line-height: 1.8; color: #91b9b8; }
.warning-instruction strong { color: #dafdf9; }
.warning-footer { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid #2b494c; margin-top: 25px; padding-top: 14px; color: #ff7b98; font-size: 9px; letter-spacing: .08em; }
.warning-laser { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: #64f5e8; box-shadow: 0 0 14px #64f5e8; opacity: .4; pointer-events: none; }
/* Explicitly retain these restrained effects with reduced-motion preferences. */
#keepWarning[open] .warning-laser { animation: warning-scan 5s linear infinite !important; }
#keepWarning[open] #keepWarningTitle::after { animation: warning-glitch 4.8s steps(1, end) infinite !important; }
#keepWarning[open] .warning-sigil { animation: warning-twitch 6s steps(1, end) infinite !important; }
#keepWarning[open] .warning-cursor { animation: warning-cursor 1.4s steps(1, end) infinite !important; }
@keyframes warning-scan { 0% { transform: translateY(0); opacity: 0; } 10%,80% { opacity: .45; } 100% { transform: translateY(580px); opacity: 0; } }
@keyframes warning-glitch { 0%,93%,100% { transform: translateX(0); opacity: 0; } 94% { transform: translateX(3px); opacity: .7; } 97% { transform: translateX(-2px); opacity: .5; } }
@keyframes warning-twitch { 0%,95%,100% { transform: translateX(0); } 96% { transform: translateX(-2px); } 98% { transform: translateX(2px); } }
@keyframes warning-cursor { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
@media (max-width: 420px) { .warning-shell { padding: 26px 20px; } }

#vault .storage-status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 32px; padding: 5px 9px; font-size: 10px; color: var(--muted); border-color: #2b494c; background: #0d1519; text-align: left; }
#vault .storage-status meter { width: 58px; height: 8px; accent-color: #64f5e8; }
#vault .storage-status meter::-webkit-meter-bar { background: #223a3d; border: 0; }
#vault .storage-status meter::-webkit-meter-optimum-value { background: #64f5e8; }
#vault .storage-full { color: #ff8f9a; border-color: #ff8f9a; }
#vault .sheet-columns span:has(button) { padding: 0; }
#vault .sheet-columns button { width: 100%; min-height: 38px; text-align: left; padding: 10px; border: 0; border-radius: 0; font-size: inherit; color: inherit; }
#vaultSort { max-width: 205px; }
#vaultBudget { display: block; width: 100%; margin-top: 8px; }
@media (max-width: 700px) { #vault .storage-status { margin-top: 8px; } }

/* The clipboard is unavailable until Firebase Authentication restores a user. */
.sign-in { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.sign-in-card { width: min(440px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 18px; background: var(--raised); line-height: 1.6; }
.sign-in-card h1 { margin-top: 0; }
.sign-in-card .primary { min-height: 44px; padding: 8px 20px; }
.sign-in-note { opacity: .75; font-size: .85rem; }
#signInError { color: #ff6b6b; min-height: 1.5em; }
.sign-out { margin-left: 12px; }
