:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-glass: rgba(255,255,255,.9);
  --surface-sidebar: rgba(255,255,255,.74);
  --surface-card: rgba(255,255,255,.88);
  --surface-soft: #eef2ff;
  --text: #111827;
  --text-soft: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-soft: rgba(226,232,240,.74);
  --field-bg: #ffffff;
  --input-focus: #c7d2fe;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #94a3b8;
  --accent: #22d3ee;
  --highlight: #eab308;
  --danger: #dc2626;
  --ok: #059669;
  --shadow: 0 1px 0 rgba(15, 23, 42, .035);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, .05);
  --body-glow: transparent;
  --button-bg: #e2e8f0;
  --button-text: #0f172a;
  --pill-bg: #f1f5f9;
  --pill-text: #475569;
  --secret-bg: #fef3c7;
  --secret-text: #92400e;
  --file-bg: #dcfce7;
  --file-text: #166534;
  --danger-bg: #fee2e2;
  --overlay: rgba(15,23,42,.32);
  --terminal-bg: #ffffff;
  --terminal-surface: #f8fafc;
  --terminal-line: #dbe3ef;
  --terminal-text: #172033;
  --terminal-muted: #64748b;
  --terminal-accent: #4f46e5;
  --grain-opacity: .24;
  --android-system-bottom: 0px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Sora, Inter, ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-ui: .875rem;
  --text-ui-sm: .8125rem;
  --text-label: .75rem;
  --text-meta: .72rem;
  --text-micro: .68rem;
  --text-button: .8rem;
  --weight-ui: 400;
  --weight-control: 400;
  --weight-strong: 500;
  --text-content: .98rem;
  --line-ui: 1.45;
  --line-content: 1.65;
  --heading-h1: clamp(1.375rem, 2.4vw, 1.75rem);
  --heading-h2: 1.08rem;
  --heading-h3: .78rem;
  --note-title-size: clamp(1.2rem, 2.6vw, 1.55rem);
  --control-height: 40px;
  --control-height-touch: 44px;
  --control-padding-block: 9px;
  --control-padding-inline: 12px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f172a;
  --surface: #172033;
  --surface-glass: rgba(23,32,51,.92);
  --surface-sidebar: rgba(15,23,42,.82);
  --surface-card: rgba(23,32,51,.9);
  --surface-soft: #1e293b;
  --text: #e5e7eb;
  --text-soft: #cbd5e1;
  --muted: #94a3b8;
  --border: #334155;
  --border-soft: rgba(51,65,85,.68);
  --field-bg: #0f172a;
  --input-focus: rgba(129,140,248,.36);
  --primary: #3b82f6;
  --primary-dark: #93c5fd;
  --secondary: #64748b;
  --accent: #fb923c;
  --highlight: #d6a77a;
  --danger: #fca5a5;
  --ok: #6ee7b7;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03);
  --shadow-soft: 0 1px 2px rgba(2, 6, 23, .18);
  --body-glow: transparent;
  --button-bg: #263449;
  --button-text: #e5e7eb;
  --pill-bg: #263449;
  --pill-text: #cbd5e1;
  --secret-bg: rgba(146,64,14,.32);
  --secret-text: #fbbf24;
  --file-bg: rgba(22,101,52,.32);
  --file-text: #86efac;
  --danger-bg: rgba(127,29,29,.38);
  --overlay: rgba(2,6,23,.68);
  --terminal-bg: #050914;
  --terminal-surface: #0b1220;
  --terminal-line: #1f2a3a;
  --terminal-text: #dbeafe;
  --terminal-muted: #8ba3bf;
  --terminal-accent: #34d399;
  --grain-opacity: .16;
}

[data-theme-choice="soft"] {
  --bg: #f5ead2;
  --surface: #fff9ef;
  --surface-glass: rgba(255,249,239,.9);
  --surface-sidebar: rgba(245,234,210,.8);
  --surface-card: rgba(255,249,239,.91);
  --surface-soft: #ead8b9;
  --text: #263238;
  --text-soft: #46515a;
  --muted: #766a57;
  --border: #d9c7a8;
  --border-soft: rgba(217,199,168,.72);
  --primary: #b86f3b;
  --primary-dark: #8f4f24;
  --secondary: #60a5fa;
  --accent: #4d7c0f;
  --highlight: #d9a441;
  --input-focus: rgba(184,111,59,.25);
  --terminal-bg: #fff8ea;
  --terminal-surface: #ead8b9;
  --terminal-line: #d9c7a8;
  --terminal-text: #263238;
  --terminal-muted: #766a57;
  --terminal-accent: #4d7c0f;
}

[data-theme-choice="ocean"] {
  --bg: #effef2;
  --surface: #fbfff7;
  --surface-soft: #d9f99d;
  --primary: #0e7490;
  --primary-dark: #155e75;
  --secondary: #facc15;
  --accent: #22c55e;
  --highlight: #14b8a6;
  --input-focus: rgba(20,184,166,.28);
  --terminal-bg: #f8fff1;
  --terminal-surface: #e8fad3;
  --terminal-line: #a7e2c4;
  --terminal-text: #06353b;
  --terminal-muted: #3b6f61;
  --terminal-accent: #14b8a6;
}

[data-theme-choice="colorblind"] {
  --bg: #fff5df;
  --surface: #fffaf0;
  --surface-glass: rgba(255,250,240,.9);
  --surface-sidebar: rgba(255,247,223,.8);
  --surface-card: rgba(255,250,240,.92);
  --surface-soft: #f3e5c0;
  --text: #16130a;
  --text-soft: #3f3217;
  --muted: #735f2b;
  --border: #e5c16f;
  --border-soft: rgba(229,193,111,.68);
  --field-bg: #fffdf7;
  --input-focus: rgba(213,94,0,.25);
  --primary: #d94f30;
  --primary-dark: #aa351d;
  --secondary: #d99a18;
  --accent: #1e3a8a;
  --highlight: #f3e5c0;
  --danger: #d55e00;
  --ok: #009e73;
  --secret-bg: #f0e442;
  --secret-text: #302900;
  --terminal-bg: #fffaf0;
  --terminal-surface: #fff0bd;
  --terminal-line: #e4c15b;
  --terminal-text: #16130a;
  --terminal-muted: #735f2b;
  --terminal-accent: #1e3a8a;
}

[data-theme-choice="midnight"] {
  --bg: #070b18;
  --surface: #111827;
  --surface-glass: rgba(17,24,39,.94);
  --surface-sidebar: rgba(7,11,24,.9);
  --surface-card: rgba(17,24,39,.92);
  --surface-soft: #1f2937;
  --text: #f8fbff;
  --text-soft: #dbeafe;
  --muted: #93a9c8;
  --border: #334155;
  --border-soft: rgba(51,65,85,.68);
  --field-bg: #0b1020;
  --primary: #38bdf8;
  --primary-dark: #7dd3fc;
  --secondary: #fb7185;
  --accent: #fb923c;
  --highlight: #a3e635;
  --input-focus: rgba(56,189,248,.28);
  --terminal-bg: #070b18;
  --terminal-surface: #101827;
  --terminal-line: #334155;
  --terminal-text: #f8fbff;
  --terminal-muted: #93a9c8;
  --terminal-accent: #a3e635;
}

[data-theme-choice="mono"] {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-glass: rgba(255,255,255,.92);
  --surface-sidebar: rgba(250,250,248,.82);
  --surface-card: rgba(255,255,255,.92);
  --surface-soft: #e5e7eb;
  --text: #111111;
  --text-soft: #333333;
  --muted: #666666;
  --border: #d1d5db;
  --border-soft: rgba(209,213,219,.74);
  --primary: #111827;
  --primary-dark: #020617;
  --secondary: #6b7280;
  --accent: #2563eb;
  --highlight: #f9fafb;
  --input-focus: rgba(17,17,17,.2);
  --terminal-bg: #ffffff;
  --terminal-surface: #eeeeea;
  --terminal-line: #cfcfca;
  --terminal-text: #111111;
  --terminal-muted: #666666;
  --terminal-accent: #111111;
}

[data-theme-choice="blueprint"] {
  --bg: #061f22;
  --surface: #0b2f33;
  --surface-glass: rgba(11,47,51,.94);
  --surface-sidebar: rgba(6,31,34,.9);
  --surface-card: rgba(11,47,51,.92);
  --surface-soft: #164f55;
  --text: #e5fbfb;
  --text-soft: #c3e7e6;
  --muted: #8fb9b8;
  --border: #28676b;
  --border-soft: rgba(45,116,120,.58);
  --field-bg: #061f22;
  --primary: #14b8a6;
  --primary-dark: #5eead4;
  --secondary: #94a3b8;
  --accent: #22d3ee;
  --highlight: #4ade80;
  --input-focus: rgba(34,211,238,.3);
  --button-bg: #123f55;
  --button-text: #e5fbfb;
  --pill-bg: #123f55;
  --pill-text: #c3e7e6;
  --secret-bg: rgba(47,192,200,.2);
  --secret-text: #91f0f2;
  --file-bg: rgba(63,153,152,.24);
  --file-text: #91f0f2;
  --danger-bg: rgba(127,29,29,.4);
  --overlay: rgba(18,27,27,.72);
  --terminal-bg: #071d2b;
  --terminal-surface: #0c2a3a;
  --terminal-line: #1d6f8d;
  --terminal-text: #e5fbfb;
  --terminal-muted: #8fb9b8;
  --terminal-accent: #34d399;
}

[data-theme-choice="plum"] {
  --bg: #120828;
  --surface: #1f123d;
  --surface-glass: rgba(31,18,61,.94);
  --surface-sidebar: rgba(18,8,40,.9);
  --surface-card: rgba(31,18,61,.92);
  --surface-soft: #33205f;
  --text: #f8ecff;
  --text-soft: #e5c9f2;
  --muted: #b891c8;
  --border: #5b2f74;
  --border-soft: rgba(91,47,116,.7);
  --field-bg: #1b0a28;
  --primary: #facc15;
  --primary-dark: #fde047;
  --secondary: #2563eb;
  --accent: #ec4899;
  --highlight: #8b5cf6;
  --input-focus: rgba(240,171,252,.28);
  --terminal-bg: #0e0713;
  --terminal-surface: #1f0d2c;
  --terminal-line: #50245f;
  --terminal-text: #f8ecff;
  --terminal-muted: #b891c8;
  --terminal-accent: #818cf8;
}

[data-theme-choice="black"] {
  --bg: #000000;
  --surface: #050505;
  --surface-glass: rgba(5,5,5,.96);
  --surface-sidebar: rgba(0,0,0,.94);
  --surface-card: rgba(8,8,8,.94);
  --surface-soft: #101510;
  --text: #f4fff4;
  --text-soft: #d6ead6;
  --muted: #8dae8d;
  --border: #1d2b1d;
  --border-soft: rgba(29,43,29,.72);
  --field-bg: #000000;
  --input-focus: rgba(71,176,102,.32);
  --primary: #a3e635;
  --primary-dark: #bef264;
  --secondary: #6b7280;
  --accent: #d9f99d;
  --highlight: #f8fafc;
  --danger: #ff8a7a;
  --ok: #72d38e;
  --button-bg: #101510;
  --button-text: #f4fff4;
  --pill-bg: #101510;
  --pill-text: #d6ead6;
  --secret-bg: rgba(71,176,102,.2);
  --secret-text: #9df0ad;
  --file-bg: rgba(71,176,102,.24);
  --file-text: #9df0ad;
  --danger-bg: rgba(127,29,29,.42);
  --overlay: rgba(0,0,0,.78);
  --terminal-bg: #000000;
  --terminal-surface: #050805;
  --terminal-line: #1b2b1b;
  --terminal-text: #f4fff4;
  --terminal-muted: #8dae8d;
  --terminal-accent: #47b066;
}


* { box-sizing: border-box; scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }
html, body, .app-shell { max-width: 100%; overflow-x: clip; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--text-ui)/var(--line-ui) var(--font-body);
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image:
    radial-gradient(circle at 1px 2px, color-mix(in srgb, var(--text) 9%, transparent) .45px, transparent .9px),
    radial-gradient(circle at 6px 5px, color-mix(in srgb, var(--highlight) 18%, transparent) .35px, transparent .85px),
    radial-gradient(circle at 10px 13px, color-mix(in srgb, var(--primary) 11%, transparent) .38px, transparent .9px),
    radial-gradient(circle at 14px 8px, color-mix(in srgb, var(--secondary) 10%, transparent) .32px, transparent .8px),
    radial-gradient(circle at 19px 17px, color-mix(in srgb, var(--accent) 9%, transparent) .36px, transparent .85px),
    linear-gradient(120deg, color-mix(in srgb, var(--highlight) 4%, transparent), transparent 42%, color-mix(in srgb, var(--text) 3%, transparent));
  background-position: 0 0, 3px 4px, 9px 2px, 2px 9px, 7px 11px, 0 0;
  background-size: 11px 11px, 13px 13px, 17px 17px, 19px 19px, 23px 23px, 100% 100%;
  mix-blend-mode: multiply;
}
html[data-theme="dark"] body::before { mix-blend-mode: screen; }
html { scrollbar-gutter: stable; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app-shell { position: relative; z-index: 1; min-height: 100vh; }
.app-shell:has(.auth-card), .app-shell:has(.loading-card) {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 32%),
    radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--secondary) 13%, transparent), transparent 30%),
    radial-gradient(circle at 48% 92%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 34%),
    radial-gradient(circle at 8% 82%, color-mix(in srgb, var(--highlight) 9%, transparent), transparent 28%),
    linear-gradient(135deg, var(--bg), color-mix(in srgb, var(--bg) 82%, var(--surface-soft)));
}
html.auth-screen,
body.auth-screen {
  overflow-y: auto;
}
body.auth-screen .app-shell,
.app-shell:has(.auth-card) {
  align-items: start;
  justify-items: center;
  overflow-y: auto;
}
.loading-card, .auth-card {
  position: relative;
  width: min(100%, 460px);
  min-width: 0;
  margin: 0 auto;
  padding: 20px 4px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.auth-card { width: min(100%, 560px); }
.loading-card {
  display: grid;
  gap: 18px;
  justify-items: center;
  width: min(90vw, 380px);
  padding: 34px 30px 30px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 74%, transparent);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-glass) 94%, transparent), color-mix(in srgb, var(--surface-soft) 68%, transparent)),
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--secondary) 12%, transparent), transparent 44%),
    radial-gradient(circle at 80% 10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 42%);
  box-shadow: 0 24px 80px rgba(15,23,42,.12), var(--shadow);
  text-align: center;
}
.loading-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--highlight) 12%, transparent), color-mix(in srgb, var(--accent) 9%, transparent), transparent);
  transform: translateX(-100%);
  animation: loading-sheen 2.6s ease-in-out infinite;
}
.loading-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-xl);
  background: transparent;
  color: var(--bg);
  font: 500 .86rem/1 var(--font-display);
  letter-spacing: -.04em;
  box-shadow: 0 14px 34px color-mix(in srgb, var(--text) 18%, transparent);
}
.loading-mark img { width: 100%; height: 100%; display: block; border-radius: inherit; }
.loading-copy { display: grid; gap: 6px; }
.loading-eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: var(--text-meta);
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.loading-copy h1 { font-size: clamp(1.35rem, 4vw, 1.75rem); }
.loading-copy p:not(.loading-eyebrow) { margin: 0; color: var(--muted); font-weight: 500; }
.loading-bar {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 74%, transparent);
}
.loading-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent), var(--highlight));
  animation: loading-progress 1.35s ease-in-out infinite;
}
@keyframes loading-progress {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(250%); }
}
@keyframes loading-sheen {
  0%, 30% { transform: translateX(-100%); }
  70%, 100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .loading-card::before, .loading-bar span { animation: none; transform: none; }
}
.auth-card .brand {
  align-items: center;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
}
.auth-card .brand-mark { flex: 0 0 auto; }
.auth-card .brand h1 { font-size: clamp(1.55rem, 3.6vw, 1.95rem); max-width: 12ch; }
.auth-card form {
  padding: 20px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--surface-glass) 88%, transparent);
  box-shadow: 0 20px 60px rgba(15,23,42,.08);
}
.onboarding-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.setup-choice { min-height: 96px; padding: 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-xl); background: var(--surface-card); color: var(--text); text-align: left; display: grid; gap: 6px; }
.setup-choice b { font-family: var(--font-display); font-size: var(--text-ui); }
.setup-choice span { color: var(--muted); font-size: var(--text-ui-sm); line-height: 1.35; }
.setup-choice.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--input-focus); }
.setup-panel.hidden { display: none; }
.setup-theme { margin-bottom: 14px; }
.auth-card .setup-theme { padding: 16px; }
.auth-card .setup-theme .theme-presets { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
@media (max-height: 760px) and (min-width: 641px) {
  .app-shell:has(.auth-card) { padding-block: 14px; }
  .auth-card { padding-block: 0; }
  .auth-card .brand { margin-bottom: 14px; padding-bottom: 12px; }
  .auth-card .brand h1 { font-size: clamp(1.4rem, 3.2vw, 1.75rem); }
  .auth-card .brand p { margin-block: 4px 0; }
  .onboarding-choice { gap: 8px; margin-bottom: 10px; }
  .setup-choice { min-height: 74px; padding: 10px 12px; }
  .auth-card .setup-theme { padding: 12px; margin-bottom: 10px; }
  .auth-card .setup-theme .theme-presets { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
  .auth-card form { padding: 14px; }
  .setup-panel .details-panel { margin-top: 8px; }
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand-mark { width: 42px; height: 42px; border-radius: var(--radius-lg); background: transparent; display: grid; place-items: center; color: var(--bg); font: 400 .8rem/1 var(--font-display); letter-spacing: -.03em; }
.brand-home { border: 0; padding: 0; cursor: pointer; }
.brand-home:hover { transform: translateY(-1px); }
.brand-home:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.menu-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); font-size: 1.1rem; font-weight: 500; }
h1, h2, h3 { line-height: 1.1; margin: 0; }
h1, h2 { font-family: var(--font-display); font-weight: 500; }
b, strong { font-weight: 500; }
h1 { font-size: var(--heading-h1); letter-spacing: -.038em; }
h2 { font-size: var(--heading-h2); letter-spacing: -.025em; }
h3 { font: var(--weight-control) var(--heading-h3)/1.15 var(--font-body); letter-spacing: .02em; text-transform: uppercase; }
.mono, .small, .pill { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
#settingsPanel .card > h3 + p.muted.small,
#settingsPanel .card > h3 + p.small.muted,
.editor-panel > .topbar p.muted.small { display: none; }
.small { font-size: var(--text-ui-sm); }
.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; }
.field, .stack, .card, .inline-panel, .editor-grid, .profile-row, .avatar-controls { min-width: 0; }
.field span { font-size: var(--text-ui-sm); color: var(--text-soft); font-weight: var(--weight-control); }
input, textarea, select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--field-bg);
  color: var(--text);
  min-height: var(--control-height);
  padding: var(--control-padding-block) var(--control-padding-inline);
  font-size: var(--text-ui);
  line-height: var(--line-ui);
  outline: none;
}
textarea { min-height: 136px; resize: vertical; }
.note-title-input { border: 0; border-bottom: 1px solid var(--border-soft); border-radius: 0; min-height: 48px; padding: 6px 2px 10px; background: transparent; font-family: var(--font-display); font-size: var(--note-title-size); font-weight: 500; letter-spacing: -.035em; }
.note-title-input:focus { box-shadow: none; border-color: var(--primary); }
.quick-note-body { min-height: 46vh; border: 0; border-radius: 0; padding: 8px 0 18px; background: transparent; color: var(--terminal-text); font: 1rem/1.6 var(--font-mono); resize: vertical; }
.quick-note-body:focus { outline: none; box-shadow: none; }
.note-compose { min-height: 48vh; border: 0; border-radius: 0; padding: 14px 2px; font-size: 1rem; line-height: var(--line-content); background: transparent; }
.note-compose:focus { box-shadow: none; border-color: transparent; }
.block-editor { display: grid; gap: 10px; padding: 12px 0 8px; }
.editor-block { position: relative; border: 1px solid transparent; border-radius: var(--radius-lg); padding: 8px 8px 8px 26px; background: transparent; }
.editor-block::before { content: ">"; position: absolute; left: 9px; top: 15px; color: var(--terminal-accent); font: 500 var(--text-ui-sm)/1 var(--font-mono); }
.editor-block.active { border-color: var(--terminal-line); background: rgba(255,255,255,.035); }
.editor-block textarea, .editor-block input:not([type="checkbox"]), .editor-block select { background: var(--terminal-surface); color: var(--terminal-text); border-color: var(--terminal-line); font-family: var(--font-mono); }
.block-move-controls { position: absolute; left: 4px; top: 34px; display: grid; gap: 4px; opacity: .72; }
.block-move-controls .icon-action { width: 22px; min-width: 22px; min-height: 22px; padding: 0; border-radius: 7px; font-size: .72rem; }
.editor-block:hover .block-move-controls, .editor-block.active .block-move-controls { opacity: 1; }
.rich-text { min-height: 132px; padding: 10px 0; color: var(--terminal-text); outline: none; font: var(--text-content)/var(--line-content) var(--font-mono); white-space: normal; }
.rich-text:empty::before { content: attr(data-placeholder); color: var(--terminal-muted); }
.rich-text a { color: var(--primary-dark); text-decoration: underline; }
.rich-text code { border: 1px solid var(--terminal-line); border-radius: 5px; padding: 1px 4px; background: var(--terminal-surface); }
.rich-text ul, .rich-text ol { margin: 8px 0 8px 22px; padding: 0; }
.rich-text blockquote { margin: 10px 0; padding-left: 12px; border-left: 3px solid var(--terminal-accent); color: var(--terminal-muted); }
.rich-text h1, .rich-text h2, .rich-text h3, .rich-text h4, .rich-text h5 { margin: 10px 0 6px; font-family: var(--font-mono); }
.paragraph-editor-block { padding-top: 6px; }
.paragraph-remove-block { position: absolute; right: 8px; top: 14px; z-index: 2; }
.paragraph-toolbar { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 0 6px; border-bottom: 1px solid var(--terminal-line); }
.editor-block[data-block="heading"] input { border: 0; border-bottom: 1px solid var(--terminal-line); border-radius: 0; font: 500 1.12rem/1.2 var(--font-mono); background: transparent; color: var(--terminal-text); }
.checklist-block { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.checklist-block input[type="checkbox"] { width: 20px; min-height: 20px; }
.code-editor-block textarea, .math-block textarea { min-height: 180px; font: .9rem/1.5 var(--font-mono); }
.list-editor-block textarea, .quote-editor-block textarea { min-height: 120px; font: .9rem/1.55 var(--font-mono); }
.quote-editor-block { border-left: 3px solid var(--terminal-accent); }
.editor-divider { height: 1px; margin: 12px 0; background: var(--terminal-line); }
.table-editor-grid { overflow: visible; border: 1px solid var(--terminal-line); border-radius: var(--radius-lg); background: var(--terminal-surface); }
.table-editor-grid table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.table-editor-grid th, .table-editor-grid td { border: 1px solid var(--terminal-line); padding: 0; }
.table-editor-grid th { background: color-mix(in srgb, var(--terminal-surface) 84%, var(--terminal-accent)); text-align: left; }
.table-editor-grid input { min-height: 40px; border: 0; border-radius: 0; background: transparent; font: .86rem/1.4 var(--font-mono); }
.table-editor-grid input:focus { position: relative; z-index: 1; }
.table-cell-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
.table-row-control { width: 42px; max-width: 42px; background: color-mix(in srgb, var(--terminal-bg) 70%, var(--terminal-surface)); text-align: center; }
.table-delete { width: 34px; min-height: 40px; border: 0; border-left: 1px solid var(--terminal-line); background: transparent; color: var(--terminal-muted); font-weight: 500; }
.table-row-control .table-delete { border-left: 0; width: 100%; }
.table-delete:hover { color: var(--danger); background: var(--danger-bg); }
.readonly-table th, .readonly-table td { padding: 9px 10px; color: var(--terminal-text); }
.note-read-body { display: grid; gap: 12px; padding: 16px; }
.read-block { color: var(--terminal-text); font: var(--text-content)/var(--line-content) var(--font-mono); }
.note-read-body blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--terminal-accent); color: var(--terminal-muted); }
.read-code-shell { overflow: hidden; border: 1px solid var(--terminal-line); border-radius: var(--radius-lg); background: var(--terminal-surface); }
.code-view-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--terminal-line); color: var(--terminal-muted); font: var(--weight-strong) var(--text-meta)/1 var(--font-mono); text-transform: uppercase; letter-spacing: .04em; }
.read-code { display: grid; grid-template-columns: auto minmax(0, 1fr); margin: 0; overflow: auto; background: var(--terminal-surface); }
.read-code .code-line-numbers { max-height: none; }
.read-code code { padding: 12px; white-space: pre; color: var(--terminal-text); font: .9rem/1.5 var(--font-mono); }
.read-drawing { max-width: 100%; border: 1px solid var(--terminal-line); border-radius: var(--radius-lg); background: #f8fafc; }
.read-check { color: var(--terminal-text); font-family: var(--font-mono); }
.inline-secret-read { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 12px; border: 1px solid var(--terminal-line); border-radius: var(--radius-lg); background: var(--terminal-surface); color: var(--terminal-text); font-family: var(--font-mono); }
.inline-secret-read .secret-value { color: var(--terminal-muted); }
.inline-secret-read b,
.inline-secret-read .secret-value { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.block-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; text-align: left; }
.block-row b { margin-right: auto; text-align: left; }
.block-row select { width: auto; min-width: 160px; }
.secret-editor-block { display: grid; grid-template-columns: minmax(120px, 180px) 1fr auto auto auto auto; gap: 10px; align-items: end; border-color: var(--terminal-line); background: rgba(255,255,255,.035); }
.drawing-block { border-color: var(--terminal-line); background: rgba(255,255,255,.035); }
.drawing-block canvas { width: 100%; height: 260px; border: 1px solid var(--terminal-line); border-radius: var(--radius-lg); background: #f8fafc; touch-action: none; display: block; }
.drawing-block.expanded { position: fixed; inset: 14px; z-index: 60; padding: 16px; background: var(--terminal-bg); border: 1px solid var(--terminal-line); border-radius: var(--radius-xl); box-shadow: 0 20px 70px rgba(15,23,42,.28); overflow: auto; }
.drawing-block.expanded canvas { height: min(72vh, 760px); }
.editor.confirm-dialog { z-index: 90; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--input-focus); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.quick-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; }
.add-menu { border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface-card); padding: 8px; order: -1; }
.add-menu summary { cursor: pointer; color: var(--text-soft); font-size: .86rem; font-weight: 500; list-style: none; }
.add-menu summary::-webkit-details-marker { display: none; }
.add-menu[open] summary { margin-bottom: 8px; color: var(--primary-dark); }
.block-toolbar, .editor-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.block-toolbar select, .editor-toolbar select { width: auto; min-height: 38px; padding: 6px 9px; font-size: var(--text-ui-sm); font-weight: var(--weight-strong); }
.tool-chip, .icon-action {
  min-height: 34px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  font-size: var(--text-label);
  font-weight: var(--weight-control);
}
.tool-chip span { font-size: .84rem; }
.tool-chip:hover, .icon-action:hover { color: var(--primary-dark); background: var(--surface-soft); }
.heading-picker { width: auto; min-width: 92px; min-height: 34px; border: 0; border-radius: 0; padding: 4px 24px 4px 6px; background: transparent; color: var(--terminal-muted); font: var(--weight-strong) var(--text-label)/1 var(--font-mono); }
.heading-picker:hover, .heading-picker:focus { color: var(--terminal-accent); background: rgba(34,197,94,.08); box-shadow: none; }
.secret-tool { color: var(--secret-text); }
.icon-action { min-width: 36px; justify-content: center; padding: 6px 8px; font-size: .94rem; }
.btn {
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--border-soft) 78%, transparent);
  border-radius: var(--radius-lg);
  padding: 7px 11px;
  background: color-mix(in srgb, var(--button-bg) 92%, var(--surface));
  color: var(--button-text);
  font-size: var(--text-button);
  font-weight: var(--weight-control);
  line-height: 1.15;
  letter-spacing: 0;
  box-shadow: var(--shadow-soft);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease, color .14s ease;
}
.btn:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--primary) 18%, var(--border-soft)); background: color-mix(in srgb, var(--button-bg) 88%, var(--surface)); box-shadow: 0 2px 5px color-mix(in srgb, var(--text) 5%, transparent); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:focus-visible { outline: 3px solid var(--input-focus); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .52; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { border-color: color-mix(in srgb, var(--primary-dark) 24%, var(--primary)); background: var(--primary); color: white; box-shadow: none; }
.btn.primary:hover { background: color-mix(in srgb, var(--primary) 90%, var(--primary-dark)); box-shadow: none; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); box-shadow: none; }
.btn.ghost:hover, .btn.ghost:focus-visible { border-color: color-mix(in srgb, var(--primary) 18%, var(--border-soft)); background: color-mix(in srgb, var(--surface-soft) 88%, transparent); color: var(--primary-dark); }
.btn.ghost.active { border-color: color-mix(in srgb, var(--primary) 28%, var(--border-soft)); background: var(--surface-soft); color: var(--primary-dark); }
.btn.danger { border-color: color-mix(in srgb, var(--danger) 24%, var(--border-soft)); background: color-mix(in srgb, var(--danger-bg) 92%, var(--surface)); color: var(--danger); }
.auth-actions { position: absolute; top: 14px; right: 14px; }
.theme-button {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: var(--text-label);
  font-weight: var(--weight-control);
}
.theme-button:hover { color: var(--text); background: var(--surface-soft); }
.sync-pill { min-height: 36px; border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 7px 12px; background: var(--surface); color: var(--muted); font-size: var(--text-label); font-weight: var(--weight-control); white-space: nowrap; }
.sync-pill.syncing { color: var(--primary-dark); background: var(--surface-soft); }
.sync-pill.offline { color: var(--danger); background: var(--danger-bg); }
.layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
@media (min-width: 821px) {
  html, body { height: 100%; overflow: hidden; }
  html.auth-screen, body.auth-screen, html:has(.auth-card), body:has(.auth-card) { height: auto; min-height: 100%; overflow-y: auto; }
  .layout { height: 100dvh; min-height: 100dvh; overflow: hidden; }
  .main { max-height: 100dvh; overflow-y: auto; }
  .sidebar { height: 100dvh; }
}
body.sidebar-collapsed .layout { grid-template-columns: 56px minmax(0, 1fr); }
.sidebar-backdrop { display: none; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid var(--border-soft);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-sidebar) 96%, var(--surface-soft)), var(--surface-sidebar));
  transition: width .16s ease, padding .16s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar:has(.notification-menu) { z-index: 1400; overflow: visible; }
.sidebar-footer { flex: 0 0 auto; margin-top: auto; padding-top: 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; }
.notification-bell { position: relative; }
.notification-badge { position: absolute; top: -5px; right: -4px; min-width: 18px; height: 18px; display: grid; place-items: center; border: 2px solid var(--surface); border-radius: 999px; background: var(--danger); color: #fff; font-size: .62rem; font-weight: 500; line-height: 1; }
.notification-menu { position: fixed; left: 14px; bottom: 66px; z-index: 1400; width: min(360px, calc(100vw - 32px)); max-height: min(430px, calc(100vh - 104px)); overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 12px; background: var(--surface); box-shadow: 0 8px 24px rgba(15,23,42,.12); }
.notification-menu h3 { margin: 0; font-size: .92rem; }
.notification-menu .section-title-row { flex-wrap: nowrap; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); }
.notification-list { min-height: 0; overflow: auto; display: grid; gap: 7px; padding-right: 2px; }
.notification-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 9px 10px; background: color-mix(in srgb, var(--surface-card) 84%, var(--surface)); box-shadow: var(--shadow); }
.notification-task-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.notification-link { color: var(--text); text-align: left; cursor: pointer; }
.notification-link:hover, .notification-link:focus-visible { border-color: color-mix(in srgb, var(--primary) 34%, var(--border-soft)); background: color-mix(in srgb, var(--primary) 7%, var(--surface-card)); outline: 0; }
.notification-kind { min-width: 0; justify-self: start; padding: 3px 7px; font-size: .58rem; letter-spacing: .035em; }
.notification-copy { min-width: 0; display: grid; gap: 3px; align-content: center; }
.notification-title { min-width: 0; color: var(--text); font-size: var(--text-ui-sm); line-height: 1.25; font-weight: 500; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notification-meta { display: block; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-action { justify-self: end; align-self: center; display: inline-grid; place-items: center; }
.notification-empty { margin: 0; padding: 4px 2px 2px; }
.task-complete-btn { width: 34px; min-width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--surface-soft) 72%, transparent); color: var(--muted); padding: 0; box-shadow: inset 0 1px 0 color-mix(in srgb, white 10%, transparent); }
.task-complete-btn::before { content: ''; width: 16px; height: 16px; border: 2px solid currentColor; border-radius: 5px; opacity: .72; box-sizing: border-box; }
.task-complete-btn:hover, .task-complete-btn:focus { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--surface)); color: var(--ok); }
.task-complete-btn.is-complete { border-color: color-mix(in srgb, var(--ok) 86%, var(--border)); background: linear-gradient(135deg, var(--ok), color-mix(in srgb, var(--ok) 72%, #0f5132)); color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, var(--ok) 24%, transparent); }
.task-complete-btn.is-complete::before { width: 15px; height: 9px; border: 0; border-left: 3px solid currentColor; border-bottom: 3px solid currentColor; border-radius: 0; opacity: 1; transform: rotate(-45deg) translate(1px, -1px); }
.task-complete-btn .tool-icon { display: none; }
.notification-menu .task-complete-btn { width: 32px; min-width: 32px; height: 32px; border-radius: var(--radius-md); background: color-mix(in srgb, var(--surface-card) 86%, var(--surface-soft)); box-shadow: none; }
.notification-menu .task-complete-btn::before { width: 14px; height: 14px; border-radius: 4px; }
.sidebar-sync { min-width: 0; overflow: hidden; text-overflow: ellipsis; box-shadow: none; }
.sidebar-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.sidebar-footer .sidebar-action {
  width: 42px;
  min-width: 42px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--primary-dark);
}
.sidebar-footer .sidebar-action .tool-icon,
.sidebar-footer .sidebar-action .tool-icon svg { width: 17px; height: 17px; }
.sidebar-footer .sidebar-action:hover { background: var(--surface-card); color: var(--primary-dark); }
.sidebar-collapse { margin-left: auto; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text-soft); font-size: 1.2rem; font-weight: var(--weight-control); line-height: 1; }
body.sidebar-collapsed .sidebar { padding: 14px 10px; }
body.sidebar-collapsed .brand { justify-content: center; }
body.sidebar-collapsed .brand-mark { width: 36px; height: 36px; border-radius: var(--radius-md); font-size: .7rem; }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-heading,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-count { display: none; }
body.sidebar-collapsed .sidebar-footer { grid-template-columns: 1fr; gap: 8px; padding-top: 12px; }
body.sidebar-collapsed .notification-menu { left: 64px; bottom: 18px; width: min(360px, calc(100vw - 78px)); }
body.sidebar-collapsed .sidebar-sync { width: 36px; min-width: 36px; height: 36px; padding: 0; font-size: 0; }
body.sidebar-collapsed .sidebar-sync::before { content: 'Sync'; font-size: .56rem; }
body.sidebar-collapsed .sidebar-footer .btn { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; display: inline-grid; place-items: center; }
body.sidebar-collapsed .sidebar-collapse { position: absolute; left: 10px; top: 58px; z-index: 6; width: 36px; height: 32px; border-radius: var(--radius-md); }
body.sidebar-collapsed .nav { width: 36px; justify-self: center; margin: 52px auto 18px; padding-right: 0; scrollbar-gutter: auto; }
body.sidebar-collapsed .nav button { justify-content: center; padding: 0; }
body.sidebar-collapsed .nav-tree-item > button { padding-left: 0; }
body.sidebar-collapsed .nav-tree-row { grid-template-columns: minmax(0, 1fr); padding-left: 0; }
body.sidebar-collapsed .nav-tree-toggle,
body.sidebar-collapsed .nav-tree-toggle-spacer { display: none; }
body.sidebar-collapsed .nav-utility-group { padding-top: 14px; }
body.sidebar-collapsed .empty-nav { display: none; }
.nav { flex: 1 1 auto; min-height: 0; display: grid; align-content: start; gap: 10px; margin: 16px 0; overflow-y: auto; overflow-x: hidden; padding-right: 3px; scrollbar-gutter: stable; }
.nav-group { display: grid; gap: 4px; }
.nav-storage-group { margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.nav-heading { display: flex; align-items: center; justify-content: space-between; min-height: 22px; padding: 0 12px 2px; color: var(--muted); font-size: var(--text-micro); font-weight: var(--weight-control); letter-spacing: .06em; text-transform: uppercase; }
.nav-heading .mini-add { margin-left: auto; }
.mini-add { border: 1px solid var(--border-soft); border-radius: 999px; background: color-mix(in srgb, var(--surface) 72%, transparent); color: var(--primary-dark); min-width: 56px; height: 24px; padding: 0 9px; font-size: var(--text-micro); font-weight: var(--weight-strong); }
.nav .nav-heading-toggle { min-height: 22px; border: 0; border-radius: 7px; background: transparent; color: inherit; padding: 0 5px 0 0; display: inline-flex; align-items: center; gap: 6px; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.nav .nav-heading-toggle:hover { background: transparent; color: var(--primary-dark); }
.nav-heading-chevron { width: 16px; height: 16px; display: inline-grid; place-items: center; border: 1px solid var(--border-soft); border-radius: 999px; color: var(--primary-dark); font-size: var(--text-micro); font-weight: var(--weight-strong); line-height: 1; }
.empty-nav { margin: 2px 14px 6px; color: var(--muted); font-size: .8rem; }
.nav button {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  padding: 0 12px;
  font-size: var(--text-ui-sm);
  font-weight: var(--weight-control);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-icon { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: transparent; color: color-mix(in srgb, var(--muted) 82%, var(--text)); font-size: var(--text-micro); font-weight: var(--weight-control); line-height: 1; }
.nav-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { min-width: 0; overflow: hidden; font-size: inherit; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { margin-left: auto; color: var(--muted); font-size: var(--text-meta); font-weight: var(--weight-control); }
.nav-tree-item { display: grid; gap: 4px; }
.nav-tree-row { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 4px; align-items: center; padding-left: calc(8px + (var(--depth, 0) * 14px)); }
.nav-tree-row > [data-section] { min-width: 0; width: 100%; padding-left: 8px; }
.nav-tree-toggle,
.nav-tree-toggle-spacer { width: 18px; min-width: 18px; }
.nav .nav-tree-toggle { min-height: 28px; height: 28px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--border-soft); border-radius: 999px; background: color-mix(in srgb, var(--surface) 78%, transparent); color: var(--muted); font-size: var(--text-label); font-weight: var(--weight-control); line-height: 1; }
.nav .nav-tree-toggle:hover { background: var(--surface-soft); color: var(--primary-dark); }
.nav button.active, .nav button:hover, .nav button.drop-ready { background: var(--surface-soft); color: var(--primary-dark); }
.nav button.active .nav-count, .nav button:hover .nav-count { color: var(--primary-dark); }
.main { min-width: 0; padding: 24px; display: grid; gap: 18px; align-content: start; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar h1 { margin-bottom: 0; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.topbar-actions .btn, .topbar-actions .theme-button { align-self: center; flex: 0 0 auto; }
.search { max-width: 420px; }
.breadcrumb { color: var(--muted); font-size: .78rem; margin-bottom: 8px; }
.filterbar { display: grid; grid-template-columns: minmax(160px, 240px) minmax(180px, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--border-soft); background: var(--surface-card); border-radius: var(--radius-lg); padding: 10px; }
.filterbar.task-filter { grid-template-columns: minmax(220px, 320px) minmax(180px, 1fr); padding: 12px; border-radius: var(--radius-xl); background: linear-gradient(135deg, color-mix(in srgb, var(--surface-card) 92%, var(--primary)), var(--surface-card)); }
.filterbar.task-filter .search { width: 100%; max-width: none; }
.filterbar.task-filter .btn { min-height: 48px; border-radius: var(--radius-lg); }
.filterbar.notes-filter { grid-template-columns: minmax(300px, max-content) minmax(260px, 520px) minmax(160px, 1fr); }
.filterbar.notes-filter .search { justify-self: center; width: 100%; max-width: 520px; }
.filter-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.filter-actions-left { justify-content: flex-start; }
.note-filter-actions { flex-wrap: wrap; }
.checkline { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.checkline input { width: auto; min-height: auto; }
.task-row .checkline { min-width: 0; white-space: normal; }
.task-row .checkline span { min-width: 0; overflow-wrap: anywhere; }
.linked-note-tools { display: grid; gap: 8px; margin-top: 8px; }
.linked-note-picks { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; align-items: center; }
.linked-note-create { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.linked-note-select { display: none; }
.linked-note-search { display: grid; gap: 6px; }
.linked-note-results { display: grid; gap: 6px; max-height: 190px; overflow: auto; }
.linked-note-result { display: grid; gap: 2px; text-align: left; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 8px 10px; background: var(--surface); color: var(--text); }
.linked-note-result span { color: var(--muted); font-size: .72rem; }
.linked-note-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border-radius: 999px; padding: 4px 6px 4px 10px; background: var(--pill-bg); color: var(--pill-text); font-size: .74rem; font-weight: var(--weight-control); }
.linked-note-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linked-note-pill button { min-height: 24px; border: 0; border-radius: 999px; padding: 2px 7px; background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary-dark); font-size: .68rem; font-weight: var(--weight-control); }
.detail-dialog { display: grid; gap: 16px; }
.detail-dialog .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: flex-start; }
.detail-dialog .topbar > div:first-child { min-width: 0; }
.detail-dialog .topbar .btn-row { flex-wrap: nowrap; justify-content: flex-end; align-items: start; }
.detail-dialog .topbar .btn-row .btn:not(.icon-only-btn) { min-width: auto; white-space: nowrap; }
.detail-grid { display: grid; gap: 8px; }
.detail-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: baseline; border-bottom: 1px solid var(--border-soft); padding: 8px 0; }
.detail-row span { color: var(--muted); font-size: .76rem; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.detail-row b { min-width: 0; overflow-wrap: anywhere; word-break: break-word; color: var(--text); font-size: .92rem; }
.detail-action-link { display: inline-block; margin-left: 6px; white-space: nowrap; }
.detail-description, .detail-notes { display: grid; gap: 8px; }
.detail-description h3, .detail-notes h3 { margin: 0; font-size: .9rem; }
.detail-description p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-soft); }
.detail-note-list { min-height: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-content: start; gap: 14px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 16px; align-items: start; }
.refined-home { grid-template-columns: minmax(0, 1.7fr) minmax(320px, .76fr); }
.home-main, .home-side { min-width: 0; }
.home-hero.card { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 20px; border-color: color-mix(in srgb, var(--primary) 12%, var(--border-soft)); background: radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 34%), radial-gradient(circle at 86% 18%, color-mix(in srgb, var(--secondary) 12%, transparent), transparent 30%), radial-gradient(circle at 70% 92%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 34%), linear-gradient(135deg, color-mix(in srgb, var(--surface-card) 90%, var(--highlight)), var(--surface-card)); box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 5%, transparent), var(--shadow); }
.home-hero::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(90deg, color-mix(in srgb, var(--primary) 16%, transparent) 1px, transparent 1px), linear-gradient(180deg, color-mix(in srgb, var(--highlight) 9%, transparent) 1px, transparent 1px); background-size: 34px 34px; mask-image: linear-gradient(115deg, black, transparent 70%); opacity: .55; pointer-events: none; }
.home-hero::after { content: ''; position: absolute; right: -58px; top: -72px; width: 180px; height: 180px; border-radius: 999px; background: conic-gradient(from 110deg, color-mix(in srgb, var(--primary) 14%, transparent), color-mix(in srgb, var(--secondary) 14%, transparent), color-mix(in srgb, var(--accent) 13%, transparent), color-mix(in srgb, var(--highlight) 12%, transparent), color-mix(in srgb, var(--primary) 14%, transparent)); filter: blur(.2px); pointer-events: none; }
.home-hero > * { position: relative; z-index: 1; }
.home-hero h2 { font-size: clamp(1.35rem, 2vw, 2rem); margin-bottom: 4px; }
.home-hero .breadcrumb { margin-bottom: 2px; }
.home-stat-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 430px; }
.home-stat-row .pill { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; text-align: center; line-height: 1.2; border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--border-soft)); background: linear-gradient(135deg, color-mix(in srgb, var(--surface-soft) 78%, var(--primary)), color-mix(in srgb, var(--surface-card) 86%, var(--secondary))); box-shadow: none; }
.home-stat-row .pill:nth-child(2) { border-color: color-mix(in srgb, var(--accent) 18%, var(--border-soft)); background: linear-gradient(135deg, color-mix(in srgb, var(--surface-soft) 78%, var(--accent)), color-mix(in srgb, var(--surface-card) 88%, var(--primary))); }
.home-stat-row .pill:nth-child(3) { border-color: color-mix(in srgb, var(--highlight) 22%, var(--border-soft)); background: linear-gradient(135deg, color-mix(in srgb, var(--surface-soft) 78%, var(--highlight)), color-mix(in srgb, var(--surface-card) 90%, var(--accent))); }
.home-search { grid-column: 1 / -1; width: min(520px, 100%); }
.home-search .search { width: 100%; max-width: none; min-height: 42px; background: color-mix(in srgb, var(--field-bg) 86%, var(--surface-card)); }
.home-action-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.home-action-row .action-fab { min-width: 48px; min-height: 44px; box-shadow: none; }
.home-action-row .action-fab:nth-child(2) { background: color-mix(in srgb, var(--surface-soft) 74%, var(--secondary)); color: var(--text); }
.home-action-row .action-fab:nth-child(3) { background: color-mix(in srgb, var(--surface-soft) 74%, var(--accent)); color: var(--text); }
.home-action-row .action-fab:nth-child(4) { background: color-mix(in srgb, var(--surface-soft) 74%, var(--highlight)); color: var(--text); }
.home-widget.card { position: relative; overflow: hidden; display: grid; gap: 12px; min-width: 0; border: 1px solid color-mix(in srgb, var(--border-soft) 88%, var(--primary)); border-radius: var(--radius-xl); padding: 15px; background: radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--primary) 6%, transparent), transparent 32%), linear-gradient(145deg, color-mix(in srgb, var(--surface-card) 96%, var(--surface)), color-mix(in srgb, var(--surface-card) 95%, var(--secondary))); box-shadow: 0 5px 16px color-mix(in srgb, var(--primary) 4%, transparent), var(--shadow); }
.home-widget::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent), var(--highlight)); opacity: .8; }
.home-widget > * { position: relative; z-index: 1; }
.home-widget .section-title-row { padding-bottom: 2px; border-bottom: 1px solid color-mix(in srgb, var(--border-soft) 62%, transparent); }
.home-note-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.home-note-card { position: relative; overflow: hidden; min-height: 108px; display: grid; align-content: space-between; gap: 9px; text-align: left; border: 1px solid color-mix(in srgb, var(--border-soft) 88%, var(--primary)); border-radius: var(--radius-lg); padding: 13px 13px 13px 15px; background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 96%, var(--primary)), var(--surface)); color: var(--text); transition: border-color .16s ease, transform .16s ease, background .16s ease, box-shadow .16s ease; }
.home-note-card::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 999px; background: linear-gradient(180deg, var(--primary), var(--accent)); pointer-events: none; }
.home-note-card::after { content: ''; position: absolute; right: -34px; top: -42px; width: 104px; height: 104px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 5%, transparent); pointer-events: none; }
.home-note-card:nth-child(2n)::before { background: linear-gradient(180deg, var(--secondary), var(--highlight)); }
.home-note-card:nth-child(2n)::after { background: color-mix(in srgb, var(--secondary) 6%, transparent); }
.home-note-card:nth-child(3n)::before { background: linear-gradient(180deg, var(--accent), var(--highlight)); }
.home-note-card:nth-child(3n)::after { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.home-note-card:hover { border-color: color-mix(in srgb, var(--primary) 28%, var(--border-soft)); transform: translateY(-1px); box-shadow: 0 6px 14px color-mix(in srgb, var(--primary) 5%, transparent); }
.home-note-card b, .home-note-card span { position: relative; z-index: 1; }
.home-note-card span { color: var(--muted); font-size: .76rem; }
.home-schedule-widget .agenda-item.large { min-height: 52px; }
.home-schedule-widget .agenda-link { position: relative; overflow: hidden; border-color: color-mix(in srgb, var(--border-soft) 82%, var(--accent)); background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 92%, var(--accent)), color-mix(in srgb, var(--surface-card) 96%, var(--primary))); }
.home-schedule-widget .agenda-link::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 999px; background: linear-gradient(180deg, var(--accent), var(--primary)); }
.home-schedule-widget .agenda-link:nth-child(2n)::before { background: linear-gradient(180deg, var(--secondary), var(--highlight)); }
.home-schedule-widget .agenda-link:hover { transform: translateY(-1px); box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 5%, transparent); }
.home-schedule-widget .agenda-list-stack,
.home-schedule-widget .agenda-day { gap: 8px; }
.home-side { display: grid; gap: 14px; }
.home-widget > header,
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.compact-view-title { min-height: 46px; padding-block: 10px; }
.compact-view-title h2 { margin: 0; font-size: 1.05rem; line-height: 1.2; }
.calendar-filter { grid-template-columns: 1fr; }
.calendar-search-panel { min-width: 0; max-width: 100%; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px; }
.calendar-search-panel label { flex: 1 1 280px; min-width: 0; }
.calendar-search-panel .search { width: 100%; max-width: none; min-height: 42px; }
.calendar-view-toggle { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.calendar-view-select { display: none; }
.calendar-search-panel + .calendar-page-grid { margin-top: 18px; }
.calendar-page-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 14px; align-items: start; }
.calendar-primary, .calendar-side { min-width: 0; max-width: 100%; }
.calendar-side { width: 100%; overflow: hidden; }
.feature-toggle-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.feature-toggle-grid .btn { min-height: 44px; justify-content: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar-day { min-height: 92px; display: grid; align-content: start; gap: 6px; border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 9px; background: var(--surface); color: var(--text-soft); }
.calendar-day[data-quick-add], .week-hour-cell[data-quick-add], .day-hour-slot[data-quick-add] { cursor: pointer; }
.calendar-day[data-quick-add]:hover, .week-hour-cell[data-quick-add]:hover, .day-hour-slot[data-quick-add]:hover { border-color: color-mix(in srgb, var(--primary) 38%, var(--border-soft)); background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.calendar-day-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.mini-btn { min-height: 26px; padding: 3px 7px; font-size: .68rem; }
.calendar-day.muted-day { opacity: .58; background: color-mix(in srgb, var(--surface-card) 72%, var(--bg)); }
.calendar-day.past-day { opacity: .62; background: color-mix(in srgb, var(--surface-card) 58%, var(--bg)); filter: grayscale(.28); }
.calendar-day.past-day .calendar-event-chip { opacity: .78; }
.calendar-day.today { border-color: color-mix(in srgb, var(--primary) 58%, var(--border)); background: color-mix(in srgb, var(--primary) 9%, var(--surface)); box-shadow: inset 3px 0 0 var(--primary); color: var(--text); }
.calendar-event-chip { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; min-height: 22px; border: 0; border-radius: 7px; padding: 3px 7px; background: color-mix(in srgb, var(--event-color, var(--primary)) 18%, var(--surface-soft)); color: var(--primary-dark); font-size: var(--text-meta); font-weight: var(--weight-control); overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.task-chip { --event-color: var(--ok); }
.calendar-agenda { display: grid; gap: 8px; }
.agenda-list-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.agenda-list-stack { display: grid; gap: 10px; }
.agenda-list-day { min-width: 0; max-width: 100%; overflow: hidden; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: stretch; border: 1px solid var(--border-soft); border-radius: var(--radius-xl); background: var(--surface-card); padding: 12px; }
.agenda-list-date { display: grid; align-content: center; justify-items: center; gap: 3px; border-radius: var(--radius-lg); background: var(--surface-soft); color: var(--text); min-height: 82px; text-align: center; }
.agenda-list-date span { color: var(--muted); font-size: .72rem; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; }
.agenda-list-date b { font-size: 1.1rem; }
.agenda-list-content { display: grid; gap: 10px; min-width: 0; }
.agenda-day { display: grid; gap: 10px; align-content: start; }
.agenda-item { min-width: 0; max-width: 100%; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 10px; background: var(--surface); }
.agenda-link { width: 100%; min-width: 0; max-width: 100%; grid-template-columns: 74px minmax(0, 1fr); color: var(--text); text-align: left; cursor: pointer; }
.agenda-link > span:not(.agenda-kind) { min-width: 0; overflow: hidden; }
.agenda-link b, .agenda-link .small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-link:hover { border-color: color-mix(in srgb, var(--primary) 42%, var(--border-soft)); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.agenda-item.done { opacity: .68; background: color-mix(in srgb, var(--surface-card) 72%, var(--bg)); }
.agenda-item.done b { text-decoration: line-through; }
.agenda-item.large { min-height: 58px; grid-template-columns: 74px minmax(0, 1fr) auto; }
.agenda-actions { justify-content: flex-end; gap: 6px; }
.agenda-actions .btn { min-height: 32px; padding: 6px 10px; }
.agenda-kind { min-width: 74px; display: inline-grid; place-items: center; border-radius: 999px; padding: 4px 8px; font-size: .68rem; font-weight: var(--weight-control); text-align: center; text-transform: uppercase; letter-spacing: .04em; }
.event-kind { background: color-mix(in srgb, var(--primary) 14%, var(--surface-soft)); color: var(--primary-dark); }
.task-kind { background: color-mix(in srgb, var(--ok) 14%, var(--surface-soft)); color: var(--ok); }
.day-timeline { display: grid; gap: 8px; }
.day-hour-slot { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; align-items: stretch; border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 8px; background: var(--surface); }
.day-hour-slot.current-hour { border-color: color-mix(in srgb, var(--primary) 48%, var(--border-soft)); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); box-shadow: inset 3px 0 0 var(--primary); }
.day-hour-slot.current-hour .day-hour-label { color: var(--primary-dark); }
.day-hour-label { display: grid; align-content: start; justify-items: end; padding-top: 8px; color: var(--muted); font-size: .76rem; font-weight: 500; }
.day-hour-content { display: grid; gap: 6px; min-height: 44px; align-content: center; }
.week-calendar { display: grid; grid-template-columns: 74px repeat(7, minmax(120px, 1fr)); overflow: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); }
.week-time-head, .week-day-head, .week-time-label, .week-all-day-cell, .week-hour-cell { border-bottom: 1px solid var(--border-soft); border-right: 1px solid var(--border-soft); }
.week-day-head { position: sticky; top: 0; z-index: 2; display: grid; place-items: center; gap: 2px; min-height: 64px; background: var(--surface-card); text-align: center; }
.week-day-head span { color: var(--muted); font-size: .72rem; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; }
.week-day-head b { font-size: 1.12rem; }
.week-day-head.today b { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; background: var(--input-focus); color: var(--primary-dark); }
.week-time-label { display: grid; align-items: start; justify-items: end; min-height: 58px; padding: 8px; color: var(--muted); font-size: .72rem; font-weight: 500; background: var(--surface-card); }
.week-time-label.current-hour-label { color: var(--primary-dark); background: color-mix(in srgb, var(--primary) 8%, var(--surface-card)); }
.week-all-day-cell, .week-hour-cell { min-height: 58px; display: grid; align-content: start; gap: 4px; padding: 6px; }
.week-hour-cell.current-day { background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.week-hour-cell.current-hour { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); box-shadow: inset 0 3px 0 var(--primary); }
.week-all-day-cell { min-height: 48px; background: color-mix(in srgb, var(--surface-card) 72%, var(--surface)); }
.quick-add-hint { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 999px; color: var(--muted); background: var(--surface-card); opacity: 0; transition: opacity .15s ease; }
.week-hour-cell:hover .quick-add-hint { opacity: 1; }
.quick-add-popover { position: absolute; z-index: 80; width: 180px; display: grid; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px; background: var(--surface); box-shadow: 0 8px 22px rgba(15,23,42,.12); color: var(--text); }
.quick-add-popover b { font-size: .78rem; }
.year-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.year-month { display: grid; gap: 8px; border: 1px solid var(--border-soft); border-radius: var(--radius-xl); padding: 12px; background: var(--surface-card); }
.year-month h3 { font-size: .95rem; }
.year-weekdays, .year-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.year-weekdays span { color: var(--muted); font-size: .68rem; font-weight: 500; text-align: center; }
.year-day { position: relative; min-width: 0; min-height: 34px; display: grid; place-items: center; border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--text-soft); font-size: .74rem; }
.year-day.muted-day { opacity: .38; }
.year-day.past-day { color: var(--muted); filter: grayscale(.25); }
.year-day.today { border-color: var(--primary); background: var(--input-focus); color: var(--primary-dark); font-weight: 500; }
.year-day.busy-day { background: color-mix(in srgb, var(--primary) 18%, var(--surface-soft)); color: var(--primary-dark); }
.year-day.busy-day::after { content: ''; position: absolute; right: 3px; bottom: 3px; width: 5px; height: 5px; border-radius: 999px; background: var(--primary); }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.compact-calendar-form { gap: 8px; }
.compact-calendar-create { display: grid; grid-template-columns: minmax(0, 1fr) 36px auto; gap: 8px; align-items: center; }
.calendar-color-menu { position: relative; width: max-content; max-width: 100%; }
.calendar-color-menu summary { min-height: 32px; display: inline-flex; align-items: center; border: 1px solid var(--border-soft); border-radius: 999px; padding: 4px 10px; background: var(--surface); color: var(--muted); font-size: .74rem; font-weight: 500; cursor: pointer; list-style: none; }
.calendar-color-menu summary::-webkit-details-marker { display: none; }
.calendar-color-presets { position: absolute; z-index: 9; top: calc(100% + 6px); left: 0; width: 184px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px; background: var(--surface); box-shadow: 0 8px 20px rgba(15,23,42,.1); }
.color-swatch { width: 32px; min-width: 32px; height: 32px; min-height: 32px; border: 1px solid color-mix(in srgb, var(--swatch) 55%, var(--border)); border-radius: 999px; padding: 0; background: var(--swatch); box-shadow: inset 0 0 0 2px rgba(255,255,255,.38); }
.color-swatch:hover, .color-swatch:focus-visible { transform: translateY(-1px); outline: 2px solid color-mix(in srgb, var(--swatch) 45%, transparent); outline-offset: 2px; }
.mini-month-card.card { position: relative; width: 100%; min-width: 0; max-width: 100%; overflow: hidden; gap: 10px; border-color: color-mix(in srgb, var(--accent) 22%, var(--border-soft)); background: radial-gradient(circle at 88% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 34%), linear-gradient(145deg, color-mix(in srgb, var(--surface-card) 94%, var(--primary)), var(--surface-card)); }
.mini-month-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent), var(--highlight)); opacity: .78; }
.mini-month-card > * { position: relative; z-index: 1; }
.mini-month-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; text-align: center; }
.mini-month-head h3 { justify-self: center; }
.mini-month-weekdays, .mini-month-grid { min-width: 0; max-width: 100%; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mini-month-weekdays span { color: var(--muted); font-size: .68rem; font-weight: 500; text-align: center; }
.mini-month-day { position: relative; min-width: 0; overflow: hidden; min-height: 32px; border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--text-soft); font-size: .74rem; }
.mini-month-day:hover { border-color: color-mix(in srgb, var(--primary) 30%, transparent); background: color-mix(in srgb, var(--primary) 7%, transparent); }
.mini-month-day.muted-day { opacity: .4; }
.mini-month-day.past-day { color: var(--muted); filter: grayscale(.2); }
.mini-month-day.today { border-color: color-mix(in srgb, var(--primary) 66%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 20%, var(--surface)), color-mix(in srgb, var(--accent) 12%, var(--surface))); color: var(--primary-dark); font-weight: var(--weight-control); }
.mini-month-day.selected { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 52%, transparent); }
.mini-month-day b { position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; border-radius: 999px; background: linear-gradient(135deg, var(--primary), var(--accent)); transform: translateX(-50%); }
.round-color-input { position: relative; width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--surface-card); cursor: pointer; overflow: hidden; }
.round-color-input::after { content: ''; width: 20px; height: 20px; border-radius: 999px; background: var(--picked-color, #2563eb); box-shadow: inset 0 0 0 2px rgba(255,255,255,.42); pointer-events: none; }
.round-color-input input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.calendar-manage-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 30px; gap: 8px; align-items: center; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 7px; background: var(--surface); }
.calendar-row-name { min-width: 0; overflow: hidden; color: var(--text); font-size: var(--text-ui); font-weight: var(--weight-control); text-overflow: ellipsis; white-space: nowrap; }
.calendar-visible-toggle { position: relative; width: 22px; height: 22px; display: grid; place-items: center; }
.calendar-visible-toggle input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.calendar-visible-toggle span { width: 14px; height: 14px; border: 2px solid color-mix(in srgb, var(--calendar-color) 70%, var(--border)); border-radius: 999px; background: transparent; }
.calendar-visible-toggle input:checked + span { background: var(--calendar-color); box-shadow: inset 0 0 0 3px var(--surface); }
.calendar-manage-row .calendar-name-input { min-height: 34px; padding: 6px 8px; border-color: transparent; background: transparent; font-size: .92rem; font-weight: 500; }
.calendar-manage-row .calendar-name-input:focus { border-color: var(--primary); background: var(--field-bg); }
.calendar-meta { grid-column: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .7rem; }
.calendar-color-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--calendar-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--calendar-color) 18%, transparent); }
.calendar-manage-row .round-color-input { width: 30px; height: 30px; }
.calendar-manage-row .round-color-input::after { width: 17px; height: 17px; }
.calendar-save, .calendar-delete, .calendar-edit { width: 30px; min-width: 30px; min-height: 30px; border-radius: 999px; }
.calendar-save { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.calendar-delete { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.calendar-edit { color: var(--primary-dark); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.calendar-save:hover, .calendar-delete:hover, .calendar-edit:hover { transform: translateY(-1px); }
.calendar-side .section-title-row .btn { min-height: 34px; padding: 6px 10px; font-size: .8rem; }
.calendar-side .file-row .btn { min-height: 34px; padding: 6px 10px; font-size: .78rem; line-height: 1.1; }
.calendar-dialog { gap: 14px; }
.calendar-dialog .topbar { align-items: start; }
.calendar-dialog-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; margin-top: 8px; }
.calendar-dialog-form .field { margin: 0; }
.compact-color-field { min-width: 74px; align-items: center; }
.calendar-description-field { grid-column: 1 / -1; }
.calendar-description-field textarea { min-height: 92px; }
.dialog-action-row { grid-column: 1 / -1; margin-top: 2px; }
.dialog-action-row .btn { min-height: 38px; padding: 8px 12px; }
.calendar-dialog-share { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.calendar-dialog-share h3 { margin: 0; font-size: .82rem; }
.dialog-inline-actions { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dialog-inline-actions .btn { min-height: 38px; padding: 8px 12px; }
.calendar-dialog-share p { margin: 0; }
.compact-dialog-share-form { display: grid; grid-template-columns: minmax(0, 1fr) 112px auto; gap: 8px; align-items: center; }
.compact-dialog-share-form input,
.compact-dialog-share-form select,
.compact-dialog-share-form .btn { min-height: 40px; }
#eventForm,
#taskForm,
#icsImportForm { gap: 12px; margin-top: 12px; }
#eventForm .field,
#taskForm .field,
#icsImportForm .field { margin: 0; }
#eventForm textarea,
#taskForm textarea { min-height: 92px; }
#eventForm .btn-row,
#taskForm .btn-row { justify-content: flex-end; padding-top: 2px; }
#eventForm .btn-row .btn,
#taskForm .btn-row .btn,
#icsImportForm .btn { min-height: 40px; padding: 8px 12px; }
.share-row select { min-height: 36px; padding: 6px 8px; }
.compact-share-card { gap: 10px; }
.compact-share-card h3 { margin: 0; }
.share-calendar-menu { position: relative; }
.share-calendar-menu summary { list-style: none; cursor: pointer; }
.share-calendar-menu summary::-webkit-details-marker { display: none; }
.compact-share-form { position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; width: min(260px, calc(100vw - 36px)); display: grid; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px; background: var(--surface); box-shadow: 0 8px 20px rgba(15,23,42,.1); }
.task-page { display: grid; gap: 14px; }
.task-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.task-summary-card { position: relative; overflow: hidden; display: grid; gap: 4px; min-height: 104px; border: 1px solid var(--border-soft); border-radius: var(--radius-xl); padding: 16px; background: linear-gradient(145deg, color-mix(in srgb, var(--surface-card) 96%, var(--primary)), var(--surface)); box-shadow: var(--shadow); text-align: left; cursor: pointer; }
.task-summary-card::after { content: ''; position: absolute; right: -24px; top: -34px; width: 92px; height: 92px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 14%, transparent); }
.task-summary-card:hover, .task-summary-card.active { border-color: color-mix(in srgb, var(--primary) 50%, var(--border-soft)); transform: translateY(-1px); }
.task-summary-card.active { background: linear-gradient(145deg, color-mix(in srgb, var(--surface-card) 86%, var(--primary)), var(--surface)); }
.task-summary-card span { color: var(--muted); font-size: var(--text-label); font-weight: var(--weight-control); letter-spacing: .05em; text-transform: uppercase; }
.task-summary-card b { color: var(--text); font-size: clamp(1.55rem, 3vw, 2.05rem); line-height: 1; }
.task-summary-card small { color: var(--text-soft); font-size: var(--text-ui-sm); font-weight: var(--weight-control); }
.task-summary-card.urgent::after { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.task-summary-card.today::after { background: color-mix(in srgb, var(--ok) 18%, transparent); }
.task-board { display: grid; gap: 10px; padding: 16px; }
.task-board-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 2px; }
.task-board-head h2 { margin: 0; }
.task-board-head .breadcrumb { margin: 0 0 4px; }
.task-row,
.share-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 10px 12px; background: var(--surface); color: var(--text-soft); }
.task-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; min-height: 74px; border-radius: var(--radius-xl); padding: 12px 14px 12px 18px; background: color-mix(in srgb, var(--surface) 92%, var(--surface-card)); color: var(--text-soft); cursor: pointer; transition: border-color .16s ease, transform .16s ease, background .16s ease; }
.task-row::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 76%, var(--accent)); opacity: .8; }
.task-row:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--primary) 34%, var(--border-soft)); background: color-mix(in srgb, var(--surface-card) 82%, var(--surface)); }
.task-row:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 62%, transparent); outline-offset: 2px; }
.task-row.overdue::before { background: var(--danger); }
.task-row.done { color: var(--muted); background: color-mix(in srgb, var(--surface-card) 70%, var(--bg)); }
.task-row.done .task-copy { text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--muted) 70%, transparent); }
.task-check { position: relative; display: inline-block; width: 38px; min-width: 38px; height: 38px; line-height: 0; border: 1px solid var(--border-soft); border-radius: 14px; background: color-mix(in srgb, var(--surface-card) 78%, transparent); cursor: pointer; }
.task-check input { position: absolute; left: 50%; top: 50%; display: block; width: 18px; height: 18px; margin: 0; transform: translate(-50%, -50%); accent-color: var(--primary); cursor: pointer; }
.task-check:hover { border-color: color-mix(in srgb, var(--primary) 42%, var(--border-soft)); background: color-mix(in srgb, var(--primary) 8%, var(--surface-card)); }
.task-copy { display: grid; gap: 5px; min-width: 0; }
.task-copy b { color: var(--text); font-size: var(--text-ui); line-height: 1.25; font-weight: var(--weight-control); }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: var(--text-ui-sm); }
.task-meta span { display: inline-flex; align-items: center; min-height: 24px; border: 1px solid var(--border-soft); border-radius: 999px; padding: 2px 8px; background: color-mix(in srgb, var(--surface-card) 76%, transparent); }
.task-row-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.task-delete-btn { min-width: 80px; }
.task-empty { border: 1px dashed var(--border); border-radius: var(--radius-xl); padding: 24px; text-align: center; background: color-mix(in srgb, var(--surface-card) 68%, transparent); }
.task-empty h3 { margin: 0 0 4px; }
.reminder-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--border)); border-radius: var(--radius-xl); padding: 12px 14px; background: color-mix(in srgb, var(--primary) 10%, var(--surface-card)); color: var(--text); box-shadow: var(--shadow); }
.notes-workspace { display: grid; gap: 12px; align-items: start; }
.notes-workspace.editor-open { grid-template-columns: minmax(240px, clamp(260px, var(--note-pane-width, 300px), 360px)) 8px minmax(0, 1fr); align-items: stretch; height: calc(100vh - 168px); min-height: 420px; }
.notes-workspace.editor-open.focus-mode { grid-template-columns: minmax(0, 1fr); }
.notes-workspace.editor-open.focus-mode .notes-list-pane,
.notes-workspace.editor-open.focus-mode .note-pane-resizer { display: none; }
.notes-list-pane { min-width: 0; min-height: 0; }
.notes-workspace.editor-open .notes-list-pane { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.notes-workspace.editor-open .notes-grid { flex: 1 1 auto; min-height: 0; grid-template-columns: 1fr; max-height: none; overflow-y: auto; overflow-x: hidden; padding: 0 2px; gap: 6px; scrollbar-gutter: auto; }
.note-pane-resizer { align-self: stretch; width: 6px; min-width: 0; min-height: 320px; padding: 0; border: 0; border-radius: var(--radius-lg); background: transparent; cursor: col-resize; position: relative; }
.note-pane-resizer::after { content: ''; position: absolute; inset: 16px 2px; border-radius: var(--radius-sm); background: var(--border); }
.note-pane-resizer:hover::after, body.resizing-note-pane .note-pane-resizer::after { background: var(--primary); }
body.resizing-note-pane { cursor: col-resize; user-select: none; }
.inline-editor-slot { min-width: 0; min-height: 0; }
.cli-placeholder { min-height: 320px; display: grid; align-content: center; gap: 10px; background: var(--terminal-bg); color: var(--terminal-text); border-color: var(--terminal-line); }
.terminal-dots { display: flex; gap: 7px; margin-bottom: 6px; }
.terminal-dots span { width: 10px; height: 10px; border-radius: 999px; background: var(--terminal-line); }
.terminal-dots span:nth-child(1) { background: #ef4444; }
.terminal-dots span:nth-child(2) { background: #f59e0b; }
.terminal-dots span:nth-child(3) { background: #22c55e; }
.terminal-path { margin: 0 0 5px; color: var(--terminal-accent); font: var(--weight-strong) var(--text-meta)/1.2 var(--font-mono); letter-spacing: .02em; }
.table-wrap { overflow: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); }
.asset-table { width: 100%; border-collapse: collapse; min-width: 940px; font-size: .86rem; }
.asset-table th, .asset-table td { border-bottom: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: middle; white-space: nowrap; }
.asset-table th { color: var(--muted); font-size: var(--text-label); font-weight: var(--weight-strong); background: var(--surface-card); }
.asset-table tr:hover td { background: var(--surface-soft); }
.link-button, .icon-btn { border: 0; background: transparent; color: var(--primary-dark); padding: 0; font: inherit; font-weight: var(--weight-control); }
.drive-filter { grid-template-columns: minmax(260px, 1fr) auto; gap: 10px; padding: 8px 10px; }
.drive-search-field { display: block; min-width: 0; }
.drive-filter .search { width: 100%; min-height: 38px; max-width: 520px; background: color-mix(in srgb, var(--field-bg) 88%, var(--surface-card)); }
.drive-commandbar { min-width: 0; display: grid; grid-template-columns: minmax(0, auto) auto; align-items: center; justify-content: end; gap: 8px; }
.drive-tool-group { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.drive-commandbar .btn { min-height: 34px; padding: 7px 10px; }
.drive-tool-btn { display: inline-grid; place-items: center; min-width: 36px; }
.drive-tool-btn .tool-icon,
.drive-tool-btn .tool-icon svg { width: 18px; height: 18px; color: currentColor; stroke: currentColor; }
.drive-tool-btn .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.drive-upload-button { display: inline-flex; gap: 7px; min-width: 0; }
.drive-upload-button span:last-child { font-size: var(--text-label); font-weight: var(--weight-strong); }
.drive-upload-input { position: fixed; left: -100vw; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drive-shell { position: relative; display: grid; gap: 8px; }
.drive-shell::after { content: 'Drop files to upload here'; position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; border: 2px dashed color-mix(in srgb, var(--primary) 62%, var(--border)); border-radius: var(--radius-xl); background: color-mix(in srgb, var(--surface-card) 84%, var(--primary)); color: var(--primary-dark); font-size: .92rem; font-weight: var(--weight-strong); letter-spacing: .02em; opacity: 0; pointer-events: none; transform: scale(.99); transition: opacity .14s ease, transform .14s ease; }
.drive-shell.drive-drop-active::after { opacity: .96; transform: scale(1); }
.drive-upload-status { position: fixed; left: 50%; bottom: calc(14px + var(--android-system-bottom)); z-index: 1250; width: min(520px, calc(100vw - 24px)); display: grid; gap: 8px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--border-soft)); border-radius: var(--radius-xl); background: color-mix(in srgb, var(--surface) 94%, var(--surface-soft)); color: var(--text); box-shadow: 0 8px 24px color-mix(in srgb, var(--text) 10%, transparent); opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: opacity .16s ease, transform .16s ease; }
.drive-upload-status.visible { opacity: 1; transform: translate(-50%, 0); }
.drive-upload-status.error { border-color: color-mix(in srgb, var(--danger) 45%, var(--border-soft)); }
.drive-upload-status-copy { min-width: 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.drive-upload-status-copy b, .drive-upload-status-copy span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-upload-status-copy b { font-size: var(--text-button); }
.drive-upload-status-copy span { color: var(--muted); font-size: var(--text-label); font-weight: var(--weight-strong); }
.drive-upload-progress { overflow: hidden; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--border) 58%, transparent); }
.drive-upload-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .16s ease; }
.drive-upload-status.error .drive-upload-progress span { background: var(--danger); }
.drive-header { position: relative; min-width: 0; max-width: 100%; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 52px; padding: 7px 10px; border-color: color-mix(in srgb, var(--primary) 14%, var(--border-soft)); background: linear-gradient(135deg, color-mix(in srgb, var(--surface-card) 94%, var(--surface-soft)), var(--surface-card)); box-shadow: none; }
.drive-header::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(90deg, color-mix(in srgb, var(--border) 42%, transparent) 1px, transparent 1px), linear-gradient(180deg, color-mix(in srgb, var(--border) 32%, transparent) 1px, transparent 1px); background-size: 24px 24px; mask-image: linear-gradient(105deg, black, transparent 62%); opacity: .22; pointer-events: none; }
.drive-header > * { position: relative; z-index: 1; }
.drive-path-controls { display: flex; align-items: center; gap: 6px; }
.drive-up-btn { width: 34px; min-width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: color-mix(in srgb, var(--surface) 84%, var(--surface-soft)); color: var(--primary-dark); font-weight: var(--weight-control); line-height: 1; cursor: pointer; }
.drive-up-btn span { display: block; margin-top: -2px; font-size: 1.45rem; }
.drive-up-btn:hover, .drive-up-btn:focus-visible { border-color: var(--primary); background: var(--surface-soft); outline: none; }
.drive-up-btn:disabled { opacity: .45; cursor: default; }
.drive-up-btn:disabled:hover { border-color: var(--border-soft); background: color-mix(in srgb, var(--surface) 84%, var(--surface-soft)); }
.drive-title-block { min-width: 0; max-width: 100%; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; align-items: center; }
.drive-root-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--border-soft) 88%, transparent); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--surface-soft) 88%, var(--surface-card)); color: color-mix(in srgb, var(--muted) 68%, var(--text)); }
.drive-root-mark.compact { width: 34px; height: 34px; border-radius: var(--radius-md); }
.drive-root-mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.drive-root-mark.compact svg { width: 19px; height: 19px; }
.drive-header h2 { margin: 1px 0 3px; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.drive-stats, .drive-breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.drive-stats { justify-content: flex-end; flex-wrap: nowrap; overflow: hidden; }
.drive-summary { flex: 0 0 auto; color: var(--text); font-size: var(--text-ui-sm); font-weight: var(--weight-strong); white-space: nowrap; }
.drive-stats .pill { border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--border-soft)); background: color-mix(in srgb, var(--surface-card) 76%, var(--surface-soft)); }
.drive-path-line { min-width: 0; display: grid; gap: 2px; }
.drive-breadcrumbs { min-width: 0; max-width: 100%; margin: 0; color: var(--muted); font-size: .82rem; flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
.drive-breadcrumbs > span { flex: 0 0 auto; }
.drive-breadcrumbs .link-button { display: block; flex: 0 1 auto; min-width: 0; max-width: 180px; min-height: 26px; overflow: hidden; border-radius: var(--radius-sm); padding: 2px 5px; color: var(--primary-dark); text-overflow: ellipsis; white-space: nowrap; }
.drive-breadcrumbs .link-button:hover, .drive-breadcrumbs .link-button:focus-visible { background: var(--surface-soft); outline: none; }
.drive-breadcrumbs .link-button[aria-current="page"] { flex: 1 1 auto; background: color-mix(in srgb, var(--surface) 74%, transparent); color: var(--text); }
.drive-path-label { display: block; color: var(--muted); font-size: var(--text-micro); font-weight: var(--weight-strong); letter-spacing: .06em; text-transform: uppercase; }
.drive-current-path, .drive-empty-path { margin-top: 4px; overflow: hidden; color: var(--muted); font: var(--weight-strong) var(--text-meta)/1.35 var(--font-mono); text-overflow: ellipsis; white-space: nowrap; }
.drive-current-path { display: inline-flex; align-items: center; gap: 5px; width: fit-content; max-width: 100%; border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 5px 8px; background: color-mix(in srgb, var(--surface) 72%, transparent); color: var(--text-soft); }
.drive-current-path code { overflow: hidden; color: inherit; font: inherit; text-overflow: ellipsis; white-space: nowrap; }
.drive-empty { overflow: hidden; display: grid; justify-items: center; gap: 8px; padding: 32px 18px; border-style: dashed; box-shadow: none; text-align: center; }
.drive-empty p { margin: 0; color: var(--muted); }
.drive-empty-mark { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--border-soft) 88%, transparent); border-radius: var(--radius-xl); background: color-mix(in srgb, var(--surface-soft) 88%, var(--surface-card)); color: color-mix(in srgb, var(--muted) 68%, var(--text)); }
.drive-empty-mark svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.drive-editor-panel { width: min(980px, calc(100vw - 28px)); }
.drive-text-editor { min-height: 58vh; font-family: var(--font-mono); font-size: 13px; line-height: 1.55; resize: vertical; }
.drive-list-card { min-width: 0; max-width: 100%; overflow: visible; border: 1px solid var(--border-soft); border-radius: var(--radius-xl); background: var(--surface-card); box-shadow: var(--shadow); }
.drive-list-meta { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--border-soft); background: color-mix(in srgb, var(--surface-card) 78%, var(--surface-soft)); }
.drive-list-meta > div { min-width: 0; display: grid; gap: 2px; }
.drive-list-meta b { min-width: 0; overflow: hidden; color: var(--text-soft); font-size: var(--text-ui-sm); font-weight: var(--weight-control); text-overflow: ellipsis; white-space: nowrap; }
.drive-view-label { color: var(--muted); font-size: var(--text-micro); font-weight: var(--weight-strong); letter-spacing: .06em; text-transform: uppercase; }
.drive-address { max-width: 42vw; overflow: hidden; color: var(--muted); font: var(--weight-strong) var(--text-label)/1.35 var(--font-mono); text-overflow: ellipsis; white-space: nowrap; }
.drive-list-head { display: none; grid-template-columns: minmax(0, 1.5fr) minmax(70px, .45fr) minmax(78px, .5fr) minmax(120px, .75fr) 54px; gap: 14px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--border-soft); background: color-mix(in srgb, var(--surface-soft) 78%, var(--surface-card)); color: var(--muted); font-size: var(--text-micro); font-weight: var(--weight-control); text-transform: uppercase; letter-spacing: .05em; }
.drive-sort-head { display: inline-flex; align-items: center; gap: 5px; border: 0; padding: 0; background: transparent; color: inherit; font: inherit; text-align: left; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.drive-sort-head:hover, .drive-sort-head.active { color: var(--primary-dark); }
.drive-sort-head span { color: var(--primary); font-size: .85rem; }
.drive-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.drive-list-card .drive-items { padding: 10px; }
.drive-gallery-note { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border-soft)); border-radius: var(--radius-lg); padding: 10px 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--surface-card) 88%, var(--accent)), color-mix(in srgb, var(--surface-card) 94%, var(--primary))); }
.drive-gallery-note > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius-md); background: color-mix(in srgb, var(--surface) 78%, var(--accent)); color: var(--primary-dark); }
.drive-gallery-note b { display: block; font-size: .86rem; font-weight: var(--weight-strong); }
.drive-gallery-note small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--text-label); font-weight: var(--weight-ui); }
.drive-item { position: relative; min-width: 0; max-width: 100%; min-height: 88px; display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 8px; align-items: start; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 12px; background: color-mix(in srgb, var(--surface-card) 96%, var(--surface)); box-shadow: none; transition: border-color .14s ease, background .14s ease, box-shadow .14s ease, opacity .14s ease, transform .14s ease; }
.drive-item:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); background: color-mix(in srgb, var(--surface-card) 93%, var(--primary)); transform: translateY(-1px); }
.drive-item.selected { border-color: var(--primary); background: color-mix(in srgb, var(--surface-card) 88%, var(--primary)); }
.drive-item[draggable="true"] { cursor: grab; }
.drive-item[draggable="true"]:active { cursor: grabbing; }
.drive-item.drive-item-dragging { opacity: .48; transform: scale(.985); }
.folder-item.drive-folder-drop-hover { border-color: color-mix(in srgb, var(--primary) 72%, var(--border)); background: color-mix(in srgb, var(--surface-card) 80%, var(--primary)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); transform: translateY(-2px); }
.folder-item.drive-folder-drop-hover .drive-icon { border-color: color-mix(in srgb, var(--primary) 42%, var(--border)); color: var(--primary-dark); }
.drive-select { position: absolute; top: 8px; left: 8px; z-index: 2; display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-soft); cursor: pointer; }
.drive-select input { position: absolute; left: 50%; top: 50%; width: 16px; min-width: 16px; height: 16px; min-height: 16px; margin: 0; accent-color: var(--primary); transform: translate(-50%, -50%); cursor: pointer; }
.drive-shell.selecting .drive-main { padding-left: 30px; }
.drive-main { width: 100%; max-width: 100%; min-width: 0; justify-self: stretch; overflow: hidden; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: start; border: 0; border-radius: var(--radius-md); padding: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.drive-main:focus-visible { outline: 3px solid var(--input-focus); outline-offset: 3px; }
.drive-main:disabled { cursor: default; }
.drive-main b { min-width: 0; max-width: 100%; display: -webkit-box; overflow: hidden; color: var(--text); font-size: var(--text-ui); font-weight: var(--weight-control); line-height: 1.22; overflow-wrap: anywhere; word-break: break-word; text-overflow: ellipsis; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.drive-main small { display: none; margin-top: 3px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-name-stack { min-width: 0; max-width: 100%; overflow: hidden; display: grid; gap: 2px; }
.drive-meta-row { display: none; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.drive-meta-row span { max-width: 100%; overflow: hidden; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 2px 6px; background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--muted); font-size: var(--text-meta); font-weight: var(--weight-ui); line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.drive-meta-row span:nth-child(3) { flex-basis: 100%; }
.drive-icon, .drive-file-mark, .drive-thumb, .drive-thumb-wrap { width: 44px; height: 44px; border-radius: var(--radius-lg); }
.drive-icon, .drive-file-mark { display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--border-soft) 86%, transparent); background: color-mix(in srgb, var(--surface-soft) 82%, transparent); color: color-mix(in srgb, var(--muted) 72%, var(--text)); font-size: var(--text-micro); font-weight: var(--weight-control); }
.drive-icon { background: color-mix(in srgb, var(--surface-soft) 88%, var(--surface-card)); color: color-mix(in srgb, var(--muted) 68%, var(--text)); }
.drive-file-mark, .drive-thumb-wrap { --file-mark-accent: var(--primary); --file-mark-tint: var(--surface-soft); position: relative; overflow: hidden; border: 1px solid color-mix(in srgb, var(--file-mark-accent) 18%, var(--border-soft)); background: color-mix(in srgb, var(--surface-card) 86%, var(--file-mark-tint)); color: color-mix(in srgb, var(--file-mark-accent) 74%, var(--muted)); letter-spacing: .02em; }
.drive-file-glyph { display: grid; place-items: center; width: 24px; height: 24px; }
.drive-file-glyph svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.drive-file-badge { position: absolute; right: 3px; bottom: 3px; max-width: 36px; overflow: hidden; border-radius: var(--radius-sm); padding: 1px 4px; background: color-mix(in srgb, var(--surface) 92%, var(--file-mark-accent)); color: color-mix(in srgb, var(--file-mark-accent) 72%, var(--muted)); font-size: .52rem; font-weight: var(--weight-control); line-height: 1.25; text-overflow: ellipsis; text-transform: uppercase; }
.drive-file-image { --file-mark-accent: var(--accent); --file-mark-tint: var(--surface-soft); }
.drive-file-audio, .drive-file-media { --file-mark-accent: var(--secondary); --file-mark-tint: var(--surface-soft); }
.drive-file-pdf { --file-mark-accent: var(--danger); --file-mark-tint: var(--danger-bg); }
.drive-file-archive { --file-mark-accent: var(--highlight); --file-mark-tint: var(--surface-soft); }
.drive-file-sheet { --file-mark-accent: var(--ok); --file-mark-tint: var(--file-bg); }
.drive-file-slides { --file-mark-accent: var(--accent); --file-mark-tint: var(--surface-soft); }
.drive-file-document { --file-mark-accent: var(--primary); --file-mark-tint: var(--surface-soft); }
.drive-file-code { --file-mark-accent: var(--terminal-accent); --file-mark-tint: var(--terminal-surface); }
.drive-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.drive-thumb-wrap { display: block; background: var(--field-bg); }
.drive-thumb { display: block; object-fit: cover; border: 1px solid var(--border); background: var(--field-bg); }
.drive-thumb-wrap .drive-thumb { width: 100%; height: 100%; border: 0; border-radius: inherit; }
.drive-shell.grid-view .drive-image-item { min-height: 230px; grid-template-rows: minmax(0, 1fr) auto; align-items: stretch; padding: 0; overflow: hidden; }
.drive-shell.grid-view .drive-image-item .drive-main { min-height: 100%; grid-template-columns: 1fr; grid-template-rows: minmax(142px, 1fr) auto; gap: 0; border-radius: 0; }
.drive-shell.grid-view .drive-image-item .drive-thumb-wrap { width: 100%; height: 100%; min-height: 150px; border-width: 0 0 1px; border-radius: 0; }
.drive-shell.grid-view .drive-image-item .drive-name-stack { padding: 11px 12px 12px; }
.drive-shell.grid-view .drive-image-item .drive-main small { display: block; }
.drive-shell.grid-view .drive-image-item .drive-actions { position: absolute; right: 10px; bottom: 10px; }
.drive-shell.grid-view.photo-folder .drive-items { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.drive-shell.grid-view.photo-folder .folder-item { min-height: 230px; }
.drive-size, .drive-kind, .drive-modified { display: none; min-width: 0; color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drive-kind { font-weight: var(--weight-control); color: var(--primary-dark); }
.drive-actions { position: relative; z-index: 2; display: flex; justify-content: flex-end; align-items: center; padding-top: 0; border-top: 0; }
.drive-menu-toggle { min-width: 36px; min-height: 36px; border: 1px solid color-mix(in srgb, var(--border-soft) 88%, transparent); border-radius: var(--radius-md); background: color-mix(in srgb, var(--surface) 86%, transparent); color: color-mix(in srgb, var(--muted) 72%, var(--text)); font-size: 1rem; font-weight: var(--weight-control); cursor: pointer; }
.drive-menu-toggle:hover, .drive-menu-toggle:focus-visible { border-color: color-mix(in srgb, var(--border-soft) 74%, var(--primary)); background: color-mix(in srgb, var(--surface-soft) 72%, transparent); outline: none; }
.drive-action-menu { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 20; display: none; align-items: center; gap: 3px; width: max-content; max-width: min(88vw, 360px); padding: 5px; border: 1px solid color-mix(in srgb, var(--border-soft) 88%, transparent); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--surface) 96%, var(--surface-soft)); box-shadow: 0 6px 18px color-mix(in srgb, var(--text) 8%, transparent); }
.drive-actions.open .drive-action-menu { display: flex; }
.drive-actions .icon-btn { min-width: 28px; min-height: 34px; margin-left: 0; border: 0; border-radius: 999px; padding: 7px 5px; background: transparent; color: var(--text); font-size: .78rem; text-align: center; text-decoration: none; }
.drive-action-btn { display: inline-grid; place-items: center; flex: 0 0 auto; }
.drive-action-btn .tool-icon { width: 20px; height: 20px; }
.drive-action-btn .tool-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.drive-actions .icon-btn:hover, .drive-actions .icon-btn:focus-visible { background: color-mix(in srgb, var(--surface-soft) 72%, transparent); color: color-mix(in srgb, var(--text) 86%, var(--primary)); outline: none; }
.drive-actions .danger-link:hover, .drive-actions .danger-link:focus-visible { background: color-mix(in srgb, var(--danger) 10%, var(--surface-soft)); color: var(--danger) !important; }
.drive-bulk-actions { align-items: center; margin-bottom: 0; padding: 8px 10px; border-color: color-mix(in srgb, var(--primary) 20%, var(--border-soft)); background: color-mix(in srgb, var(--surface-card) 88%, var(--surface-soft)); box-shadow: none; }
.drive-bulk-actions.has-selection { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); background: color-mix(in srgb, var(--surface-card) 82%, var(--primary)); }
.drive-bulk-actions .small { font-weight: var(--weight-strong); white-space: nowrap; }
.drive-bulk-actions .btn { min-height: 34px; padding: 6px 10px; }
.drive-bulk-actions .bulk-danger-zone { margin-left: 8px; padding-left: 10px; }
.drive-shell.selecting .drive-header { min-height: 46px; padding-block: 6px; background: color-mix(in srgb, var(--surface-card) 94%, var(--surface-soft)); }
.app-context-menu { position: fixed; z-index: 1200; display: grid; gap: 3px; min-width: 188px; max-width: min(280px, calc(100vw - 16px)); padding: 6px; border: 1px solid color-mix(in srgb, var(--border-soft) 88%, transparent); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--surface) 96%, var(--surface-soft)); color: var(--text); box-shadow: 0 6px 18px color-mix(in srgb, var(--text) 8%, transparent); }
.app-context-menu-item { width: 100%; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: center; border: 0; border-radius: var(--radius-md); padding: 8px 10px; background: transparent; color: var(--text); font-size: var(--text-button); font-weight: var(--weight-control); text-align: left; }
.app-context-menu-item:hover, .app-context-menu-item:focus-visible { outline: none; background: var(--surface-soft); color: var(--primary-dark); }
.app-context-menu-item.danger-link:hover, .app-context-menu-item.danger-link:focus-visible { background: color-mix(in srgb, var(--danger) 10%, var(--surface-soft)); color: var(--danger) !important; }
.app-context-menu-item .tool-icon { display: grid; place-items: center; width: 20px; height: 20px; color: currentColor; }
.app-context-menu-item .tool-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.app-context-menu-item span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger-link { color: var(--danger) !important; }
.drive-shell.list-view .drive-items { grid-template-columns: 1fr; }
.drive-shell.list-view .drive-list-card .drive-items { padding: 0; gap: 0; }
.drive-shell.list-view .drive-list-head { display: grid; }
.drive-shell.list-view .drive-item { min-height: 0; grid-template-columns: minmax(0, 1.5fr) minmax(70px, .45fr) minmax(78px, .5fr) minmax(120px, .75fr) 54px; gap: 14px; align-items: center; border-width: 0 0 1px; border-radius: 0; padding: 9px 14px; background: transparent; transform: none; }
.drive-shell.list-view .drive-item:hover { background: color-mix(in srgb, var(--surface-soft) 62%, transparent); transform: none; }
.drive-shell.list-view .drive-meta-row { display: none; }
.drive-shell.list-view .drive-main { align-items: center; }
.drive-shell.list-view .drive-main b { display: block; overflow: hidden; color: color-mix(in srgb, var(--text) 84%, var(--muted)); font-size: var(--text-ui-sm); font-weight: var(--weight-control); text-overflow: ellipsis; white-space: nowrap; }
.drive-shell.list-view .drive-main small { display: none; }
.drive-shell.list-view.selecting .drive-item { padding-left: 46px; }
.drive-shell.list-view.selecting .drive-main { padding-left: 0; }
.drive-shell.list-view .drive-select { top: 50%; left: 12px; transform: translateY(-50%); }
.drive-shell.list-view .drive-item:last-child { border-bottom: 0; }
.drive-shell.list-view .drive-size, .drive-shell.list-view .drive-kind, .drive-shell.list-view .drive-modified { display: block; }
.drive-shell.list-view .drive-actions { border-top: 0; padding-top: 0; justify-content: flex-end; }
.drive-shell.list-view .drive-action-menu { right: calc(100% + 5px); top: 50%; bottom: auto; gap: 3px; padding: 5px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 8px 22px color-mix(in srgb, var(--text) 12%, transparent); transform: translateY(-50%); }
.icon-btn { color: var(--muted); font-size: .76rem; margin-left: 8px; }
.row-actions { text-align: right; }
.expired { color: var(--danger); font-weight: var(--weight-control); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: 16px;
  background: var(--surface-card);
  box-shadow: var(--shadow);
  min-width: 0;
}
.note-card { position: relative; overflow: hidden; min-height: 124px; display: grid; grid-template-rows: auto auto 1fr auto; gap: 7px; align-content: start; border: 1px solid color-mix(in srgb, var(--border-soft) 88%, var(--primary)); border-radius: var(--radius-lg); padding: 12px 12px 12px 15px; background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 96%, var(--primary)), var(--surface)); color: var(--text); cursor: pointer; transition: border-color .16s ease, transform .16s ease, background .16s ease, box-shadow .16s ease; }
.note-card::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 999px; background: linear-gradient(180deg, var(--primary), var(--accent)); pointer-events: none; z-index: 0; }
.note-card::after { content: ''; position: absolute; right: -34px; top: -42px; width: 104px; height: 104px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 5%, transparent); pointer-events: none; z-index: 0; }
.notes-workspace.quick-notes .note-card::after { display: none; }
.note-card:nth-child(2n)::before { background: linear-gradient(180deg, var(--secondary), var(--highlight)); }
.note-card:nth-child(2n)::after { background: color-mix(in srgb, var(--secondary) 6%, transparent); }
.note-card:nth-child(3n)::before { background: linear-gradient(180deg, var(--accent), var(--highlight)); }
.note-card:nth-child(3n)::after { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.note-card > * { position: relative; z-index: 1; }
.note-card:focus-visible { outline: 3px solid var(--input-focus); outline-offset: 2px; }
.note-card.selected { border-color: color-mix(in srgb, var(--primary) 48%, var(--border-soft)); background: color-mix(in srgb, var(--surface-card) 90%, var(--primary)); }
.note-card:not(.selected):not(.active):hover { border-color: color-mix(in srgb, var(--primary) 28%, var(--border-soft)); transform: translateY(-1px); box-shadow: 0 6px 14px color-mix(in srgb, var(--primary) 5%, transparent); }
.note-title-row { min-width: 0; display: flex; align-items: center; gap: 8px; }
.note-title-row button[data-open] { min-width: 0; flex: 1 1 auto; overflow: hidden; }
.note-card h2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: .95rem; font-weight: var(--weight-control); line-height: 1.2; letter-spacing: -.01em; }
.note-select { flex: 0 0 auto; display: inline-flex; align-items: center; color: var(--muted); font-size: .72rem; font-weight: var(--weight-control); }
.note-select input { width: auto; min-height: auto; }
.bulk-note-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; padding: 10px; box-shadow: none; }
.bulk-note-actions-simple { justify-content: flex-end; padding: 0; margin-bottom: 8px; background: transparent; border: 0; }
.bulk-note-actions-simple .btn { min-height: 34px; padding: 6px 14px; background: var(--surface-soft); color: var(--primary-dark); }
.bulk-note-actions select { width: auto; min-width: 150px; min-height: 38px; padding: 7px 10px; }
.note-layout-toggle { display: flex; justify-content: flex-end; gap: 10px; margin: 0; }
.note-layout-toggle .btn { min-height: 34px; font-size: .76rem; display: inline-grid; place-items: center; }
.note-layout-toggle .tool-icon,
.note-layout-toggle .tool-icon svg { width: 18px; height: 18px; }
.note-layout-toggle .btn { color: var(--muted); border: 1px solid transparent; }
.note-layout-toggle .btn .tool-icon,
.note-layout-toggle .btn .tool-icon svg { color: currentColor; stroke: currentColor; }
.note-layout-toggle .btn:not(.active):hover { color: var(--primary-dark); background: var(--surface-soft); }
.note-layout-toggle .active { border-color: var(--primary); background: var(--primary); color: white; }
.note-layout-toggle .active .tool-icon,
.note-layout-toggle .active .tool-icon svg { color: white; stroke: currentColor; }
.note-sort-control { min-height: 34px; display: inline-flex; align-items: center; gap: 8px; width: auto; min-width: 166px; padding: 0 8px 0 10px; border: 1px solid var(--border-soft); border-radius: 9px; background: var(--surface-soft); color: var(--primary-dark); font-size: .76rem; font-weight: 500; }
.note-sort-control .tool-icon, .note-sort-control .tool-icon svg { width: 18px; height: 18px; color: currentColor; stroke: currentColor; }
.note-sort-control select { width: auto; min-width: 0; min-height: 32px; flex: 1 1 auto; padding: 4px 22px 4px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--text); font-size: .78rem; font-weight: 500; }
.note-sort-control select:focus { box-shadow: none; border-color: transparent; }
.bulk-icon-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; border: 1px solid var(--border); background: var(--surface-soft); color: var(--primary-dark); font-weight: 500; }
.bulk-icon-btn .tool-icon,
.bulk-icon-btn .tool-icon svg { width: 20px; height: 20px; }
.bulk-danger-zone { margin-left: 18px; padding-left: 14px; border-left: 1px solid var(--border-soft); }
.notes-workspace.editor-open:not(.list-view) .note-card { min-height: 74px; grid-template-rows: auto auto auto; gap: 5px; border-color: color-mix(in srgb, var(--border-soft) 88%, var(--primary)); border-radius: var(--radius-lg); padding: 9px 10px 10px 14px; background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 96%, var(--primary)), var(--surface)); box-shadow: var(--shadow); overflow: hidden; }
.notes-workspace.editor-open:not(.list-view) .note-card::before { display: block; pointer-events: none; }
.notes-workspace.editor-open:not(.list-view) .note-card::after { display: none; }
.notes-workspace.editor-open:not(.list-view) .note-card::before { top: 10px; bottom: 10px; }
.notes-workspace.editor-open:not(.list-view) .note-card > * { position: relative; z-index: 1; }
.notes-workspace.editor-open:not(.list-view) .note-card:not(.selected):not(.active):hover { border-color: color-mix(in srgb, var(--primary) 26%, var(--border-soft)); transform: translateY(-1px); box-shadow: 0 5px 12px color-mix(in srgb, var(--primary) 4%, transparent); }
.notes-workspace.editor-open:not(.list-view) .note-card.selected,
.notes-workspace.editor-open:not(.list-view) .note-card.active { border-color: color-mix(in srgb, var(--primary) 48%, var(--border-soft)); background: linear-gradient(145deg, color-mix(in srgb, var(--surface-card) 90%, var(--primary)), var(--surface)); box-shadow: inset 2px 0 0 color-mix(in srgb, var(--primary) 70%, transparent), var(--shadow); }
.notes-workspace.list-view .note-card::before,
.notes-workspace.list-view .note-card::after { display: none; }
.notes-workspace.list-view .note-card:not(.selected):not(.active):hover { border-color: var(--border-soft); background: var(--surface-card); box-shadow: var(--shadow); transform: none; }
.notes-workspace.editor-open .note-card h2 { font-size: var(--text-ui-sm); line-height: 1.2; font-weight: var(--weight-control); }
.notes-workspace.editor-open .note-card .note-body { display: none; }
.notes-workspace.editor-open .note-card .pill-row { min-width: 0; gap: 4px; flex-wrap: nowrap; max-height: 18px; overflow: hidden; }
.notes-workspace.editor-open .note-card .pill { flex: 0 1 auto; max-width: 92px; overflow: hidden; padding: 2px 6px; font-size: .62rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.notes-workspace.editor-open .note-card .small { align-self: start; font-size: var(--text-meta); line-height: 1.25; }
.notes-workspace.list-view .notes-grid { grid-template-columns: 1fr; gap: 7px; }
.notes-workspace.list-view .note-card { min-height: 52px; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: 1fr; align-content: center; align-items: center; gap: 12px; border-color: var(--border-soft); border-radius: var(--radius-lg); padding: 8px 12px; background: var(--surface-card); box-shadow: var(--shadow); }
.notes-workspace.list-view .note-card .note-title-row { min-width: 0; }
.notes-workspace.list-view .note-card button[data-open] { min-width: 0; display: flex; align-items: center; min-height: 24px; }
.notes-workspace.list-view .note-card h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-ui-sm); line-height: 1.15; }
.notes-workspace.list-view .note-card .pill-row { justify-content: flex-end; flex-wrap: nowrap; overflow: hidden; max-width: 280px; }
.notes-workspace.list-view .note-card .pill-row .pill:not(:first-child) { display: none; }
.notes-workspace.list-view .note-card .small { white-space: nowrap; font-size: .74rem; }
.notes-workspace.editor-open.list-view .note-card.title-only { min-height: 38px; grid-template-columns: 1fr; align-content: center; align-items: center; padding: 7px 10px; }
.notes-workspace.editor-open.list-view .note-card.title-only h2 { font-size: .82rem; line-height: 1.15; }
.notes-workspace.editor-open.list-view .note-card { min-height: 38px; grid-template-columns: 1fr; align-content: center; align-items: center; padding: 7px 10px; }
.notes-workspace.editor-open.list-view .note-card button[data-open] { display: flex; align-items: center; min-height: 22px; }
.notes-workspace.editor-open.list-view .note-card .pill-row,
.notes-workspace.editor-open.list-view .note-card .small { display: none; }
.note-card.active { border-color: color-mix(in srgb, var(--primary) 48%, var(--border-soft)); background: color-mix(in srgb, var(--surface-card) 92%, var(--primary)); box-shadow: inset 1px 0 0 color-mix(in srgb, var(--primary) 72%, transparent); }
.notes-workspace.editor-open:not(.list-view) .note-card.active { padding-left: 14px; padding-right: 10px; }
.note-card.dragging { opacity: .55; outline: 2px solid var(--primary); }
.note-card button { text-align: left; border: 0; background: transparent; padding: 0; }
.note-card > .small { align-self: end; min-width: 0; overflow-wrap: anywhere; }
.note-body { color: var(--text-soft); white-space: pre-wrap; max-height: 7.5rem; overflow: hidden; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { border-radius: 6px; background: var(--pill-bg); color: var(--pill-text); padding: 4px 8px; font-size: var(--text-meta); font-weight: var(--weight-control); font-family: var(--font-mono); }
.pill.secret { background: var(--secret-bg); color: var(--secret-text); }
.pill.file { background: var(--file-bg); color: var(--file-text); }
.pill.danger { background: color-mix(in srgb, var(--danger) 12%, var(--surface-soft)); color: var(--danger); }
.user-management-row .pill-row { justify-content: flex-end; align-items: center; }
.editor {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--overlay);
}
.editor-panel {
  width: min(820px, 100%);
  max-width: calc(100vw - 32px);
  max-height: min(92vh, 900px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: 0 10px 32px rgba(15,23,42,.16);
}
.editor-panel, .editor-panel * { min-width: 0; }
.editor-panel > .topbar > div:first-child { min-width: 0; }
.editor-panel > .topbar h2 { overflow-wrap: anywhere; }
.onlyoffice-editor { padding: 10px; }
.onlyoffice-editor-panel { width: min(1400px, calc(100vw - 20px)); height: calc(100vh - 20px); max-height: calc(100vh - 20px); padding: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.onlyoffice-editor-panel > .topbar { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.onlyoffice-editor.preview-fullscreen { place-items: stretch; padding: 0; overflow: hidden; }
.onlyoffice-editor.preview-fullscreen .onlyoffice-editor-panel { width: 100%; height: 100%; max-width: 100%; max-height: 100%; border-radius: 0; }
.onlyoffice-frame { min-height: 0; background: var(--surface-soft); }
.onlyoffice-frame iframe { width: 100%; height: 100%; border: 0; }
.onlyoffice-error { min-height: 100%; display: grid; grid-template-columns: auto minmax(0, 520px); gap: 14px; place-content: center; align-items: center; padding: 24px; text-align: left; }
.onlyoffice-error h3 { margin: 0 0 6px; color: var(--text); font-size: 1rem; text-transform: none; letter-spacing: 0; }
.onlyoffice-error p { margin: 0 0 6px; }
.dialog-close { flex: 0 0 auto; }
.note-editor-panel { width: min(1120px, 100%); min-height: min(88vh, 900px); }
.inline-note-editor {
  width: 100%;
  max-height: calc(100vh - 96px);
  min-height: calc(100vh - 152px);
  background: var(--terminal-bg);
  color: var(--terminal-text);
  border: 1px solid var(--terminal-line);
  border-radius: var(--radius-xl);
  padding: 0;
  box-shadow: 0 8px 24px rgba(15,23,42,.08);
}
.inline-note-editor.drop-ready { outline: 2px dashed var(--terminal-accent); outline-offset: -10px; background: color-mix(in srgb, var(--terminal-bg) 90%, var(--terminal-accent)); }
.inline-panel { display: grid; gap: 14px; }
.inline-panel.card { padding: 18px; }
.settings-shell { display: grid; gap: 16px; }
.settings-tabs { position: sticky; top: -18px; z-index: 5; display: flex; gap: 8px; flex-wrap: wrap; padding: 0 0 12px; background: var(--surface-card); border-bottom: 1px solid var(--border-soft); }
.settings-tab { min-height: 38px; border-radius: var(--radius-xl); }
.settings-tab.active { background: var(--primary); color: white; }
.settings-tab-panel { display: grid; gap: 14px; }
.settings-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); align-items: start; }
.settings-code-block { margin: 0; padding: 12px; overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--terminal-surface); color: var(--terminal-text); font: .82rem/1.5 var(--font-mono); white-space: pre; }
.ai-token-preview textarea { min-height: 96px; font-family: var(--font-mono); font-size: .78rem; word-break: break-all; }
.profile-row { display: flex; align-items: center; gap: 12px; }
.profile-avatar { width: 58px; height: 58px; border-radius: var(--radius-xl); object-fit: cover; background: var(--surface-soft); border: 1px solid var(--border); }
.profile-avatar.initials { display: grid; place-items: center; color: var(--primary-dark); font-weight: 500; }
.avatar-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.avatar-controls input { flex: 1 1 220px; }
input[type="file"] { max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.inline-note-editor .terminal-topbar { position: sticky; top: 0; z-index: 4; padding: 14px 16px; border-bottom: 1px solid var(--terminal-line); background: var(--terminal-surface); }
.inline-note-editor .terminal-topbar h2 { color: var(--terminal-text); font-family: var(--font-mono); font-weight: var(--weight-strong); letter-spacing: -.02em; }
.inline-note-editor .terminal-topbar .btn-row { gap: 16px; }
.inline-note-editor .note-editor-form { margin: 0; padding: 14px 16px 0; }
.inline-note-editor .note-title-input { color: var(--terminal-text); border-color: var(--terminal-line); font-family: var(--font-mono); }
.inline-note-editor .note-title-input::placeholder,
.inline-note-editor input::placeholder,
.inline-note-editor textarea::placeholder { color: var(--terminal-muted); }
.inline-note-editor .editor-toolbar, .paragraph-toolbar { display: flex; align-items: center; gap: 4px; width: max-content; max-width: 100%; overflow-x: auto; border: 0; border-radius: 0; padding: 4px 0; background: transparent; box-shadow: none; }
.inline-note-editor .editor-toolbar { position: sticky; top: 67px; z-index: 3; border-bottom: 1px solid var(--terminal-line); }
.inline-note-editor .tool-chip { width: 34px; min-width: 34px; height: 34px; border: 0; background: transparent; color: var(--terminal-muted); border-radius: 999px; padding: 0; display: inline-grid; place-items: center; font-family: var(--font-mono); }
.inline-note-editor .tool-chip:hover { color: var(--terminal-accent); background: rgba(34,197,94,.08); }
.tool-icon, .tool-icon svg { width: 20px; height: 20px; display: block; }
.tool-icon svg { fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.icon-only-btn { min-width: 40px; padding-inline: 12px; font-weight: var(--weight-control); display: inline-grid; place-items: center; }
.icon-only-btn .tool-icon { margin: 0 auto; }
.btn.primary.action-fab { min-width: 54px; min-height: 44px; border-radius: var(--radius-xl); background: var(--primary); box-shadow: none; transition: transform .16s ease, box-shadow .16s ease; }
.btn.primary.action-fab .sr-only { display: none; }
.btn.primary.action-fab:hover { transform: translateY(-1px); box-shadow: none; }
.code-edit-shell { display: grid; grid-template-columns: auto minmax(0, 1fr); border: 1px solid var(--terminal-line); border-radius: var(--radius-lg); overflow: hidden; background: var(--terminal-surface); }
.code-line-numbers { min-width: 44px; max-height: 360px; overflow: hidden; margin: 0; padding: 12px 10px; border-right: 1px solid var(--terminal-line); color: var(--terminal-muted); background: color-mix(in srgb, var(--terminal-bg) 70%, var(--terminal-surface)); text-align: right; user-select: none; white-space: pre; font: .9rem/1.5 var(--font-mono); }
.code-edit-shell textarea[data-block-code] { border: 0; border-radius: 0; min-height: 220px; max-height: 360px; background: transparent; color: var(--terminal-text); resize: vertical; line-height: 1.5; }
.theme-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.theme-preset { display: grid; grid-template-columns: auto 1fr; gap: 2px 9px; align-items: center; text-align: left; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px; background: var(--field-bg); color: var(--text); }
.theme-preset.active { border-color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
.theme-preset small { grid-column: 2; color: var(--muted); font-size: .72rem; }
.theme-swatch { width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--border); background: conic-gradient(#2563eb 0 25%, #94a3b8 0 50%, #22d3ee 0 75%, #eab308 0); grid-row: span 2; }
.theme-light { background: conic-gradient(#2563eb 0 25%, #94a3b8 0 50%, #22d3ee 0 75%, #eab308 0); }
.theme-soft { background: conic-gradient(#b86f3b 0 25%, #60a5fa 0 50%, #4d7c0f 0 75%, #d9a441 0); }
.theme-ocean { background: conic-gradient(#0e7490 0 25%, #facc15 0 50%, #22c55e 0 75%, #14b8a6 0); }
.theme-colorblind { background: conic-gradient(#d94f30 0 25%, #d99a18 0 50%, #1e3a8a 0 75%, #f3e5c0 0); }
.theme-mono { background: conic-gradient(#111827 0 25%, #6b7280 0 50%, #2563eb 0 75%, #f9fafb 0); }
.theme-blueprint { background: conic-gradient(#14b8a6 0 25%, #94a3b8 0 50%, #22d3ee 0 75%, #4ade80 0); }
.theme-dark { background: conic-gradient(#3b82f6 0 25%, #64748b 0 50%, #fb923c 0 75%, #d6a77a 0); }
.theme-midnight { background: conic-gradient(#38bdf8 0 25%, #fb7185 0 50%, #fb923c 0 75%, #a3e635 0); }
.theme-plum { background: conic-gradient(#facc15 0 25%, #2563eb 0 50%, #ec4899 0 75%, #8b5cf6 0); }
.theme-black { background: conic-gradient(#a3e635 0 25%, #6b7280 0 50%, #d9f99d 0 75%, #f8fafc 0); }
.inline-note-editor .compact-field span,
.inline-note-editor .muted,
.inline-note-editor .small { color: var(--terminal-muted); }
.inline-note-editor .compact-field input,
.inline-note-editor .compact-field select { background: var(--terminal-surface); color: var(--terminal-text); border-color: var(--terminal-line); font-family: var(--font-mono); }
.inline-note-editor .details-panel,
.inline-note-editor .inline-block-group,
.inline-note-editor .inline-secret,
.inline-note-editor .code-block-card pre,
.inline-note-editor .file-upload-line { background: var(--terminal-surface); color: var(--terminal-text); border-color: var(--terminal-line); }
.inline-note-editor .inline-block-heading { color: var(--terminal-accent); font-family: var(--font-mono); }
.inline-note-editor .note-top-actions { justify-content: flex-end; flex-wrap: wrap; gap: 16px; }
.small-panel { width: min(560px, 100%); }
.category-form { margin: 16px 0; }
.category-form input { flex: 1 1 260px; }
.category-edit-row { display: grid; grid-template-columns: 180px minmax(160px, 1fr) minmax(120px, auto) auto auto; gap: 10px; align-items: center; margin-top: 10px; }
.category-icon-picker { position: relative; min-width: 0; }
.category-icon-picker summary { min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--field-bg); color: var(--text-soft); font-weight: 500; cursor: pointer; list-style: none; }
.category-icon-picker summary::-webkit-details-marker { display: none; }
.category-icon-picker[open] summary { border-color: color-mix(in srgb, var(--primary) 32%, var(--border)); box-shadow: none; }
.category-icon-menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 10; width: min(360px, calc(100vw - 48px)); max-height: 280px; overflow: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 8px; border: 1px solid color-mix(in srgb, var(--border-soft) 88%, transparent); background: color-mix(in srgb, var(--surface) 96%, var(--surface-soft)); box-shadow: 0 6px 18px color-mix(in srgb, var(--text) 8%, transparent); }
.category-icon-option { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-soft); text-align: left; font-weight: 500; }
.category-icon-option:hover, .category-icon-option.active { background: color-mix(in srgb, var(--surface-soft) 72%, transparent); color: color-mix(in srgb, var(--text) 86%, var(--primary)); }
.editor-grid, .note-editor-form { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 16px; }
.note-main { min-width: 0; display: grid; gap: 12px; }
.compact-field { gap: 5px; }
.compact-field span { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.compact-field input, .compact-field select { min-height: 40px; padding: 8px 10px; border-radius: 9px; font-size: .88rem; }
.mini-card { padding: 14px; }
.details-panel { border: 1px solid var(--border-soft); border-radius: 0; background: var(--surface-card); padding: 0; overflow: hidden; }
.details-panel summary { cursor: pointer; color: var(--text-soft); font-weight: 500; font-size: .82rem; padding: 7px 10px; line-height: 1.15; }
.details-panel[open] { padding-bottom: 10px; }
.details-panel[open] summary { border-bottom: 1px solid var(--border-soft); margin-bottom: 6px; }
.note-support-panel { margin-top: 2px; }
.details-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.editor-sync { margin-right: auto; }
.inline-note-blocks { display: grid; gap: 10px; padding: 0 12px; }
.inline-note { display: grid; gap: 3px; border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 10px 12px; background: var(--surface); color: var(--text); }
.inline-note span { color: var(--text-soft); font-size: .86rem; }
.inline-note.active { border-color: color-mix(in srgb, var(--primary) 45%, var(--border-soft)); background: color-mix(in srgb, var(--primary) 8%, var(--surface-card)); }
.inline-hint { margin: 0; }
.inline-block-group { display: grid; gap: 8px; border: 1px solid var(--border-soft); border-radius: 0; padding: 12px; background: var(--surface-card); }
.inline-block-heading { color: var(--muted); font-size: .72rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.inline-secret { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; background: var(--field-bg); }
.file-upload-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border: 1px dashed var(--border); border-radius: var(--radius-lg); padding: 9px; }
.file-upload-line input { width: auto; min-height: auto; padding: 0; border: 0; }
.version-panel { margin-top: 0; }
.version-panel > p.small { margin: 0; padding: 10px 12px; }
.version-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.version-preview { display: grid; gap: 8px; margin: 8px 0; padding: 10px; border: 1px solid var(--border-soft); border-radius: 0; background: var(--surface); }
.version-preview .note-read-body { padding: 8px; border: 1px solid var(--border-soft); border-radius: 0; background: var(--field-bg); }
.settings-inline-input { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; text-align: right; color: var(--text); }
.settings-inline-input input { width: 64px; min-height: 34px; padding: 6px 8px; text-align: center; }
.secret-row, .file-row, .audit-row, .user-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.file-block { display: grid; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.pending-file-row { justify-content: flex-start; }
.pending-file-row > span { flex: 1 1 auto; min-width: 0; }
.code-block-card { display: grid; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.code-block-card pre { max-height: 150px; overflow: auto; margin: 0; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--field-bg); color: var(--text-soft); font: .78rem/1.45 var(--font-mono); white-space: pre-wrap; }
.file-thumb { display: block; width: fit-content; max-width: 100%; border: 0; padding: 0; background: transparent; }
.file-preview { display: block; width: 112px; height: 82px; object-fit: cover; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--field-bg); }
.file-thumb:hover .file-preview { border-color: var(--primary); box-shadow: 0 8px 18px rgba(15,23,42,.14); }
.image-lightbox { z-index: 70; place-items: center; padding: clamp(8px, 1.6vw, 20px); }
.image-lightbox-panel { width: min(1440px, calc(100vw - clamp(16px, 3vw, 56px))); height: min(1040px, calc(100vh - clamp(16px, 3vw, 56px))); max-height: none; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
.image-lightbox.preview-fullscreen { place-items: stretch; overflow: hidden; padding: 0; }
.image-lightbox.preview-fullscreen .image-lightbox-panel { width: 100%; height: 100%; max-width: 100%; max-height: 100%; border-radius: 0; padding: var(--control-padding-block); gap: var(--control-padding-block); }
.image-lightbox.preview-fullscreen .file-preview-stage { border-radius: var(--radius-md); }
.image-lightbox.preview-fullscreen .file-preview-stage.image-stage { padding: var(--control-padding-block); }
.image-lightbox.preview-fullscreen .file-detail-stage { padding: var(--control-padding-inline); }
.preview-topbar { align-items: flex-start; gap: 12px; }
.preview-topbar h2 { max-width: min(720px, 52vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-action-row .icon-only-btn { min-width: 42px; min-height: 40px; }
.preview-action-row [data-image-zoom="fit"] { width: auto; min-width: 44px; padding-inline: 10px; font-size: .72rem; }
.image-preview-meta { align-self: center; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .74rem; font-weight: 500; }
.preview-action-row .tool-icon { width: 20px; height: 20px; }
.preview-action-row .tool-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.file-preview-stage { min-height: 0; display: grid; place-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--field-bg); overflow: hidden; }
.file-preview-stage.image-stage { place-items: center; padding: 10px; overflow: auto; }
.text-preview-stage { overflow: auto; }
.text-file-preview { margin: 0; min-height: 100%; padding: 16px; overflow: auto; background: var(--terminal-surface); color: var(--terminal-text); font: .86rem/1.55 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.numbered-code-preview { min-height: 100%; overflow: auto; padding: 10px 0; background: var(--terminal-surface); color: var(--terminal-text); font: .86rem/1.55 var(--font-mono); }
.code-preview-row { display: grid; grid-template-columns: 58px minmax(0, 1fr); min-height: 22px; }
.code-preview-row:hover { background: color-mix(in srgb, var(--primary) 9%, transparent); }
.code-preview-line { padding: 0 14px 0 8px; color: color-mix(in srgb, var(--terminal-text) 42%, transparent); text-align: right; user-select: none; border-right: 1px solid color-mix(in srgb, var(--terminal-line) 70%, transparent); }
.code-preview-row code { display: block; min-width: 0; padding: 0 16px; color: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.media-preview-stage { place-items: center; padding: clamp(12px, 3vw, 28px); background: #050b16; }
.media-preview-stage audio { width: min(680px, 100%); }
.media-preview-stage video { display: block; max-width: 100%; max-height: 100%; border-radius: var(--radius-lg); background: #000; }
.file-detail-stage { overflow: auto; padding: clamp(14px, 2.6vw, 28px); place-items: start center; }
.file-detail-card { display: grid; gap: 14px; max-width: 880px; width: min(100%, 880px); margin: 0 auto; }
.file-detail-identity { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px; border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--border-soft)); border-radius: var(--radius-xl); background: linear-gradient(135deg, color-mix(in srgb, var(--surface-card) 94%, var(--surface-soft)), var(--surface-card)); }
.detail-file-mark { width: 58px; height: 58px; font-size: .82rem; }
.file-detail-heading { min-width: 0; display: grid; gap: 4px; }
.file-detail-kicker { margin: 0; color: var(--muted); font-size: var(--text-meta); font-weight: 500; letter-spacing: .07em; text-transform: uppercase; }
.file-detail-heading h3 { margin: 0; color: var(--text); font-size: clamp(.98rem, 2vw, 1.18rem); letter-spacing: -.015em; text-transform: none; overflow-wrap: anywhere; }
.file-detail-heading p.small { margin: 0; overflow-wrap: anywhere; }
.file-detail-copy { display: grid; gap: 14px; min-width: 0; }
.file-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.file-detail-meta { min-width: 0; display: grid; gap: 5px; align-content: start; padding: 11px 12px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--surface-card) 92%, var(--surface)); }
.file-detail-grid span { color: var(--muted); font-size: var(--text-meta); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.file-detail-grid b { min-width: 0; color: var(--text); font-size: .86rem; line-height: 1.25; overflow-wrap: anywhere; }
.file-detail-empty { align-self: center; justify-self: center; text-align: center; }
.zip-preview { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border-soft); border-radius: var(--radius-xl); background: var(--surface-card); }
.zip-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.zip-preview h4 { margin: 0; color: var(--text); font-size: .96rem; letter-spacing: -.01em; }
.zip-preview .pill { flex: 0 0 auto; border: 1px solid color-mix(in srgb, var(--primary) 16%, var(--border-soft)); background: color-mix(in srgb, var(--surface-soft) 76%, var(--primary)); }
.zip-entry-list { max-height: min(44vh, 440px); overflow: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); }
.zip-entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(76px, auto); gap: 12px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--border-soft); font-size: .84rem; }
.zip-entry:last-child { border-bottom: 0; }
.zip-entry-head { position: sticky; top: 0; z-index: 1; background: color-mix(in srgb, var(--surface-soft) 76%, var(--surface-card)); color: var(--muted); font-size: var(--text-meta); font-weight: 500; letter-spacing: .05em; text-transform: uppercase; }
.zip-entry-name { min-width: 0; display: inline-flex; align-items: center; gap: 8px; overflow: hidden; }
.zip-entry-name span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zip-entry-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 72%, var(--accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
.zip-entry b { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.zip-empty-note, .zip-preview-note { margin: 0; }
.image-lightbox-panel img { display: block; max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; border-radius: var(--radius-lg); background: var(--field-bg); }
.file-preview-frame { width: 100%; height: 100%; min-height: 0; border: 0; background: var(--field-bg); }
.code-lightbox-panel { width: min(1100px, calc(100vw - 28px)); max-height: calc(100vh - 28px); display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 14px; }
.code-full-preview { margin: 0; overflow: auto; padding: 14px; border: 1px solid var(--terminal-line); border-radius: var(--radius-lg); background: var(--terminal-surface); color: var(--terminal-text); font: .9rem/1.55 var(--font-mono); white-space: pre; }
.secret-value { font-family: var(--font-mono); word-break: break-all; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: #0f172a; color: white; padding: 12px 16px; border-radius: 8px; z-index: 40; }
.hidden { display: none !important; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.offline-shell { width: min(1040px, 100%); margin: 0 auto; padding: 24px; display: grid; gap: 18px; }

.notes-workspace.editor-open.list-view .notes-list-pane .note-card {
  min-height: 38px;
  height: 38px;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  align-content: center;
  align-items: center;
  padding: 7px 10px 7px 16px;
}
.notes-workspace.editor-open.list-view .notes-list-pane .note-card button[data-open] { min-height: 20px; display: flex; align-items: center; }
.notes-workspace.editor-open.list-view .notes-list-pane .note-card h2 { font-size: .82rem; line-height: 1.1; }
.filterbar .note-layout-toggle .tool-icon,
.filterbar .note-layout-toggle .tool-icon svg { width: 22px; height: 22px; }
.filterbar .note-layout-toggle .tool-icon svg,
.btn.primary.action-fab .tool-icon svg,
.note-top-actions .icon-only-btn .tool-icon svg,
.bulk-icon-btn .tool-icon svg { stroke-width: 1.7; }

.block-editor .editor-block { padding-left: 72px; }
.block-editor .editor-block::before { left: 46px; }
.block-editor .block-move-controls { left: 10px; top: 22px; gap: 7px; opacity: .86; }
.block-editor .block-move-controls .icon-action { width: 26px; min-width: 26px; min-height: 26px; }

@media (min-width: 821px) and (max-width: 1180px) {
  .layout { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { padding: 14px 10px; }
  .sidebar .brand { justify-content: center; margin-bottom: 12px; }
  .sidebar .brand-mark { width: 40px; height: 40px; border-radius: var(--radius-md); }
  .brand-text,
  .nav-heading,
  .nav-label,
  .nav-count,
  .empty-nav { display: none; }
  .sidebar-collapse { display: none; }
  .nav { width: 44px; justify-self: center; margin: 16px auto; padding: 0; overflow-x: hidden; scrollbar-gutter: auto; }
  .nav-group { gap: 6px; margin-bottom: 8px; }
  .nav button { justify-content: center; min-height: 44px; padding: 0; }
  .nav-tree-item > button { padding-left: 0; }
  .nav-tree-row { grid-template-columns: minmax(0, 1fr); padding-left: 0; }
  .nav-tree-toggle,
  .nav-tree-toggle-spacer { display: none; }
  .nav-utility-group { margin-top: 10px; padding-top: 10px; }
  .sidebar-footer { grid-template-columns: 1fr; gap: 8px; padding-top: 10px; }
  .sidebar-sync { width: 44px; min-width: 44px; height: 36px; padding: 0; font-size: 0; }
  .sidebar-sync::before { content: 'Sync'; font-size: .58rem; }
  .sidebar-footer .btn { width: 44px; min-width: 44px; height: 38px; min-height: 38px; padding: 0; }
  .main { padding: 16px; gap: 14px; }
  .calendar-search-panel + .calendar-page-grid { margin-top: 14px; }
  .topbar { align-items: flex-start; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .filterbar,
  .filterbar.notes-filter,
  .filterbar.task-filter { grid-template-columns: 1fr; }
  .filter-actions { justify-content: flex-start; flex-wrap: wrap; }
  .drive-filter { grid-template-columns: minmax(260px, 1fr) auto; }
  .drive-filter .drive-commandbar { display: grid; grid-template-columns: minmax(0, auto) auto; justify-content: end; }
  .drive-tool-group { flex-wrap: nowrap; }
  .drive-filter .drive-commandbar .drive-tool-btn { min-width: 52px; min-height: 52px; padding: 12px; border-radius: var(--radius-lg); }
  .drive-filter .drive-commandbar .drive-tool-btn .tool-icon,
  .drive-filter .drive-commandbar .drive-tool-btn .tool-icon svg { width: 22px; height: 22px; }
  .drive-filter .drive-layout-toggle .btn { min-height: 52px; }
  .drive-shell.list-view .drive-list-head { grid-template-columns: minmax(0, 1.4fr) 70px 82px minmax(0, .85fr) 56px; gap: 12px; }
  .drive-shell.list-view .drive-item { grid-template-columns: minmax(0, 1.4fr) 70px 82px minmax(0, .85fr) 56px; gap: 12px; }
  .drive-menu-toggle { min-width: 42px; }
  .home-grid,
  .refined-home,
  .calendar-page-grid,
  .settings-grid { grid-template-columns: 1fr; }
  .home-side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .home-notes-widget { grid-column: 1 / -1; }
  .home-hero { grid-template-columns: minmax(0, 1fr); }
  .home-stat-row { justify-content: flex-start; max-width: none; }
  .calendar-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .calendar-nav-row { display: grid; grid-template-columns: 44px minmax(120px, 1fr) 44px; }
  .calendar-add-row { justify-content: flex-start; }
  .task-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .task-row { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .task-row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .table-wrap { overflow: visible; border: 0; background: transparent; }
  .asset-table { min-width: 0; border-collapse: separate; border-spacing: 0 10px; font-size: .84rem; }
  .asset-table thead { display: none; }
  .asset-table tbody,
  .asset-table tr,
  .asset-table td { display: block; width: 100%; }
  .asset-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; overflow: hidden; border: 1px solid var(--border-soft); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow); }
  .asset-table td { min-width: 0; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; align-items: start; border-bottom: 1px solid var(--border-soft); padding: 9px 11px; white-space: normal; overflow-wrap: anywhere; }
.asset-table td::before { content: attr(data-label); color: var(--muted); font-size: .66rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
  .asset-table td:nth-last-child(2),
  .asset-table td:last-child { border-bottom: 0; }
  .asset-table .row-actions { grid-column: 1 / -1; display: flex; justify-content: flex-start; gap: 10px; background: color-mix(in srgb, var(--surface-card) 72%, var(--surface)); }
  .asset-table .row-actions::before { align-self: center; }
  .asset-table .icon-btn { min-height: 34px; margin-left: 0; border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 6px 10px; background: var(--surface); }
.asset-table .icon-btn .tool-icon,
.asset-table .icon-btn .tool-icon svg { width: 20px; height: 20px; }
  .table-editor-grid { overflow-x: auto; }
  .table-editor-grid table { min-width: 560px; }
  .category-edit-row { grid-template-columns: minmax(140px, 1fr) minmax(160px, 1.2fr) minmax(110px, auto) auto auto; }
}

@media (min-width: 1181px) and (max-width: 1280px) {
  .calendar-page-grid { grid-template-columns: minmax(0, 1fr); }
  .calendar-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .calendar-side .mini-month-card { grid-column: 1; }
}

@media (max-width: 820px) {
  body { background: var(--bg); }
  .app-shell { min-height: 100dvh; padding-bottom: max(12px, env(safe-area-inset-bottom), var(--android-system-bottom)); }
  .layout { display: block; padding-bottom: max(20px, env(safe-area-inset-bottom), var(--android-system-bottom)); }
  .menu-toggle { display: grid; place-items: center; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    display: block;
    overflow: visible;
  }
  .sidebar-footer { margin-top: 0; padding-top: 0; }
  .notification-menu,
  body.sidebar-collapsed .notification-menu { left: 14px; right: 14px; bottom: max(14px, env(safe-area-inset-bottom), var(--android-system-bottom)); width: auto; max-height: min(420px, calc(100dvh - 84px)); }
  .sidebar.open .notification-menu { right: auto; width: min(300px, calc(86vw - 28px)); }
  .notification-row { min-height: 44px; }
  body.sidebar-collapsed .layout { grid-template-columns: 1fr; }
  body.sidebar-collapsed .sidebar { padding: 12px 14px; }
  body.sidebar-collapsed .brand-text,
  body.sidebar-collapsed .nav-heading,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-count { display: initial; }
  body.sidebar-collapsed .sidebar-footer { grid-template-columns: minmax(0, 1fr) auto auto; }
  body.sidebar-collapsed .sidebar-sync { width: auto; min-width: 0; height: auto; padding: 7px 12px; font-size: .74rem; }
  body.sidebar-collapsed .sidebar-sync::before { content: none; }
  .sidebar-collapse,
  body.sidebar-collapsed .sidebar-collapse { display: none; }
  .sidebar .brand { margin-bottom: 0; }
  .sidebar .brand-mark { width: 40px; height: 40px; border-radius: 10px; }
  .onboarding-choice { grid-template-columns: 1fr; }
  .auth-card .brand h1 { max-width: none; }
  .sidebar .brand h2 { font-size: 1.05rem; }
  .app-shell:has(.auth-card), .app-shell:has(.loading-card) { min-height: 100svh; padding: 18px 12px; place-items: start center; }
  .auth-card, .loading-card { width: 100%; max-width: calc(100vw - 24px); padding-inline: 0; }
  .auth-card .brand { align-items: flex-start; gap: 10px; margin-bottom: 18px; padding-bottom: 14px; }
  .auth-card .brand h1 { font-size: clamp(1.5rem, 8vw, 1.8rem); overflow-wrap: anywhere; }
  .auth-card form { width: 100%; padding: 16px; border-radius: var(--radius-lg); }
  .sidebar .nav,
  .sidebar-footer { display: none; }
  .sidebar.open {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 340px);
    height: 100vh;
    overflow: auto;
    border-right: 1px solid var(--border);
    border-bottom: 0;
    box-shadow: 16px 0 40px rgba(15,23,42,.18);
  }
  .sidebar.open .brand { margin-bottom: 18px; }
  .sidebar.open .nav { display: grid; gap: 12px; margin: 0 0 18px; padding: 0; overflow: visible; }
  .sidebar.open .sidebar-footer { display: grid; gap: 8px; }
  .sidebar.open .sidebar-footer .btn { min-height: 44px; }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; z-index: 25; border: 0; background: var(--overlay); }
  .nav { display: grid; gap: 8px; margin: 8px -14px 0; padding: 0 14px 4px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar, .add-menu .block-toolbar::-webkit-scrollbar { display: none; }
  .sidebar.open .nav-group { display: grid; gap: 5px; margin: 0; min-width: 0; }
  .sidebar.open .nav-heading { padding: 8px 6px 4px; font-size: .7rem; white-space: normal; }
  .sidebar.open .nav-utility-group { margin-top: 16px; padding-top: 14px; }
  .mini-add { min-width: 62px; height: 30px; margin-left: 4px; }
  .sidebar.open .nav button { min-height: 44px; white-space: normal; padding: 0 12px; gap: 8px; border: 0; background: transparent; }
  .sidebar.open .nav-tree-row { grid-template-columns: 22px minmax(0, 1fr); padding-left: calc(4px + (var(--depth, 0) * 12px)); }
  .sidebar.open .nav .nav-tree-toggle { min-height: 30px; height: 30px; padding: 0; border: 1px solid var(--border-soft); background: color-mix(in srgb, var(--surface) 78%, transparent); }
  .sidebar.open .nav-tree-row > [data-section] { padding-left: 8px; }
  .sidebar.open .nav-label { font-size: .92rem; text-transform: none; }
  .sidebar.open .nav-count { margin-left: auto; }
  .category-edit-row { grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 8px; }
  .category-edit-row .category-icon-picker,
  .category-edit-row input,
  .category-edit-row select,
  .category-edit-row .small,
  .category-edit-row .btn { grid-column: 1; width: 100%; }
  .category-icon-picker summary { justify-content: flex-start; }
  .category-icon-menu { position: static; width: 100%; max-height: 240px; margin-top: 6px; grid-template-columns: minmax(0, 1fr); box-shadow: none; }
  .main { width: 100%; padding: 14px 14px calc(18px + max(12px, env(safe-area-inset-bottom), var(--android-system-bottom))); }
  .main,
  .topbar,
  .filterbar,
  .grid,
  .home-grid,
  .home-main,
  .home-side,
  .calendar-page-grid,
  .task-page,
  .settings-shell,
  .settings-grid,
  .notes-workspace,
  .notes-grid,
  .inline-panel,
  .inline-panel.card,
  .card,
  .editor-grid,
  .inline-note-editor,
  .note-editor-form,
  .block-editor,
  .editor-block { width: 100%; max-width: 100%; min-width: 0; justify-self: stretch; overflow-x: hidden; }
  .inline-panel.card, .card { padding: 14px; }
  .settings-tabs { top: -14px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .settings-tabs::-webkit-scrollbar { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .profile-row { align-items: flex-start; }
  .profile-row > div { min-width: 0; }
  .profile-row b,
  .profile-row .small { overflow-wrap: anywhere; }
  .avatar-controls { display: grid; grid-template-columns: minmax(0, 1fr); }
  .avatar-controls input { width: 100%; flex-basis: auto; }
  .btn, input, textarea, select { max-width: 100%; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
  select { min-height: var(--control-height-touch); }
  .topbar { display: grid; align-items: stretch; }
  .topbar h1 { font-size: 1.55rem; }
  .topbar p { margin: 6px 0 0; }
  .topbar-actions { display: flex; justify-content: stretch; gap: 10px; width: 100%; }
  .topbar-actions .action-fab { flex: 1 1 0; max-width: none; min-width: 0; min-height: 44px; display: inline-grid; place-items: center; text-align: center; }
  .topbar-actions .action-fab .tool-icon { margin: 0 auto; }
  .topbar-actions .desktop-only { display: none !important; }
  .note-layout-toggle { justify-content: stretch; }
  .note-layout-toggle .btn { flex: 1; }
  .note-layout-toggle .tool-icon, .note-layout-toggle .tool-icon svg { width: 21px; height: 21px; }
  .notes-workspace.list-view .note-card { grid-template-columns: minmax(0, 1fr) minmax(0, 84px) auto; min-height: 52px; }
  .notes-workspace.list-view .note-card .pill-row { grid-column: auto; justify-content: flex-end; max-width: 84px; }
  .notes-workspace.list-view .note-card .pill { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 84px; }
  .notes-workspace.list-view .note-card .small { font-size: .7rem; }
  .filterbar { grid-template-columns: 1fr; gap: 8px; padding: 8px; }
  .filterbar.task-filter { grid-template-columns: 1fr; padding: 10px; }
  .filterbar.drive-filter { grid-template-columns: minmax(0, 1fr); }
  .filterbar.notes-filter { grid-template-columns: 1fr; }
  .filterbar.notes-filter .search { max-width: none; }
  .filter-actions { gap: 8px; }
  .filter-actions { justify-content: stretch; }
  .drive-filter .filter-actions { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 6px; width: 100%; min-width: 0; overflow: visible; padding-bottom: 0; }
  .drive-filter .drive-commandbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(76px, 88px); align-items: stretch; gap: 6px; }
  .drive-tool-group { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; justify-content: stretch; }
  .drive-filter .filter-actions .btn, .drive-layout-toggle { flex: initial; min-width: 0; }
  .drive-filter .drive-commandbar .drive-tool-btn { width: 100%; min-width: 0; min-height: 44px; padding: 8px; border-radius: var(--radius-lg); }
  .drive-filter .drive-commandbar .drive-tool-btn .tool-icon,
  .drive-filter .drive-commandbar .drive-tool-btn .tool-icon svg { width: 20px; height: 20px; }
  .drive-layout-toggle { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-self: stretch; gap: 4px; }
  .drive-layout-toggle .btn { width: 100%; min-width: 0; min-height: 44px; padding-inline: 8px; }
  .filter-actions-left { display: grid; grid-template-columns: minmax(76px, 1fr) 92px minmax(132px, 1.2fr); justify-content: stretch; align-items: center; }
  .filter-actions .btn,
  .filter-actions .note-layout-toggle,
  .filter-actions .note-sort-control { flex: 1 1 0; }
  .filter-actions-left > .btn { min-width: 0; padding-inline: 8px; }
  .filter-actions-left .note-layout-toggle { gap: 4px; }
  .filter-actions-left .note-layout-toggle .btn { min-width: 40px; padding-inline: 8px; }
  .note-sort-control { min-width: 0; padding-inline: 8px 6px; gap: 6px; }
  .note-sort-control select { font-size: .74rem; padding-right: 18px; }
  .note-filter-actions { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); }
  .note-filter-actions .btn { flex: initial; min-width: 0; }
  .search { max-width: none; }
  .two-col { grid-template-columns: 1fr; }
  .home-grid { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .home-grid.refined-home { display: flex; flex-direction: column; }
  .home-main { display: contents; }
  .home-hero { order: 1; width: 100%; align-self: stretch; }
  .home-side { order: 2; width: 100%; align-self: stretch; }
  .home-notes-widget { order: 3; width: 100%; align-self: stretch; }
  .home-hero { grid-template-columns: 1fr; gap: 10px; padding: 12px; }
  .home-hero h2 { font-size: 1.2rem; margin: 0; }
  .home-hero .breadcrumb { margin: 0; font-size: .72rem; }
  .home-stat-row { justify-content: flex-start; gap: 6px; }
  .home-search { width: 100%; }
  .home-stat-row .pill { min-height: 26px; padding: 4px 8px; font-size: .68rem; }
  .home-action-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .home-action-row .action-fab { min-width: 0; min-height: var(--control-height-touch); }
  .home-widget { width: 100%; gap: 10px; padding: 12px; border-radius: var(--radius-lg); }
  .home-widget .section-title-row h3 { font-size: .95rem; }
  .home-widget .section-title-row .btn { min-height: 34px; padding: 6px 10px; }
  .home-schedule-widget > .small.muted { margin-top: -4px; }
  .home-schedule-widget .agenda-item.large { min-height: 0; padding: 9px; }
  .home-schedule-widget .agenda-kind { min-width: 56px; font-size: .62rem; padding-inline: 6px; }
  .home-note-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .home-note-card { min-height: 96px; padding: 12px; gap: 8px; }
  .home-note-card b { font-size: .88rem; line-height: 1.2; overflow-wrap: anywhere; }
  .mini-month-card { gap: 8px; padding: 12px; }
  .mini-month-head h3 { font-size: .95rem; }
  .mini-month-weekdays, .mini-month-grid { gap: 2px; }
  .mini-month-day { min-height: 28px; font-size: .7rem; }
  .feature-toggle-grid { grid-template-columns: 1fr; }
  .calendar-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 106px; gap: 10px; align-items: stretch; width: 100%; }
  .calendar-toolbar .btn-row { width: auto; }
  .calendar-nav-row { grid-column: 1 / -1; display: grid; grid-template-columns: 44px minmax(120px, 1fr) 44px; gap: 6px; }
  .calendar-add-row { display: grid; grid-template-columns: 46px 46px; justify-content: space-between; gap: 12px; }
  .calendar-add-row .action-fab {
    min-width: 46px;
    min-height: 44px;
    padding-inline: 0;
    border-radius: var(--radius-lg);
  }
  .calendar-view-toggle { display: none; }
.calendar-view-select { display: block; min-height: 44px; font-weight: 500; text-align: center; text-align-last: center; }
  .calendar-page-grid { grid-template-columns: minmax(0, 1fr); }
  .calendar-primary, .calendar-side { width: 100%; max-width: 100%; overflow: hidden; }
  .agenda-list-day { grid-template-columns: minmax(0, 1fr); }
  .week-calendar { grid-template-columns: 58px repeat(7, minmax(96px, 1fr)); }
  .week-time-label { padding: 6px; font-size: .66rem; }
  .week-day-head { min-height: 52px; }
  .agenda-list-date { justify-items: start; align-content: start; min-height: 0; padding: 10px; text-align: left; }
  .agenda-item { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .agenda-link { grid-template-columns: minmax(0, 1fr); }
  .agenda-item.large { grid-template-columns: minmax(0, 1fr); }
  .agenda-kind { justify-self: start; }
  .calendar-day-head { display: grid; }
  .calendar-grid { gap: 4px; }
  .calendar-day { min-height: 68px; padding: 6px; font-size: .82rem; }
  .calendar-event-chip { min-height: 22px; padding-inline: 5px; font-size: .66rem; }
  .task-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .task-summary-card { min-height: 86px; padding: 12px; }
  .task-board { padding: 12px; }
  .task-board-head { align-items: flex-start; }
  .task-row { grid-template-columns: minmax(0, 1fr); gap: 10px; min-height: 0; padding: 12px; }
  .task-row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .task-meta { gap: 5px; }
  .share-row { grid-template-columns: auto minmax(0, 1fr); }
  .share-row > .btn { grid-column: 2; justify-self: start; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .drive-header { grid-template-columns: auto minmax(0, 1fr); gap: 7px; min-height: 0; padding: 7px 8px; }
  .drive-title-block { grid-template-columns: minmax(0, 1fr); }
  .drive-path-controls { gap: 5px; }
  .drive-root-mark.compact { display: none; }
  .drive-up-btn { width: 44px; min-width: 44px; height: 44px; }
  .drive-path-label { display: none; }
  .drive-breadcrumbs { min-width: 0; max-width: 100%; flex-wrap: nowrap; overflow: hidden; gap: 4px; font-size: .8rem; }
  .drive-breadcrumbs .link-button { max-width: min(92px, 34vw); min-height: 24px; padding: 1px 4px; }
  .drive-breadcrumbs .link-button[aria-current="page"] { max-width: min(128px, 42vw); }
  .drive-stats { grid-column: 2; justify-content: flex-start; gap: 5px; }
  .drive-summary { font-size: .76rem; }
  .drive-stats .pill { padding: 2px 6px; font-size: .64rem; }
  .drive-stats .pill:nth-of-type(n+4) { display: none; }
  .drive-shell::after { font-size: .82rem; text-align: center; }
  .drive-upload-status { bottom: calc(10px + var(--android-system-bottom)); padding: 10px 12px; }
  .drive-upload-status-copy { display: grid; gap: 2px; }
  .drive-bulk-actions { gap: 6px; padding: 7px; }
  .drive-bulk-actions .btn { min-height: 36px; padding: 6px 9px; }
  .drive-bulk-actions .bulk-icon-btn > span:not(.tool-icon):not(.sr-only) { display: none; }
  .drive-bulk-actions .bulk-danger-zone { margin-left: 0; padding-left: 6px; }
  .drive-items { grid-template-columns: minmax(0, 1fr); }
  .drive-list-card .drive-items { padding: 10px; }
  .drive-list-meta { display: grid; gap: 3px; padding: 8px 10px; }
  .drive-shell.list-view .drive-list-head { display: none; }
  .drive-item,
  .drive-shell.list-view .drive-item { min-height: 0; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; align-items: center; padding: 10px 12px; }
  .drive-shell.grid-view .drive-image-item { min-height: 210px; grid-template-columns: minmax(0, 1fr) 44px; grid-template-rows: auto; align-items: stretch; padding: 0; }
  .drive-shell.grid-view .drive-image-item .drive-main { grid-template-rows: 132px auto; }
  .drive-shell.grid-view .drive-image-item .drive-actions { right: 10px; bottom: 10px; }
  .drive-shell.grid-view.photo-folder .drive-items { grid-template-columns: minmax(0, 1fr); }
  .drive-main { grid-column: 1; grid-template-columns: 40px minmax(0, 1fr); }
  .drive-name-stack { min-width: 0; max-width: 100%; }
  .drive-main b,
  .drive-shell.list-view .drive-main b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .drive-shell.list-view .drive-size, .drive-shell.list-view .drive-kind, .drive-shell.list-view .drive-modified { display: none; }
  .drive-actions,
  .drive-shell.list-view .drive-actions { justify-content: flex-end; padding-top: 0; border-top: 0; }
  .drive-action-menu,
  .drive-shell.list-view .drive-action-menu { right: calc(100% + 4px); top: 50%; bottom: auto; gap: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; transform: translateY(-50%); }
  .drive-menu-toggle { min-width: 44px; min-height: 44px; }
  .drive-select { top: 50%; left: 12px; transform: translateY(-50%); }
  .image-lightbox { padding: 6px; }
  .image-lightbox-panel { width: calc(100vw - 12px); height: calc(100vh - 12px); padding: 10px; gap: 10px; }
  .preview-topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; overflow: hidden; }
  .preview-topbar h2 { flex: 1 1 auto; min-width: 0; max-width: none; }
  .preview-topbar .btn-row,
  .preview-action-row { flex: 0 0 auto; flex-wrap: nowrap; justify-content: flex-start; gap: 6px; max-width: 62vw; overflow-x: auto; overflow-y: hidden; padding-bottom: 2px; scrollbar-width: none; }
  .preview-topbar .btn-row::-webkit-scrollbar,
  .preview-action-row::-webkit-scrollbar { display: none; }
  .preview-action-row > * { flex: 0 0 auto; }
  .preview-action-row .icon-only-btn { min-width: 40px; min-height: 40px; padding-inline: 10px; }
  .file-detail-stage { padding: 10px; place-items: start stretch; }
  .file-detail-card { width: 100%; gap: 10px; }
  .file-detail-identity { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px; }
  .detail-file-mark { width: 50px; height: 50px; }
  .file-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .file-detail-meta { padding: 9px 10px; }
  .zip-preview { padding: 10px; }
  .zip-preview-head { align-items: flex-start; }
  .zip-entry { grid-template-columns: minmax(0, 1fr) auto; padding: 8px; }
  .notes-workspace,
  .notes-workspace.editor-open { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .notes-workspace:not(.editor-open) .inline-editor-slot { display: none; }
  .note-pane-resizer { display: none; }
  .notes-workspace.editor-open .notes-list-pane { display: none; }
  .notes-workspace.editor-open .notes-grid { max-height: none; overflow: visible; }
  .inline-editor-slot { width: 100%; }
  .inline-note-editor { max-height: none; min-height: calc(100vh - 92px); border-radius: 12px; padding: 0; overflow: visible; }
  .inline-note-editor.editor-panel { width: 100%; max-height: none; min-height: calc(100vh - 92px); border-radius: 12px; padding: 0; display: block; }
  .inline-note-editor.editor-panel > .topbar { top: 0; margin: 0; padding: 12px 14px; background: var(--terminal-surface); border-bottom: 1px solid var(--terminal-line); }
  .inline-note-editor .terminal-topbar { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .inline-note-editor .terminal-topbar h2 { overflow-wrap: anywhere; word-break: break-word; }
  .inline-note-editor .note-editor-form { padding: 12px 14px 0; }
  .inline-note-editor .editor-toolbar { top: 63px; }
  .inline-note-editor .note-top-actions { display: flex; gap: 10px; justify-content: flex-start; width: 100%; flex-wrap: wrap; }
  .inline-note-editor .note-top-actions .btn { min-width: 0; }
  .note-read-body { padding: 12px; }
  .note-read-body .table-wrap { overflow-x: auto; }
  .inline-secret-read { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
  .inline-secret-read b { grid-column: 1 / -1; }
  .inline-secret-read .secret-value { grid-column: 1; }
  .inline-secret-read .btn-row { grid-column: 2; grid-row: 2; flex-wrap: nowrap; gap: 6px; }
  .inline-secret-read .icon-action { min-width: 36px; width: 36px; }
  .note-card { min-height: 132px; }
  .editor { padding: 12px; place-items: center; }
  .editor-panel { width: min(540px, 100%); max-height: calc(100vh - 24px); min-height: auto; border-radius: var(--radius-xl); padding: 14px; display: grid; align-content: start; }
  .image-lightbox-panel { width: calc(100vw - 12px); height: calc(100vh - 12px); }
  .onlyoffice-editor { padding: 0; }
  .onlyoffice-editor-panel { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .editor-panel > .topbar { position: sticky; top: -14px; z-index: 4; margin: -14px -14px 12px; padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--border-soft); }
  .onlyoffice-editor-panel > .topbar { position: static; margin: 0; }
  .editor-panel > .topbar .btn { min-height: 44px; }
  .detail-dialog .topbar { grid-template-columns: minmax(0, 1fr); }
  .detail-dialog .topbar .btn-row { display: flex; flex-wrap: wrap; gap: 8px; overflow-x: hidden; padding-bottom: 2px; }
  .detail-row { grid-template-columns: 1fr; gap: 3px; }
  .editor-grid, .note-editor-form { grid-template-columns: 1fr; gap: 10px; margin-top: 8px; }
  .note-editor-panel { min-height: 100vh; }
  .note-title-input { min-height: 50px; font-size: 1.32rem; }
  .inline-note-editor .editor-toolbar,
  .inline-note-editor .paragraph-toolbar,
  .editor-toolbar { width: 100%; max-width: 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding: 2px 0 8px; border-bottom: 1px solid var(--border-soft); scrollbar-width: thin; }
  .inline-note-editor .editor-toolbar::-webkit-scrollbar,
  .inline-note-editor .paragraph-toolbar::-webkit-scrollbar,
  .editor-toolbar::-webkit-scrollbar { height: 4px; }
  .inline-note-editor .editor-toolbar > *,
  .inline-note-editor .paragraph-toolbar > * { flex: 0 0 auto; }
  .editor-toolbar select,
  .paragraph-toolbar select { min-width: 96px; }
  .details-grid { grid-template-columns: 1fr; }
  .note-compose { min-height: 50vh; font-size: 1rem; padding: 12px 0 18px; }
  .block-editor { gap: 8px; padding: 8px 0; }
  .block-editor .editor-block { padding: 6px 4px 6px 42px; }
  .block-editor .editor-block::before { left: 30px; }
  .block-editor .block-move-controls { left: 4px; top: 18px; }
  .editor-block[data-block="paragraph"] textarea { min-height: 110px; font-size: 1rem; }
  .secret-editor-block { grid-template-columns: 1fr; align-items: stretch; }
  .linked-note-create { grid-template-columns: 1fr; }
  .drawing-block canvas { height: 260px; }
  .editor-sync { flex: 1 1 100%; order: -1; }
  .tool-chip b { display: none; }
  .tool-chip { min-width: 42px; justify-content: center; }
  .add-menu .block-toolbar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .offline-shell { padding: 14px; }
  .desktop-only { display: none !important; }

  @media (min-width: 640px) {
    .filter-actions-left { grid-template-columns: 96px 106px 190px; justify-content: start; }
    .note-filter-actions { grid-template-columns: 44px 140px 140px; justify-content: end; }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .nav button { transition: background .16s ease, color .16s ease; }
}
