:root {
  --paper: #f1eee7;
  --surface: #fffdf9;
  --surface-2: #f8f5ef;
  --ink: #151715;
  --muted: #7c7971;
  --muted-2: #a39e94;
  --line: #d6d0c5;
  --line-soft: #e8e3d9;
  --forest: #26483b;
  --forest-2: #335b4b;
  --critical: #b24840;
  --attention: #bd8736;
  --normal: #4e7a65;
  --shadow: 0 26px 90px rgba(39, 33, 25, .14);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body.is-locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 200; background: var(--ink); color: #fff; padding: 12px 16px; text-decoration: none; transition: .2s; }
.skip-link:focus { top: 16px; }

.app { width: min(1600px, 100%); margin: 0 auto; padding: 0 38px 54px; }
.topbar { height: 88px; display: grid; grid-template-columns: 270px 1fr auto; align-items: center; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 13px; width: fit-content; color: var(--ink); text-decoration: none; }
.brand__sign { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--ink); font: 17px/1 var(--serif); letter-spacing: -.06em; }
.brand__text { text-transform: uppercase; font-size: 9px; font-weight: 800; line-height: 1.2; letter-spacing: .18em; }
.topbar__context { display: flex; align-items: center; gap: 17px; }
.topbar__context > span { color: var(--muted); text-transform: uppercase; font-size: 9px; font-weight: 800; letter-spacing: .19em; }
.topbar__context i { display: block; width: 1px; height: 23px; background: var(--line); }
.topbar__context em { font: italic 16px/1 var(--serif); }
.topbar__actions { display: flex; align-items: center; gap: 9px; }
.square-btn { position: relative; width: 42px; height: 42px; display: grid; place-items: center; padding: 0; background: transparent; border: 1px solid var(--line); cursor: pointer; transition: background .18s, border-color .18s, transform .18s; }
.square-btn:hover, .square-btn:focus-visible { background: var(--surface); border-color: var(--ink); outline: none; }
.square-btn:active { transform: scale(.96); }
.square-btn--badge::after { content: ""; position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--critical); box-shadow: 0 0 0 2px var(--paper); }
.square-btn--badge.is-read::after { display: none; }
.profile { height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 0 0 7px; border: 0; background: transparent; cursor: pointer; }
.profile > svg { width: 14px; color: var(--muted); transition: transform .2s; }
.profile[aria-expanded="true"] > svg { transform: rotate(180deg); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--forest); color: #fff; font-size: 10px; letter-spacing: .08em; }
.profile__copy { display: grid; gap: 3px; text-align: left; }
.profile__copy strong { font-size: 11px; }
.profile__copy small { color: var(--muted); font-size: 9px; }

main { padding-top: 53px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 48px; margin-bottom: 43px; }
.hero__copy { max-width: 880px; }
.system-state { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--forest); text-transform: uppercase; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.system-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--normal); box-shadow: 0 0 0 5px rgba(78, 122, 101, .12); }
h1 { margin: 18px 0 20px; font: 400 clamp(56px, 6.25vw, 100px)/.88 var(--serif); letter-spacing: -.055em; }
h1 em { color: var(--forest); font-weight: 400; }
.hero__description { max-width: 620px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.72; }
.hero__actions { display: flex; gap: 10px; padding-bottom: 3px; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 20px; border: 1px solid var(--ink); background: transparent; font-size: 11px; font-weight: 750; cursor: pointer; transition: .18s; white-space: nowrap; }
.button svg { width: 17px; height: 17px; }
.button .plus { font-size: 19px; font-weight: 400; line-height: 1; }
.button:hover, .button:focus-visible { transform: translateY(-1px); outline: none; }
.button--outline:hover { background: var(--surface); }
.button--dark { background: var(--ink); color: #fff; }
.button--dark:hover { background: var(--forest); }

.overview { display: grid; grid-template-columns: 1.68fr .76fr .76fr; gap: 16px; margin-bottom: 16px; }
.card, .calendar-card, .registry-card, .priorities-card { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 34px rgba(48, 42, 33, .035); }
.card { min-height: 328px; padding: 24px; }
.card__eyebrow { display: flex; align-items: center; justify-content: space-between; min-height: 14px; color: var(--muted); text-transform: uppercase; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.dots-btn { border: 0; background: transparent; color: var(--muted); letter-spacing: .13em; cursor: pointer; }
.card--nearest { padding-bottom: 21px; }
.nearest { display: grid; grid-template-columns: 177px minmax(0, 1fr); align-items: end; padding: 28px 0 24px; }
.nearest__number { display: flex; align-items: flex-end; gap: 7px; }
.nearest__number strong { color: var(--critical); font: 400 108px/.73 var(--serif); letter-spacing: -.08em; }
.nearest__number span { margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.nearest__summary { min-height: 101px; padding-left: 27px; border-left: 1px solid var(--line); }
.risk-caption { color: var(--critical); text-transform: uppercase; font-size: 9px; font-weight: 850; letter-spacing: .15em; }
.nearest__summary h2 { margin: 9px 0 5px; font: 400 26px/1.1 var(--serif); letter-spacing: -.035em; }
.nearest__summary p { margin: 0; color: var(--muted); font-size: 11px; }
.link-button { margin: 17px 0 0; padding: 0; border: 0; background: transparent; font-size: 10px; font-weight: 780; cursor: pointer; }
.link-button span { padding-left: 5px; }
.link-button:hover { color: var(--forest); }
.deadline-line { height: 3px; overflow: hidden; background: var(--line-soft); }
.deadline-line span { display: block; width: 62%; height: 100%; background: var(--critical); transition: width .45s; }
.nearest__meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 18px; }
.nearest__meta div { display: grid; gap: 5px; }
.nearest__meta span { color: var(--muted); text-transform: uppercase; font-size: 8px; letter-spacing: .13em; }
.nearest__meta strong { font-size: 11px; font-weight: 700; }

.health-score { display: flex; align-items: center; gap: 17px; margin: 37px 0 30px; }
.donut { --p: 92; position: relative; width: 102px; height: 102px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--forest) calc(var(--p) * 1%), var(--line-soft) 0); }
.donut::before { content: ""; position: absolute; width: 76px; height: 76px; border-radius: 50%; background: var(--surface); }
.donut div { z-index: 1; display: flex; align-items: flex-start; }
.donut strong { font: 400 31px/1 var(--serif); }
.donut span { margin-top: 5px; font-size: 10px; }
.health-score__copy > span { color: var(--forest); text-transform: uppercase; font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.health-score__copy p { margin: 8px 0 0; font: 400 16px/1.28 var(--serif); }
.legend { border-top: 1px solid var(--line-soft); }
.legend button { width: 100%; min-height: 39px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 0; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; text-align: left; cursor: pointer; }
.legend button:hover span { color: var(--ink); }
.legend span { color: var(--muted); font-size: 10px; }
.legend strong { font-size: 10px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; }
.status-dot--normal { background: var(--normal); }
.status-dot--attention { background: var(--attention); }
.status-dot--critical { background: var(--critical); }
.plan-total { display: flex; align-items: flex-end; gap: 10px; margin-top: 30px; }
.plan-total strong { font: 400 63px/.8 var(--serif); }
.plan-total span { color: var(--muted); font-size: 10px; line-height: 1.25; }
.bar-chart { height: 129px; display: flex; align-items: flex-end; gap: 9px; padding-top: 20px; }
.bar { position: relative; flex: 1; min-width: 9px; background: var(--forest); transition: height .35s, background .2s; cursor: default; }
.bar:hover { background: var(--critical); }
.bar::before { content: attr(data-value); position: absolute; top: -18px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 8px; }
.bar::after { content: attr(data-tooltip); position: absolute; left: 50%; bottom: calc(100% + 28px); z-index: 5; transform: translate(-50%, 5px); padding: 7px 9px; background: var(--ink); color: #fff; white-space: nowrap; font-size: 8px; opacity: 0; pointer-events: none; transition: .18s; }
.bar:hover::after { opacity: 1; transform: translate(-50%, 0); }
.bar-labels { display: flex; justify-content: space-between; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; }

.calendar-card { padding: 26px 28px 28px; margin-bottom: 16px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.section-label { color: var(--muted); text-transform: uppercase; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.section-header h2, .registry-header h2, .priorities-header h2 { margin: 6px 0 0; font: 400 27px/1.05 var(--serif); letter-spacing: -.035em; }
.month-switcher { height: 42px; display: flex; align-items: center; border: 1px solid var(--line); }
.month-switcher button { width: 42px; height: 100%; border: 0; background: transparent; cursor: pointer; }
.month-switcher button:hover { background: var(--paper); }
.month-switcher strong { min-width: 159px; padding: 0 18px; border-right: 1px solid var(--line); border-left: 1px solid var(--line); font: 400 14px/40px var(--serif); text-align: center; }
.timeline-scroll { overflow: auto; }
.timeline { display: grid; grid-template-columns: 200px repeat(5, minmax(145px, 1fr)); min-width: 925px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.timeline__head, .timeline__label, .timeline__cell { min-height: 55px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.timeline__head { display: grid; place-items: center; color: var(--muted); text-transform: uppercase; font-size: 8px; letter-spacing: .11em; }
.timeline__label { display: flex; flex-direction: column; justify-content: center; padding: 11px 14px; }
.timeline__label strong { font-size: 10px; }
.timeline__label span { margin-top: 4px; color: var(--muted); font-size: 8px; }
.timeline__cell { position: relative; background-image: linear-gradient(90deg, transparent 49%, rgba(214, 208, 197, .35) 50%, transparent 51%); }
.timeline__event { position: absolute; inset: 14px 8% auto; height: 25px; display: flex; align-items: center; justify-content: space-between; padding: 0 9px; border: 0; background: var(--ink); color: #fff; font-size: 8px; cursor: pointer; transition: transform .18s, filter .18s; }
.timeline__event:hover { transform: translateY(-2px); filter: brightness(1.12); }
.timeline__event--attention { background: var(--attention); }
.timeline__event--normal { background: var(--forest); }
.timeline__event span:last-child { opacity: .65; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; }
.registry-card { min-width: 0; }
.registry-header { display: flex; align-items: flex-end; justify-content: space-between; padding: 26px 28px 22px; }
.search { width: min(380px, 42%); height: 43px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--ink); }
.search svg { width: 16px; height: 16px; }
.search input { min-width: 0; flex: 1; border: 0; outline: none; background: transparent; font-size: 11px; }
.search input::placeholder { color: var(--muted-2); }
kbd { padding: 3px 5px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface-2); color: var(--muted); font: 8px/1.2 var(--sans); box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.registry-toolbar { min-height: 59px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tabs { align-self: stretch; display: flex; }
.tab { position: relative; padding: 0 16px; border: 0; background: transparent; color: var(--muted); font-size: 9px; cursor: pointer; }
.tab span { margin-left: 5px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 10px; font-size: 7px; }
.tab.is-active { color: var(--ink); font-weight: 800; }
.tab.is-active::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 2px; background: var(--ink); }
.toolbar-actions { display: flex; align-items: center; gap: 7px; }
.small-button { height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; border: 1px solid var(--line); background: transparent; font-size: 9px; cursor: pointer; }
.small-button svg { width: 14px; height: 14px; }
.small-button:hover { border-color: var(--ink); background: var(--surface); }
.filter-badge { min-width: 16px; height: 16px; display: inline-grid; place-items: center; padding: 0 4px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 7px; }
.table-scroll { overflow: auto; }
table { width: 100%; min-width: 935px; border-collapse: collapse; }
th { height: 44px; padding: 0 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; text-transform: uppercase; font-size: 7px; font-weight: 800; letter-spacing: .13em; }
th:first-child, td:first-child { padding-left: 28px; }
th:last-child, td:last-child { padding-right: 28px; }
td { height: 70px; padding: 0 16px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; font-size: 10px; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #faf8f3; }
tbody tr.is-selected { background: #f6f2ea; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; text-transform: uppercase; font-size: 7px; font-weight: 850; letter-spacing: .08em; }
.cell-main { display: grid; gap: 4px; }
.cell-main strong { font-size: 10px; }
.cell-main span { max-width: 215px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 8px; }
.fn-chip { display: inline-flex; padding: 6px 8px; background: var(--paper); font: 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .025em; }
.deadline { font-weight: 800; }
.days-badge { min-width: 55px; display: inline-flex; justify-content: center; padding: 6px 8px; border: 1px solid; }
.days-badge--critical { color: var(--critical); border-color: rgba(178, 72, 64, .28); background: rgba(178, 72, 64, .045); }
.days-badge--attention { color: var(--attention); border-color: rgba(189, 135, 54, .3); background: rgba(189, 135, 54, .05); }
.days-badge--normal { color: var(--normal); border-color: rgba(78, 122, 101, .28); background: rgba(78, 122, 101, .045); }
.row-menu-btn { width: 32px; height: 32px; border: 1px solid transparent; background: transparent; font-weight: 800; letter-spacing: .1em; cursor: pointer; }
.row-menu-btn:hover, .row-menu-btn[aria-expanded="true"] { border-color: var(--line); background: var(--surface); }
.empty-state td { height: 180px; text-align: center; }
.empty-state div { display: grid; place-items: center; gap: 7px; color: var(--muted); }
.empty-state strong { color: var(--ink); font: 400 21px/1 var(--serif); }
.table-footer { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; color: var(--muted); font-size: 9px; }
.pagination { display: flex; align-items: center; gap: 12px; }
.pagination button { width: 34px; height: 34px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.pagination button:hover:not(:disabled) { border-color: var(--ink); }
.pagination button:disabled { opacity: .3; cursor: not-allowed; }
.pagination span { min-width: 54px; text-align: center; }

.priorities-card { min-height: 100%; display: flex; flex-direction: column; padding: 26px 22px; }
.priorities-header { display: flex; align-items: flex-start; justify-content: space-between; }
.priorities-header > strong { color: var(--critical); font: 400 32px/1 var(--serif); }
.priority-list { margin: 22px 0 18px; border-top: 1px solid var(--line); }
.priority-item { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 15px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.priority-item:hover .priority-item__number { background: var(--ink); color: #fff; }
.priority-item__number { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); font: 400 10px/1 var(--serif); transition: .18s; }
.priority-item__copy { display: grid; gap: 4px; }
.priority-item__copy strong { font-size: 9px; }
.priority-item__copy span { color: var(--muted); font-size: 8px; }
.priority-item__days { color: var(--critical); font-size: 8px; font-weight: 850; }
.priority-all { height: 45px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border: 1px solid var(--ink); background: transparent; font-size: 9px; font-weight: 800; cursor: pointer; }
.priority-all:hover { background: var(--ink); color: #fff; }
.owners-summary { margin-top: auto; padding-top: 26px; }
.owner-avatars { display: flex; }
.owner-avatars span { width: 34px; height: 34px; display: grid; place-items: center; margin-left: -7px; border: 2px solid var(--surface); border-radius: 50%; background: var(--paper); font-size: 7px; }
.owner-avatars span:first-child { margin-left: 0; background: var(--forest); color: #fff; }
.owners-summary p { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.owners-summary strong { color: var(--ink); }

.popover-anchor { position: relative; }
.popover { position: absolute; z-index: 50; right: 0; top: calc(100% + 10px); min-width: 260px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(-7px); transition: .18s; }
.popover.is-open { opacity: 1; visibility: visible; transform: none; }
.popover__head { display: flex; align-items: center; justify-content: space-between; padding: 14px; border-bottom: 1px solid var(--line-soft); }
.popover__head strong { font: 400 18px/1 var(--serif); }
.popover__head button { padding: 0; border: 0; background: transparent; color: var(--critical); font-size: 8px; cursor: pointer; }
.notifications { width: 320px; }
.notification-item { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: flex-start; padding: 13px 14px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; text-align: left; cursor: pointer; }
.notification-item:hover { background: var(--surface-2); }
.notification-item.is-read { opacity: .62; }
.notification-item__copy { display: grid; gap: 4px; }
.notification-item__copy strong { font-size: 9px; }
.notification-item__copy span { color: var(--muted); font-size: 8px; }
.notification-item time { color: var(--muted); font-size: 7px; }
.popover__footer { width: 100%; height: 43px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border: 0; background: transparent; font-size: 9px; font-weight: 800; cursor: pointer; }
.profile-menu { width: 260px; }
.profile-menu button { width: 100%; display: grid; gap: 4px; padding: 13px 14px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; text-align: left; cursor: pointer; }
.profile-menu button:hover { background: var(--surface-2); }
.profile-menu span { font-size: 10px; font-weight: 750; }
.profile-menu small { color: var(--muted); font-size: 8px; }
.export-menu { width: 245px; left: 0; right: auto; }
.export-menu button { width: 100%; display: grid; gap: 4px; padding: 13px 14px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; text-align: left; cursor: pointer; }
.export-menu button:hover { background: var(--surface-2); }
.export-menu strong { font-size: 10px; }
.export-menu span { color: var(--muted); font-size: 8px; }
.filter-panel { width: 285px; padding: 15px; }
.filter-panel label { display: grid; gap: 6px; margin-bottom: 13px; }
.filter-panel label > span { color: var(--muted); text-transform: uppercase; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.filter-panel select { width: 100%; height: 39px; padding: 0 10px; border: 1px solid var(--line); background: var(--surface-2); outline: none; font-size: 9px; }
.filter-panel__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filter-panel__actions button { height: 36px; border: 1px solid var(--ink); background: transparent; font-size: 9px; cursor: pointer; }
.filter-panel__actions button:last-child { background: var(--ink); color: #fff; }

.backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(22, 22, 18, .35); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: .23s; }
.backdrop.is-open { opacity: 1; visibility: visible; }
.drawer { position: fixed; z-index: 90; top: 0; right: 0; bottom: 0; width: min(535px, 100%); display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow); transform: translateX(102%); transition: transform .28s cubic-bezier(.25,.8,.25,1); }
.drawer.is-open { transform: none; }
.drawer__header { display: flex; align-items: flex-start; justify-content: space-between; padding: 32px 32px 24px; border-bottom: 1px solid var(--line); }
.drawer__header h2, .modal__header h2 { margin: 7px 0 0; font: 400 31px/1.05 var(--serif); letter-spacing: -.035em; }
.close-btn { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid var(--line); background: transparent; font: 300 24px/1 var(--sans); cursor: pointer; }
.close-btn:hover { border-color: var(--ink); }
.drawer__content { flex: 1; overflow: auto; padding: 26px 32px 30px; }
.drawer-status { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-left: 3px solid currentColor; }
.drawer-status span { font-size: 10px; }
.drawer-status strong { font: 400 25px/1 var(--serif); }
.drawer-status--critical { color: var(--critical); background: rgba(178,72,64,.05); }
.drawer-status--attention { color: var(--attention); background: rgba(189,135,54,.05); }
.drawer-status--normal { color: var(--normal); background: rgba(78,122,101,.05); }
.detail-section { margin-top: 25px; }
.detail-section h3 { margin: 0 0 12px; color: var(--muted); text-transform: uppercase; font-size: 8px; letter-spacing: .14em; }
.detail-row { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.detail-row > span { color: var(--muted); text-transform: uppercase; font-size: 8px; letter-spacing: .1em; }
.detail-row > strong { font-size: 10px; }
.checklist { border-top: 1px solid var(--line); }
.check-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.check-item button { width: 20px; height: 20px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); background: transparent; font-size: 10px; cursor: pointer; }
.check-item.is-done button { background: var(--forest); border-color: var(--forest); color: #fff; }
.check-item span { font-size: 9px; }
.check-item.is-done span { color: var(--muted); text-decoration: line-through; }
.check-item small { color: var(--muted); font-size: 7px; }
.drawer__footer { display: grid; grid-template-columns: 1fr 1.45fr; gap: 10px; padding: 18px 32px 26px; border-top: 1px solid var(--line); background: var(--surface); }

.modal { position: fixed; z-index: 95; left: 50%; top: 50%; width: min(720px, calc(100% - 30px)); max-height: 90vh; overflow: auto; padding: 30px; background: var(--surface); box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translate(-50%, -47%) scale(.985); transition: .22s; }
.modal.is-open { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.modal--compact { width: min(520px, calc(100% - 30px)); }
.modal__header { display: flex; align-items: flex-start; justify-content: space-between; }
.modal__header p { max-width: 500px; margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 26px; }
.form-grid--single { grid-template-columns: 1fr; }
.field { display: grid; gap: 7px; }
.field--wide { grid-column: 1 / -1; }
.field > span { color: var(--muted); text-transform: uppercase; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); background: var(--surface-2); outline: none; font-size: 10px; transition: border-color .15s, box-shadow .15s; }
.field input, .field select { height: 43px; padding: 0 11px; }
.field textarea { min-height: 98px; padding: 11px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(21,23,21,.06); }
.field.is-invalid input, .field.is-invalid select { border-color: var(--critical); }
.field-error { min-height: 10px; color: var(--critical); font-size: 7px; }
.field--textarea { margin-top: 24px; }
.modal__footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }

.command-palette { position: fixed; inset: 0; z-index: 110; display: grid; place-items: start center; padding-top: min(14vh, 120px); background: rgba(22,22,18,.45); backdrop-filter: blur(5px); opacity: 0; visibility: hidden; transition: .18s; }
.command-palette.is-open { opacity: 1; visibility: visible; }
.command-palette__box { width: min(690px, calc(100% - 28px)); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.command-palette__box > label { height: 62px; display: flex; align-items: center; gap: 12px; padding: 0 17px; border-bottom: 1px solid var(--line); }
.command-palette__box input { min-width: 0; flex: 1; border: 0; outline: none; background: transparent; font: 400 18px/1 var(--serif); }
.command-results { max-height: 380px; overflow: auto; padding: 8px; }
.command-item { width: 100%; display: grid; grid-template-columns: 40px 1fr auto; gap: 11px; align-items: center; padding: 11px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.command-item:hover, .command-item.is-active { background: var(--paper); }
.command-item__icon { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); font: 400 11px/1 var(--serif); }
.command-item__copy { display: grid; gap: 3px; }
.command-item__copy strong { font-size: 10px; }
.command-item__copy span { color: var(--muted); font-size: 8px; }
.command-item small { color: var(--muted); font-size: 8px; }
.command-palette footer { display: flex; gap: 18px; padding: 11px 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 7px; }

.context-menu { position: fixed; z-index: 75; width: 220px; padding: 7px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(-5px); transition: .13s; }
.context-menu.is-open { opacity: 1; visibility: visible; transform: none; }
.context-menu button { width: 100%; padding: 10px; border: 0; background: transparent; text-align: left; font-size: 9px; cursor: pointer; }
.context-menu button:hover { background: var(--paper); }
.context-menu .danger { color: var(--critical); }

.toast-region { position: fixed; z-index: 130; left: 50%; bottom: 24px; display: grid; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast { min-width: 250px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 15px; background: var(--ink); color: #fff; box-shadow: var(--shadow); font-size: 9px; animation: toast-in .24s ease both; }
.toast button { padding: 0; border: 0; background: transparent; color: #fff; font-size: 8px; text-decoration: underline; pointer-events: auto; cursor: pointer; }
.toast.is-leaving { animation: toast-out .2s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1260px) {
  .overview { grid-template-columns: 1.42fr 1fr; }
  .card--plan { grid-column: 1 / -1; min-height: 245px; }
  .bar-chart { height: 94px; }
  .workspace { grid-template-columns: 1fr; }
  .priorities-card { min-height: 390px; }
  .priority-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 25px; }
  .owners-summary { margin-top: 20px; }
}

@media (max-width: 900px) {
  .app { padding: 0 20px 42px; }
  .topbar { height: 76px; grid-template-columns: 1fr auto; }
  .topbar__context { display: none; }
  .profile__copy { display: none; }
  .profile > svg { display: none; }
  .hero { align-items: flex-start; flex-direction: column; }
  .hero__actions { width: 100%; }
  .hero__actions > *, .hero__actions .button { flex: 1; width: 100%; }
  .overview { grid-template-columns: 1fr; }
  .card--plan { grid-column: auto; }
  .nearest { grid-template-columns: 145px minmax(0, 1fr); }
  .nearest__number strong { font-size: 86px; }
  .registry-header { align-items: flex-start; flex-direction: column; gap: 20px; }
  .search { width: 100%; }
  .priority-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 650px) {
  .app { padding: 0 12px 30px; }
  .topbar { height: 68px; }
  .brand__text { display: none; }
  .brand__sign { width: 39px; height: 39px; }
  .topbar__actions { gap: 4px; }
  .square-btn, .avatar { width: 38px; height: 38px; }
  main { padding-top: 35px; }
  .hero { margin-bottom: 28px; gap: 26px; }
  h1 { font-size: 54px; line-height: .93; }
  .hero__description { font-size: 12px; }
  .overview { gap: 10px; }
  .card, .calendar-card { padding: 20px; }
  .nearest { grid-template-columns: 1fr; padding-top: 24px; }
  .nearest__number { margin-bottom: 23px; }
  .nearest__summary { padding-left: 0; border-left: 0; }
  .nearest__meta { grid-template-columns: 1fr 1fr; }
  .nearest__meta div:last-child { grid-column: 1 / -1; }
  .section-header { align-items: flex-start; flex-direction: column; gap: 18px; }
  .month-switcher { width: 100%; }
  .month-switcher strong { flex: 1; }
  .registry-header, .registry-toolbar, .table-footer { padding-left: 18px; padding-right: 18px; }
  .registry-toolbar { min-height: 66px; overflow-x: auto; }
  .tabs { min-height: 65px; }
  .tab { padding: 0 12px; white-space: nowrap; }
  .tab.is-active::after { left: 12px; right: 12px; }
  #advancedFilterBtn { display: none; }
  .priority-list { display: block; }
  .drawer__header, .drawer__content { padding-left: 20px; padding-right: 20px; }
  .drawer__footer { grid-template-columns: 1fr; padding: 16px 20px 22px; }
  .detail-row { grid-template-columns: 125px 1fr; }
  .modal { padding: 24px 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  .notifications { position: fixed; top: 62px; right: 12px; left: 12px; width: auto; }
  .profile-menu { position: fixed; top: 62px; right: 12px; width: 260px; }
  .export-menu { left: 0; }
}

@media print {
  body { background: #fff; }
  .app { width: 100%; padding: 0; }
  .topbar__actions, .hero__actions, .registry-toolbar, .priorities-card, .drawer, .modal, .command-palette, .context-menu, .toast-region { display: none !important; }
  .overview { grid-template-columns: 1.7fr 1fr 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .card, .calendar-card, .registry-card { box-shadow: none; break-inside: avoid; }
}
