:root {
  color-scheme: light;
  --bg: #f1f3f6;
  --card: #fff;
  --text: #253044;
  --muted: #6b7585;
  --border: #dfe4ec;
  --note: #eef0f4;
  --accent: #3898ff;
  --accent-soft: #e9f3ff;
  --accent-text: #1767b9;
  --hover: rgba(100,116,139,.07);
  --top: rgba(241,243,246,.92);
  --shadow: 0 4px 18px rgba(34,46,68,.035);
  --danger: #ae403d;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; --bg: #121722; --card: #1f2633; --text: #e6e9ef; --muted: #a1acbd; --border: #3b4556; --note: #2a3240; --accent: #60a5fa; --accent-soft: #233b58; --accent-text: #a2ccff; --hover: rgba(180,195,220,.08); --top: rgba(18,23,34,.92); --shadow: none; --danger: #ffaaa1; }
}
html[data-theme="dark"] { color-scheme: dark; --bg: #121722; --card: #1f2633; --text: #e6e9ef; --muted: #a1acbd; --border: #3b4556; --note: #2a3240; --accent: #60a5fa; --accent-soft: #233b58; --accent-text: #a2ccff; --hover: rgba(180,195,220,.08); --top: rgba(18,23,34,.92); --shadow: none; --danger: #ffaaa1; }
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font-sans); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
[hidden] { display: none !important; }
button, select, input { font: inherit; color: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button, select { border: 0; }
a { color: var(--accent-text); text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
button:disabled { cursor: default; }
button, a, select { transition: background-color .16s ease, color .16s ease, opacity .16s ease, border-color .16s ease; }
::selection { background: rgba(74,140,255,.25); }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; background: var(--card); padding: 12px 16px; border-radius: 10px; }
.skip-link:focus { top: 12px; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--top); border-bottom: 1px solid var(--border); padding-top: env(safe-area-inset-top); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.topbar-inner { min-height: 72px; max-width: 1216px; margin: 0 auto; padding: 0 max(20px,env(safe-area-inset-right)) 0 max(20px,env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 19px; font-weight: 750; letter-spacing: -.7px; line-height: 1.15; white-space: nowrap; }
.brand img { display: block; border-radius: 9px; }
.brand-label { display: block; font-size: 8px; font-weight: 650; letter-spacing: 2.3px; color: var(--muted); margin-top: 4px; }
.header-actions { display: flex; align-items: center; gap: 3px; }
.icon-button { display: inline-flex; width: 44px; min-width: 44px; height: 44px; padding: 11px; align-items: center; justify-content: center; border-radius: 12px; background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--hover); color: var(--text); }
.icon-button svg { width: 22px; height: 22px; flex-shrink: 0; }
.mock-badge { font-size: 10px; line-height: 1.5; font-weight: 650; color: var(--accent-text); background: var(--accent-soft); border-radius: 6px; padding: 3px 7px; }
.main-shell { max-width: 1180px; margin: 0 auto; padding: 25px max(20px,env(safe-area-inset-right)) calc(110px + env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left)); }
.workspace-bar { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.workspace-field { min-width: 0; max-width: calc(100% - 90px); }
.workspace-field label { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; color: var(--muted); display: block; margin-bottom: 1px; }
.select-wrap { position: relative; display: flex; align-items: center; }
.select-wrap svg { position: absolute; right: 1px; width: 20px; height: 20px; pointer-events: none; color: var(--muted); }
#workspaceSelect { padding: 5px 29px 6px 0; min-height: 40px; max-width: 100%; background: transparent; font-weight: 650; font-size: 18px; letter-spacing: -.4px; appearance: none; -webkit-appearance: none; overflow: hidden; text-overflow: ellipsis; }
#workspaceSelect option { color: var(--text); background: var(--card); }
.read-only-badge { flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; padding: 5px 0 0; }
.read-only-badge svg { width: 15px; height: 15px; }
.board-tabs { display: flex; gap: 7px; overflow-x: auto; padding: 15px 1px 17px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.board-tabs::-webkit-scrollbar { display: none; }
.board-tab { border-radius: 10px; padding: 10px 16px; min-height: 44px; flex-shrink: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 550; white-space: nowrap; }
.board-tab:hover { background: var(--hover); }
.board-tab[aria-pressed="true"], .board-tab.active { background: var(--card); color: var(--text); box-shadow: 0 1px 5px rgba(30,45,65,.06); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 22px; }
.eyebrow { margin: 0 0 7px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .4px; }
h1 { margin: 0; font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -1.15px; overflow-wrap: anywhere; }
.heading-decoration { color: var(--accent); font-size: 29px; padding-right: 5px; font-weight: 400; opacity: .65; }
.sync-status { color: var(--muted); font-size: 11px; margin: 10px 0 23px; min-height: 17px; }
.message-box { margin: 0 0 20px; padding: 15px 17px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--danger); font-size: 13px; }
.content-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 20px; align-items: start; outline: none; }
.group-card, .goal-card, .view-section { min-width: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.group-card[data-group-id] { border-top: 4px solid var(--group-color,var(--border)); }
.group-header { display: flex; gap: 12px; align-items: center; padding: 22px 20px 17px; }
.group-emoji { font-size: 29px; line-height: 1.3; flex-shrink: 0; }
.group-title { font-size: 16px; line-height: 1.35; font-weight: 650; letter-spacing: -.25px; margin: 0; min-width: 0; }
.count-badge { background: var(--note); color: var(--muted); border-radius: 6px; font-size: 10px; font-weight: 500; line-height: 1.5; padding: 2px 7px; flex-shrink: 0; margin-left: auto; }
.group-items { display: flex; flex-direction: column; gap: 12px; padding: 0 18px 20px; }
.tab-link { display: flex; align-items: center; gap: 12px; min-height: 56px; border-radius: 9px; padding: 6px 3px; text-decoration: none; color: var(--text); }
.tab-link:hover { background: var(--hover); }
.tab-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--note); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 15px; color: var(--muted); font-weight: 600; }
.tab-icon img { width: 20px; height: 20px; object-fit: contain; border-radius: 3px; }
.tab-text { min-width: 0; flex: 1; }
.tab-title { display: block; font-size: 14px; font-weight: 550; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-url { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.external-icon { color: var(--muted); opacity: .55; font-size: 15px; padding-right: 3px; flex-shrink: 0; }
.note-card { padding: 14px; background: var(--note); border-radius: 9px; color: var(--text); }
.note-card.has-color { background: var(--item-color,var(--note)); }
html[data-theme="dark"] .note-card.has-color { background: color-mix(in srgb,var(--item-color) 22%,var(--note)); }
.note-body, .rich-text, .md { white-space: normal; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.note-body p, .rich-text p, .md p { margin: 0 0 10px; }
.note-body > :last-child, .rich-text > :last-child, .md > :last-child { margin-bottom: 0; }
.note-body h1,.note-body h2,.note-body h3,.rich-text h1,.rich-text h2,.rich-text h3,.md h1,.md h2,.md h3 { margin: 12px 0 7px; font-size: 16px; font-weight: 650; line-height: 1.35; letter-spacing: -.25px; }
.note-body :is(h4,h5,h6),.rich-text :is(h4,h5,h6),.md :is(h4,h5,h6) { font-size: 14px; margin: 10px 0 6px; }
.note-body ul,.note-body ol,.rich-text ul,.rich-text ol,.md ul,.md ol { padding-left: 20px; margin: 6px 0 10px; }
.note-body li,.rich-text li,.md li { margin: 3px 0; }
.note-body pre,.rich-text pre,.md pre { white-space: pre-wrap; padding: 12px; background: var(--bg); border-radius: 7px; overflow-wrap: anywhere; font-size: 12px; }
.note-body code,.rich-text code,.md code { font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: .87em; background: var(--hover); border-radius: 3px; padding: 1px 3px; }
.note-body pre code,.rich-text pre code,.md pre code { padding: 0; background: transparent; }
.md-check { display: inline-flex; width: 17px; height: 17px; margin: 0 7px 0 0; vertical-align: -3px; border: 1.5px solid var(--muted); border-radius: 5px; background: transparent; padding: 0; opacity: .8; color: var(--accent-text); justify-content: center; align-items: center; pointer-events: none; }
.md-check[aria-checked="true"] { background: var(--accent-soft); border-color: var(--accent); }
.todo-item { display: flex; align-items: flex-start; gap: 11px; padding: 13px 12px; background: var(--note); border-radius: 9px; }
.todo-check { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; min-width: 20px; margin-top: 2px; border: 1.5px solid var(--muted); border-radius: 6px; background: transparent; color: var(--accent-text); font-size: 13px; line-height: 1; padding: 0; }
.todo-check:disabled { opacity: .7; }
.todo-body { min-width: 0; flex: 1; }
.todo-title { font-size: 14px; line-height: 1.5; font-weight: 400; }
.todo-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 10px; line-height: 1.6; color: var(--muted); margin-top: 7px; }
.todo-meta .overdue,.overdue { color: var(--danger); }
.todo-item.is-done .todo-title { text-decoration: line-through; color: var(--muted); }
.todo-item.is-done .todo-check { border-color: var(--accent); background: var(--accent-soft); }
.view-notice { grid-column: 1/-1; color: var(--muted); font-size: 12px; line-height: 1.65; margin: 0; padding: 2px 1px 6px; }
.view-section { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.section-heading { font-size: 13px; font-weight: 650; color: var(--muted); letter-spacing: .1px; margin: 0 0 3px; }
.source-link { color: var(--muted); font-size: 11px; text-decoration: none; background: transparent; padding: 0; text-align: left; }
.source-link:hover { color: var(--accent-text); text-decoration: underline; }
.goal-card { padding: 20px; }
.goal-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.goal-heading h2,.goal-heading h3 { font-size: 16px; font-weight: 600; margin: 0; line-height: 1.4; }
.goal-progress { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); margin: 15px 0 7px; }
.progress-track { background: var(--note); border-radius: 99px; height: 6px; overflow: hidden; }
.progress-fill { background: var(--accent); border-radius: 99px; height: 100%; }
.empty-state,.loading-state { grid-column: 1/-1; padding: 48px 24px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--border); border-radius: 16px; }
.empty-state h2 { font-size: 18px; color: var(--text); margin: 10px 0; font-weight: 600; }
.empty-state p { font-size: 13px; max-width: 340px; margin: 0 auto; }
.empty-state .empty-icon { display: block; font-size: 30px; opacity: .7; }
.loading-state { animation: breathe 1.5s ease-in-out infinite alternate; }
@keyframes breathe { to { opacity: .45; } }
.view-nav { position: fixed; z-index: 25; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; padding: 9px max(12px,env(safe-area-inset-right)) calc(9px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); border-top: 1px solid var(--border); background: var(--top); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); gap: 10px; }
.view-button { display: flex; flex: 1; max-width: 160px; min-height: 55px; flex-direction: column; gap: 5px; align-items: center; justify-content: center; background: transparent; color: var(--muted); border-radius: 12px; font-size: 10px; font-weight: 550; }
.view-button > svg,.nav-icon-wrap > svg { width: 21px; height: 21px; display: block; }
.view-button:hover { background: var(--hover); }
.view-button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }
.nav-icon-wrap { position: relative; }
.nav-count { position: absolute; top: -4px; left: 16px; background: var(--accent); color: #fff; border: 2px solid var(--bg); border-radius: 99px; font-size: 8px; padding: 0 4px; font-weight: 700; line-height: 13px; min-width: 17px; }
.install-hint { display: flex; gap: 12px; align-items: center; padding: 15px; margin-top: 28px; border: 1px solid var(--border); border-radius: 13px; background: var(--card); }
.install-hint img { border-radius: 10px; flex-shrink: 0; }
.install-hint p { flex: 1; font-size: 11px; line-height: 1.6; color: var(--muted); margin: 0; }
.install-hint strong { font-size: 12px; font-weight: 600; color: var(--text); }
.install-hint .icon-button { width: 30px; min-width: 30px; height: 38px; padding: 3px; font-size: 24px; }
.auth-panel { text-align: center; padding: 35px 0 0; max-width: 440px; margin: 0 auto; }
.auth-panel .eyebrow { margin: 32px 0 13px; font-size: 11px; }
.auth-panel h1 { font-size: clamp(38px,10vw,48px); letter-spacing: -2px; line-height: 1.12; }
.welcome-copy { font-size: 14px; color: var(--muted); line-height: 1.8; margin: 19px 0 27px; }
.primary-button { display: inline-flex; min-height: 52px; align-items: center; justify-content: center; gap: 30px; padding: 13px 24px; background: #3898ff; color: #fff; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 4px 15px rgba(56,152,255,.16); }
.primary-button:hover { background: #2f86ef; }
.primary-button:disabled { opacity: .5; }
.primary-button span { font-size: 19px; font-weight: 400; }
.auth-status { font-size: 11px; color: var(--muted); line-height: 1.7; margin: 18px auto; max-width: 330px; }
.auth-footnote { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 10px; margin-top: 32px; }
.auth-footnote svg { width: 13px; height: 13px; }
.clerk-mount { margin: 24px auto 0; max-width: 100%; display: flex; justify-content: center; }
.clerk-mount:empty { display: none; }
.clerk-mount > * { max-width: 100%; }
.welcome-art { width: 230px; height: 163px; position: relative; margin: 0 auto; }
.art-window { width: 218px; height: 143px; padding: 11px 12px; position: absolute; left: 2px; top: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 13px; box-shadow: 0 14px 35px rgba(20,40,70,.06); transform: rotate(-5deg); text-align: left; }
.art-dot { display: inline-block; width: 4px; height: 4px; background: var(--border); border-radius: 100%; margin: 0 1px; vertical-align: top; }
.art-columns { display: flex; gap: 7px; padding-top: 10px; }
.art-columns > div { flex: 1; padding: 7px 6px; border: 1px solid var(--border); border-radius: 6px; height: 95px; }
.art-columns i { display: block; width: 12px; height: 12px; border-radius: 4px; background: #dbeafe; margin-bottom: 9px; }
.art-columns > div:nth-child(2) i { background: #e4dafa; }
.art-columns > div:nth-child(3) i { background: #d4eddd; }
.art-columns b { display: block; height: 5px; background: var(--border); border-radius: 4px; margin-bottom: 9px; width: 100%; }
.art-columns b:nth-child(3) { width: 70%; }
.art-columns em { display: block; background: var(--note); height: 23px; border-radius: 4px; margin-bottom: 9px; }
.art-spark { position: absolute; top: 1px; right: -3px; color: var(--accent); font-size: 35px; transform: rotate(12deg); }
@media (max-width: 360px) { .topbar-inner { padding-left: 15px; padding-right: 10px; } .header-actions { gap: 0; } .brand { font-size: 17px; gap: 7px; } .brand img { width: 29px; height: 29px; } .mock-badge { padding: 2px 4px; font-size: 9px; } .main-shell { padding-left: 15px; padding-right: 15px; } .icon-button { width: 39px; min-width: 39px; } }
@media (min-width: 640px) { .content-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .main-shell { padding-top: 34px; } .page-heading { margin-top: 30px; } .auth-panel { padding-top: 65px; } .view-nav { gap: 20px; } }
@media (min-width: 1000px) { .content-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } .topbar-inner { min-height: 80px; } .main-shell { padding-top: 35px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *,*::before,*::after { animation: none !important; transition: none !important; } }
/* Shared card markup keeps the same spacing in Today and Goals. */
.view-section.group-card,.goal-card.group-card { padding: 0; gap: 0; }
.goal-card .goal-progress { display: block; margin: 0 20px 20px; }
.goal-progress p { margin: 0 0 9px; }
.group-empty { color: var(--muted); font-size: 12px; margin: 0; padding: 3px 0; }
.group-card { scroll-margin-top: calc(95px + env(safe-area-inset-top)); }
.filter-button { grid-column: 1/-1; justify-self: start; background: var(--card); color: var(--muted); border: 1px solid var(--border); padding: 10px 14px; min-height: 44px; border-radius: 10px; font-size: 12px; }
.filter-button:hover { color: var(--text); background: var(--hover); }
.filter-button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.note-emoji { font-size: 19px; display: block; margin-bottom: 7px; }
.md-task { list-style: none; }
.todo-check { margin: 2px 0 0; accent-color: var(--accent); }
.tab-stack { margin: 4px 0 3px 12px; padding-left: 12px; border-left: 1px solid var(--border); }
.tab-stack summary { color: var(--muted); font-size: 11px; padding: 8px 0; cursor: pointer; min-height: 36px; }
.tab-stack .tab-link { min-height: 50px; }
.message-box:not(.is-error) { color: var(--muted); }
.is-refreshing svg { animation: rotate 1.2s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }
.source-link { display: flex; align-items: center; min-height: 44px; width: 100%; padding: 6px 0; line-height: 1.5; }
.kanban-card-title { margin: 0 0 8px; font-size: 14px; font-weight: 650; line-height: 1.5; }
