@font-face { font-family: "Mark"; src: url("fonts/markpro-book.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Mark"; src: url("fonts/markpro-medium.otf") format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Mark"; src: url("fonts/markpro-bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Mark"; src: url("fonts/markpro-heavy.otf") format("opentype"); font-weight: 800; font-display: swap; }

:root {
    --ink: #171710;
    --muted: #5f5d55;
    --soft: #817f76;
    --paper: #f3f2ed;
    --white: #fff;
    --line: #e5e3da;
    --line-dark: #d5d2c7;
    --accent: #e64d78;
    --accent-dark: #ad2855;
    --accent-soft: #fce8ef;
    --green: #42a86d;
    --green-soft: #eaf7ef;
    --orange: #c77a2e;
    --orange-soft: #fff3e6;
    --red: #cf4e3a;
    --red-soft: #fcecea;
    --purple: #7464ce;
    --shadow: 0 15px 45px rgba(23, 23, 16, .06);
    --font: "Mark", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--paper); color: var(--ink); font: 400 15.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body.detail-open { overflow: hidden; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(230, 77, 120, .22); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }

.app-header { position: sticky; z-index: 50; top: 0; display: flex; min-height: 68px; align-items: center; gap: 28px; padding: 10px max(24px, calc((100vw - 1480px) / 2)); border-bottom: 1px solid rgba(229, 227, 218, .9); background: rgba(255, 255, 255, .94); backdrop-filter: blur(16px); }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 42px; height: 42px; flex: 0 0 auto; overflow: hidden; place-items: center; border-radius: 13px; background: var(--ink); box-shadow: 0 5px 15px rgba(23,23,16,.13); }
.brand-mark img { display: block; width: 42px; height: 42px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11.5px; }
.view-switcher { display: flex; align-items: center; gap: 3px; padding: 4px; border-radius: 11px; background: var(--paper); }
.view-button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; }
.view-button:hover { color: var(--ink); }
.view-button.is-active { background: var(--white); color: var(--ink); box-shadow: 0 2px 8px rgba(23,23,16,.06); }
.view-button span { min-width: 18px; padding: 1px 5px; border-radius: 99px; background: var(--line); font-size: 9px; text-align: center; }
.view-button.is-active span { background: var(--accent-soft); color: var(--accent-dark); }
.header-account { position: relative; display: flex; flex: 0 0 auto; align-items: center; gap: 8px; margin-left: auto; }
.theme-toggle { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.theme-toggle:hover { background: var(--paper); color: var(--ink); }
.theme-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: block; }
html[data-theme="dark"] .theme-icon-moon { display: none; }
.header-user { display: flex; align-items: center; gap: 9px; }
.user-avatar { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-size: 11px; font-weight: 700; }
.user-copy strong, .user-copy small { display: block; }
.user-copy strong { max-width: 160px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { color: var(--muted); font-size: 10px; }
.icon-button { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muted); text-decoration: none; }
.icon-button:hover { background: var(--paper); color: var(--ink); }
.icon-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-switcher { position: static; flex: 0 0 auto; }
.app-switcher-toggle { display: grid; width: 36px; height: 36px; cursor: pointer; list-style: none; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.app-switcher-toggle::-webkit-details-marker { display: none; }
.app-switcher-toggle:hover, .app-switcher[open] .app-switcher-toggle { background: var(--paper); color: var(--ink); }
.app-switcher-dots { width: 18px; height: 18px; background-image: radial-gradient(circle, currentColor 1.45px, transparent 1.7px); background-position: 0 0; background-size: 6px 6px; }
.app-switcher-menu { position: absolute; z-index: 100; top: calc(100% + 12px); right: 0; width: min(312px, calc(100vw - 28px)); padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); box-shadow: 0 22px 60px rgba(23,23,16,.16); }
.app-switcher-title strong, .app-switcher-title small { display: block; }
.app-switcher-title strong { font-size: 14px; font-weight: 700; }
.app-switcher-title small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.app-switcher-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 13px; }
.app-switcher-item { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 9px; border-radius: 12px; color: var(--ink); font-size: 11.5px; font-weight: 500; text-decoration: none; }
.app-switcher-item:hover { background: var(--paper); }
.app-switcher-item.is-current { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.app-switcher-icon { display: block; width: 37px; height: 37px; flex: 0 0 auto; overflow: hidden; border-radius: 11px; }
.app-switcher-icon img { display: block; width: 100%; height: 100%; }

.app-shell { width: min(1480px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 70px; }
.cycle-strip { display: grid; grid-template-columns: auto minmax(320px, 1fr) auto; align-items: center; gap: 22px; min-height: 70px; margin-bottom: 14px; padding: 10px 12px 10px 17px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.72); }
.cycle-heading { display: flex; align-items: center; gap: 10px; min-width: 215px; }
.cycle-heading small, .cycle-heading strong { display: block; }
.cycle-heading small { color: var(--soft); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.cycle-heading strong { margin-top: 1px; font-size: 13px; font-weight: 500; }
.cycle-signal { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.cycle-picker { display: flex; min-width: 0; gap: 5px; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.cycle-option { min-width: 108px; flex: 0 0 auto; padding: 7px 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; }
.cycle-option:hover { background: var(--white); }
.cycle-option.is-active { border-color: #efb6c7; background: var(--accent-soft); color: var(--accent-dark); }
.cycle-option strong, .cycle-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cycle-option strong { font-size: 11px; font-weight: 500; }
.cycle-option small { margin-top: 2px; font-size: 9px; }
.sync-status { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 9px 14px; border: 1px solid transparent; border-radius: 9px; font-size: 11px; font-weight: 700; }
.button-secondary { border-color: var(--line-dark); background: var(--white); color: var(--ink); }
.button-secondary:hover { border-color: #bdb9ad; background: #fcfcfa; }
.button-small { min-height: 34px; padding: 7px 11px; font-size: 10px; }
.alert { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; padding: 13px 15px; border: 1px solid #f0c3bb; border-left: 4px solid var(--red); border-radius: 12px; background: var(--red-soft); color: #843827; font-size: 12px; }
.alert button { border: 0; background: transparent; color: inherit; font-size: 11px; font-weight: 700; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: 0 8px 25px rgba(23,23,16,.035); }
.kpi-card { display: flex; min-height: 82px; align-items: center; gap: 13px; padding: 15px 20px; border: 0; border-right: 1px solid var(--line); background: transparent; color: inherit; text-align: left; }
.kpi-card:last-child { border-right: 0; }
.kpi-card:hover { background: #fcfcfa; }
.kpi-card > span:last-child strong, .kpi-card > span:last-child small { display: block; }
.kpi-card strong { font-size: 24px; font-weight: 700; letter-spacing: -.035em; }
.kpi-card small { color: var(--muted); font-size: 11px; }
.kpi-icon { display: grid; width: 37px; height: 37px; flex: 0 0 auto; place-items: center; border-radius: 11px; font-size: 16px; font-weight: 800; }
.kpi-icon.is-accent { background: var(--accent-soft); color: var(--accent-dark); }
.kpi-icon.is-danger { background: var(--red-soft); color: var(--red); }
.kpi-icon.is-warning { background: var(--orange-soft); color: var(--orange); }
.kpi-icon.is-success { background: var(--green-soft); color: var(--green); }

.filter-panel { display: grid; grid-template-columns: minmax(280px, 1.5fr) repeat(3, minmax(140px, .55fr)) auto auto; align-items: stretch; gap: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.74); }
.search-control { display: flex; min-height: 46px; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line-dark); border-radius: 10px; background: var(--white); }
.search-control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-control svg { width: 17px; flex: 0 0 auto; fill: none; stroke: var(--soft); stroke-width: 1.7; stroke-linecap: round; }
.search-control input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search-control input::placeholder { color: var(--soft); }
.search-control kbd { padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--soft); font: 9px/1.6 var(--font); }
.filter-field { display: grid; align-content: center; padding: 5px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.filter-field span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.filter-field select { min-width: 0; padding: 2px 22px 2px 0; border: 0; outline: 0; background-color: transparent; color: var(--ink); font-size: 11px; font-weight: 500; }
.status-filter { position: relative; min-width: 112px; }
.status-filter summary { display: grid; min-height: 46px; cursor: pointer; list-style: none; align-content: center; padding: 5px 28px 5px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.status-filter summary::after { position: absolute; top: 17px; right: 11px; border: 4px solid transparent; border-top-color: var(--muted); content: ""; }
.status-filter summary::-webkit-details-marker { display: none; }
.status-filter summary span { display: block; margin-top: 1px; color: var(--ink); font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.status-filter > div { position: absolute; z-index: 40; top: calc(100% + 7px); right: 0; display: grid; width: 245px; max-height: 390px; gap: 2px; overflow-y: auto; padding: 9px; border: 1px solid var(--line); border-radius: 13px; background: var(--white); box-shadow: 0 18px 50px rgba(23,23,16,.16); }
.status-option { --status: var(--soft); display: grid; grid-template-columns: 15px 8px minmax(0,1fr); align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; font-size: 11px; }
.status-option:hover { background: var(--paper); }
.status-option input { margin: 0; accent-color: var(--accent); }
.status-swatch { width: 7px; height: 7px; border-radius: 50%; background: var(--status); }
.filter-reset { border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.filter-reset:hover { background: var(--paper); color: var(--ink); }
.active-filter-row { display: flex; min-height: 43px; align-items: center; gap: 12px; padding: 7px 4px 12px; }
.active-filters { display: flex; min-width: 0; flex: 1; flex-wrap: wrap; gap: 5px; }
.filter-chip { padding: 4px 8px; border: 1px solid #efc7d3; border-radius: 99px; background: var(--accent-soft); color: var(--accent-dark); font-size: 10px; font-weight: 500; }
.filter-chip span { margin-left: 3px; font-size: 12px; }
.filter-empty { color: var(--muted); font-size: 10px; }
.toggle-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 500; white-space: nowrap; }
.toggle-label input { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); }

.workspace { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--white); box-shadow: var(--shadow); }
.workspace-heading { display: flex; min-height: 88px; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 25px 19px 30px; border-bottom: 1px solid var(--line); }
.panel-kicker { margin: 0; color: var(--accent-dark); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.workspace-heading h1 { margin: 4px 0 0; font-size: 25px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
.workspace-summary { max-width: 440px; margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.subtle-badge { padding: 5px 8px; border-radius: 99px; background: var(--paper); color: var(--muted); font-size: 10px; font-weight: 500; }
.attention-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.attention-card { --tone: var(--soft); --tone-soft: var(--paper); display: flex; min-width: 0; min-height: 265px; flex-direction: column; padding: 19px 17px 16px; border-right: 1px solid var(--line); }
.attention-card:last-child { border-right: 0; }
.attention-card.tone-danger { --tone: var(--red); --tone-soft: var(--red-soft); }
.attention-card.tone-warning { --tone: var(--orange); --tone-soft: var(--orange-soft); }
.attention-card.tone-blocked { --tone: #a84234; --tone-soft: #f8e7e5; }
.attention-card.tone-quiet { --tone: var(--purple); --tone-soft: #efedfb; }
.attention-card.tone-neutral { --tone: #78766d; --tone-soft: var(--paper); }
.attention-card.tone-accent { --tone: var(--accent-dark); --tone-soft: var(--accent-soft); }
.attention-head { display: flex; align-items: center; gap: 10px; }
.attention-symbol { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--tone-soft); color: var(--tone); font-size: 14px; font-weight: 800; }
.attention-head strong, .attention-head small { display: block; }
.attention-head strong { font-size: 20px; font-weight: 700; line-height: 1; }
.attention-head small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.attention-card > p { min-height: 30px; margin: 12px 0 10px; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.attention-list { display: grid; gap: 5px; }
.attention-list button { display: grid; width: 100%; padding: 7px 8px; border: 0; border-radius: 8px; background: #fafaf8; color: inherit; text-align: left; text-decoration: none; }
.attention-list button:hover { background: var(--tone-soft); }
.attention-list button > span { overflow: hidden; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .045em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.attention-list button strong { overflow: hidden; margin-top: 2px; font-size: 10.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.attention-list time { margin-top: 1px; color: var(--muted); font-size: 8.5px; }
.attention-list time.is-overdue { color: var(--red); font-weight: 800; }
.attention-clear { display: block; padding: 13px 8px; border-radius: 8px; background: var(--green-soft); color: #347c51; font-size: 10px; text-align: center; }
.attention-action { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding: 10px 0 0; border: 0; background: transparent; color: var(--tone); font-size: 9.5px; font-weight: 700; }
.insight-grid { display: grid; grid-template-columns: 1.05fr .95fr; }
.insight-panel { min-width: 0; }
.insight-panel + .insight-panel { border-left: 1px solid var(--line); }
.panel-heading { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px 14px 23px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 3px 0 0; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.team-list { display: grid; }
.team-row { display: grid; min-height: 65px; grid-template-columns: 33px minmax(150px, 1fr) repeat(3, 55px); align-items: center; gap: 11px; padding: 9px 20px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; text-align: left; }
.team-row:last-child { border-bottom: 0; }
.team-row:hover { background: #fcfcfa; }
.person-avatar { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 2px solid var(--white); border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-size: 9px; font-weight: 700; }
.person-avatar.is-empty { background: var(--paper); color: var(--soft); }
.person-name strong, .person-name small { display: block; }
.person-name strong { font-size: 11px; font-weight: 500; }
.person-name small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.team-metric { text-align: right; }
.team-metric strong, .team-metric small { display: block; }
.team-metric strong { font-size: 13px; font-weight: 700; }
.team-metric small { color: var(--muted); font-size: 8px; }
.team-metric.has-danger strong { color: var(--red); }
.flow-list { display: grid; padding: 9px 18px 13px; }
.flow-row { --status: var(--soft); display: grid; min-height: 33px; grid-template-columns: 118px minmax(80px, 1fr) 24px; align-items: center; gap: 10px; padding: 2px 5px; border: 0; border-radius: 7px; background: transparent; color: inherit; text-align: left; }
.flow-row:hover { background: var(--paper); }
.flow-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9.5px; font-weight: 500; }
.flow-label i { width: 7px; height: 7px; border-radius: 50%; background: var(--status); }
.flow-row progress { width: 100%; height: 6px; overflow: hidden; border: 0; border-radius: 9px; background: var(--paper); }
.flow-row progress::-webkit-progress-bar { border-radius: 9px; background: var(--paper); }
.flow-row progress::-webkit-progress-value { border-radius: 9px; background: var(--status); }
.flow-row progress::-moz-progress-bar { border-radius: 9px; background: var(--status); }
.flow-row > strong { font-size: 10px; font-weight: 700; text-align: right; }

.sort-control { display: flex; min-height: 41px; align-items: center; gap: 8px; padding: 5px 6px 5px 11px; border: 1px solid var(--line-dark); border-radius: 10px; background: var(--white); }
.sort-control span { color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.sort-control select { min-width: 145px; padding: 4px 24px 4px 4px; border: 0; outline: 0; background-color: transparent; color: var(--ink); font-size: 11px; font-weight: 500; }
.board-workspace { overflow: visible; background: transparent; box-shadow: none; }
.board-workspace > .workspace-heading { border: 1px solid var(--line); border-radius: 20px 20px 0 0; background: var(--white); }
.board { display: flex; min-height: 590px; gap: 10px; overflow-x: auto; padding: 12px 2px 18px; scroll-snap-type: x proximity; }
.board-column { --status: var(--soft); width: 292px; min-width: 292px; overflow: hidden; align-self: flex-start; border: 1px solid var(--line); border-radius: 14px; background: #eae9e4; scroll-snap-align: start; }
.board-column > header { display: grid; min-height: 49px; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--white); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--status); }
.board-column > header strong { font-size: 11.5px; font-weight: 700; }
.board-column > header small { min-width: 23px; padding: 2px 6px; border-radius: 99px; background: var(--paper); color: var(--muted); font-size: 9px; font-weight: 700; text-align: center; }
.board-stack { display: grid; gap: 8px; padding: 8px; }
.issue-card { overflow: hidden; border: 1px solid rgba(23,23,16,.08); border-radius: 11px; background: var(--white); box-shadow: 0 3px 10px rgba(23,23,16,.035); }
.issue-card.has-overdue { border-left: 3px solid var(--red); }
.issue-card.has-stale:not(.has-overdue) { border-left: 3px solid var(--orange); }
.issue-card.has-conflict:not(.has-overdue):not(.has-stale) { border-left: 3px solid var(--accent); }
.issue-main { display: block; width: 100%; padding: 12px; border: 0; background: transparent; color: inherit; text-align: left; text-decoration: none; }
.issue-main:hover { background: #fdfdfb; }
.issue-context { display: flex; min-width: 0; align-items: center; gap: 5px; color: var(--muted); font-size: 8.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.issue-context span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.issue-context span:first-child { color: var(--accent-dark); }
.issue-context span + span::before { margin-right: 5px; color: var(--line-dark); content: "/"; }
.issue-context code { margin-left: auto; font: 9px/1 var(--font); }
.issue-card h3 { margin: 8px 0 11px; font-size: 13px; font-weight: 500; letter-spacing: -.005em; line-height: 1.4; }
.issue-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.deadline-badge, .priority-badge, .meta-badge, .warning-badge { display: inline-flex; min-height: 20px; align-items: center; padding: 3px 6px; border-radius: 5px; background: var(--paper); color: var(--muted); font-size: 8.5px; font-weight: 700; }
.deadline-badge.is-overdue { background: var(--red-soft); color: var(--red); }
.deadline-badge.is-soon { background: var(--orange-soft); color: var(--orange); }
.priority-badge.priority-0, .priority-badge.priority-1 { background: var(--red-soft); color: var(--red); }
.priority-badge.priority-2 { background: var(--orange-soft); color: var(--orange); }
.warning-badge { background: var(--accent-soft); color: var(--accent-dark); }
.issue-footer { display: flex; align-items: center; gap: 7px; margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line); }
.assignee-stack { display: flex; min-width: 0; flex: 1; align-items: center; }
.assignee-stack .person-avatar { width: 24px; height: 24px; margin-right: -5px; font-size: 7px; }
.assignee-name { overflow: hidden; margin-left: 10px; color: var(--muted); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.issue-footer time { color: var(--muted); font-size: 8.5px; white-space: nowrap; }
.open-arrow { color: var(--soft); font-size: 10px; }
.column-empty { display: grid; min-height: 94px; place-items: center; color: var(--soft); font-size: 10px; }
.is-compact .board-column { width: 252px; min-width: 252px; }
.is-compact .issue-main { padding: 9px 10px; }
.is-compact .issue-card h3 { margin-block: 6px 8px; font-size: 11.5px; }
.is-compact .issue-tags .meta-badge { display: none; }
.is-compact .issue-footer { margin-top: 7px; padding-top: 6px; }

.planning-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.cycle-timeline { padding: 24px 28px 32px; }
.timeline-group { position: relative; padding: 0 0 28px 29px; border-left: 1px solid var(--line); }
.timeline-group:last-child { padding-bottom: 0; }
.timeline-marker { position: absolute; top: 14px; left: -6px; width: 11px; height: 11px; border: 2px solid var(--white); border-radius: 50%; background: var(--line-dark); box-shadow: 0 0 0 1px var(--line-dark); }
.timeline-group.is-current .timeline-marker { background: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 0 5px var(--accent-soft); }
.timeline-group > header { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 20px; margin-bottom: 12px; }
.timeline-group > header p { margin: 0; color: var(--accent-dark); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.timeline-group > header h2 { margin: 3px 0 0; font-size: 18px; font-weight: 700; }
.timeline-group dl { display: flex; gap: 18px; margin: 0; }
.timeline-group dl div { min-width: 45px; text-align: right; }
.timeline-group dt { color: var(--muted); font-size: 8.5px; font-weight: 700; text-transform: uppercase; }
.timeline-group dd { margin: 1px 0 0; font-size: 13px; font-weight: 700; }
.has-danger dd, .is-danger { color: var(--red) !important; }
.timeline-issues { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.timeline-issues button { display: grid; width: 100%; min-height: 49px; grid-template-columns: 7px minmax(0, 1fr) auto 27px; align-items: center; gap: 10px; padding: 7px 11px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; text-align: left; text-decoration: none; }
.timeline-issues button:last-child { border-bottom: 0; }
.timeline-issues button:hover { background: #fcfcfa; }
.timeline-issues button > span:nth-child(2) strong, .timeline-issues button > span:nth-child(2) small { display: block; }
.timeline-issues button > span:nth-child(2) strong { font-size: 10.5px; font-weight: 500; }
.timeline-issues button > span:nth-child(2) small { margin-top: 2px; color: var(--muted); font-size: 8.5px; }
.status-pip { --status: var(--soft); width: 7px; height: 7px; border-radius: 50%; background: var(--status); }
.person-mini { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: var(--paper); color: var(--muted); font-size: 8px; font-weight: 700; }
.more-copy { margin: 7px 0 0; color: var(--muted); font-size: 9px; }
.deadline-radar { border-left: 1px solid var(--line); background: #fcfcfa; }
.deadline-list { display: grid; }
.deadline-row { display: grid; width: 100%; min-height: 60px; grid-template-columns: 38px minmax(0,1fr) 8px; align-items: center; gap: 11px; padding: 9px 18px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; text-align: left; text-decoration: none; }
.deadline-row:hover { background: var(--white); }
.deadline-row > time { display: grid; width: 37px; height: 39px; place-items: center; align-content: center; border: 1px solid var(--line); border-radius: 9px; background: var(--white); }
.deadline-row > time strong, .deadline-row > time small { display: block; line-height: 1; }
.deadline-row > time strong { font-size: 14px; font-weight: 700; }
.deadline-row > time small { margin-top: 2px; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.deadline-row.is-overdue > time { border-color: #f1bfb6; background: var(--red-soft); color: var(--red); }
.deadline-row.is-soon > time { border-color: #efd6b8; background: var(--orange-soft); color: var(--orange); }
.deadline-row > span:nth-child(2) strong, .deadline-row > span:nth-child(2) small { display: block; }
.deadline-row > span:nth-child(2) strong { font-size: 10.5px; font-weight: 500; }
.deadline-row > span:nth-child(2) small { margin-top: 2px; color: var(--muted); font-size: 8.5px; }
.empty-inline { padding: 10px 20px; color: var(--muted); font-size: 10px; }

.project-toolbar { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 24px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.project-toolbar p { margin: 0; }
.project-toolbar > div { display: flex; align-items: center; gap: 7px; }
.risk-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--soft); }
.risk-dot.is-danger { background: var(--red); }
.risk-dot.is-warning { background: var(--orange); }
.risk-dot.is-good { background: var(--green); }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
.project-card { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.project-card:nth-child(3n) { border-right: 0; }
.project-card > header { display: grid; min-height: 80px; grid-template-columns: 8px minmax(0,1fr) 32px; align-items: center; gap: 10px; padding: 15px 18px; }
.project-card > header p { margin: 0 0 3px; color: var(--accent-dark); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.project-card > header h2 { overflow: hidden; margin: 0; font-size: 16px; font-weight: 500; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }
.project-card > header a { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 8px; background: var(--paper); color: var(--muted); text-decoration: none; }
.project-card > header a:hover { background: var(--ink); color: var(--white); }
.project-meta { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); background: #fcfcfa; }
.project-meta > span { min-width: 0; padding: 11px 13px; border-right: 1px solid var(--line); }
.project-meta > span:last-child { border-right: 0; }
.project-meta strong, .project-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-meta strong { font-size: 11px; font-weight: 500; }
.project-meta small { margin-top: 2px; color: var(--muted); font-size: 8.5px; }
.project-statuses { display: flex; min-height: 66px; flex-wrap: wrap; align-content: center; gap: 5px; padding: 12px 18px; }
.project-statuses span { --status: var(--soft); display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px; border-radius: 5px; background: var(--paper); color: var(--muted); font-size: 8.5px; font-weight: 500; }
.project-statuses i { width: 6px; height: 6px; border-radius: 50%; background: var(--status); }
.project-footer { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9.5px; }
.project-footer > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-footer strong { color: var(--muted); font-weight: 700; white-space: nowrap; }
.risk-danger .project-footer strong { color: var(--red); }
.risk-warning .project-footer strong { color: var(--orange); }
.risk-good .project-footer strong { color: var(--green); }

.empty-state { display: flex; min-height: 210px; align-items: center; justify-content: center; gap: 13px; padding: 35px; color: var(--muted); text-align: left; }
.empty-state > span { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: var(--paper); color: var(--soft); }
.empty-state strong { font-size: 12px; font-weight: 500; }
.empty-state p { margin: 2px 0 0; color: var(--muted); font-size: 10.5px; }
.toast { position: fixed; z-index: 250; right: 20px; bottom: 20px; width: min(360px, calc(100% - 40px)); padding: 13px 15px; border: 1px solid var(--line-dark); border-left: 4px solid var(--accent); border-radius: 10px; background: var(--white); box-shadow: 0 12px 35px rgba(23,23,16,.16); font-size: 11px; animation: toast-in .2s ease; }
@keyframes toast-in { from { transform: translateY(7px); opacity: 0; } }

.detail-layer { position: fixed; z-index: 200; inset: 0; display: flex; justify-content: flex-end; }
.detail-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(23,23,16,.38); cursor: default; animation: detail-fade .18s ease; }
.detail-drawer { position: relative; z-index: 1; display: flex; width: min(820px, calc(100vw - 80px)); height: 100%; flex-direction: column; overflow: hidden; outline: 0; background: var(--paper); box-shadow: -20px 0 65px rgba(23,23,16,.2); animation: detail-slide .22s ease; }
.detail-drawer-head { display: flex; min-height: 68px; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 18px 12px 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.detail-drawer-head strong { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; }
.detail-close { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 10px; background: var(--paper); color: var(--muted); font-size: 23px; font-weight: 400; line-height: 1; }
.detail-close:hover { background: var(--line); color: var(--ink); }
.detail-content { min-height: 0; flex: 1; overflow-y: auto; }
.detail-hero { --status: var(--soft); padding: 27px 30px 25px; border-bottom: 1px solid var(--line); background: var(--white); }
.detail-reference { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.detail-reference > span + span::before { margin-right: 7px; color: var(--line-dark); content: "/"; }
.detail-reference code { font: 10px/1 var(--font); }
.confidential-badge { margin-left: auto; padding: 4px 7px; border-radius: 5px; background: var(--red-soft); color: var(--red); font-size: 8px; }
.detail-hero h2 { max-width: 690px; margin: 11px 0 16px; font-size: clamp(22px, 3vw, 30px); font-weight: 500; letter-spacing: -.025em; line-height: 1.25; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-status { display: inline-flex; min-height: 26px; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 7px; background: color-mix(in srgb, var(--status) 10%, var(--white)); color: var(--ink); font-size: 10px; font-weight: 500; }
.detail-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--status); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(250px, .75fr); align-items: start; }
.detail-main-column { min-width: 0; padding: 18px; }
.detail-side-column { min-width: 0; padding: 18px 18px 18px 0; }
.detail-section, .detail-fact-card { overflow: hidden; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.detail-section-heading { display: flex; min-height: 65px; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 17px; border-bottom: 1px solid var(--line); }
.detail-section-heading h3 { margin: 3px 0 0; font-size: 15px; font-weight: 500; }
.detail-section-heading > span, .detail-section-heading > strong { color: var(--muted); font-size: 9px; font-weight: 500; }
.issue-description { min-height: 150px; padding: 20px 19px 24px; color: #35352f; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.issue-description a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.description-empty { margin: 0; color: var(--muted); font-style: italic; }
.task-section { padding-bottom: 15px; }
.task-section progress { width: calc(100% - 34px); height: 9px; overflow: hidden; margin: 17px 17px 4px; border: 0; border-radius: 9px; background: var(--paper); }
.task-section progress::-webkit-progress-bar { border-radius: 9px; background: var(--paper); }
.task-section progress::-webkit-progress-value { border-radius: 9px; background: var(--green); }
.task-section progress::-moz-progress-bar { border-radius: 9px; background: var(--green); }
.task-section > small { display: block; padding: 0 17px; color: var(--muted); font-size: 9px; }
.detail-labels { display: flex; flex-wrap: wrap; gap: 6px; padding: 15px 17px; }
.detail-labels > span { padding: 5px 8px; border-radius: 6px; background: var(--paper); color: var(--muted); font-size: 9px; font-weight: 500; }
.detail-labels > span.is-pm { background: var(--accent-soft); color: var(--accent-dark); }
.detail-fact-card { padding: 6px 0; }
.detail-fact-card > h3 { margin: 0; padding: 10px 14px 11px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.detail-fact { display: grid; gap: 2px; padding: 9px 14px; border-bottom: 1px solid #efeee9; }
.detail-fact:last-child { border-bottom: 0; }
.detail-fact > span { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.detail-fact strong, .detail-fact a { font-size: 10px; font-weight: 500; text-decoration: none; }
.detail-fact a { color: var(--accent-dark); }
.detail-fact.is-danger strong { color: var(--red); }
.detail-assignees { display: grid; gap: 7px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.detail-person { display: flex; align-items: center; gap: 8px; }
.detail-person strong, .detail-person small { display: block; }
.detail-person strong { font-size: 10px; font-weight: 500; }
.detail-person small { color: var(--muted); font-size: 8px; }
.detail-person .person-avatar { width: 29px; height: 29px; }
.detail-empty-value { color: var(--muted); font-size: 10px; }
.detail-actions { position: sticky; bottom: 0; display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 18px 13px 22px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.detail-actions > span { color: var(--muted); font-size: 9px; }
.detail-gitlab-link { background: var(--ink); color: var(--white); text-decoration: none; }
.detail-gitlab-link:hover { background: #303027; }
.detail-gitlab-link span { margin-left: 5px; }
.detail-loading { display: grid; gap: 12px; padding: 30px; }
.detail-loading span { height: 68px; border-radius: 12px; background: linear-gradient(90deg, #e8e6df 25%, #f5f4f0 50%, #e8e6df 75%); background-size: 200% 100%; animation: detail-shimmer 1.1s infinite linear; }
.detail-loading span:first-child { height: 150px; }
.detail-loading span:nth-child(3) { width: 72%; }
.detail-error { display: grid; min-height: 360px; place-items: center; align-content: center; gap: 14px; padding: 30px; color: var(--muted); text-align: center; }
.detail-error > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--red-soft); color: var(--red); font-size: 18px; font-weight: 700; }
.detail-error strong { max-width: 420px; font-size: 12px; font-weight: 500; }
@keyframes detail-fade { from { opacity: 0; } }
@keyframes detail-slide { from { transform: translateX(40px); opacity: .6; } }
@keyframes detail-shimmer { to { background-position: -200% 0; } }

.status-triage { --status: #9a6ad6; }
.status-scheduled { --status: #397cc8; }
.status-backlog { --status: #8f8d83; }
.status-in_progress { --status: #df8b24; }
.status-blocked { --status: #cf4e3a; }
.status-ready { --status: #6c8c57; }
.status-in_review { --status: #7464ce; }
.status-code_accepted { --status: #4f9a70; }
.status-ready_for_customer { --status: #159e91; }
.status-ready_for_live { --status: #1477a5; }
.status-is_live { --status: #2c9d58; }
.status-unknown_status { --status: #c35d7c; }
.status-no_status { --status: #77756c; }

html[data-theme="dark"] {
    --ink: #f0efe8;
    --muted: #b9b7ae;
    --soft: #949289;
    --paper: #171714;
    --white: #23231f;
    --line: #393833;
    --line-dark: #4b4a43;
    --accent: #ef6088;
    --accent-dark: #ff9ab6;
    --accent-soft: #43232e;
    --green: #65c98b;
    --green-soft: #1d3829;
    --orange: #eba75d;
    --orange-soft: #412f1e;
    --red: #ef7664;
    --red-soft: #442520;
    --purple: #9d90ef;
    --shadow: 0 18px 50px rgba(0,0,0,.22);
}
html[data-theme="dark"] body { background: #171714; }
html[data-theme="dark"] .app-header { border-bottom-color: rgba(57,56,51,.92); background: rgba(35,35,31,.94); }
html[data-theme="dark"] .view-button.is-active { background: #34342f; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
html[data-theme="dark"] .app-switcher-menu { box-shadow: 0 22px 60px rgba(0,0,0,.42); }
html[data-theme="dark"] .cycle-strip,
html[data-theme="dark"] .filter-panel { background: rgba(35,35,31,.8); }
html[data-theme="dark"] .cycle-option:hover { background: #2c2c27; }
html[data-theme="dark"] .cycle-option.is-active { border-color: #714052; }
html[data-theme="dark"] .button-secondary:hover,
html[data-theme="dark"] .kpi-card:hover,
html[data-theme="dark"] .team-row:hover { background: #2b2b26; }
html[data-theme="dark"] .search-control:focus-within { border-color: var(--accent); }
html[data-theme="dark"] input,
html[data-theme="dark"] select { color-scheme: dark; }
html[data-theme="dark"] select option { background: var(--white); color: var(--ink); }
html[data-theme="dark"] .attention-list button { background: #292924; }
html[data-theme="dark"] .attention-list button:hover { background: var(--tone-soft); }
html[data-theme="dark"] .attention-card.tone-danger { --tone-soft: #442520; }
html[data-theme="dark"] .attention-card.tone-warning { --tone-soft: #412f1e; }
html[data-theme="dark"] .attention-card.tone-blocked { --tone: #ef7664; --tone-soft: #402522; }
html[data-theme="dark"] .attention-card.tone-quiet { --tone: #a99df2; --tone-soft: #302d49; }
html[data-theme="dark"] .attention-card.tone-neutral { --tone: #aaa89e; --tone-soft: #30302b; }
html[data-theme="dark"] .attention-card.tone-accent { --tone: var(--accent-dark); --tone-soft: var(--accent-soft); }
html[data-theme="dark"] .board-column { background: #1b1b18; }
html[data-theme="dark"] .issue-card { border-color: #41403a; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
html[data-theme="dark"] .issue-main:hover,
html[data-theme="dark"] .timeline-issues button:hover,
html[data-theme="dark"] .deadline-row:hover { background: #292924; }
html[data-theme="dark"] .deadline-radar,
html[data-theme="dark"] .project-meta { background: #1d1d1a; }
html[data-theme="dark"] .project-card > header a:hover { background: #f0efe8; color: #171714; }
html[data-theme="dark"] .detail-backdrop { background: rgba(0,0,0,.62); }
html[data-theme="dark"] .detail-drawer { box-shadow: -20px 0 65px rgba(0,0,0,.5); }
html[data-theme="dark"] .detail-drawer-head,
html[data-theme="dark"] .detail-actions { background: rgba(35,35,31,.97); }
html[data-theme="dark"] .issue-description { color: #deddd5; }
html[data-theme="dark"] .detail-loading span { background: linear-gradient(90deg, #2c2c27 25%, #3a3933 50%, #2c2c27 75%); background-size: 200% 100%; }
html[data-theme="dark"] .detail-gitlab-link { background: #f0efe8; color: #171714; }
html[data-theme="dark"] .detail-gitlab-link:hover { background: #d9d8d1; }
html[data-theme="dark"] .login-page { background: radial-gradient(circle at 82% 10%, rgba(239,96,136,.13), transparent 26rem), #171714; }
html[data-theme="dark"] .login-card { box-shadow: 0 24px 65px rgba(0,0,0,.32), inset 0 3px 0 var(--accent); }
html[data-theme="dark"] .login-setup code { background: rgba(255,255,255,.08); }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(circle at 82% 10%, rgba(230,77,120,.14), transparent 26rem), #f4f3ee; }
.login-theme-toggle { position: fixed; z-index: 10; top: 20px; right: 20px; border: 1px solid var(--line); background: var(--white); box-shadow: 0 7px 22px rgba(23,23,16,.08); }
.login-card { width: min(440px, 100%); padding: 38px 36px 32px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); box-shadow: 0 24px 65px rgba(23,23,16,.1), inset 0 3px 0 var(--accent); }
.login-brand { margin: 0 0 26px; }
.login-brand .brand-mark { box-shadow: 0 0 0 3px var(--accent-soft), 0 5px 15px rgba(23,23,16,.13); }
.login-card h1 { margin: 0 0 6px; font-size: 26px; font-weight: 500; line-height: 1.2; }
.login-lead { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.login-button { display: inline-flex; width: 100%; min-height: 46px; align-items: center; justify-content: center; gap: 10px; padding: 11px 18px; border: 0; border-radius: 10px; background: var(--accent); color: white; font-size: 13px; font-weight: 700; text-decoration: none; transition: filter .15s, transform .15s; }
.login-button:hover { filter: brightness(.96); transform: translateY(-1px); }
.login-button svg { width: 18px; height: 18px; flex: 0 0 auto; }
.login-hint { margin: 14px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.login-hint strong { color: var(--ink); }
.login-alert { margin: 0 0 20px; padding: 12px 14px; border: 1px solid #f3c4bb; border-radius: 12px; background: #fdeeea; color: #8a3a28; font-size: 13px; line-height: 1.5; }
.login-setup { margin-top: 6px; padding: 18px 20px; border: 1px dashed var(--line-dark); border-radius: 14px; background: var(--paper); }
.login-setup h2 { margin: 0 0 8px; font-size: 16px; }
.login-setup p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.login-setup code { display: block; padding: 6px; overflow-wrap: anywhere; border-radius: 6px; background: rgba(23,23,16,.07); font: 11px/1.4 Consolas, monospace; }

@media (max-width: 1260px) {
    .attention-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .attention-card { min-height: 240px; border-bottom: 1px solid var(--line); }
    .attention-card:nth-child(3n) { border-right: 0; }
    .project-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .project-card:nth-child(3n) { border-right: 1px solid var(--line); }
    .project-card:nth-child(2n) { border-right: 0; }
    .filter-panel { grid-template-columns: minmax(260px, 1.3fr) repeat(2, minmax(135px,.55fr)) auto auto; }
    .filter-field:nth-of-type(4) { grid-column: 2; }
}

@media (max-width: 980px) {
    .cycle-strip { grid-template-columns: auto minmax(280px,1fr); }
    .sync-status { grid-column: 1 / -1; justify-content: flex-end; padding-top: 7px; border-top: 1px solid var(--line); }
    .kpi-grid { grid-template-columns: repeat(2,1fr); }
    .kpi-card:nth-child(2) { border-right: 0; }
    .kpi-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .filter-panel { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .search-control { grid-column: 1 / -1; }
    .filter-field:nth-of-type(4) { grid-column: auto; }
    .insight-grid, .planning-layout { grid-template-columns: 1fr; }
    .insight-panel + .insight-panel, .deadline-radar { border-top: 1px solid var(--line); border-left: 0; }
    .project-grid { grid-template-columns: 1fr; }
    .project-card, .project-card:nth-child(3n) { border-right: 0; }
}

@media (max-width: 780px) {
    .app-header { flex-wrap: wrap; gap: 8px 12px; padding: 9px 14px; }
    .brand > span:last-child, .user-copy { display: none; }
    .view-switcher { order: 3; width: 100%; gap: 1px; overflow-x: auto; }
    .view-button { min-width: max-content; flex: 1; justify-content: center; padding-inline: 8px; font-size: 10px; }
    .header-account { margin-left: auto; }
    .app-shell { width: min(100% - 24px, 1480px); padding-top: 18px; }
    .cycle-strip { grid-template-columns: 1fr; gap: 10px; }
    .cycle-picker { width: 100%; }
    .sync-status { grid-column: auto; justify-content: space-between; }
    .filter-panel { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .search-control { grid-column: 1 / -1; }
    .status-filter > div { right: auto; left: 0; }
    .active-filter-row { flex-wrap: wrap; }
    .active-filters { width: 100%; flex-basis: 100%; }
    .workspace-heading { min-height: 76px; align-items: flex-start; flex-direction: column; gap: 8px; padding: 17px 18px; }
    .workspace-summary { text-align: left; }
    .attention-grid { grid-template-columns: 1fr 1fr; }
    .attention-card, .attention-card:nth-child(3n) { min-height: 220px; border-right: 1px solid var(--line); }
    .attention-card:nth-child(2n) { border-right: 0; }
    .team-row { grid-template-columns: 30px minmax(110px,1fr) repeat(3,42px); gap: 7px; padding-inline: 12px; }
    .cycle-timeline { padding: 20px 16px 26px; }
    .timeline-group { padding-left: 20px; }
    .timeline-group > header { grid-template-columns: 1fr; }
    .timeline-group dl div { text-align: left; }
    .project-toolbar { align-items: flex-start; flex-direction: column; }
    .detail-drawer { width: 100%; }
    .detail-layout { grid-template-columns: 1fr; }
    .detail-side-column { padding: 0 18px 18px; }
    .detail-hero { padding: 23px 20px 21px; }
}

@media (max-width: 520px) {
    .kpi-card { min-height: 70px; padding: 11px 13px; }
    .kpi-card strong { font-size: 20px; }
    .kpi-icon { width: 31px; height: 31px; }
    .filter-panel { grid-template-columns: 1fr; }
    .search-control { grid-column: auto; }
    .attention-grid { grid-template-columns: 1fr; }
    .attention-card, .attention-card:nth-child(3n), .attention-card:nth-child(2n) { min-height: 0; border-right: 0; }
    .team-row { grid-template-columns: 30px minmax(0,1fr) repeat(3,35px); }
    .team-metric small { display: none; }
    .flow-row { grid-template-columns: 100px minmax(60px,1fr) 22px; }
    .timeline-issues button { grid-template-columns: 7px minmax(0,1fr) auto; }
    .timeline-issues .deadline-badge { grid-column: 2; }
    .timeline-issues .person-mini { grid-column: 3; grid-row: 1; }
    .project-meta { grid-template-columns: 1fr; }
    .project-meta > span { border-right: 0; border-bottom: 1px solid var(--line); }
    .project-meta > span:last-child { border-bottom: 0; }
    .detail-drawer-head { padding-inline: 16px 12px; }
    .detail-main-column, .detail-side-column { padding: 12px; }
    .detail-side-column { padding-top: 0; }
    .detail-actions { align-items: stretch; flex-direction: column; padding: 12px; }
    .detail-actions .button { width: 100%; }
    .login-page { padding: 14px; }
    .login-card { padding: 30px 24px 26px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
