:root {
  --bg: #070a12;
  --bg-soft: #0c111d;
  --surface: rgba(18, 24, 38, 0.9);
  --surface-strong: #151d2d;
  --surface-hover: #1a2437;
  --ink: #eef5ff;
  --muted: #8e9bb1;
  --line: rgba(148, 163, 184, 0.18);
  --accent: #36d399;
  --accent-strong: #15b981;
  --cyan: #38bdf8;
  --violet: #a78bfa;
  --rose: #fb7185;
  --warning: #facc15;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  --glow-a: rgba(54, 211, 153, 0.18);
  --glow-b: rgba(56, 189, 248, 0.16);
  --page-end: #070a12;
  --body-bg:
    radial-gradient(circle at 18% 8%, var(--glow-a), transparent 28%),
    radial-gradient(circle at 88% 4%, var(--glow-b), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 52%, var(--page-end) 100%);
  --topbar-bg: rgba(7, 10, 18, 0.78);
  --card-bg: linear-gradient(180deg, rgba(22, 30, 46, 0.96), rgba(15, 21, 34, 0.96));
  --focus-card-bg: linear-gradient(180deg, rgba(22, 30, 46, 0.98), rgba(14, 20, 32, 0.98));
  --login-bg: rgba(18, 24, 38, 0.94);
  --input-bg: rgba(255, 255, 255, 0.06);
  --button-bg: rgba(255, 255, 255, 0.06);
  --note-bg: rgba(255, 255, 255, 0.04);
  --empty-bg: rgba(255, 255, 255, 0.025);
  --menu-bg: #111827;
  --reminder-bg: rgba(250, 204, 21, 0.08);
  --reminder-border: rgba(250, 204, 21, 0.24);
  --avatar-bg: linear-gradient(135deg, rgba(54, 211, 153, 0.22), rgba(56, 189, 248, 0.2));
  --card-radius: 14px;
  --control-radius: 10px;
}

body[data-theme="deep-work"] {
  --bg: #050816;
  --bg-soft: #0a1022;
  --surface: rgba(15, 23, 42, 0.92);
  --surface-strong: #111827;
  --ink: #eef2ff;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.2);
  --accent: #818cf8;
  --accent-strong: #6366f1;
  --cyan: #22d3ee;
  --violet: #c084fc;
  --rose: #fb7185;
  --warning: #fbbf24;
  --glow-a: rgba(129, 140, 248, 0.18);
  --glow-b: rgba(34, 211, 238, 0.14);
  --page-end: #070b18;
}

body[data-theme="forest"] {
  --bg: #07110d;
  --bg-soft: #0d1c15;
  --surface: rgba(17, 34, 26, 0.92);
  --surface-strong: #14251d;
  --ink: #ecfdf5;
  --muted: #9bb8aa;
  --line: rgba(167, 243, 208, 0.16);
  --accent: #34d399;
  --accent-strong: #10b981;
  --cyan: #5eead4;
  --violet: #a7f3d0;
  --rose: #fb7185;
  --warning: #fde047;
  --glow-a: rgba(52, 211, 153, 0.18);
  --glow-b: rgba(94, 234, 212, 0.12);
  --page-end: #06100c;
}

body[data-theme="steel"] {
  --bg: #081018;
  --bg-soft: #111c28;
  --surface: rgba(19, 30, 43, 0.93);
  --surface-strong: #172434;
  --ink: #eef6ff;
  --muted: #9aa9bb;
  --line: rgba(148, 163, 184, 0.22);
  --accent: #60a5fa;
  --accent-strong: #3b82f6;
  --cyan: #67e8f9;
  --violet: #93c5fd;
  --rose: #f87171;
  --warning: #facc15;
  --glow-a: rgba(96, 165, 250, 0.16);
  --glow-b: rgba(103, 232, 249, 0.12);
  --page-end: #07111b;
}

body[data-theme="graphite"] {
  --bg: #09090b;
  --bg-soft: #121214;
  --surface: rgba(24, 24, 27, 0.94);
  --surface-strong: #202024;
  --ink: #fafafa;
  --muted: #a1a1aa;
  --line: rgba(212, 212, 216, 0.14);
  --accent: #d4d4d8;
  --accent-strong: #a1a1aa;
  --cyan: #94a3b8;
  --violet: #e4e4e7;
  --rose: #f43f5e;
  --warning: #eab308;
  --glow-a: rgba(212, 212, 216, 0.08);
  --glow-b: rgba(148, 163, 184, 0.1);
  --page-end: #09090b;
}

body[data-theme="sandstone"] {
  --bg: #040617;
  --bg-soft: #080d24;
  --surface: rgba(11, 18, 42, 0.94);
  --surface-strong: #101936;
  --ink: #eff6ff;
  --muted: #91a4c7;
  --line: rgba(147, 197, 253, 0.16);
  --accent: #a16207;
  --accent-strong: #854d0e;
  --cyan: #0f766e;
  --violet: #d6a756;
  --rose: #be123c;
  --warning: #ca8a04;
  --glow-a: rgba(217, 119, 6, 0.14);
  --glow-b: rgba(15, 118, 110, 0.1);
  --page-end: #eee2c9;
}

body[data-theme="violet"] {
  --bg: #120807;
  --bg-soft: #1c0f0b;
  --surface: rgba(36, 20, 15, 0.94);
  --surface-strong: #2b1711;
  --ink: #fff7ed;
  --muted: #d1a995;
  --line: rgba(251, 146, 60, 0.18);
  --accent: #7c3aed;
  --accent-strong: #6d28d9;
  --cyan: #06b6d4;
  --violet: #c084fc;
  --rose: #e11d48;
  --warning: #d97706;
  --glow-a: rgba(124, 58, 237, 0.15);
  --glow-b: rgba(6, 182, 212, 0.1);
  --page-end: #f3e8ff;
}

body[data-theme="focus-blue"] {
  --bg: #06131f;
  --bg-soft: #0d2133;
  --surface: rgba(15, 34, 52, 0.94);
  --surface-strong: #132d45;
  --ink: #f0f9ff;
  --muted: #9fc5dc;
  --line: rgba(125, 211, 252, 0.16);
  --accent: #0ea5e9;
  --accent-strong: #0284c7;
  --cyan: #06b6d4;
  --violet: #7dd3fc;
  --rose: #fb7185;
  --warning: #facc15;
  --glow-a: rgba(14, 165, 233, 0.18);
  --glow-b: rgba(6, 182, 212, 0.12);
  --page-end: #06111d;
}

body[data-theme="olive"] {
  --bg: #0d1007;
  --bg-soft: #171d0e;
  --surface: rgba(28, 36, 18, 0.94);
  --surface-strong: #222b16;
  --ink: #f7fee7;
  --muted: #b8c89b;
  --line: rgba(190, 242, 100, 0.16);
  --accent: #84cc16;
  --accent-strong: #65a30d;
  --cyan: #bef264;
  --violet: #a3e635;
  --rose: #fb7185;
  --warning: #facc15;
  --glow-a: rgba(132, 204, 22, 0.16);
  --glow-b: rgba(190, 242, 100, 0.1);
  --page-end: #0b0f06;
}

body[data-theme="clean-light"] {
  --bg: #eef3f6;
  --bg-soft: #e7eef3;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #f4f7fa;
  --ink: #111827;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.12);
  --accent: #0f766e;
  --accent-strong: #0d9488;
  --cyan: #0284c7;
  --violet: #4f46e5;
  --rose: #e11d48;
  --warning: #ca8a04;
  --shadow: 0 18px 55px rgba(15, 23, 42, 0.12);
  --glow-a: rgba(15, 118, 110, 0.11);
  --glow-b: rgba(2, 132, 199, 0.1);
  --page-end: #eef3f6;
}

body[data-theme="aurora"] {
  --body-bg:
    radial-gradient(circle at 14% 8%, rgba(54, 211, 153, 0.24), transparent 27%),
    radial-gradient(circle at 86% 10%, rgba(167, 139, 250, 0.22), transparent 29%),
    linear-gradient(135deg, #071019 0%, #0a1224 45%, #07141b 100%);
  --card-bg: linear-gradient(160deg, rgba(18, 28, 45, 0.82), rgba(12, 20, 35, 0.94));
  --focus-card-bg: linear-gradient(145deg, rgba(27, 39, 62, 0.9), rgba(12, 24, 36, 0.96));
  --topbar-bg: rgba(7, 13, 23, 0.72);
  --input-bg: rgba(255, 255, 255, 0.07);
  --button-bg: rgba(255, 255, 255, 0.07);
  --note-bg: rgba(255, 255, 255, 0.055);
  --menu-bg: #111827;
  --avatar-bg: linear-gradient(135deg, rgba(54, 211, 153, 0.28), rgba(167, 139, 250, 0.24));
  --card-radius: 18px;
  --control-radius: 12px;
}

body[data-theme="hortus"] {
  --bg: #071316;
  --bg-soft: #0d2022;
  --surface: rgba(13, 32, 34, 0.94);
  --surface-strong: #102a2d;
  --ink: #f3fbf7;
  --muted: #9bb7b1;
  --line: rgba(92, 211, 188, 0.18);
  --accent: #58c8a8;
  --accent-strong: #2fa782;
  --cyan: #43d6d8;
  --violet: #d6b25e;
  --rose: #ef6f7f;
  --warning: #f1c75b;
  --shadow: 0 22px 70px rgba(2, 23, 25, 0.5);
  --body-bg:
    radial-gradient(circle at 20% 10%, rgba(88, 200, 168, 0.2), transparent 28%),
    radial-gradient(circle at 90% 14%, rgba(67, 214, 216, 0.14), transparent 28%),
    linear-gradient(140deg, #061113 0%, #0d2022 48%, #071316 100%);
  --card-bg: linear-gradient(165deg, rgba(16, 42, 45, 0.96), rgba(8, 22, 25, 0.98));
  --focus-card-bg: linear-gradient(145deg, rgba(24, 59, 59, 0.96), rgba(9, 24, 27, 0.98));
  --topbar-bg: rgba(6, 17, 19, 0.86);
  --login-bg: var(--card-bg);
  --input-bg: rgba(255, 255, 255, 0.065);
  --button-bg: rgba(88, 200, 168, 0.09);
  --note-bg: rgba(88, 200, 168, 0.06);
  --empty-bg: rgba(255, 255, 255, 0.025);
  --menu-bg: #102225;
  --reminder-bg: rgba(214, 178, 94, 0.12);
  --reminder-border: rgba(214, 178, 94, 0.24);
  --avatar-bg: linear-gradient(135deg, rgba(88, 200, 168, 0.3), rgba(67, 214, 216, 0.18));
  --card-radius: 14px;
  --control-radius: 8px;
}

body[data-theme="edy365"] {
  --bg: #f4fbff;
  --bg-soft: #e8f7fb;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #eef9fb;
  --ink: #14303f;
  --muted: #557182;
  --line: rgba(0, 160, 190, 0.14);
  --accent: #12b9c8;
  --accent-strong: #0797a7;
  --cyan: #3bd477;
  --violet: #f4c430;
  --rose: #ef476f;
  --warning: #f7b801;
  --shadow: 0 18px 55px rgba(24, 105, 127, 0.14);
  --body-bg:
    radial-gradient(circle at 14% 12%, rgba(18, 185, 200, 0.18), transparent 28%),
    radial-gradient(circle at 92% 10%, rgba(59, 212, 119, 0.14), transparent 26%),
    linear-gradient(180deg, #f9fdff 0%, #e8f7fb 100%);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 250, 252, 0.95));
  --focus-card-bg: linear-gradient(145deg, rgba(224, 249, 252, 0.98), rgba(255, 255, 255, 0.96));
  --topbar-bg: rgba(244, 251, 255, 0.88);
  --login-bg: var(--card-bg);
  --input-bg: rgba(255, 255, 255, 0.84);
  --button-bg: rgba(18, 185, 200, 0.085);
  --note-bg: rgba(18, 185, 200, 0.065);
  --empty-bg: rgba(255, 255, 255, 0.46);
  --menu-bg: #ffffff;
  --reminder-bg: rgba(247, 184, 1, 0.14);
  --reminder-border: rgba(247, 184, 1, 0.22);
  --avatar-bg: linear-gradient(135deg, #b6f3f7, #c7f9d7);
  --card-radius: 22px;
  --control-radius: 999px;
}

body[data-theme="deep-work"] {
  --body-bg:
    linear-gradient(rgba(129, 140, 248, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129, 140, 248, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 76% 12%, rgba(99, 102, 241, 0.18), transparent 28%),
    linear-gradient(180deg, #050816 0%, #090d1f 100%);
  background-size: 34px 34px, 34px 34px, auto, auto;
  --card-bg: linear-gradient(180deg, rgba(10, 16, 34, 0.98), rgba(7, 11, 24, 0.98));
  --focus-card-bg: linear-gradient(180deg, rgba(30, 35, 78, 0.92), rgba(9, 13, 32, 0.98));
  --topbar-bg: rgba(5, 8, 22, 0.88);
  --input-bg: rgba(129, 140, 248, 0.08);
  --button-bg: rgba(129, 140, 248, 0.1);
  --note-bg: rgba(129, 140, 248, 0.075);
  --menu-bg: #0f1430;
  --avatar-bg: linear-gradient(135deg, rgba(129, 140, 248, 0.32), rgba(34, 211, 238, 0.16));
  --card-radius: 10px;
  --control-radius: 8px;
}

body[data-theme="forest"],
body[data-theme="steel"],
body[data-theme="sandstone"],
body[data-theme="violet"],
body[data-theme="focus-blue"],
body[data-theme="olive"],
body[data-theme="clean-light"] {
  --login-bg: var(--card-bg);
}

body[data-theme="forest"] {
  --body-bg:
    radial-gradient(circle at 18% 18%, rgba(52, 211, 153, 0.2), transparent 24%),
    linear-gradient(135deg, #eef8ef 0%, #dcefe5 42%, #cfe8d8 100%);
  --surface: rgba(255, 255, 255, 0.9);
  --ink: #102019;
  --muted: #5d7669;
  --line: rgba(28, 77, 55, 0.15);
  --shadow: 0 18px 45px rgba(36, 68, 50, 0.16);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(236, 248, 241, 0.92));
  --focus-card-bg: linear-gradient(145deg, rgba(218, 244, 229, 0.98), rgba(255, 255, 255, 0.94));
  --topbar-bg: rgba(238, 248, 241, 0.84);
  --input-bg: rgba(255, 255, 255, 0.86);
  --button-bg: rgba(14, 78, 52, 0.08);
  --note-bg: rgba(15, 118, 110, 0.065);
  --empty-bg: rgba(255, 255, 255, 0.45);
  --menu-bg: #ffffff;
  --reminder-bg: rgba(254, 240, 138, 0.42);
  --avatar-bg: linear-gradient(135deg, #bbf7d0, #ccfbf1);
  --card-radius: 22px;
  --control-radius: 14px;
}

body[data-theme="steel"] {
  --body-bg:
    linear-gradient(120deg, rgba(255, 255, 255, 0.06), transparent 35%),
    linear-gradient(180deg, #dce5ec 0%, #aebdca 100%);
  --surface: rgba(245, 248, 251, 0.92);
  --ink: #0f172a;
  --muted: #526173;
  --line: rgba(15, 23, 42, 0.14);
  --shadow: 0 20px 55px rgba(34, 50, 70, 0.18);
  --card-bg: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(225, 232, 239, 0.94));
  --focus-card-bg: linear-gradient(145deg, rgba(239, 246, 255, 0.98), rgba(211, 224, 237, 0.96));
  --topbar-bg: rgba(226, 235, 243, 0.84);
  --input-bg: rgba(255, 255, 255, 0.72);
  --button-bg: rgba(30, 64, 175, 0.08);
  --note-bg: rgba(59, 130, 246, 0.07);
  --empty-bg: rgba(255, 255, 255, 0.36);
  --menu-bg: #f8fafc;
  --avatar-bg: linear-gradient(135deg, #bfdbfe, #e2e8f0);
  --card-radius: 8px;
  --control-radius: 6px;
}

body[data-theme="graphite"] {
  --body-bg:
    linear-gradient(135deg, #151515 0%, #09090b 45%, #222 100%);
  --card-bg: linear-gradient(180deg, #202024, #111113);
  --focus-card-bg: linear-gradient(145deg, #2a2a30, #141416);
  --topbar-bg: rgba(10, 10, 12, 0.88);
  --input-bg: rgba(255, 255, 255, 0.08);
  --button-bg: rgba(255, 255, 255, 0.075);
  --note-bg: rgba(255, 255, 255, 0.055);
  --menu-bg: #18181b;
  --avatar-bg: linear-gradient(135deg, #3f3f46, #18181b);
  --card-radius: 4px;
  --control-radius: 4px;
}

body[data-theme="sandstone"] {
  --body-bg:
    linear-gradient(90deg, rgba(120, 113, 108, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, #fbf2df 0%, #efe1c2 100%);
  background-size: 32px 32px, auto;
  --surface: rgba(255, 251, 235, 0.94);
  --ink: #2c2115;
  --muted: #7c6b58;
  --line: rgba(92, 64, 35, 0.15);
  --shadow: 0 16px 42px rgba(92, 64, 35, 0.14);
  --card-bg: linear-gradient(180deg, rgba(255, 251, 235, 0.98), rgba(243, 230, 203, 0.94));
  --focus-card-bg: linear-gradient(145deg, rgba(250, 240, 214, 0.98), rgba(255, 251, 235, 0.95));
  --topbar-bg: rgba(251, 242, 223, 0.86);
  --input-bg: rgba(255, 255, 255, 0.7);
  --button-bg: rgba(161, 98, 7, 0.08);
  --note-bg: rgba(161, 98, 7, 0.07);
  --empty-bg: rgba(255, 255, 255, 0.34);
  --menu-bg: #fffbeb;
  --reminder-bg: rgba(217, 119, 6, 0.12);
  --reminder-border: rgba(161, 98, 7, 0.18);
  --avatar-bg: linear-gradient(135deg, #fef3c7, #ccfbf1);
  --card-radius: 14px;
  --control-radius: 10px;
}

body[data-theme="violet"] {
  --body-bg:
    radial-gradient(circle at 22% 18%, rgba(196, 181, 253, 0.34), transparent 26%),
    linear-gradient(135deg, #faf5ff 0%, #ede9fe 48%, #e0f2fe 100%);
  --surface: rgba(255, 255, 255, 0.94);
  --ink: #211334;
  --muted: #6b5a7e;
  --line: rgba(109, 40, 217, 0.13);
  --shadow: 0 18px 48px rgba(88, 28, 135, 0.13);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(245, 243, 255, 0.94));
  --focus-card-bg: linear-gradient(145deg, rgba(237, 233, 254, 0.98), rgba(255, 255, 255, 0.95));
  --topbar-bg: rgba(250, 245, 255, 0.86);
  --input-bg: rgba(255, 255, 255, 0.78);
  --button-bg: rgba(124, 58, 237, 0.075);
  --note-bg: rgba(124, 58, 237, 0.06);
  --empty-bg: rgba(255, 255, 255, 0.36);
  --menu-bg: #ffffff;
  --reminder-bg: rgba(196, 181, 253, 0.22);
  --reminder-border: rgba(124, 58, 237, 0.16);
  --avatar-bg: linear-gradient(135deg, #ddd6fe, #bae6fd);
  --card-radius: 20px;
  --control-radius: 14px;
}

body[data-theme="focus-blue"] {
  --body-bg:
    linear-gradient(135deg, #e0f2fe 0%, #f8fafc 46%, #dbeafe 100%);
  --surface: rgba(255, 255, 255, 0.94);
  --ink: #082f49;
  --muted: #52708a;
  --line: rgba(2, 132, 199, 0.14);
  --shadow: 0 18px 55px rgba(14, 116, 144, 0.14);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.94));
  --focus-card-bg: linear-gradient(145deg, rgba(224, 242, 254, 0.98), rgba(255, 255, 255, 0.95));
  --topbar-bg: rgba(224, 242, 254, 0.84);
  --input-bg: rgba(255, 255, 255, 0.8);
  --button-bg: rgba(14, 165, 233, 0.08);
  --note-bg: rgba(14, 165, 233, 0.07);
  --empty-bg: rgba(255, 255, 255, 0.38);
  --menu-bg: #ffffff;
  --avatar-bg: linear-gradient(135deg, #bae6fd, #dbeafe);
  --card-radius: 16px;
  --control-radius: 10px;
}

body[data-theme="olive"] {
  --body-bg:
    linear-gradient(90deg, rgba(63, 98, 18, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, #f7f5e8 0%, #e7e4c8 100%);
  background-size: 28px 28px, auto;
  --surface: rgba(255, 253, 240, 0.94);
  --ink: #20240f;
  --muted: #73744e;
  --line: rgba(77, 83, 34, 0.16);
  --shadow: 0 16px 42px rgba(70, 76, 37, 0.14);
  --card-bg: linear-gradient(180deg, rgba(255, 253, 240, 0.98), rgba(239, 236, 206, 0.92));
  --focus-card-bg: linear-gradient(145deg, rgba(236, 252, 203, 0.88), rgba(255, 253, 240, 0.96));
  --topbar-bg: rgba(247, 245, 232, 0.86);
  --input-bg: rgba(255, 255, 255, 0.68);
  --button-bg: rgba(101, 163, 13, 0.08);
  --note-bg: rgba(132, 204, 22, 0.08);
  --empty-bg: rgba(255, 255, 255, 0.34);
  --menu-bg: #fffdf0;
  --reminder-bg: rgba(254, 240, 138, 0.32);
  --avatar-bg: linear-gradient(135deg, #d9f99d, #fef3c7);
  --card-radius: 2px;
  --control-radius: 2px;
}

body[data-theme="clean-light"] {
  --body-bg:
    linear-gradient(180deg, #f8fafc 0%, #eef3f6 100%);
  --card-bg: #ffffff;
  --focus-card-bg: linear-gradient(180deg, #ffffff, #f6f9fc);
  --topbar-bg: rgba(248, 250, 252, 0.9);
  --input-bg: #ffffff;
  --button-bg: #f1f5f9;
  --note-bg: #f8fafc;
  --empty-bg: #f8fafc;
  --menu-bg: #ffffff;
  --avatar-bg: linear-gradient(135deg, #ccfbf1, #e0f2fe);
  --card-radius: 12px;
  --control-radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--body-bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
}

h2 {
  font-size: 19px;
  line-height: 1.1;
}

h3 {
  font-size: 16px;
  line-height: 1.25;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--body-bg);
}

.login-screen.hidden {
  display: none;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--login-bg);
  box-shadow: var(--shadow);
}

.login-error {
  min-height: 20px;
  color: var(--rose);
  font-weight: 800;
}

.login-help {
  font-size: 14px;
}

.hidden-step {
  display: none;
}

.app-shell {
  min-height: 100vh;
}

.app-shell.locked {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) minmax(300px, 470px);
  align-items: center;
  gap: 18px;
  padding: 16px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(20px);
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.theme-picker {
  width: 210px;
  min-width: 210px;
  gap: 4px;
  font-size: 11px;
}

.theme-picker select {
  min-height: 38px;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.quick-add {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 38px;
  gap: 8px;
  min-width: 260px;
}

.brand-block {
  min-width: 150px;
}

.today-label {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: capitalize;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

.account-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.account-tab {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  padding: 0 14px;
  color: var(--muted);
  background: var(--button-bg);
  font-weight: 900;
}

.account-tab.active {
  color: #04110d;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  gap: 18px;
  padding: 20px clamp(16px, 3vw, 34px) 34px;
}

.main-column,
.notes-column {
  min-width: 0;
}

.task-grid {
  column-count: 2;
  column-gap: 14px;
  margin-bottom: 14px;
}

.focus-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.focus-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--focus-card-bg);
  box-shadow: var(--shadow);
}

.focus-card.today {
  border-color: rgba(250, 204, 21, 0.4);
}

.focus-card.overdue {
  border-color: rgba(251, 113, 133, 0.5);
}

.focus-card h3 {
  margin-top: 9px;
}

.focus-meta,
.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.focus-meta {
  margin-top: 10px;
}

.top-task-grid {
  column-count: 2;
}

.task-card,
.person-card,
.sticky-panel,
.modal-card {
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.task-card {
  position: relative;
  display: grid;
  gap: 12px;
  break-inside: avoid;
  min-height: 230px;
  margin: 0 0 14px;
  padding: 16px;
  overflow: visible;
}

.task-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--cyan), var(--violet));
  opacity: 0.78;
}

.task-card.today::before {
  background: var(--warning);
}

.task-card.overdue::before {
  background: var(--rose);
}

.task-card.done {
  opacity: 0.62;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.card-title h3,
.assignment-title {
  overflow-wrap: anywhere;
}

.priority-chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  padding: 5px 8px;
  border-radius: var(--control-radius);
  background: rgba(54, 211, 153, 0.13);
  border: 1px solid rgba(54, 211, 153, 0.28);
}

.priority-icons {
  font-size: 11px;
  white-space: nowrap;
}

.priority-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.status-chip,
.due-chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: var(--control-radius);
  background: var(--button-bg);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.status-chip.blocked,
.due-chip.overdue {
  color: #fecdd3;
  border-color: rgba(251, 113, 133, 0.34);
  background: rgba(251, 113, 133, 0.1);
}

.status-chip.waiting,
.due-chip.today {
  color: #fef3c7;
  border-color: rgba(250, 204, 21, 0.34);
  background: rgba(250, 204, 21, 0.1);
}

.status-chip.in-progress {
  color: #bae6fd;
  border-color: rgba(56, 189, 248, 0.34);
  background: rgba(56, 189, 248, 0.1);
}

.status-chip.done {
  color: #bbf7d0;
  border-color: rgba(54, 211, 153, 0.34);
  background: rgba(54, 211, 153, 0.1);
}

.description {
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.progress-row {
  display: grid;
  gap: 8px;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.progress-control {
  width: 100%;
  height: 9px;
  border: 0;
  padding: 0;
  accent-color: var(--accent);
  background: transparent;
}

.comment-stack {
  display: grid;
  gap: 7px;
}

.comment-details {
  display: grid;
  gap: 8px;
}

.comment-details summary {
  width: fit-content;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  list-style: none;
  cursor: pointer;
}

.comment-details summary::-webkit-details-marker {
  display: none;
}

.comment-details summary::after {
  content: " +";
  color: var(--accent);
}

.comment-details[open] summary::after {
  content: " -";
}

.comment-list {
  display: grid;
  gap: 7px;
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
}

.comment-item,
.person-note {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-left: 3px solid var(--accent);
  padding: 8px 10px;
  background: var(--note-bg);
  border-radius: var(--control-radius);
}

.note-body div:last-child {
  white-space: pre-wrap;
}

.comment-date {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 4px;
}

.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: end;
  gap: 8px;
}

.comment-form textarea {
  min-width: 0;
  min-height: 58px;
  max-height: 170px;
  resize: vertical;
  line-height: 1.4;
}

.action-menu {
  position: relative;
  justify-self: end;
  z-index: 3;
}

.action-menu summary {
  display: grid;
  place-items: center;
  width: 32px;
  height: 30px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--button-bg);
  font-size: 18px;
  font-weight: 1000;
  line-height: 1;
  list-style: none;
  cursor: pointer;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu-list {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  min-width: 145px;
  display: grid;
  gap: 4px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--menu-bg);
  box-shadow: var(--shadow);
}

.action-menu-list button {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-weight: 850;
}

.action-menu-list button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.people-section {
  margin-top: 18px;
}

.add-person-button {
  margin-bottom: 14px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading.compact {
  margin-bottom: 14px;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.person-card {
  position: relative;
  display: grid;
  gap: 13px;
  min-height: 320px;
  padding: 16px;
}

.person-identity {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.person-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: calc(var(--card-radius) + 2px);
  background: var(--avatar-bg);
  border: 1px solid rgba(54, 211, 153, 0.28);
  color: var(--ink);
  font-size: 24px;
  font-weight: 1000;
}

.person-action-menu {
  position: absolute;
  top: 0;
  right: 0;
}

.person-action-menu .action-menu-list {
  top: calc(100% + 7px);
}

.assignment-list,
.person-notes {
  display: grid;
  gap: 8px;
}

.assignment-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border-radius: var(--control-radius);
  background: var(--note-bg);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.assignment-item.done {
  opacity: 0.6;
}

.assignment-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.assignment-priority {
  color: var(--accent);
  font-size: 11px;
  font-weight: 1000;
}

.assignment-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.person-notes-details {
  display: grid;
  gap: 8px;
}

.person-notes-details summary {
  width: fit-content;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  list-style: none;
  cursor: pointer;
}

.person-notes-details summary::-webkit-details-marker {
  display: none;
}

.person-notes-details summary::after {
  content: " +";
  color: var(--accent);
}

.person-notes-details[open] summary::after {
  content: " -";
}

.person-notes {
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
}

.sticky-panel {
  position: sticky;
  top: 92px;
  padding: 16px;
}

.reminder-list {
  display: grid;
  gap: 12px;
}

.reminder-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--reminder-border);
  border-radius: var(--card-radius);
  background: var(--reminder-bg);
}

.reminder-card textarea {
  min-height: 86px;
  max-height: 280px;
  resize: vertical;
  background: transparent;
  border: 0;
  padding: 0;
  line-height: 1.45;
}

.reminder-card textarea:focus {
  outline: 2px solid rgba(250, 204, 21, 0.24);
  border-radius: 8px;
}

.empty-state {
  min-height: 135px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed rgba(148, 163, 184, 0.24);
  border-radius: var(--card-radius);
  color: var(--muted);
  line-height: 1.45;
  padding: 18px;
  background: var(--empty-bg);
}

.primary-button,
.secondary-button,
.tiny-button,
.danger-button,
.icon-button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  font-weight: 950;
}

.primary-button {
  color: #04110d;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  padding: 0 16px;
  white-space: nowrap;
}

.primary-button.wide {
  width: 100%;
}

.secondary-button,
.tiny-button {
  color: var(--ink);
  background: var(--button-bg);
  border-color: var(--line);
  padding: 0 12px;
}

.danger-button {
  color: #fff;
  background: var(--rose);
  padding: 0 12px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  padding: 0;
  color: var(--ink);
  background: var(--button-bg);
  border-color: var(--line);
  font-size: 19px;
}

.tiny-button {
  min-height: 30px;
  font-size: 12px;
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.modal-card {
  width: min(560px, calc(100vw - 28px));
  display: grid;
  gap: 14px;
  padding: 20px;
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-actions {
  justify-content: flex-end;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  padding: 10px 11px;
  background: var(--input-bg);
  color: var(--ink);
}

select option {
  color: #111827;
}

body[data-theme="clean-light"] input,
body[data-theme="clean-light"] textarea,
body[data-theme="clean-light"] select {
  background: rgba(255, 255, 255, 0.9);
}

body[data-theme="clean-light"] .topbar {
  background: rgba(238, 243, 246, 0.82);
}

body[data-theme="clean-light"] .action-menu-list {
  background: #ffffff;
}

textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 1220px) {
  .people-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .quick-add {
    min-width: 0;
  }

  .account-tabs {
    justify-content: flex-start;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sticky-panel {
    position: static;
  }
}

@media (max-width: 780px) {
  .task-grid {
    column-count: 1;
  }

  .top-task-grid {
    column-count: 1;
  }

  .people-grid {
    grid-template-columns: 1fr;
  }

  .form-row,
  .comment-form {
    grid-template-columns: 1fr;
  }

  .top-actions {
    display: grid;
  }

  .brand-block {
    min-width: 0;
  }
}
