:root {
  --paper: #f4efe7;
  --paper-light: #fbf8f3;
  --ink: #24221f;
  --muted: #817a70;
  --line: #d9d0c4;
  --terracotta: #c55b42;
  --terracotta-dark: #994432;
  --sage: #a9b5a0;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', 'Segoe UI', sans-serif;
  --mono: 'DM Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  min-width: 320px;
}
body::before {
  background-image: radial-gradient(rgba(91, 71, 52, .08) .7px, transparent .7px);
  background-size: 9px 9px;
  content: '';
  inset: 0;
  opacity: .28;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.auth-screen { align-items: center; background: var(--paper); display: flex; min-height: 100vh; padding: 48px; position: relative; }
.auth-panel { margin: 0 auto; max-width: 430px; width: 100%; }
.auth-brand { margin-bottom: 82px; }
.auth-panel .eyebrow { margin-bottom: 16px; }
.auth-panel h1 { font-size: clamp(42px, 6vw, 66px); }
.auth-copy { color: var(--muted); font-size: 13px; margin: 26px 0 32px; }
.auth-tabs { border-bottom: 1px solid var(--line); display: flex; gap: 24px; margin-bottom: 26px; }
.auth-tab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12px; margin-bottom: -1px; padding: 0 0 12px; }
.auth-tab.active { border-color: var(--terracotta); color: var(--ink); font-weight: 700; }
.auth-form { display: grid; gap: 17px; }
.field-group { display: grid; gap: 8px; }
.field-group label { color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.field-group input { background: var(--paper-light); border: 1px solid var(--line); color: var(--ink); font-size: 13px; outline: 0; padding: 14px 15px; }
.field-group input:focus { border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(197, 91, 66, .1); }
.auth-error { color: var(--terracotta-dark); font-size: 12px; margin: -3px 0 -2px; }
.auth-submit { background: var(--ink); border: 1px solid var(--ink); color: var(--paper); font-size: 12px; font-weight: 700; min-height: 49px; padding: 0 18px; text-align: left; transition: background .2s, transform .2s; }
.auth-submit span { float: right; font-size: 18px; font-weight: 400; line-height: 1; }
.auth-submit:hover { background: var(--terracotta-dark); transform: translateY(-1px); }
.auth-note { color: var(--muted); font-size: 10px; margin: 18px 0 0; }
.auth-aside { bottom: 29px; color: var(--muted); display: flex; font-family: var(--mono); font-size: 9px; justify-content: space-between; left: 48px; letter-spacing: .12em; position: absolute; right: 48px; text-transform: uppercase; }
.app-shell { margin: 0 auto; max-width: 1180px; padding: 0 48px; }
.topbar { align-items: center; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr 1fr; height: 82px; }
.brand { align-items: center; color: var(--ink); display: inline-flex; font-size: 15px; font-weight: 800; gap: 9px; letter-spacing: -.04em; text-decoration: none; }
.brand-mark { color: var(--terracotta); font-size: 22px; line-height: 1; }
.date-stamp { color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-align: center; text-transform: uppercase; }
.topbar-actions { align-items: center; display: flex; gap: 13px; justify-content: flex-end; }
.user-name { color: var(--muted); font-size: 11px; }
.avatar { align-items: center; background: var(--ink); border: 0; border-radius: 50%; color: var(--paper); display: flex; font-family: var(--mono); font-size: 10px; height: 34px; justify-content: center; padding: 0; width: 34px; }
.avatar:hover { background: var(--terracotta-dark); }
.profile-wrap { position: relative; }
.profile-menu { background: var(--paper-light); border: 1px solid var(--line); box-shadow: 0 14px 35px rgba(36, 34, 31, .12); min-width: 220px; padding: 17px; position: absolute; right: 0; top: 45px; z-index: 10; }
.profile-menu-name { font-size: 13px; font-weight: 700; margin: 0 0 4px; }
.profile-menu-email { color: var(--muted); font-family: var(--mono); font-size: 9px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu-divider { border-top: 1px solid var(--line); margin: 15px 0 8px; }
.profile-menu-item { align-items: center; background: transparent; border: 0; color: var(--ink); display: flex; font-size: 12px; justify-content: space-between; padding: 10px 0; text-align: left; width: 100%; }
.profile-menu-item:hover { color: var(--terracotta-dark); }
.profile-menu-item span { color: var(--muted); font-size: 15px; }
.logout-item { color: var(--terracotta-dark); }
.profile-dialog { align-items: center; background: rgba(36, 34, 31, .3); display: flex; inset: 0; justify-content: center; padding: 22px; position: fixed; z-index: 20; }
.profile-dialog-panel { background: var(--paper-light); box-shadow: 0 20px 60px rgba(36, 34, 31, .2); max-width: 440px; padding: 30px; width: 100%; }
.profile-dialog-header { align-items: start; display: flex; justify-content: space-between; margin-bottom: 25px; }
.profile-dialog-header .eyebrow { margin-bottom: 9px; }
.profile-dialog-header h2 { font-size: 27px; }
.dialog-close { background: transparent; border: 0; color: var(--muted); font-size: 27px; line-height: .8; padding: 0 0 0 15px; }
.dialog-close:hover { color: var(--terracotta-dark); }
.profile-form { display: grid; gap: 17px; }
.profile-form input:disabled { color: var(--muted); cursor: not-allowed; }
.profile-form-actions { align-items: center; display: flex; gap: 16px; justify-content: flex-end; margin-top: 8px; }
.profile-form-actions .auth-submit { min-height: 44px; }
.dialog-cancel { background: transparent; border: 0; color: var(--muted); font-size: 12px; }
.dialog-cancel:hover { color: var(--ink); }
.main-content { padding: 76px 0 86px; }
.intro-block { align-items: end; display: flex; justify-content: space-between; margin-bottom: 62px; }
.eyebrow, .stat-label { color: var(--terracotta-dark); font-family: var(--mono); font-size: 10px; letter-spacing: .15em; margin: 0 0 14px; text-transform: uppercase; }
h1 { font-size: clamp(42px, 6vw, 74px); font-weight: 500; letter-spacing: -.065em; line-height: .98; margin: 0; }
h1 em { color: var(--terracotta); font-family: var(--serif); font-weight: 400; letter-spacing: -.06em; }
.intro-copy { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 0 0 4px; text-align: right; }
.overview { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr 2fr; margin-bottom: 70px; }
.overview-stat, .progress-stat { min-height: 142px; padding: 28px 30px; }
.overview-stat + .overview-stat, .progress-stat { border-left: 1px solid var(--line); }
.primary-stat { background: rgba(197, 91, 66, .08); }
.overview strong { display: block; font-family: var(--serif); font-size: 52px; font-weight: 400; letter-spacing: -.06em; line-height: 1; margin-bottom: 8px; }
.stat-caption { color: var(--muted); font-size: 11px; }
.progress-header { display: flex; justify-content: space-between; }
.progress-percent { font-family: var(--mono); font-size: 12px; }
.progress-track { background: var(--line); height: 5px; margin: 28px 0 12px; overflow: hidden; }
.progress-track span { background: var(--terracotta); display: block; height: 100%; transition: width .35s ease; width: 0; }
.section-heading { align-items: end; display: flex; justify-content: space-between; margin-bottom: 25px; }
.section-heading .eyebrow { margin-bottom: 10px; }
h2 { font-size: 30px; letter-spacing: -.06em; margin: 0; }
.filters { display: flex; gap: 7px; }
.filter-button { background: transparent; border: 1px solid transparent; color: var(--muted); font-size: 11px; padding: 8px 12px; }
.filter-button:hover, .filter-button.active { border-color: var(--line); color: var(--ink); }
.filter-button.active { background: var(--paper-light); }
.add-task-form { display: flex; gap: 10px; margin-bottom: 20px; }
.add-task-form input { background: var(--paper-light); border: 1px solid var(--line); color: var(--ink); flex: 1; font-size: 13px; outline: 0; padding: 16px 18px; transition: border-color .2s, box-shadow .2s; }
.add-task-form input::placeholder { color: #aaa196; }
.add-task-form input:focus { border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(197, 91, 66, .1); }
.add-button { background: var(--ink); border: 1px solid var(--ink); color: var(--paper); font-size: 12px; font-weight: 700; padding: 0 23px; transition: background .2s, transform .2s; }
.add-button:hover { background: var(--terracotta-dark); transform: translateY(-1px); }
.add-button span { font-size: 18px; font-weight: 400; vertical-align: -1px; }
.task-list { display: flex; flex-direction: column; }
.task-item { align-items: center; animation: slide-in .3s ease both; border-bottom: 1px solid var(--line); display: flex; gap: 16px; min-height: 72px; padding: 13px 4px; }
.task-item:first-child { border-top: 1px solid var(--line); }
.task-check { appearance: none; border: 1px solid #b5ab9e; border-radius: 50%; flex: 0 0 19px; height: 19px; margin: 0; position: relative; width: 19px; }
.task-check:hover { border-color: var(--terracotta); }
.task-check:checked { background: var(--terracotta); border-color: var(--terracotta); }
.task-check:checked::after { border-bottom: 1.5px solid white; border-right: 1.5px solid white; content: ''; height: 8px; left: 6px; position: absolute; top: 3px; transform: rotate(42deg); width: 4px; }
.task-title { flex: 1; font-size: 13px; line-height: 1.4; }
.task-item.completed .task-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--terracotta); }
.delete-button { background: none; border: 0; color: #b0a79c; font-size: 20px; line-height: 1; opacity: 0; padding: 5px 8px; transition: color .2s, opacity .2s; }
.task-item:hover .delete-button, .delete-button:focus { opacity: 1; }
.delete-button:hover { color: var(--terracotta-dark); }
.empty-state { border: 1px dashed var(--line); padding: 53px 20px; text-align: center; }
.empty-icon { color: var(--terracotta); display: block; font-size: 29px; margin-bottom: 13px; }
.empty-state h3 { font-family: var(--serif); font-size: 23px; font-weight: 400; margin: 0 0 8px; }
.empty-state p { color: var(--muted); font-size: 12px; margin: 0; }
.footer { border-top: 1px solid var(--line); color: var(--muted); display: flex; font-family: var(--mono); font-size: 9px; justify-content: space-between; letter-spacing: .12em; padding: 20px 0 25px; text-transform: uppercase; }
.sr-only { height: 1px; margin: -1px; overflow: hidden; position: absolute; width: 1px; clip: rect(0, 0, 0, 0); }
@keyframes slide-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 700px) {
  .auth-screen { padding: 30px 22px 75px; }
  .auth-brand { margin-bottom: 60px; }
  .auth-aside { bottom: 22px; left: 22px; right: 22px; }
  .app-shell { padding: 0 22px; }
  .topbar { grid-template-columns: 1fr auto; }
  .date-stamp { display: none; }
  .user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .main-content { padding: 48px 0 60px; }
  .intro-block { align-items: start; display: block; margin-bottom: 44px; }
  h1 { font-size: clamp(42px, 13vw, 64px); }
  .intro-copy { margin-top: 24px; text-align: left; }
  .overview { grid-template-columns: 1fr 1fr; margin-bottom: 50px; }
  .overview-stat, .progress-stat { min-height: 125px; padding: 23px 18px; }
  .progress-stat { border-left: 0; border-top: 1px solid var(--line); grid-column: 1 / -1; }
  .overview strong { font-size: 42px; }
  .section-heading { align-items: start; display: block; }
  .filters { margin-top: 21px; }
  .add-task-form { display: block; }
  .add-task-form input { width: 100%; }
  .add-button { margin-top: 9px; min-height: 49px; width: 100%; }
  .delete-button { opacity: 1; }
  .footer { gap: 15px; line-height: 1.6; }
}
