:root {
  --ink: #17211d;
  --muted: #6f7772;
  --paper: #f4f2ed;
  --surface: #fffefa;
  --line: #deddd6;
  --green: #173f36;
  --green-2: #2b5b4e;
  --acid: #e9ff95;
  --orange: #da7046;
  --red: #b9443d;
  --blue: #386a89;
  --shadow: 0 18px 50px rgba(24, 35, 30, .12);
  --safe-top: max(18px, env(safe-area-inset-top));
  --safe-bottom: max(12px, env(safe-area-inset-bottom));
}

.auth-shell{min-height:100dvh;display:grid;place-items:center;padding:24px;background:var(--cream,#f4f2ed)}
.auth-card{width:min(100%,420px);background:#fff;border-radius:28px;padding:34px 28px;box-shadow:0 24px 80px rgba(28,45,39,.13)}
.auth-card h1{font-size:48px;line-height:.94;margin:12px 0 18px;letter-spacing:-2px}
.auth-copy{color:#65716c;line-height:1.5;margin-bottom:24px}
.auth-message{padding:12px 14px;border-radius:12px;background:#fff1e8;color:#8f3e1c;margin-bottom:18px;font-size:14px}
.text-button{width:100%;border:0;background:transparent;padding:14px;color:var(--green,#174d3d);font-weight:700}
.account-button{border:0;cursor:pointer}

* { box-sizing: border-box; }
html { background: #d9d8d2; color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, textarea, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

#app { min-height: 100vh; }
.shell { min-height: 100vh; padding: var(--safe-top) 18px calc(96px + var(--safe-bottom)); background: var(--paper); }
.screen { max-width: 720px; margin: 0 auto; animation: appear .2s ease; }
@keyframes appear { from { opacity: .4; transform: translateY(4px); } }

.eyebrow { margin: 0 0 7px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(32px, 9vw, 46px); line-height: .99; letter-spacing: -.055em; }
h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
h3 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
p { line-height: 1.45; }
.muted { color: var(--muted); }
.accent { color: var(--green); }
.row { display: flex; align-items: center; gap: 12px; }
.row.spread { justify-content: space-between; }
.stack { display: grid; gap: 10px; }

.topbar { display: flex; align-items: flex-start; justify-content: space-between; margin: 10px 2px 22px; }
.avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; background: var(--green); color: var(--acid); font-weight: 850; letter-spacing: -.04em; }
.avatar.small { width: 39px; height: 39px; flex-basis: 39px; font-size: 13px; }
.avatar.company { border-radius: 12px; background: #e2e7e2; color: var(--green); }
.avatar.project { border-radius: 12px; background: #e9e4d6; color: #725e38; }

.searchbox { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 3px 12px rgba(30,40,35,.04); color: var(--muted); text-align: left; }
.searchbox input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 16px; }
.kbd { margin-left: auto; padding: 4px 7px; border-radius: 7px; background: #eeece6; font-size: 11px; }

.hero { overflow: hidden; position: relative; margin-top: 14px; min-height: 200px; padding: 22px; border-radius: 27px; background: var(--green); color: white; box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -46px; bottom: -66px; width: 180px; height: 180px; border: 42px solid rgba(233,255,149,.14); border-radius: 50%; }
.hero-kicker { color: #b8c7c1; font-size: 12px; font-weight: 700; }
.hero h2 { max-width: 280px; margin-top: 8px; font-size: 29px; line-height: 1.04; color: #fff; }
.hero .due { display: inline-flex; align-items: center; gap: 8px; margin-top: 24px; padding: 9px 12px; border-radius: 999px; background: var(--acid); color: var(--green); font-size: 13px; font-weight: 800; }

.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 12px; }
.section-head button { border: 0; background: none; color: var(--green-2); font-size: 13px; font-weight: 750; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.quick { min-height: 91px; padding: 13px 10px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); text-align: left; }
.quick .iconbox { display: grid; place-items: center; width: 33px; height: 33px; margin-bottom: 10px; border-radius: 10px; background: #e8ede9; color: var(--green); }
.quick b { display: block; font-size: 13px; }

.list { overflow: hidden; border: 1px solid var(--line); border-radius: 21px; background: var(--surface); }
.list-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 70px; padding: 12px 14px; border: 0; border-bottom: 1px solid #e9e7e1; background: transparent; text-align: left; }
.list-item:last-child { border-bottom: 0; }
.list-copy { min-width: 0; flex: 1; }
.list-title { display: block; overflow: hidden; font-size: 15px; font-weight: 770; text-overflow: ellipsis; white-space: nowrap; }
.list-sub { display: block; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.chevron { color: #a0a59f; font-size: 20px; }
.date-chip { align-self: flex-start; padding: 6px 9px; border-radius: 9px; background: #f0ede5; color: #625d51; font-size: 11px; font-weight: 800; }
.date-chip.overdue { background: #fae3de; color: var(--red); }
.date-chip.today { background: var(--acid); color: var(--green); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.stat { padding: 15px; border-top: 1px solid var(--line); }
.stat strong { display: block; font-size: 25px; letter-spacing: -.04em; }
.stat span { color: var(--muted); font-size: 11px; font-weight: 700; }

.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: 14px 0; padding: 4px; border-radius: 14px; background: #e8e6df; }
.tabs button { min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 750; }
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px rgba(30,40,35,.08); }

.filter-row { display: flex; gap: 7px; overflow-x: auto; margin: 12px -18px 14px; padding: 0 18px 4px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.pill { min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.active { border-color: var(--green); background: var(--green); color: white; }
.tag { display: inline-flex; align-items: center; min-height: 27px; padding: 0 9px; border-radius: 999px; background: #e8ede9; color: var(--green); font-size: 11px; font-weight: 750; }

.nav { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); min-height: calc(70px + var(--safe-bottom)); padding: 7px max(8px, calc((100vw - 720px)/2)) var(--safe-bottom); border-top: 1px solid rgba(190,190,182,.75); background: rgba(250,249,245,.93); backdrop-filter: blur(22px); }
.nav button { display: grid; place-items: center; align-content: center; gap: 3px; border: 0; background: transparent; color: #737b76; font-size: 10px; font-weight: 680; }
.nav button.active { color: var(--green); }
.nav .add-orb { width: 47px; height: 47px; margin: -18px auto 0; border-radius: 50%; background: var(--green); color: var(--acid); box-shadow: 0 9px 22px rgba(23,63,54,.28); font-size: 28px; font-weight: 300; }

.page-title { margin: 12px 2px 18px; }
.page-title h1 { font-size: 38px; }
.count { color: var(--muted); font-size: 13px; }
.empty { padding: 36px 22px; color: var(--muted); text-align: center; }

.overlay { position: fixed; z-index: 50; inset: 0; display: flex; align-items: flex-end; justify-content: center; background: rgba(19,28,24,.38); backdrop-filter: blur(5px); animation: fade .16s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet { overflow: auto; width: min(100%, 720px); max-height: 94vh; padding: 10px 18px calc(24px + var(--safe-bottom)); border-radius: 28px 28px 0 0; background: var(--paper); box-shadow: 0 -18px 55px rgba(20,30,25,.17); animation: rise .22s ease; }
@keyframes rise { from { transform: translateY(30px); } }
.handle { width: 38px; height: 5px; margin: 2px auto 14px; border-radius: 9px; background: #c8c7c0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.icon-button { display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-size: 18px; }
.primary { min-height: 50px; padding: 0 18px; border: 0; border-radius: 15px; background: var(--green); color: white; font-weight: 800; }
.primary:disabled { opacity: .4; }
.secondary { min-height: 46px; padding: 0 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-weight: 730; }
.danger-link { border: 0; background: none; color: var(--red); font-weight: 750; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { margin-left: 3px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.field input, .field textarea, .field select { width: 100%; min-height: 51px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; outline: 0; background: var(--surface); font-size: 16px; }
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(43,91,78,.10); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.advanced { padding: 13px 0; border: 0; background: transparent; color: var(--green-2); text-align: left; font-weight: 750; }
.duplicate { padding: 12px; border-radius: 13px; background: #fae3de; color: #7e312c; font-size: 13px; }

.detail-hero { margin: 2px -18px 0; padding: 12px 20px 24px; background: var(--green); color: white; }
.detail-hero .back { margin-bottom: 28px; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: white; }
.detail-hero h1 { font-size: 37px; }
.detail-hero p { margin: 8px 0 0; color: #c2d0ca; }
.detail-body { padding-top: 20px; }
.actions { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin: -40px 0 20px; padding: 0 4px; }
.action { display: grid; place-items: center; align-content: center; gap: 5px; min-height: 69px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 8px 18px rgba(20,30,25,.07); color: var(--green); text-decoration: none; font-size: 10px; font-weight: 800; }
.action.disabled { opacity: .38; pointer-events: none; }
.info-card { padding: 17px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.info-card + .info-card { margin-top: 10px; }
.info-label { margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.info-value { font-size: 14px; line-height: 1.45; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.timeline { position: relative; display: grid; gap: 0; }
.timeline-item { position: relative; padding: 2px 0 18px 28px; }
.timeline-item::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: -4px; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { position: absolute; top: 4px; left: 1px; width: 13px; height: 13px; border: 3px solid var(--paper); border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.timeline-title { font-size: 13px; font-weight: 780; }
.timeline-note { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }

.search-screen { position: fixed; z-index: 45; inset: 0; overflow: auto; padding: var(--safe-top) 18px 40px; background: var(--paper); }
.search-top { display: flex; gap: 9px; max-width: 720px; margin: 0 auto; }
.search-top .searchbox { flex: 1; }
.search-results { max-width: 720px; margin: 18px auto 0; }
.result-group { margin-top: 23px; }
.result-group .eyebrow { margin-left: 3px; }

#toast { position: fixed; z-index: 100; left: 50%; bottom: calc(88px + var(--safe-bottom)); transform: translate(-50%, 20px); max-width: calc(100vw - 36px); padding: 11px 15px; border-radius: 12px; background: #17211d; color: white; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s ease; font-size: 13px; font-weight: 700; white-space: nowrap; }
#toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (min-width: 760px) {
  body { background: #dddcd6; }
  .shell { width: 760px; margin: 0 auto; box-shadow: 0 0 50px rgba(20,30,25,.08); }
  .nav { left: 50%; width: 760px; transform: translateX(-50%); }
  .sheet { margin-bottom: 18px; border-radius: 28px; }
  .overlay { align-items: center; }
  .search-screen { left: 50%; width: 760px; transform: translateX(-50%); box-shadow: 0 0 50px rgba(20,30,25,.08); }
}

@media (max-width: 370px) {
  .shell { padding-right: 13px; padding-left: 13px; }
  .quick-grid { gap: 6px; }
  .quick { padding: 11px 8px; }
  .actions { gap: 5px; }
}
