:root {
  --paper: #f8f9fc;
  --white: #fff;
  --ink: #30313a;
  --muted: #626471;
  --line: #e2e3eb;
  --brand: #066ad8;
  --brand-dark: #0757b0;
  --brand-soft: #edf4ff;
  --sidebar: #f2f2fa;
  --radius: 14px;
  --shadow: 0 2px 4px #172b4d0b, 0 1px 2px #172b4d09;
  font-size: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, ol, ul { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .42; cursor: default; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #066ad8; outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.workspace { min-width: 0; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 36px; padding: 24px 15px 17px; background: var(--sidebar); color: var(--ink); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 7px; }
.brand strong { display: block; font-size: 15px; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.nav-group { display: grid; gap: 5px; }
.nav-group + .nav-group { margin-top: 27px; }
.nav-label { padding-left: 11px; margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.nav-item { display: flex; gap: 11px; align-items: center; text-align: left; min-height: 43px; padding: 8px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 14px; font-weight: 550; white-space: nowrap; }
.nav-item:hover { background: #e9edf6; color: #235492; }
.nav-item[aria-current="page"] { background: #e2e8f5; color: #235492; box-shadow: inset 2px 0 var(--brand); }
.nav-item .ico { color: #536c97; }
.nav-count { margin-left: auto; padding: 1px 7px; background: #dce8fa; color: #204e91; border-radius: 20px; font-size: 12px; }
.side-foot { margin-top: auto; padding: 13px 8px 0; border-top: 1px solid var(--line); color: var(--muted); display: grid; gap: 5px; font-size: 12px; }
.side-foot strong { font-weight: 650; color: var(--ink); }
.status-dot { display: inline-block; background: currentColor; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.side-foot .status-dot { color: #066ad8; margin-right: 6px; }
.topbar { min-height: 67px; padding: 10px clamp(16px, 2.8vw, 37px); display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--white); border-bottom: 1px solid var(--line); }
.crumb { color: #454f65; font-size: 14px; font-weight: 650; white-space: nowrap; display: flex; gap: 9px; align-items: center; }
.crumb .ico { color: var(--brand); }
.top-actions { display: flex; gap: 15px; align-items: center; }
.profile { display: flex; align-items: center; gap: 8px; }
.top-actions .icon-button { position: relative; }
.notify-dot { width: 8px; height: 8px; background: #c24e61; position: absolute; top: 6px; right: 6px; border: 1px solid white; border-radius: 50%; }
main { padding: 30px clamp(16px, 2.8vw, 37px) 36px; max-width: 1710px; margin: auto; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 23px; }
h1 { font-size: clamp(28px, 3vw, 38px); line-height: 1.11; letter-spacing: -.05em; font-weight: 760; }
.page-heading p { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.primary, .secondary, .quiet, .icon-button { border-radius: 8px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 37px; padding: 7px 12px; border: 1px solid transparent; font-size: 13px; font-weight: 650; line-height: 1.25; white-space: nowrap; }
.primary { background: var(--brand); color: white; padding: 10px 15px; box-shadow: var(--shadow); }
.primary:hover { background: var(--brand-dark); }
.secondary, .icon-button { color: #3f4960; background: white; border-color: var(--line); }
.secondary:hover, .icon-button:hover { background: #f1f6fd; border-color: #ccdcf3; }
.quiet { color: var(--brand); background: transparent; }
.quiet:hover { background: var(--brand-soft); }
.icon-button { width: 37px; padding: 0; }
.ico { position: relative; display: inline-block; width: 16px; height: 16px; flex: none; vertical-align: -.13em; }
.ico::before, .ico::after { content: ""; position: absolute; }
.ico-board::before { inset: 2px 1px; border: 1.5px solid currentColor; border-radius: 2px; }
.ico-board::after { top: 3px; bottom: 3px; left: 5px; width: 6px; border-left: 1.5px solid currentColor; border-right: 1.5px solid currentColor; }
.ico-inbox::before { inset: 5px 1px 2px; border: 1.5px solid currentColor; border-radius: 2px; }
.ico-inbox::after { inset: 2px 4px 7px; border: 1.5px solid currentColor; background: inherit; border-radius: 2px; }
.ico-bell::before { left: 3px; top: 2px; width: 10px; height: 10px; border: 1.5px solid currentColor; border-radius: 6px 6px 2px 2px; }
.ico-bell::after { top: 13px; left: 6px; width: 4px; border-top: 1.5px solid currentColor; }
.ico-doc::before { inset: 1px 3px; border: 1.5px solid currentColor; border-radius: 2px; }
.ico-doc::after { top: 6px; left: 6px; width: 4px; height: 4px; border-top: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; }
.ico-plus::before { left: 7px; top: 2px; width: 2px; height: 12px; background: currentColor; border-radius: 2px; }
.ico-plus::after { top: 7px; left: 2px; height: 2px; width: 12px; background: currentColor; border-radius: 2px; }
.ico-search::before { inset: 1px 4px 4px 1px; border: 1.5px solid currentColor; border-radius: 50%; }
.ico-search::after { bottom: 2px; right: 1px; width: 6px; border-top: 1.5px solid currentColor; transform: rotate(46deg); }
.ico-clock::before { inset: 1px; border: 1.5px solid currentColor; border-radius: 50%; }
.ico-clock::after { top: 4px; left: 7px; width: 4px; height: 5px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; }
.ico-flow::before { left: 2px; top: 2px; width: 5px; height: 5px; border: 1px solid currentColor; border-radius: 50%; box-shadow: 8px 8px 0 -1px var(--white), 8px 8px 0 0 currentColor; }
.ico-flow::after { left: 4px; top: 7px; width: 6px; height: 6px; border-left: 1px solid currentColor; border-bottom: 1px solid currentColor; border-radius: 0 0 0 3px; }
.ico-check::before { top: 3px; left: 5px; width: 6px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(43deg); }
.ico-alert::before { inset: 1px; border: 1.5px solid currentColor; border-radius: 50%; }
.ico-alert::after { top: 4px; left: 7px; width: 2px; height: 5px; border-radius: 1px; background: currentColor; box-shadow: 0 6px 0 -0.2px currentColor; }
.ico-x::before, .ico-x::after { top: 7px; left: 2px; width: 12px; height: 2px; background: currentColor; border-radius: 2px; transform: rotate(45deg); }
.ico-x::after { transform: rotate(-45deg); }
.ico-up::before, .ico-down::before { inset: 5px; border-top: 1.5px solid currentColor; border-left: 1.5px solid currentColor; transform: rotate(45deg); }
.ico-down::before { transform: rotate(225deg); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 22px; }
.metric { display: flex; align-items: center; gap: 11px; padding: 13px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.metric-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.metric:nth-child(2) .metric-icon { color: #25519c; background: #e7efff; }
.metric:nth-child(3) .metric-icon { color: #7a4a12; background: #fff0d8; }
.metric:nth-child(4) .metric-icon { color: #a12744; background: #fbe8ef; }
.metric strong { display: block; font-size: 22px; line-height: 1; font-weight: 740; letter-spacing: -.045em; margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.metric span:not(.metric-icon):not(.ico) { display: block; font-size: 12px; color: var(--muted); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 13px; }
.searchbox { position: relative; min-width: min(240px, 100%); }
.searchbox .ico { position: absolute; top: 11px; left: 11px; color: #636d83; }
.searchbox input { padding-left: 35px; width: 100%; }
input, select, textarea { color: var(--ink); background: white; border: 1px solid #d8deeb; border-radius: 8px; padding: 8px 10px; font-size: 14px; min-height: 36px; }
input::placeholder, textarea::placeholder { color: #68748a; opacity: 1; }
.toolbar select, .toolbar input { font-size: 13px; }
.toolbar-count { flex: 1; min-width: 80px; text-align: right; color: var(--muted); font-size: 12px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.column { --lane-color: #64748b; border: 1px solid #dfe6f1; border-radius: var(--radius); padding: 9px; min-width: 0; background: #edf1f8; min-height: 236px; }
.column[data-status="working"] { --lane-color: #3367c7; }
.column[data-status="approval"] { --lane-color: #a96816; }
.column[data-status="done"] { --lane-color: #16816a; }
.column-head { display: flex; gap: 8px; align-items: center; padding: 5px 3px 11px; }
.column-head .status-dot { color: var(--lane-color); }
.column-head h2 { font-size: 13px; font-weight: 730; overflow-wrap: anywhere; }
.column-head .count { margin-left: auto; font-size: 11px; font-weight: 700; color: #47516a; background: #e1e8f4; border-radius: 6px; padding: 2px 6px; }
.card-list { display: grid; gap: 8px; }
.task-card { display: block; width: 100%; min-width: 0; padding: 11px; text-align: left; border: 1px solid #e0e6f0; border-radius: 10px; background: white; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.task-card:hover { border-color: #a8c3e9; box-shadow: 0 3px 9px #254d8617; }
.card-top, .card-footer { display: flex; align-items: center; gap: 5px; justify-content: space-between; }
.card-badges { display: flex; align-items: center; gap: 5px; }
.card-activity { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 10px; font-weight: 650; }
.card-activity .ico { transform: scale(.75); }
.ico-chat::before { inset: 2px 1px 4px; border: 1.5px solid currentColor; border-radius: 3px; }
.ico-chat::after { left: 4px; bottom: 2px; width: 4px; height: 4px; border-left: 1.5px solid currentColor; transform: skewY(-30deg); }
.ico-clip::before { inset: 1px 4px; border: 1.5px solid currentColor; border-radius: 5px; transform: rotate(30deg); }
.card-code { font-size: 11px; font-weight: 650; color: #5e6880; letter-spacing: .015em; }
.priority { display: inline-flex; align-items: center; gap: 4px; color: #526079; background: #f1f3f8; border-radius: 20px; padding: 2px 6px; font-weight: 700; font-size: 10px; white-space: nowrap; }
.priority .status-dot { width: 5px; height: 5px; }
.priority.high { color: #97334e; background: #fcebf1; }
.priority.medium { color: #775114; background: #fbf1dd; }
.task-title { display: block; margin: 8px 0 7px; font-size: 14px; font-weight: 710; line-height: 1.3; min-height: 2.6em; overflow-wrap: anywhere; }
.card-stage { display: flex; align-items: center; gap: 4px; color: var(--brand); font-size: 11px; font-weight: 650; }
.card-stage span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-stage .ico { transform: scale(.85); }
.segments { display: flex; gap: 3px; margin: 8px 0 9px; }
.segments span { height: 3px; flex: 1; min-width: 0; border-radius: 3px; background: #e7edf8; }
.segments .completed { background: #7ba6e8; }
.segments .current { background: #066ad8; }
.card-footer { padding-top: 8px; border-top: 1px solid #eef0f5; min-height: 32px; }
.owner { display: inline-flex; align-items: center; min-width: 0; gap: 5px; color: #4c566d; font-weight: 600; font-size: 11px; }
.owner-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; font-size: 9px; font-weight: 750; color: var(--avatar-ink); background: var(--avatar-fill); }
.profile .avatar { width: 32px; height: 32px; font-size: 11px; }
.deadline { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; color: #536077; font-size: 10px; font-weight: 650; }
.deadline .ico { transform: scale(.72); margin: 0 -1px; }
.deadline.late, .deadline.complete-late, .alert-icon.late { color: #a72c48; }
.deadline.soon, .alert-icon.soon { color: #885400; }
.deadline.complete { color: #1a705e; }
.lane-empty { color: var(--muted); text-align: center; padding: 22px 6px; font-size: 12px; border: 1px dashed #cad1e1; border-radius: 9px; }
.board-foot { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-top: 15px; font-size: 12px; }
.list-heading { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 8px; }
.list-heading:not(:first-child) { margin-top: 18px; }
.list-heading span { color: var(--muted); background: #e8ebf4; padding: 2px 6px; border-radius: 6px; font-size: 12px; }
.list-panel { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: white; box-shadow: var(--shadow); }
.list-row { display: flex; width: 100%; align-items: center; gap: 13px; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: left; color: var(--ink); }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #f2f7fe; }
.list-row strong { display: block; font-size: 14px; margin-bottom: 3px; overflow-wrap: anywhere; }
.list-row small { display: block; font-size: 12px; color: var(--muted); }
.list-row .deadline { margin-left: auto; font-size: 12px; }
.alert-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; color: var(--brand); background: var(--brand-soft); }
.alert-icon.late { background: #fcebf1; }
.alert-icon.soon { background: #fff1d8; }
.empty { padding: 24px; color: var(--muted); font-size: 14px; }
.clock-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 13px; color: var(--muted); font-size: 13px; }
.scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.scope-card { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.scope-card h2 { font-size: 17px; margin-bottom: 8px; letter-spacing: -.025em; }
.scope-card p, .scope-card li { font-size: 14px; line-height: 1.55; color: #4e5971; }
.scope-card p + p, .scope-card li + li, .scope-card ul, .scope-card ol { margin-top: 7px; }
.scope-card ul, .scope-card ol { padding-left: 21px; }
.scope-card strong { color: #262f49; }
dialog { padding: 0; border: 0; background: white; color: var(--ink); box-shadow: -18px 0 70px #172b4d27; }
dialog::backdrop { background: #172b4d85; }
.drawer { margin: 0 0 0 auto; width: min(100%, 558px); max-width: none; height: 100dvh; max-height: 100dvh; overflow: auto; }
.creator { width: min(690px, calc(100% - 24px)); max-height: calc(100dvh - 28px); border-radius: 16px; overflow: auto; }
.dialog-inner { padding: 23px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 9px; margin-bottom: 16px; }
.dialog-head h2 { margin: 4px 0 5px; line-height: 1.15; font-size: 25px; letter-spacing: -.04em; overflow-wrap: anywhere; }
.dialog-head p, .detail-description { color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.dialog-head .icon-button { flex: none; }
.detail-status { font-size: 12px; font-weight: 700; color: var(--brand); }
.detail-description { margin-bottom: 14px; white-space: pre-wrap; }
.detail-panel { background: #f3f7fe; border: 1px solid #dfeaf8; border-radius: 12px; padding: 13px; }
.detail-panel h3 { font-size: 15px; margin-bottom: 6px; overflow-wrap: anywhere; }
.detail-panel p { font-size: 13px; color: #505a73; line-height: 1.5; }
.detail-panel .deadline { font-size: 12px; margin-top: 3px; }
.action-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.tabs { display: flex; gap: 9px; border-bottom: 1px solid var(--line); margin: 16px 0 12px; }
.tab { padding: 8px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: none; font-size: 14px; font-weight: 650; }
.tab[aria-pressed="true"] { color: var(--brand); border-color: var(--brand); }
.steps, .history { list-style: none; padding: 0; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 8px; margin-bottom: 5px; border: 1px solid var(--line); border-radius: 9px; }
.steps li.active { background: #f3f7fe; border-color: #c8dbf5; }
.step-index { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: #e9f1fc; color: var(--brand); flex: none; font-size: 12px; font-weight: 700; }
.steps strong, .history strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.steps small, .history small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.step-caption { margin-left: auto; font-size: 11px; color: var(--muted); text-align: right; }
.history li { border-left: 2px solid #dce7f8; padding: 2px 0 11px 10px; margin-left: 4px; }
.history li p { font-size: 13px; color: #4f5870; margin-top: 4px; overflow-wrap: anywhere; white-space: pre-wrap; }
.fields { display: grid; gap: 10px; grid-template-columns: 1fr 165px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span, .field > label { font-size: 12px; font-weight: 680; color: #48536d; }
.field input, .field select, .field textarea { width: 100%; }
.wide { grid-column: 1 / -1; }
textarea { resize: vertical; }
.builder-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin: 15px 0 7px; }
.builder-head h3 { font-size: 15px; }
.builder-head p { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.stage-editor { border: 1px solid var(--line); border-radius: 9px; padding: 9px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin-bottom: 7px; min-width: 0; }
.stage-editor legend { padding: 0 5px; color: var(--brand); font-size: 12px; font-weight: 700; }
.stage-fields { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 6px; }
.stage-tools { display: flex; justify-content: flex-end; gap: 5px; }
.stage-tools .icon-button { min-height: 28px; width: 28px; }
.approval-info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 9px; background: var(--brand-soft); border-radius: 8px; font-size: 13px; }
.approval-info input { width: 75px; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 7px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.adjust-form, .comment-form { margin-top: 12px; display: grid; gap: 8px; }
.adjust-form .action-row { margin-top: 0; }

.detail-heading { font-size: 14px; margin: 14px 0 7px; }
.timings { list-style: none; padding: 0; display: grid; gap: 5px; }
.timings li { background: #f2f5fb; border-radius: 8px; padding: 7px 9px; }
.timings strong, .timings small { display: block; font-size: 12px; }
.timings small { color: var(--muted); margin-top: 2px; }
.tabs { flex-wrap: wrap; gap: 3px 7px; }
.tab-count { color: var(--muted); font-size: 11px; margin-left: 3px; }
.approval-info .field { flex: 1 1 200px; }
.approval-info .field input { width: min(100%, 235px); }
.field input[type="datetime-local"] { min-width: 0; }
.conversation-list, .attachment-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.conversation-item { display: flex; align-items: flex-start; gap: 8px; }
.conversation-comment { flex: 1; min-width: 0; background: #f2f5fb; border-radius: 8px; padding: 8px 10px; }
.conversation-meta { display: flex; gap: 4px 9px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.conversation-meta strong { color: var(--ink); font-size: 13px; }
.conversation-text { color: var(--ink); font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 5px; }
.conversation-mention { color: var(--brand-dark); background: var(--brand-soft); border-radius: 4px; padding: 0 3px; font-weight: 650; }
.conversation-empty, .conversation-hint, .attachment-note { color: var(--muted); font-size: 13px; line-height: 1.5; }
.conversation-tools, .attachment-actions, .conversation-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.conversation-tools { justify-content: space-between; }
.conversation-suggestions { padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.conversation-suggestion, .attachment-actions button { min-height: 32px; }
.mention-snippet { white-space: normal; overflow-wrap: anywhere; }
.unread-tag { color: var(--brand); font-size: 11px; white-space: nowrap; margin-left: auto; }
.attachment-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 9px; }
.attachment-file { min-width: 0; overflow-wrap: anywhere; }
.attachment-file strong, .attachment-file small { display: block; font-size: 13px; }
.attachment-file small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.attachment-upload { display: grid; gap: 6px; margin-top: 12px; justify-items: start; }
.attachment-upload input { max-width: 100%; min-width: 0; }
.attachment-error { color: #a72c48; font-size: 13px; }
.attachment-image { display: block; max-width: 100%; max-height: 70dvh; margin: auto; object-fit: contain; }
.attachment-pdf { width: 100%; height: 57dvh; border: 1px solid var(--line); border-radius: 8px; }
.attachment-text { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--paper); border-radius: 8px; padding: 10px; }

.toast { position: fixed; bottom: 18px; right: 18px; max-width: min(90vw, 370px); padding: 11px 15px; color: white; background: #172b4d; border-radius: 9px; font-size: 13px; z-index: 2; box-shadow: 0 7px 30px #172b4d36; }
@media (min-width: 1380px) {
  .card-top, .card-footer { gap: 8px; }
  .task-card { padding: 13px; }
  .task-title { font-size: 15px; }
}
@media (max-width: 1180px) {
  .shell { grid-template-columns: 191px minmax(0, 1fr); }
  .board { grid-template-columns: repeat(4, minmax(176px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
  .card-footer { gap: 5px; }
}
@media (max-width: 870px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { z-index: 1; height: auto; padding: 11px 14px; gap: 10px; flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; }
  .sidebar nav { display: flex; gap: 4px; flex-wrap: wrap; }
  .nav-group { display: flex; gap: 4px; }
  .nav-group + .nav-group { margin-top: 0; }
  .nav-label, .side-foot { display: none; }
  .nav-item { min-height: 32px; padding: 5px 7px; font-size: 12px; gap: 5px; }
  .nav-item[aria-current="page"] { box-shadow: inset 0 -2px var(--brand); }
  .nav-count { padding: 1px 4px; }
  .brand { padding: 0; }
  .brand small { display: none; }
  main { padding-top: 20px; }
}
@media (max-width: 570px) {
  .sidebar { position: static; padding: 9px 11px; }
  .sidebar nav { width: 100%; }
  .nav-item .ico { display: none; }
  .topbar { min-height: 51px; padding: 7px 12px; }
  .top-actions { gap: 6px; }
  main { padding: 17px 12px 24px; }
  .page-heading { flex-wrap: wrap; margin-bottom: 15px; gap: 10px; }
  .page-heading p { margin-top: 5px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 14px; }
  .metric { padding: 8px; }
  .toolbar { gap: 5px; }
  .searchbox { min-width: 100%; }
  .toolbar select { max-width: 46%; }
  .toolbar-count { display: none; }
  .board { grid-template-columns: repeat(4, minmax(230px, 68vw)); }
  .scope-grid, .fields { grid-template-columns: 1fr; }
  .stage-editor { grid-template-columns: minmax(0, 1fr); }
  .stage-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog-inner { padding: 14px; }
  .list-row { gap: 7px; padding: 11px 9px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Marca e superfícies institucionais. */
.brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}
.brand-logo {
  display: block;
  width: 144px;
  height: auto;
  margin-left: -9px;
  object-fit: contain;
}
.brand small { font-size: .8125rem; }
.sidebar { overflow-y: auto; }
.sidebar .nav-item { font-size: .875rem; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #526788 50%),
    linear-gradient(135deg, #526788 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 26px;
  max-width: 100%;
}
@media (forced-colors: active) {
  select { appearance: auto; background-image: none; }
}
.account-name {
  display: block;
  color: var(--ink);
  font-size: .8125rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.account-role {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .75rem;
}
.workspace-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.topbar .workspace-actions { justify-content: flex-end; }
.filter-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  color: var(--muted);
  font-size: .8125rem;
  white-space: nowrap;
}
.filter-check input {
  width: 16px;
  height: 16px;
  min-height: auto;
  margin: 0;
  accent-color: var(--brand);
}
.toolbar input, .toolbar select, .field > span, .field > label,
.column-head h2, .detail-panel p { font-size: .875rem; }
.task-title { font-size: .9375rem; }
.card-code, .card-stage, .priority, .card-activity, .owner, .deadline {
  font-size: .75rem;
}
.card-top { flex-wrap: wrap; }
.card-footer { align-items: flex-start; }
.owner-name { display: block; min-width: 0; }
.card-footer .deadline { margin-top: 3px; }
.card-stage { gap: 5px; }
.segments span { height: 4px; }

/* Rótulos e ações do fluxo. */
.tenure, .block-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  border-radius: 6px;
  padding: 3px 6px;
  font-weight: 650;
  font-size: .75rem;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.tenure {
  color: #204c85;
  background: #eaf2ff;
}
.tenure .ico, .block-tag .ico {
  width: 14px;
  height: 14px;
  transform: scale(.82);
}
.task-card > .tenure { margin-top: 8px; }
.card-flags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.card-footer .tenure { flex: none; }
.card-footer:has(.tenure) { flex-wrap: wrap; }
.conversation-suggestion { max-width: 100%; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.invite-history { list-style: none; padding: 0; }
.block-tag {
  color: #805017;
  background: #fff2da;
}
.block-panel {
  margin-block: 10px;
  padding: 11px;
  color: #67471f;
  background: #fff8ea;
  border: 1px solid #f3e2bf;
  border-radius: 9px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.block-panel strong { color: #673c0b; }
.block-panel form { display: grid; gap: 8px; }
.block-panel p + p { margin-top: 4px; }
.deadline-original {
  color: var(--muted);
  font-size: .8125rem;
}
.interval-list {
  display: grid;
  gap: 8px;
  list-style: none;
  padding: 0;
}
.interval-list li {
  background: #f3f6fb;
  border: 1px solid #e6ebf4;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: .875rem;
}
.interval-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .75rem;
}

/* Entrada e cadastro pelo convite. */
.auth-screen {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 27px 16px;
  background: radial-gradient(ellipse at 3% 10%, #dce8fc, transparent 60%),
    radial-gradient(ellipse at 100% 0, #eeebfb, transparent 51%), var(--paper);
}
.auth-card {
  width: min(100%, 450px);
  padding: clamp(22px, 6vw, 36px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 58px #172b4d14;
}
.auth-brand { margin-bottom: 22px; }
.auth-brand .brand-logo, .auth-brand img {
  display: block;
  width: 166px;
  max-width: 100%;
  height: auto;
  margin-left: -11px;
}
.auth-brand .auth-symbol { width: 42px; height: 42px; margin-left: 0; }
.auth-brand small {
  color: var(--muted);
  font-size: .875rem;
}
.auth-card h1 {
  font-size: clamp(1.75rem, 5vw, 2.125rem);
  margin-bottom: 8px;
  letter-spacing: -.04em;
}
.auth-card p { color: var(--muted); line-height: 1.5; }
.auth-form { display: grid; gap: 14px; margin-top: 18px; }
.auth-form input { min-height: 42px; font-size: 1rem; }
.auth-form label { display: grid; gap: 6px; font-size: .875rem; font-weight: 650; }
.auth-form button[type="submit"] { min-height: 42px; font-size: .875rem; }
.auth-card a { color: var(--brand-dark); font-weight: 650; }
.auth-card form + p { margin-top: 16px; font-size: .875rem; }
.error-banner:not([hidden]) {
  display: block;
  color: #8f2338;
  background: #fff1f3;
  border: 1px solid #f0d3d9;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: .875rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.auth-card > .error-banner { margin-top: 14px; }
main > .error-banner { margin-bottom: 12px; }

/* Gestão de modelos e convites. */
.management-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  align-items: start;
  gap: 14px;
}
.management-card {
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px;
  box-shadow: var(--shadow);
}
.management-card h2, .management-card h3 { font-size: 1rem; margin-bottom: 7px; }
.management-card p, .management-card li {
  color: var(--muted);
  line-height: 1.5;
  font-size: .875rem;
}
.management-card ul, .management-card ol { padding-left: 20px; }
.management-card li + li { margin-top: 4px; }
.management-card form { display: grid; gap: 9px; margin-top: 8px; }
.management-card form .primary { justify-self: start; }
.management-card .interval-list { padding-left: 0; }
.invite-link {
  display: block;
  margin-block: 8px;
  width: 100%;
  color: #164c95;
  background: #f1f6ff;
  border: 1px solid #dae7f8;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: .8125rem;
  overflow-wrap: anywhere;
}
.invite-link:link, .invite-link:visited { text-decoration-color: #94b7e6; }
.toast { z-index: 5; }

@media (max-width: 870px) {
  .sidebar { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-logo { width: 116px; margin-left: -7px; }
}
@media (max-width: 570px) {
  .sidebar .nav-item { font-size: .75rem; }
  .toolbar select { max-width: 100%; }
  .account-role { display: none; }
  .profile .avatar { width: 26px; height: 26px; }
  .management-card { padding: 13px; }
}
