:root {
  --ink: #181714;
  --paper: #f3efe7;
  --card: #fffdf8;
  --line: #d8d1c5;
  --accent: #ef5b3f;
  --mint: #9bd3b2;
  --muted: #6d695f;
  --shadow: 0 20px 60px rgba(38, 33, 25, 0.09);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.site-header { height: 72px; display: flex; align-items: center; justify-content: space-between; width: min(1160px, calc(100% - 40px)); margin: auto; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 20px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; background: var(--ink); color: white; border-radius: 50%; font-family: Georgia, serif; font-style: italic; }
.stage-pill { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; letter-spacing: .05em; white-space: nowrap; }
.landing { display: grid; grid-template-columns: 1.25fr .75fr; gap: 70px; padding-block: 88px 60px; align-items: center; }
.landing-actions { display: grid; gap: 14px; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .13em; font-weight: 800; font-size: 12px; margin: 0 0 18px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: clamp(48px, 7vw, 92px); line-height: .94; letter-spacing: -.045em; margin-bottom: 28px; }
h1 em { color: var(--accent); font-weight: 400; }
.lede { font-size: 20px; line-height: 1.55; max-width: 680px; color: #4f4b44; }
.proof-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.proof-row span { background: #e6dfd3; border-radius: 999px; padding: 8px 12px; font-size: 13px; }
.card { background: var(--card); border: 1px solid rgba(24, 23, 20, .08); box-shadow: var(--shadow); border-radius: 24px; }
.create-card, .join-card { padding: 34px; }
.connect-card { padding: 24px; }
.connect-card h2 { font-family: Georgia, serif; font-size: 24px; font-weight: 500; margin-bottom: 20px; }
.connect-card .eyebrow { margin-bottom: 7px; }
.connect-card .secondary { width: 100%; }
.create-card h2 { font-family: Georgia, serif; font-size: 30px; font-weight: 500; margin: 18px 0 30px; }
.step-number { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: white; font-weight: 800; font-size: 12px; flex: 0 0 auto; }
.step-number.success { background: var(--mint); color: var(--ink); }
.step-number.dark { background: var(--ink); }
label { display: grid; gap: 8px; color: var(--muted); font-weight: 700; font-size: 13px; margin-bottom: 18px; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); padding: 14px 15px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(239, 91, 63, .12); }
textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
#task-subtasks { min-height: 108px; }
.primary, .secondary { border: 0; border-radius: 12px; padding: 15px 18px; font-weight: 800; display: inline-flex; align-items: center; justify-content: space-between; gap: 20px; }
.primary { width: 100%; background: var(--ink); color: white; }
.primary:hover { background: var(--accent); }
.primary.compact { width: auto; padding: 12px 16px; }
.secondary { background: transparent; border: 1px solid var(--ink); color: var(--ink); }
.secondary:hover { background: var(--ink); color: white; }
.text-button { border: 0; background: transparent; color: #9c2d1c; text-decoration: underline; font-size: 12px; padding: 5px; }
.fine-print, .muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
.optional { font-weight: 500; color: #918b80; }
.field-hint { color: #918b80; font-size: 11px; font-weight: 500; line-height: 1.4; }
.fine-print { margin: 14px 0 0; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-block: 1px solid var(--line); margin-bottom: 60px; }
.how article { padding: 34px; background: var(--paper); }
.how b { color: var(--accent); font-size: 12px; }
.how h3 { margin: 38px 0 8px; font-family: Georgia, serif; font-size: 26px; }
.how p { color: var(--muted); line-height: 1.5; }
.recent-spaces { padding: 50px 0 0; }
.recent-spaces:not(.hidden) + .landing { padding-top: 46px; }
.recent-spaces h2 { font-family: Georgia, serif; font-size: 36px; font-weight: 500; }
.recent-space-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.recent-space { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); text-decoration: none; font-weight: 750; }
.recent-space:hover { border-color: var(--accent); }
.centered { min-height: calc(100vh - 72px); display: grid; place-items: center; }
.join-card { width: min(480px, 100%); }
.join-card h1 { font-size: 48px; }
.workspace { padding-block: 52px 70px; }
.workspace-head { display: flex; justify-content: space-between; gap: 30px; align-items: end; margin-bottom: 32px; }
.workspace-actions { display: grid; gap: 10px; min-width: 220px; }
.workspace-head h1 { font-size: clamp(42px, 6vw, 68px); margin-bottom: 10px; }
.workspace-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 22px; align-items: start; }
.workspace-grid > * { min-width: 0; }
.capture, .today { padding: 28px; }
.section-title { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.section-title h2 { font-family: Georgia, serif; font-size: 28px; font-weight: 500; margin: 0 0 4px; }
.section-title p { margin: 0; color: var(--muted); font-size: 13px; }
.capture-actions { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.privacy-dot { font-size: 12px; color: #397b59; }
.confirm-panel { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 28px; }
.hidden { display: none !important; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.assignee-fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.assignee-fieldset legend { color: var(--muted); font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.assignee-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.assignee-option { display: inline-flex; grid-template-columns: auto 1fr; align-items: center; gap: 7px; margin: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--ink); }
.assignee-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.notify-option { display: flex; grid-template-columns: auto 1fr; align-items: flex-start; gap: 10px; margin: 4px 0 18px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: #faf8f3; }
.notify-option input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.notify-option span { display: grid; gap: 3px; }
.notify-option small { color: #777064; font-size: 11px; font-weight: 500; line-height: 1.4; }
.form-error { margin: 0 0 14px; padding: 11px 13px; border: 1px solid #d9614b; border-radius: 12px; background: #fff0ec; color: #8b2414; font-size: 13px; font-weight: 700; line-height: 1.45; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: #c33f2b; box-shadow: 0 0 0 2px rgba(195, 63, 43, .12); }
.form-actions { display: grid; gap: 8px; }
.today-title-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; }
.today-title-row .section-title { margin-bottom: 0; }
.task-view-actions { display: flex; align-items: center; gap: 8px; }
.view-toggle { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.view-toggle-button { border: 0; border-radius: 999px; padding: 7px 10px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; }
.view-toggle-button.active { background: var(--ink); color: white; }
.archive-button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 9px 12px; background: white; color: var(--ink); font-size: 12px; font-weight: 800; }
.archive-button:hover { border-color: var(--ink); }
.archive-button span { min-width: 21px; padding: 2px 6px; border-radius: 999px; background: var(--paper); text-align: center; }
.filter-panel { display: grid; gap: 12px; margin: -4px 0 18px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.filter-group { display: grid; gap: 7px; }
.filter-label { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-chip { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; background: white; color: var(--ink); font-size: 12px; font-weight: 700; }
.filter-chip.active { border-color: var(--ink); background: var(--ink); color: white; }
.task-list { display: grid; gap: 10px; }
.workspace-grid.board-view { grid-template-columns: 1fr; }
.kanban-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.kanban-column { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.kanban-column-head { display: flex; justify-content: space-between; gap: 10px; min-height: 58px; margin-bottom: 10px; }
.kanban-column-head h3 { margin: 0 0 4px; font-family: Georgia, serif; font-size: 17px; font-weight: 600; }
.kanban-column-head p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.35; }
.kanban-column-head > span { align-self: start; min-width: 24px; padding: 3px 7px; border-radius: 999px; background: white; color: var(--muted); text-align: center; font-size: 11px; font-weight: 800; }
.kanban-attention { border-color: #e9b8ae; background: #fff3f0; }
.kanban-today { border-color: #ddc886; background: #fff9e8; }
.kanban-column-list { display: grid; gap: 9px; }
.kanban-card { padding: 12px; gap: 9px; }
.kanban-card .task-head { display: grid; }
.kanban-card .task-actions { flex-wrap: wrap; }
.kanban-card .task-meta { gap: 5px; }
.kanban-card .task-meta span { padding: 3px 5px; font-size: 10px; }
.kanban-card .completion-row { font-size: 12px; }
.kanban-empty { padding: 26px 10px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; font-size: 12px; }
.task { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.task.done { opacity: .52; }
.task.done .task-title { text-decoration: line-through; }
.task-check { width: 24px; height: 24px; margin: 0; accent-color: var(--accent); }
.task-check:disabled { opacity: .45; cursor: not-allowed; }
.task-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.task-title { font-weight: 750; overflow-wrap: anywhere; }
.task-actions { display: flex; gap: 8px; }
.task-action { border: 0; background: transparent; color: var(--muted); padding: 2px 4px; font-size: 12px; text-decoration: underline; }
.task-action.delete { color: #9c2d1c; }
.task-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.task-meta span { font-size: 11px; color: var(--muted); padding: 4px 7px; background: var(--paper); border-radius: 6px; }
.task-meta .overdue { background: #ffe1dc; color: #9c2d1c; }
.task-meta .priority-badge { background: #fff0c9; color: #805d00; font-weight: 800; }
.progress-track { height: 6px; border-radius: 999px; background: #e7e0d5; overflow: hidden; }
.progress-fill { height: 100%; background: var(--mint); border-radius: inherit; }
.task-today-note { font-size: 12px; color: var(--muted); }
.task-today-note.missed { color: #9c2d1c; }
.completion-list { display: grid; gap: 7px; padding-top: 10px; border-top: 1px solid var(--line); }
.subtask-block { display: grid; gap: 8px; margin-top: 12px; padding: 11px; border-radius: 12px; background: #f6f2eb; }
.subtask-summary { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.subtask-list { display: grid; gap: 6px; }
.subtask-row { display: flex; align-items: start; gap: 8px; font-size: 12px; line-height: 1.4; cursor: pointer; }
.subtask-row input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--success); }
.subtask-row.done span { color: var(--muted); text-decoration: line-through; }
.subtask-more { color: var(--muted); font-size: 10px; }
.completion-row { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 9px; margin: 0; color: var(--ink); font-size: 13px; font-weight: 650; }
.completion-row input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.empty { border: 1px dashed var(--line); padding: 44px 20px; border-radius: 14px; color: var(--muted); text-align: center; }
.experiment-note { margin-top: 22px; padding: 18px 22px; border-left: 4px solid var(--accent); background: #e9e2d7; color: var(--muted); line-height: 1.5; }
.experiment-note b { color: var(--ink); }
.workspace-exit { display: grid; justify-items: center; gap: 5px; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; }
.workspace-exit .text-button { color: #746f66; }
.workspace-exit p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.detail-overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(24, 23, 20, .58); }
.detail-card { width: min(720px, 100%); max-height: min(86vh, 860px); overflow: auto; padding: 28px; }
.device-code-card { width: min(520px, 100%); padding: 28px; }
.device-code-card h2 { font-family: Georgia, serif; font-size: 32px; font-weight: 500; margin-bottom: 8px; }
.device-code-value { margin: 24px 0 10px; padding: 18px; border: 1px dashed var(--line); border-radius: 14px; background: var(--paper); text-align: center; font-size: clamp(30px, 8vw, 46px); font-weight: 850; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.telegram-open { margin-top: 14px; text-decoration: none; }
.telegram-relink { width: 100%; margin-top: 10px; }
.warning-note { margin: 18px 0 0; padding: 12px 14px; border: 1px solid #d9614b; border-radius: 12px; background: #fff0ec; color: #7d2b1e; font-size: 12px; line-height: 1.5; }
.device-code-card hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.detail-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.detail-head h2 { font-family: Georgia, serif; font-size: 32px; font-weight: 500; margin-bottom: 8px; }
.detail-close { border: 1px solid var(--line); border-radius: 50%; background: white; width: 38px; height: 38px; font-size: 24px; line-height: 1; }
.detail-days { display: grid; gap: 10px; margin-top: 24px; }
.archive-list { display: grid; gap: 10px; margin-top: 24px; }
.archive-item { display: grid; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.archive-item-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.archive-item-actions { display: flex; gap: 8px; }
.detail-day { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.detail-day-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.day-status { padding: 4px 8px; border-radius: 999px; background: var(--paper); color: var(--muted); font-size: 11px; }
.day-status.done { background: #dff3e7; color: #276746; }
.day-status.missed { background: #ffe1dc; color: #9c2d1c; }
.day-status.today { background: #fff0c9; color: #805d00; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); opacity: 0; transition: .2s ease; padding: 12px 18px; background: var(--ink); color: white; border-radius: 999px; z-index: 10; box-shadow: var(--shadow); }
#toast.show { transform: translate(-50%, 0); opacity: 1; }
.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; }

@media (max-width: 800px) {
  .landing, .workspace-grid { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
  .landing { gap: 36px; padding-top: 56px; }
  .how { grid-template-columns: 1fr; }
  .workspace-head { align-items: stretch; flex-direction: column; }
  .workspace-actions { width: 100%; }
  .workspace-head .secondary { width: 100%; align-self: stretch; }
}

@media (max-width: 520px) {
  .shell, .site-header { width: min(100% - 24px, 1160px); }
  h1 { font-size: 45px; }
  .create-card, .join-card, .capture, .today { padding: 21px; border-radius: 18px; }
  .capture-actions { align-items: stretch; flex-direction: column; }
  .primary.compact { width: 100%; }
  .two-columns { grid-template-columns: 1fr; }
  .task-head { align-items: flex-start; }
  .today-title-row { align-items: flex-start; flex-direction: column; }
  .task-view-actions { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
