:root {
  color-scheme: light;
  --paper: #f3f0e8;
  --surface: #fbfaf6;
  --surface-strong: #ffffff;
  --ink: #20231f;
  --muted: #6f746c;
  --line: #dcd9cf;
  --green: #235c43;
  --green-soft: #dfe9e1;
  --amber: #b36a16;
  --amber-soft: #f3e7d5;
  --red: #a44336;
  --red-soft: #f4dfda;
  --blue: #496276;
  --sidebar: #e8e5dc;
  --radius: 12px;
  --shadow: 0 14px 40px rgba(43, 45, 39, .07);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.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; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px 20px; background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px 10px 10px 3px; background: var(--green); color: #fff; font-family: Georgia, serif; font-size: 22px; }
.brand strong { display: block; font: 700 18px/1.15 Georgia, serif; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.nav-list { display: grid; gap: 3px; }
.nav-item { min-height: 42px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; border-radius: 8px; color: #555a52; font-size: 14px; font-weight: 600; }
.nav-item:hover { background: rgba(255,255,255,.48); color: var(--ink); }
.nav-item.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(28,32,27,.06); }
.nav-item.is-active::before { content: ""; width: 4px; height: 16px; margin-left: -12px; border-radius: 0 4px 4px 0; background: var(--green); }
.nav-item.is-active span { margin-left: -4px; }
.nav-item kbd { color: #a6a99f; background: transparent; border: 0; font-size: 10px; font-weight: 500; }
.sidebar-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid #d4d1c7; }
.sidebar-foot p { margin: 0 0 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.quiet-button { padding: 0; border: 0; color: var(--muted); background: none; font-size: 12px; cursor: pointer; }
.quiet-button:hover { color: var(--red); }

.main-content { width: min(1320px, 100%); padding: 34px 44px 64px; }
.topbar { min-height: 68px; margin-bottom: 28px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.topbar h1 { margin: 0; font: 500 clamp(30px, 3vw, 42px)/1.05 Georgia, serif; letter-spacing: -.025em; }
.telegram-link { margin-top: 4px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.35); color: var(--muted); font-size: 12px; font-weight: 600; }
.telegram-link:hover { border-color: #b8b6ae; color: var(--green); background: var(--surface); }

.pulse-band { min-height: 190px; padding: 28px 30px; display: grid; grid-template-columns: minmax(280px, 1fr) auto; gap: 32px; align-items: end; color: #eef4ef; background: #214d3a; border-radius: 16px; box-shadow: var(--shadow); }
.pulse-kicker { display: inline-block; margin-bottom: 24px; color: #b9d0c0; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.pulse-copy h2 { max-width: 600px; margin: 0 0 8px; font: 500 clamp(27px, 3.4vw, 46px)/1.05 Georgia, serif; letter-spacing: -.025em; }
.pulse-copy p { max-width: 610px; margin: 0; color: #cbdad0; font-size: 13px; line-height: 1.5; }
.pulse-metrics { display: grid; grid-template-columns: repeat(4, 92px); border-top: 1px solid rgba(255,255,255,.18); }
.metric { min-height: 72px; padding: 12px 10px 0; border-right: 1px solid rgba(255,255,255,.14); }
.metric:last-child { border-right: 0; }
.metric strong { display: block; font: 500 28px/1 Georgia, serif; }
.metric span { display: block; margin-top: 8px; color: #b9cbbf; font-size: 10px; }
.metric-danger strong { color: #f3b9a9; }

.dashboard-grid { margin-top: 28px; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .8fr); gap: 22px; align-items: start; }
.content-section { min-width: 0; }
.section-heading { min-height: 34px; margin-bottom: 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin: 0; font: 500 20px/1.2 Georgia, serif; }
.section-heading > h2 { font-size: 22px; }
.section-heading > a, .section-heading > span { color: var(--muted); font-size: 11px; font-weight: 600; }
.section-heading > a:hover { color: var(--green); }
.list-surface { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 5px 20px rgba(43,45,39,.035); }
.task-row { position: relative; min-height: 70px; padding: 14px 18px 14px 24px; display: flex; gap: 12px; align-items: flex-start; border-bottom: 1px solid #e8e5dc; }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: var(--surface-strong); }
.task-row.is-overdue { background: #fffaf8; }
.status-pin { position: absolute; left: 11px; top: 21px; width: 5px; height: 18px; border-radius: 4px; background: #9ba199; }
.status-active { background: var(--green); }
.status-waiting { background: var(--amber); }
.status-backlog { background: var(--blue); }
.status-done { background: #8c968c; }
.status-cancelled { background: #aaa; }
.is-overdue .status-pin { background: var(--red); }
.task-copy { min-width: 0; }
.task-title { margin: 0; font-size: 14px; font-weight: 580; line-height: 1.45; }
.meta-line { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--muted); font-size: 10px; }
.reference { color: #858a81; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.person-chip { color: var(--green); font-weight: 700; }
.status-label { color: var(--muted); }
.due-label { margin-left: auto; }
.danger { color: var(--red); font-weight: 700; }
.side-stack { display: grid; gap: 26px; }
.compact-list { overflow: hidden; border-top: 1px solid var(--line); }
.compact-list article { padding: 11px 0; border-bottom: 1px solid var(--line); }
.compact-list time { display: block; margin-bottom: 4px; color: var(--amber); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.compact-list p { margin: 0; font-size: 12px; font-weight: 600; line-height: 1.4; }
.compact-list span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.event-list time { color: var(--green); }
.muted, .sync-note { color: var(--muted); font-size: 10px; line-height: 1.4; }
.sync-note { margin: 9px 0 0; }
.people-strip { margin-top: 30px; }
.people-links { display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.people-links a { min-height: 104px; padding: 16px 14px; border-right: 1px solid var(--line); }
.people-links a:last-child { border-right: 0; }
.people-links a:hover { background: var(--surface-strong); }
.people-links span, .avatar { width: 30px; height: 30px; margin-bottom: 10px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); font: 600 14px Georgia, serif; }
.people-links strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.people-links small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }

.filter-bar { margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.status-tabs { display: flex; gap: 22px; overflow-x: auto; }
.status-tabs a { position: relative; padding: 0 0 13px; color: var(--muted); white-space: nowrap; font-size: 12px; font-weight: 600; }
.status-tabs a.is-active { color: var(--ink); }
.status-tabs a.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--green); }
.search-form { padding-bottom: 8px; display: flex; gap: 6px; }
.search-form input, .search-form select { height: 32px; max-width: 180px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--surface); font-size: 10px; outline: none; }
.search-form input:focus, .search-form select:focus { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.search-form button { height: 32px; padding: 0 11px; border: 0; border-radius: 7px; color: #fff; background: var(--green); font-size: 10px; font-weight: 700; cursor: pointer; }
.result-count { margin: 0 0 16px; color: var(--muted); font-size: 10px; }
.task-group { margin-bottom: 28px; }

.page-lead { max-width: 720px; margin: -8px 0 26px; color: var(--muted); font: 400 16px/1.5 Georgia, serif; }
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.person-card { min-height: 270px; padding: 22px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.person-card header { display: flex; gap: 12px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.person-card .avatar { width: 42px; height: 42px; margin: 0; font-size: 17px; }
.person-card h2 { margin: 0; font: 500 19px/1.2 Georgia, serif; }
.person-card header p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.person-agenda { padding: 10px 0; }
.person-agenda p { margin: 0; padding: 6px 0 6px 14px; position: relative; font-size: 11px; line-height: 1.4; }
.person-agenda small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.tiny-status { position: absolute; left: 0; top: 10px; width: 5px; height: 5px; border-radius: 50%; }
.tiny-status.reminder { background: var(--amber); }
.person-card > a { margin-top: auto; color: var(--green); font-size: 10px; font-weight: 700; }

.calendar-note { margin: -8px 0 24px; color: var(--muted); font-size: 10px; }
.live-dot { width: 6px; height: 6px; margin-right: 6px; display: inline-block; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.calendar-flow { border-top: 1px solid var(--line); }
.calendar-day { display: grid; grid-template-columns: 145px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.calendar-day > header { padding: 22px 18px 22px 0; display: flex; gap: 12px; align-items: flex-start; }
.calendar-day > header > span { color: #989c94; font: 500 32px/1 Georgia, serif; }
.calendar-day > header p { margin: 1px 0 0; font-size: 10px; font-weight: 700; }
.calendar-day > header small { color: var(--green); font-size: 9px; }
.calendar-day.is-today > header > span { color: var(--green); }
.day-events { padding: 12px 0 12px 18px; border-left: 1px solid var(--line); }
.day-events article { min-height: 58px; padding: 10px 0; display: grid; grid-template-columns: 88px minmax(0, 1fr); border-bottom: 1px solid #e5e2d9; }
.day-events article:last-child { border-bottom: 0; }
.day-events time { color: var(--muted); font-size: 10px; }
.day-events h2 { margin: 0; font-size: 12px; font-weight: 650; }
.day-events p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.review-chip { display: inline-block; margin-top: 6px; padding: 3px 6px; border-radius: 4px; color: var(--amber); background: var(--amber-soft); font-size: 8px; font-weight: 700; }

.inbox-intro { margin: -8px 0 24px; padding: 16px 18px; display: flex; justify-content: space-between; gap: 24px; border-left: 3px solid var(--green); background: rgba(255,255,255,.4); }
.inbox-intro p { max-width: 750px; margin: 0; color: #555b53; font-size: 12px; line-height: 1.5; }
.inbox-intro span { align-self: center; color: var(--muted); white-space: nowrap; font-size: 9px; }
.inbox-list { display: grid; gap: 10px; }
.inbox-list article { padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.inbox-list header { display: flex; gap: 10px; align-items: center; }
.inbox-list time { color: var(--muted); font-size: 9px; }
.kind-chip { margin-left: auto; color: var(--blue); font-size: 9px; }
.inbox-list article > p { margin: 12px 0; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.inbox-list article > small { color: var(--muted); font-size: 9px; }

.empty-state { min-height: 270px; padding: 40px; display: grid; place-items: center; align-content: center; text-align: center; border: 1px dashed #c9c6bd; border-radius: var(--radius); color: var(--muted); }
.empty-state > span { font: 400 30px Georgia, serif; color: var(--green); }
.empty-state h2 { margin: 12px 0 4px; color: var(--ink); font: 500 20px Georgia, serif; }
.empty-state p { margin: 0; font-size: 11px; }
.empty-state.compact { min-height: 150px; border: 0; }

.mobile-nav { display: none; }

.login-body { min-height: 100vh; background: #e9e6dd; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.login-intro { padding: clamp(48px, 8vw, 120px); display: flex; flex-direction: column; justify-content: center; color: #eef4ef; background: #214d3a; }
.brand-mark-large { width: 50px; height: 50px; margin-bottom: 58px; background: #f0eee6; color: var(--green); }
.login-intro .eyebrow { color: #afc7b7; }
.login-intro h1 { max-width: 680px; margin: 8px 0 18px; font: 500 clamp(38px, 5vw, 68px)/1.02 Georgia, serif; letter-spacing: -.035em; }
.login-intro > p:last-child { max-width: 540px; margin: 0; color: #bed0c4; font-size: 14px; line-height: 1.55; }
.login-panel { padding: clamp(36px, 8vw, 110px); display: flex; flex-direction: column; justify-content: center; background: var(--surface); }
.login-panel h2 { margin: 0; font: 500 30px/1.15 Georgia, serif; }
.login-form { margin-top: 42px; display: grid; gap: 10px; }
.login-form label { font-size: 11px; font-weight: 700; }
.login-form input { height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none; }
.login-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.primary-button { height: 46px; margin-top: 8px; border: 0; border-radius: 8px; color: #fff; background: var(--green); font-weight: 700; cursor: pointer; }
.primary-button:hover { background: #194932; }
.form-error { margin: 0; color: var(--red); font-size: 11px; }
.login-note { margin: 20px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .main-content { padding: 30px 28px 60px; }
  .pulse-band { grid-template-columns: 1fr; align-items: start; }
  .pulse-metrics { width: 100%; grid-template-columns: repeat(4, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people-links { grid-template-columns: repeat(3, 1fr); }
  .people-links a:nth-child(3) { border-right: 0; }
  .people-links a { border-bottom: 1px solid var(--line); }
  .filter-bar { align-items: stretch; flex-direction: column; gap: 12px; }
  .search-form { padding-bottom: 12px; }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content { width: 100%; padding: 22px 16px 92px; }
  .topbar { min-height: 58px; margin-bottom: 20px; }
  .topbar h1 { font-size: 30px; }
  .telegram-link { padding: 8px 10px; font-size: 0; }
  .telegram-link::after { content: "Telegram ↗"; font-size: 10px; }
  .pulse-band { min-height: 0; padding: 22px 20px; gap: 24px; border-radius: 12px; }
  .pulse-kicker { margin-bottom: 16px; }
  .pulse-copy h2 { font-size: 30px; }
  .pulse-metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric { border-bottom: 1px solid rgba(255,255,255,.14); }
  .metric:nth-child(3), .metric:nth-child(4) { border-bottom: 0; }
  .dashboard-grid { margin-top: 24px; gap: 26px; }
  .side-stack { grid-template-columns: 1fr; }
  .task-row { padding-right: 14px; }
  .due-label { width: 100%; margin-left: 0; }
  .people-links { grid-template-columns: repeat(2, 1fr); }
  .people-links a:nth-child(3) { border-right: 1px solid var(--line); }
  .people-links a:nth-child(even) { border-right: 0; }
  .people-grid { grid-template-columns: 1fr; }
  .person-card { min-height: 240px; }
  .status-tabs { gap: 18px; }
  .search-form { display: grid; grid-template-columns: 1fr 1fr auto; }
  .search-form input, .search-form select { width: 100%; max-width: none; }
  .calendar-day { grid-template-columns: 1fr; }
  .calendar-day > header { padding: 18px 0 8px; }
  .day-events { padding-left: 0; border-left: 0; }
  .day-events article { grid-template-columns: 76px 1fr; }
  .inbox-intro { flex-direction: column; gap: 10px; }
  .inbox-intro span { align-self: flex-start; white-space: normal; }
  .mobile-nav { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 20; height: 64px; padding: 5px; display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid rgba(220,217,207,.9); border-radius: 13px; background: rgba(251,250,246,.96); box-shadow: 0 8px 28px rgba(32,35,31,.15); }
  .mobile-nav a { display: grid; place-items: center; align-content: center; gap: 3px; border-radius: 8px; color: var(--muted); font-size: 8px; font-weight: 700; }
  .mobile-nav a span { font-size: 15px; font-weight: 400; }
  .mobile-nav a.is-active { color: var(--green); background: var(--green-soft); }
  .login-shell { display: block; }
  .login-intro { min-height: 43vh; padding: 36px 26px; justify-content: flex-end; }
  .brand-mark-large { width: 42px; height: 42px; margin-bottom: 38px; }
  .login-intro h1 { font-size: 38px; }
  .login-intro > p:last-child { display: none; }
  .login-panel { min-height: 57vh; padding: 38px 26px; justify-content: flex-start; }
  .login-panel h2 { font-size: 25px; }
  .login-form { margin-top: 30px; }
}

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