@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/roboto-latin.woff2) format('woff2'); }
@font-face { font-family: 'Roboto Condensed'; font-style: normal; font-weight: 600 700; font-display: swap; src: url(/fonts/roboto-condensed-latin.woff2) format('woff2'); }

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f2f5;
  --border: #e4e6eb;
  --text: #1a1c2e;
  --muted: #5f6377;
  --accent: #cc3a1b;
  --accent-soft: #fdece6;
  --brand: #ff5a36;
  --nav-bg: #17182a;
  --nav-text: #d4d5e3;
  --nav-muted: #8b8da3;
  --nav-hover: #22243b;
  --nav-active: #2b2e4b;
  --nav-border: #2a2c45;
  --danger: #c4122f;
  --danger-soft: #fdecea;
  --warn: #b54708;
  --warn-soft: #fef4e6;
  --ok: #067647;
  --ok-soft: #e7f6ee;
  --todo: #667085;
  --doing: #2f6fd8;
  --done: #067647;
  --shadow: 0 1px 2px rgba(23, 24, 42, .05), 0 1px 3px rgba(23, 24, 42, .07);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --radius: 10px;
  --font: 'Roboto', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: 'Roboto Condensed', 'Roboto', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101120;
    --surface: #17182a;
    --surface-2: #202238;
    --border: #2b2e47;
    --text: #e7e8f1;
    --muted: #9a9cb3;
    --accent: #ff7a59;
    --accent-soft: #3a2220;
    --nav-bg: #0b0c18;
    --nav-hover: #17182c;
    --nav-active: #21233c;
    --nav-border: #1d1f33;
    --danger: #ff6b5e;
    --danger-soft: #3a1e1c;
    --warn: #f5a524;
    --warn-soft: #3a2c14;
    --ok: #3ccf8e;
    --ok-soft: #15322a;
    --todo: #98a0b3;
    --doing: #6f9cff;
    --done: #3ccf8e;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4);
    --series-1: #3987e5;
    --series-2: #d95926;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: .005em; }
h2 { font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.page-head h1 { text-transform: uppercase; font-size: 28px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--nav-bg); color: var(--nav-text); border-right: 1px solid var(--nav-border); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; padding: 4px 8px 12px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; color: #fff; font-size: 15px; flex: none; }
.brand-name { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name small { font-size: 11px; font-weight: 500; color: var(--nav-muted); }
.sidebar .brand { color: #fff; }
.nav-section { font-size: 12px; font-weight: 500; color: var(--nav-muted); padding: 12px 10px 4px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 6px 10px; border-radius: 8px; color: var(--nav-text); font-size: 14px; }
.nav-ico { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; color: var(--nav-muted); }
.nav-ico svg { width: 18px; height: 18px; }
.nav-link:hover .nav-ico, .nav-link.active .nav-ico { color: #fff; }
.brand-name b { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: .005em; }
.brand-name b span { font-weight: 600; color: var(--muted); }
.sidebar .brand-name b { color: #fff; }
.sidebar .brand-name b span { color: var(--nav-text); }
.brand-mark.ring { background: none; border: 5px solid var(--brand); border-radius: 50%; width: 26px; height: 26px; }
.nav-link:hover { background: var(--nav-hover); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--nav-active); color: #fff; font-weight: 600; }
.nav-link.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-key { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); color: var(--muted); min-width: 34px; text-align: center; }
.sidebar .nav-key { background: var(--nav-active); color: var(--nav-muted); }
.nav-link.current { color: #fff; font-weight: 600; }
.sidebar .nav-link.current .nav-key, .sidebar .nav-link.active .nav-key { background: var(--brand); color: #fff; }
.nav-sub { padding-left: 54px; font-size: 13px; color: var(--nav-muted); }
.sidebar-foot .btn { justify-content: flex-start; color: var(--nav-text); }
.sidebar-foot .btn:hover { background: var(--nav-hover); }
.sidebar-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--nav-border); display: flex; flex-direction: column; gap: 4px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-size: 13px; color: #fff; }
.user-menu { position: relative; }
.user-menu > summary.active { background: var(--nav-active); }
.user-menu > summary { list-style: none; cursor: pointer; border-radius: 8px; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { background: var(--nav-hover); }
.user-menu .user-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-caret { color: var(--nav-muted); font-size: 11px; transition: transform .15s; }
.user-menu:not([open]) .user-caret { transform: rotate(180deg); }
.user-menu-list { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); display: flex; flex-direction: column; gap: 2px; padding: 6px; background: var(--nav-active); border: 1px solid var(--nav-border); border-radius: 10px; box-shadow: 0 -8px 24px rgba(0, 0, 0, .35); z-index: 10; }
.user-menu-list .nav-link:hover { background: var(--nav-hover); }
.nav-logout { border: 0; background: none; width: 100%; text-align: left; cursor: pointer; padding-left: 39px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--surface); border-top: 3px solid var(--brand); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.topbar .search { flex: 1; max-width: 420px; }
.menu-btn { display: none; }
.content { padding: 24px; flex: 1; min-width: 0; }
.content > .card + .card { margin-top: 20px; }
.topbar .spacer { flex: 1; }
.narrow { max-width: 440px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); padding: 7px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }

.input, select.input, textarea.input { width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 7px 10px; outline: none; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 110px; line-height: 1.5; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; display: block; color: var(--text); }
.stat:hover { text-decoration: none; outline: 2px solid var(--accent-soft); }
.stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.alert b { color: var(--danger); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; }
.filters .input { width: auto; min-width: 140px; }
.filters .input.grow { flex: 1; min-width: 200px; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.column { background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 240px; display: flex; flex-direction: column; gap: 8px; transition: background .15s; }
.column.drop-ok { background: var(--accent-soft); outline: 2px dashed var(--accent); }
.column.drop-no { opacity: .55; }
.column.drop-hover { background: color-mix(in srgb, var(--accent) 22%, var(--surface-2)); outline-style: solid; }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.count { background: var(--surface); border-radius: 999px; padding: 0 8px; font-size: 12px; }
.tcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: grab; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.tcard:hover { border-color: var(--accent); text-decoration: none; }
.tcard.dragging { opacity: .45; }
.tcard-title { font-weight: 500; word-break: break-word; }
.tcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12px; color: var(--muted); }
.tcard-meta .spacer { flex: 1; }
.tcard-meta > span { white-space: nowrap; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.todo { background: var(--surface-2); color: var(--todo); }
.badge.doing { background: var(--accent-soft); color: var(--doing); }
.badge.done { background: var(--ok-soft); color: var(--done); }
.badge.label { background: var(--surface-2); color: var(--muted); font-weight: 500; }
.badge.overdue { background: var(--danger-soft); color: var(--danger); }
.prio { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.prio::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.prio.baixa { color: var(--muted); }
.prio.media { color: var(--accent); }
.prio.alta { color: var(--warn); }
.prio.critica { color: var(--danger); }
.type-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; color: #fff; flex: none; background: #2f80ed; }
.type-icon svg { width: 12px; height: 12px; }
.type-icon.task { background: #2f80ed; }
.type-icon.bug, .type-icon.incident { background: #e5484d; }
.type-icon.improvement, .type-icon.process { background: #30a46c; }
.type-icon.data, .type-icon.dashboard, .type-icon.flow { background: #7a4fc4; }
.type-icon.support, .type-icon.request, .type-icon.access, .type-icon.hardware, .type-icon.onboarding { background: #f0a020; color: #17182a; }
.avatar.av-0 { background: #2f55d4; } .avatar.av-1 { background: #0e7c66; } .avatar.av-2 { background: #b4472a; } .avatar.av-3 { background: #7a4fc4; }
.avatar.av-4 { background: #0c3c21; } .avatar.av-5 { background: #a54d25; } .avatar.av-6 { background: #1d6fa5; } .avatar.av-7 { background: #9b3b6a; }
.key { white-space: nowrap; font-weight: 600; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; flex: none; }
.avatar.none { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border); }

table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.list td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: var(--surface-2); }
table.list tbody tr.clickable { cursor: pointer; }
.table-wrap { overflow-x: auto; }
.cell-title { display: flex; align-items: center; gap: 8px; min-width: 260px; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

.ticket { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.ticket-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.title-edit { resize: none; overflow: hidden; line-height: 1.3; font-size: 22px; font-weight: 600; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; margin: 0 -8px; width: calc(100% + 16px); background: transparent; }
.title-edit:hover { background: var(--surface-2); }
.title-edit:focus { border-color: var(--accent); background: var(--surface); outline: none; }
.desc-view { white-space: pre-wrap; word-break: break-word; padding: 10px 12px; margin: 0 -12px; border-radius: 8px; cursor: text; min-height: 44px; }
.desc-view:hover { background: var(--surface-2); }
.desc-view.placeholder { color: var(--muted); }
.side-panel { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; }
.side-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 8px; font-size: 13px; }
.side-row > span:first-child { color: var(--muted); }
.status-select { font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tab { padding: 8px 12px; border: 0; background: none; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tab.active { color: var(--text); font-weight: 700; border-bottom-color: var(--accent); }
.comment { display: flex; gap: 10px; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.comment-text { white-space: pre-wrap; word-break: break-word; margin-top: 4px; }
.history-item { font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.history-item:last-child { border-bottom: 0; }
.history-change { margin-top: 2px; color: var(--muted); word-break: break-word; }
.history-change s { opacity: .7; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.labels-wrap { display: flex; flex-wrap: wrap; gap: 4px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 620px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 40px rgba(0, 0, 0, .25); }
.modal-head { padding: 18px 20px 0; display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 0 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }

#toasts { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 360px; font-size: 13px; }
.toast.error { background: var(--danger); color: #fff; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 380px; }
.login .brand { justify-content: center; font-size: 18px; padding-bottom: 6px; }
.login p { text-align: center; color: var(--muted); margin: 0 0 20px; }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 8px 12px; border-radius: 8px; font-size: 13px; }


.points { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 11px; font-weight: 700; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; min-width: 160px; }
.progress-fill { height: 100%; background: var(--ok); border-radius: 999px; }
.sprint-progress { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-width: 520px; }
.home-sprint { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 13px; }
a.home-sprint:hover { text-decoration: none; outline: 2px solid var(--accent-soft); }
.home-sprint-top { display: flex; justify-content: space-between; gap: 8px; }

.stack-lg { display: flex; flex-direction: column; gap: 18px; }
.plan-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; display: flex; flex-direction: column; min-width: 110px; }
.chip b { font-size: 18px; font-variant-numeric: tabular-nums; }
.chip span { font-size: 12px; color: var(--muted); }
.chip.warn b { color: var(--warn); }
.bl-section { overflow: hidden; }
.bl-section.is-active { border-color: var(--accent); }
.bl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px 10px; flex-wrap: wrap; }
.bl-head h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.bl-head .muted, .bl-head .warn-text { font-size: 13px; }
.warn-text { color: var(--warn); font-weight: 500; }
.bl-progress { padding: 0 16px 10px; }
.bl-progress .sprint-progress { margin-top: 0; }
.bl-list { border-top: 1px solid var(--border); min-height: 44px; }
.bl-list.drop-end { box-shadow: inset 0 -2px 0 var(--accent); }
.bl-row { display: flex; align-items: center; gap: 10px; padding: 7px 16px; border-bottom: 1px solid var(--border); background: var(--surface); cursor: grab; }
.bl-row:hover { background: var(--surface-2); }
.bl-row.dragging { opacity: .4; }
.bl-row.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.bl-title { flex: 1; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.grip { color: var(--muted); font-size: 12px; letter-spacing: -2px; cursor: grab; }
.bl-empty { padding: 14px 16px; color: var(--muted); font-size: 13px; text-align: center; }
.mini-select { border: 1px solid var(--border); background: var(--surface); border-radius: 6px; padding: 2px 4px; font-size: 12px; max-width: 150px; }
.quick-wrap { padding: 8px 12px; }
.quick-add { border-style: dashed; background: transparent; }
.form-warn { background: var(--warn-soft); color: var(--warn); padding: 8px 12px; border-radius: 8px; font-size: 13px; }

.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; margin-bottom: 20px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 13px; }
.chart .line-ideal { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 5 5; }
.chart .line-actual { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; }
.chart .dot-actual { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; }
.chart .hit { fill: transparent; }
.chart .bar.committed { fill: var(--series-2); }
.chart .bar.completed { fill: var(--series-1); }
.chart .avg-line { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 3 4; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.swatch.actual, .swatch.completed { background: var(--series-1); }
.swatch.committed { background: var(--series-2); }
.swatch.ideal { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); height: 3px; border-radius: 0; }
.swatch.avg { background: repeating-linear-gradient(90deg, var(--text) 0 3px, transparent 3px 6px); height: 3px; border-radius: 0; }
.chart-tip { position: fixed; z-index: 200; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 8px; padding: 8px 10px; font-size: 12px; }
.chart-tip .tip-title { font-weight: 600; margin-bottom: 2px; }

@media (max-width: 960px) {
  .ticket { grid-template-columns: 1fr; }
  .side-panel { position: static; }
}
@media (max-width: 760px) {
  .bl-row { flex-wrap: wrap; }
  .bl-title { flex-basis: calc(100% - 120px); }
  .bl-meta { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .report-grid { grid-template-columns: 1fr; }
  .title-edit { font-size: 18px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .row { flex-direction: column; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

.badge.source { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.badge.internal { background: var(--warn-soft); color: var(--warn); font-weight: 500; }
.badge.public { background: var(--ok-soft); color: var(--ok); font-weight: 500; }
.comment.is-internal .comment-text { background: var(--warn-soft); padding: 8px 10px; border-radius: 8px; }
.comment.from-requester .comment-text { background: var(--accent-soft); padding: 8px 10px; border-radius: 8px; }
.requester-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); font-size: 13px; }
.requester-box b { color: var(--accent); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; white-space: pre-wrap; word-break: break-all; }
.sub-section { border-top: 1px solid var(--border); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }

body.pub { background: var(--bg); }
body.pub.embedded { background: transparent; }
.pub-wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 40px; }
body.embedded .pub-wrap { padding: 0; max-width: none; }
body.embedded .pub-card { box-shadow: none; }
.pub-card { gap: 18px; }
.pub-card h1 { font-size: 22px; margin-bottom: 4px; }
.pub-card p { margin: 0; }
.pub-brand { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.pub-brand .muted { font-size: 12px; }
.area-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.area-card, .impact { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; font-weight: 400; background: var(--surface); }
.area-card:hover, .impact:hover { border-color: var(--accent); }
.area-card:has(input:checked), .impact:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.area-card input, .impact input { margin-top: 3px; accent-color: var(--accent); }
.area-card span, .impact span { display: flex; flex-direction: column; gap: 2px; }
.area-card b { font-size: 15px; }
.area-card small, .impact small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.impact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pub-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.pub-success { align-items: flex-start; }
.success-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 22px; font-weight: 700; }
.protocol { font-size: 18px; }
.link-box { width: 100%; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; word-break: break-all; font-size: 13px; }
.track-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.status-help { padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.status-help.waiting { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.status-help.done { background: var(--ok-soft); color: var(--ok); }
.status-help.doing { background: var(--accent-soft); color: var(--accent); }
.small { font-size: 12px; }
.msg { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; max-width: 92%; }
.msg.mine { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.msg.team { align-self: flex-start; background: var(--surface); }
.msg-head { display: flex; gap: 10px; align-items: baseline; font-size: 13px; flex-wrap: wrap; }
.msg-body { white-space: pre-wrap; word-break: break-word; margin-top: 4px; }
@media (max-width: 560px) {
  .impact-grid { grid-template-columns: 1fr; }
  .track-head { flex-direction: column; }
}

.cap::first-letter { text-transform: uppercase; }
.att-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.att { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.att:hover { text-decoration: none; border-color: var(--accent); }
.att-num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; line-height: 1; }
.att-text { display: flex; flex-direction: column; min-width: 0; }
.att-text b { font-size: 13px; font-weight: 600; }
.att-text small { font-size: 12px; color: var(--muted); }
.att.danger .att-num { color: var(--danger); }
.att.warn .att-num { color: var(--warn); }
.att.calm .att-num { color: var(--muted); }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.home-head { display: flex; align-items: center; gap: 8px; padding: 16px 18px 6px; }
.home-head .spacer { flex: 1; }
.home-head a { font-size: 13px; }
.area { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.area + .area { border-top: 1px solid var(--border); }
.area-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.area-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: var(--text); }
.area-name:hover { color: var(--accent); text-decoration: none; }
.area-open { font-size: 13px; color: var(--muted); }
.area-open b { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.segbar { display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.seg { display: block; flex-basis: 0; min-width: 6px; }
.seg.todo { background: var(--series-2); }
.seg.doing { background: var(--series-1); }
.seg.empty { flex: 1; background: var(--surface-2); }
.area-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.area-legend a { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.area-legend a:hover { color: var(--text); text-decoration: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.todo { background: var(--series-2); }
.dot.doing { background: var(--series-1); }
.dot.done { background: var(--ok); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-link { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.chip-link.warn { background: var(--warn-soft); color: var(--warn); }
.chip-link.danger { background: var(--danger-soft); color: var(--danger); }
.chip-link:hover { text-decoration: none; filter: brightness(.97); }
.area .home-sprint { margin-top: 2px; }

.mine-list { display: flex; flex-direction: column; padding: 4px 8px 10px; }
.mine-item { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 8px; color: var(--text); }
.mine-item + .mine-item { border-top: 1px solid var(--border); border-radius: 0; }
.mine-item:hover { background: var(--surface-2); text-decoration: none; border-radius: 8px; }
.mine-top, .mine-meta { display: flex; align-items: center; gap: 8px; }
.mine-top .spacer { flex: 1; }
.mine-title { font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.small-empty { padding: 28px 16px; }

.tcard, .bl-row { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.drag-ghost { position: fixed; z-index: 300; pointer-events: none; transform: rotate(2deg); box-shadow: 0 12px 28px rgba(16, 24, 40, .25); opacity: .95; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
@media (max-width: 960px) {
  .home-grid { grid-template-columns: 1fr; }
  .att-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.selectable { user-select: all; }
.ticket-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ticket-main.drop-target { outline: 2px dashed var(--accent); outline-offset: 8px; border-radius: 8px; }

.md { display: flex; flex-direction: column; gap: 8px; word-break: break-word; }
.md p { margin: 0; }
.md ul, .md ol { margin: 0; padding-left: 22px; }
.md li { margin: 2px 0; }
.md li.md-check { list-style: none; margin-left: -20px; }
.md li.md-check input { margin-right: 6px; }
.md code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--surface-2); border-radius: 4px; padding: 1px 5px; }
.md pre { margin: 0; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 0; padding: 4px 12px; border-left: 3px solid var(--border); color: var(--muted); }
.md .md-h { margin: 4px 0 0; font-size: 15px; }
.md-img { max-width: min(100%, 420px); max-height: 320px; border-radius: 8px; border: 1px solid var(--border); display: block; }
.mention { color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.desc-view .md { white-space: normal; }
.comment-text .md { white-space: normal; }
.comment.is-internal .comment-text, .comment.from-requester .comment-text { white-space: normal; }

.editor { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: visible; }
.editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.editor-toolbar .spacer { flex: 1; }
.tb-btn { border: 0; background: transparent; padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--muted); }
.tb-btn:hover { background: var(--surface-2); color: var(--text); }
.editor-body { position: relative; }
.editor-input { border: 0 !important; box-shadow: none !important; border-radius: 0 0 10px 10px; min-height: 90px; }
.editor-input.drop-target { background: var(--accent-soft); }
.editor-preview { padding: 10px 12px; min-height: 90px; }
.editor-hint { padding: 0 10px 6px; }
.mention-box { position: absolute; left: 8px; top: 100%; z-index: 60; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 24px rgba(16, 24, 40, .18); padding: 4px; display: flex; flex-direction: column; }
.mention-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; font-size: 13px; }
.mention-item.on, .mention-item:hover { background: var(--accent-soft); }

.bell-wrap { position: relative; }
.bell { position: relative; padding: 6px 10px; }
.bell-icon { font-size: 16px; line-height: 1; }
.bell-badge { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; z-index: 70; box-shadow: 0 16px 36px rgba(16, 24, 40, .22); }
.bell-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.bell-head .spacer { flex: 1; }
.bell-list { display: flex; flex-direction: column; }
.notif { display: flex; gap: 10px; padding: 10px 14px; color: var(--text); border-bottom: 1px solid var(--border); }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif.unread { background: var(--accent-soft); }
.notif-icon { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 13px; flex: none; }
.notif.sla_breach .notif-icon { background: var(--danger-soft); color: var(--danger); }
.notif.sla_warn .notif-icon { background: var(--warn-soft); color: var(--warn); }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.notif-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sla-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.sla-chip.ok { background: var(--ok-soft); color: var(--ok); }
.sla-chip.warn { background: var(--warn-soft); color: var(--warn); }
.sla-chip.breach { background: var(--danger); color: #fff; }
.sla-chip.paused { background: var(--surface-2); color: var(--muted); }
.sla-card .sla-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.sla-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex: none; background: var(--muted); }
.sla-dot.ok { background: var(--ok); }
.sla-dot.warn { background: var(--warn); }
.sla-dot.breach, .sla-dot.late { background: var(--danger); }
.sla-dot.paused { background: var(--border); }

.att-section h3 { margin: 0; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.att-tile { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.att-thumb { height: 104px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-ext { font-weight: 800; font-size: 13px; color: var(--muted); letter-spacing: .05em; }
.att-meta { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.att-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; }
.att-public { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); cursor: pointer; }

.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.pref-list { display: flex; flex-direction: column; gap: 10px; }
.pref { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.pref input { margin-top: 3px; accent-color: var(--accent); }
.input.num { width: 90px; text-align: right; font-variant-numeric: tabular-nums; }

.drop-zone { border: 1.5px dashed var(--border); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; text-align: center; font-weight: 400; }
.drop-zone:hover, .drop-zone.over, .drop-zone:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.file-list { display: flex; flex-direction: column; gap: 4px; }
.file-row { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 4px 8px; border-radius: 6px; background: var(--surface-2); font-weight: 400; }
.file-row .file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row.error { background: var(--danger-soft); color: var(--danger); }
.success-mark.mail { background: var(--accent-soft); color: var(--accent); }
.msg-body .md-img { max-width: 100%; }
@media (max-width: 960px) { .att-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.drawer-wrap { position: fixed; inset: 0; z-index: 45; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(16, 24, 40, .35); }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(980px, 100vw); background: var(--bg); box-shadow: -12px 0 32px rgba(16, 24, 40, .22); overflow-y: auto; padding: 18px max(20px, env(safe-area-inset-right, 0px)) 28px 24px; animation: drawer-in .18s ease-out; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }
body.drawer-open { overflow: hidden; }
.ticket.in-drawer { grid-template-columns: 1fr 290px; }
.ticket.in-drawer .side-panel { top: 0; }

.section-block { padding-top: 4px; }
.section-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-head h3, .section-head h2 { margin: 0; }
.section-head .progress { flex: 1; max-width: 220px; min-width: 80px; }
.small-bar { height: 5px; }
.check-list { display: flex; flex-direction: column; }
.check-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; }
.check-row:hover { background: var(--surface-2); }
.check-row:hover .icon-btn { opacity: 1; }
.check-box input { width: 16px; height: 16px; accent-color: var(--ok); cursor: pointer; }
.check-text { flex: 1; min-width: 0; word-break: break-word; cursor: text; }
.check-text.done { text-decoration: line-through; color: var(--muted); }
.check-edit { padding: 3px 8px; }
.check-add { border-style: dashed; background: transparent; }
.icon-btn { opacity: .45; padding: 2px 8px; }
.sub-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.sub-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--text); background: var(--surface); }
.sub-row + .sub-row { border-top: 1px solid var(--border); }
a.sub-row:hover { background: var(--surface-2); text-decoration: none; }
.sub-row:hover .icon-btn { opacity: 1; }
.sub-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-title.done { text-decoration: line-through; color: var(--muted); }
.link-label { font-size: 12px; color: var(--muted); min-width: 108px; }
.link-label.blocking { color: var(--danger); font-weight: 600; }
.link-form { display: grid; grid-template-columns: 170px 1fr auto; gap: 8px; }
.mini-badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.mini-badge.danger { background: var(--danger-soft); color: var(--danger); }
.mini-badge.ok { background: var(--ok-soft); color: var(--ok); }

.canned-anchor { position: relative; display: inline-flex; }
.canned-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 80; width: min(380px, 80vw); padding: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 16px 36px rgba(16, 24, 40, .22); }
.canned-list { display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow-y: auto; }
.canned-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 0; background: none; padding: 8px; border-radius: 6px; cursor: pointer; }
.canned-item:hover { background: var(--accent-soft); }
.canned-item .nav-key { font-size: 10px; }
.canned-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.canned-body { font-size: 13px; color: var(--text); max-height: 180px; overflow: hidden; }

table.list tr.selected { background: var(--accent-soft); }
.col-check { width: 36px; }
.col-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.bulk-bar { position: sticky; bottom: 12px; z-index: 20; margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: 0 12px 28px rgba(16, 24, 40, .3); }
.bulk-bar .input { width: auto; min-width: 140px; background: var(--surface); color: var(--text); }
.bulk-bar .btn { background: var(--surface); color: var(--text); }
.bulk-bar .btn.ghost { background: transparent; color: var(--bg); }
.bulk-bar .spacer { flex: 1; }
.nav-filter { font-size: 13px; padding-left: 12px; }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tpl { display: flex; flex-direction: column; gap: 6px; }
.stars { color: #f5a524; letter-spacing: 2px; font-size: 18px; }
.stars .off { color: var(--border); }
.star-pick { display: flex; gap: 4px; }
.star { font-size: 30px; line-height: 1; border: 0; background: none; cursor: pointer; color: var(--border); padding: 0 2px; }
.star.on { color: #f5a524; }
.star:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
.rate-box { padding: 14px; border-radius: 10px; background: var(--surface-2); }
.rate-box.done { display: flex; align-items: center; gap: 8px; }
@media (max-width: 960px) { .ticket.in-drawer { grid-template-columns: 1fr; } .link-form { grid-template-columns: 1fr; } }
td > .cell-title { flex-wrap: wrap; row-gap: 4px; }
.cell-name { flex: 1 1 220px; min-width: 160px; }

.modal.wide { max-width: 860px; width: calc(100vw - 32px); }
.stack.tight { gap: 2px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi span { font-size: 13px; color: var(--text); }
.kpi small { font-size: 12px; }
.kpi.good { border-left: 3px solid var(--ok); }
.kpi.warn { border-left: 3px solid var(--warn); }
.kpi.bad { border-left: 3px solid var(--danger); }
.kpi.bad b { color: var(--danger); }
.sla-pct.good { color: var(--ok); }
.sla-pct.warn { color: var(--warn); }
.sla-pct.bad { color: var(--danger); font-weight: 600; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.mini-table td { padding: 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.mini-table tr:last-child td { border-bottom: 0; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-cell { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.hbar { display: block; height: 6px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--series-2); }
.rating-dist { display: flex; flex-direction: column; gap: 6px; }
.rating-row { display: grid; grid-template-columns: 90px 1fr 32px; gap: 10px; align-items: center; }
.rating-row .stars { font-size: 13px; letter-spacing: 1px; }
.rating-row .track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.rating-row .track i { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.rating-item .stars { font-size: 14px; letter-spacing: 1px; }
.rating-list { gap: 10px; }
.user-cell { display: inline-flex; align-items: center; gap: 8px; }
.workload td { vertical-align: middle; }
.load-cell { width: 28%; min-width: 120px; }
.load-bar { display: flex; gap: 2px; height: 10px; border-radius: 4px; overflow: hidden; }
.load-bar .seg { min-width: 4px; }
.seg.critica, .swatch.seg.critica { background: #0d366b; }
.seg.alta, .swatch.seg.alta { background: #1c5cab; }
.seg.media, .swatch.seg.media { background: #3987e5; }
.seg.baixa, .swatch.seg.baixa { background: #86b6ef; }
.tone-bad { color: var(--danger); font-weight: 600; }
.unassigned-row td { background: var(--surface-2); }

@media (prefers-color-scheme: dark) {
  .seg.critica, .swatch.seg.critica { background: #b7d3f6; }
  .seg.alta, .swatch.seg.alta { background: #6da7ec; }
  .seg.media, .swatch.seg.media { background: #2a78d6; }
  .seg.baixa, .swatch.seg.baixa { background: #184f95; }
}

.chip-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; cursor: pointer; background: var(--surface); }
.chip-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip-check input { margin: 0; }
.secret-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; }
.secret-box code { flex: 1; word-break: break-all; font-size: 13px; }
.hook-row { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.hook-row:last-child { border-bottom: 0; padding-bottom: 0; }
.grow { flex: 1 1 260px; min-width: 0; }
.muted-row td { opacity: .55; }
.route-row .input { max-width: 260px; }
.api-docs summary { cursor: pointer; font-weight: 600; }
.api-docs[open] { display: flex; flex-direction: column; gap: 8px; }
pre.code { background: var(--surface-2); padding: 10px 12px; border-radius: 8px; font-size: 12px; overflow-x: auto; white-space: pre; margin: 0; }
.action-row { border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; gap: 8px; }
.rule-card { display: flex; flex-direction: column; gap: 8px; }
.rule-card.paused { opacity: .7; }
.rule-card h2 { margin: 0; }
.rule-line { display: flex; gap: 10px; align-items: baseline; }
.rule-tag { flex: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 5px; background: var(--surface-2); color: var(--muted); min-width: 52px; text-align: center; }
.rule-tag.then { background: var(--accent-soft); color: var(--accent); }
.card-pad.section-head { justify-content: space-between; align-items: flex-start; }
.card-pad.section-head > div:first-child { flex: 1 1 320px; }

body.pub:not(.embedded) .pub-wrap:has(.dm) { max-width: 1080px; }
.dm { display: flex; flex-direction: column; gap: 18px; }
.dm-head h1 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.02em; margin: 4px 0 8px; }
.dm-head p { margin: 0; max-width: 660px; font-size: 15px; }
.dm-eyebrow { color: var(--accent); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.dm-info { background: var(--accent-soft); color: var(--text); border-radius: 10px; padding: 12px 16px; font-size: 13px; }
.dm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; align-items: start; }
.dm-panel { padding: 24px; display: flex; flex-direction: column; }
.dm-panel.small { padding: 18px; gap: 8px; }
.dm-panel h3 { margin: 0; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--text); }
.dm-section { padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.dm-section-title { display: flex; align-items: center; gap: 12px; }
.dm-section-title h2 { margin: 0; font-size: 17px; }
.dm-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; flex: none; }
.dm-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dm .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; min-width: 0; }
.dm .field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.dm-full { grid-column: 1 / -1; }
.dm .input { min-height: 42px; padding: 9px 12px; font-weight: 400; }
.dm .dm-text { min-height: 104px; resize: vertical; }
.dm .dm-text.short { min-height: 78px; }
.dm .input.invalid { border-color: var(--danger); }
.dm-req { color: var(--danger); }
.dm-error { color: var(--danger); font-size: 12px; font-weight: 500; }
.dm-helper { color: var(--muted); font-size: 12px; font-weight: 400; margin: 0; }
.dm-options { display: grid; gap: 10px; }
.dm-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.dm-actions .hint { color: var(--muted); font-size: 12px; }
.dm-btn { min-height: 42px; padding: 9px 18px; font-weight: 600; }
.dm-panel .form-error { margin-bottom: 14px; }
.dm-side { position: sticky; top: 16px; display: grid; gap: 14px; }
.dm-tag { align-self: flex-start; display: inline-flex; background: var(--accent-soft); color: var(--accent); padding: 4px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.dm-area-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.dm-area { font-size: 12px; color: var(--muted); padding: 10px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid transparent; }
.dm-area b { color: var(--text); }
.dm-area.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.dm-steps { list-style: none; margin: 6px 0 0; padding: 0; counter-reset: dm; display: flex; flex-direction: column; gap: 14px; }
.dm-steps li { counter-increment: dm; display: grid; grid-template-columns: 26px 1fr; column-gap: 10px; font-size: 12px; }
.dm-steps li::before { content: counter(dm); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; font-weight: 700; }
.dm-steps li:first-child::before { background: var(--accent-soft); color: var(--accent); }
.dm-steps span { color: var(--muted); }
.dm-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dm-cell { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.dm-cell b { display: block; color: var(--muted); font-size: 11px; font-weight: 600; margin-bottom: 3px; }
.dm-cell div { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .dm-layout { grid-template-columns: 1fr; }
  .dm-side { position: static; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .dm-fields, .dm-side, .dm-preview { grid-template-columns: 1fr; }
  .dm-panel { padding: 18px; }
}

.raci-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.raci-chip { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 99px; padding: 1px 2px 1px 10px; font-size: 12px; }
.raci-chip .btn { padding: 0 6px; }
.raci-letter { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; font-size: 11px; color: #fff; }
.raci-letter.r { background: #1d8fe1; }
.raci-letter.a { background: #3f9d3a; }
.raci-letter.c { background: #d4452b; }
.raci-letter.i { background: #d98a0b; }

.cal-title { display: inline-block; min-width: 150px; text-align: center; }
.cal-title::first-letter { text-transform: uppercase; }
.cal { overflow: hidden; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); }
.cal-day { min-height: 108px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.blank { background: var(--surface-2); }
.cal-day.today { background: var(--accent-soft); }
.cal-num { font-size: 12px; font-weight: 600; color: var(--muted); }
.cal-day.today .cal-num { color: var(--accent); }
.cal-wd { display: none; }
.cal-chip { display: block; font-size: 12px; line-height: 1.35; padding: 3px 6px; border-radius: 6px; border-left: 3px solid var(--todo); background: var(--surface-2); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip:hover { text-decoration: none; filter: brightness(.97); }
.cal-chip.doing { border-left-color: var(--doing); }
.cal-chip.late { border-left-color: var(--danger); background: var(--danger-soft); }
.cal-chip.done { border-left-color: var(--done); color: var(--muted); text-decoration: line-through; }
.cal-sprint { font-size: 11px; font-weight: 600; color: var(--accent); }
.cal-sprint.end { color: var(--muted); }
.cal-sprint:hover { text-decoration: underline; }
.cal-none { padding: 14px; text-align: center; }
.swatch.cal-sw.todo { background: var(--todo); }
.swatch.cal-sw.doing { background: var(--doing); }
.swatch.cal-sw.late { background: var(--danger); }
.swatch.cal-sw.done { background: var(--done); }
@media (max-width: 760px) {
  .cal-head { display: none; }
  .cal-grid { display: block; }
  .cal-day { min-height: 0; border-right: 0; }
  .cal-day.blank, .cal-day.empty:not(.today) { display: none; }
  .cal-wd { display: inline; }
}
.temp-pass { display: block; padding: 12px 14px; border-radius: 8px; background: var(--surface-2, #f3f4f6); font-size: 20px; letter-spacing: .06em; text-align: center; user-select: all; }

.fbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 560px; min-width: 0; }
.fbar-search { width: 240px; max-width: 100%; }
.fpop-wrap { position: relative; display: inline-flex; }
.fchip { display: inline-flex; align-items: center; gap: 6px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fchip.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.fchip.static { padding: 4px 6px 4px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.fchip .caret { font-size: 10px; opacity: .7; }
.fchip-x { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 4px; font-size: 12px; opacity: .7; }
.fchip-x:hover { opacity: 1; }
.fadv { color: var(--accent); }
.fadv.on { background: var(--accent-soft); }
.fcount { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; }
.fpop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 280px; max-height: 360px; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
.fpop-head { display: flex; align-items: center; justify-content: space-between; }
.fopts { display: flex; flex-direction: column; gap: 2px; }
.fopt { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.fopt:hover { background: var(--surface-2); }
.frange { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fpresets { display: flex; flex-wrap: wrap; gap: 6px; }
.fpanel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: 360px; max-width: 100vw; border-radius: 0; display: flex; flex-direction: column; gap: 12px; padding: 18px; box-shadow: -12px 0 32px rgba(0, 0, 0, .18); }
.fpanel-head { display: flex; align-items: center; justify-content: space-between; }
.fpanel-head h2 { margin: 0; }
.fpanel-list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.fpanel-foot { border-top: 1px solid var(--border); padding-top: 12px; }
.fgroup { border: 1px solid var(--border); border-radius: 8px; }
.fgroup summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; cursor: pointer; font-weight: 600; list-style: none; }
.fgroup summary::-webkit-details-marker { display: none; }
.fgroup summary::after { content: '▾'; font-size: 11px; color: var(--muted); }
.fgroup[open] summary::after { content: '▴'; }
.fsum { flex: 1; text-align: right; font-weight: 500; font-size: 12px; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fgroup-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.fgroup-body > * { width: 100%; }
.fgroup-body > .btn { width: auto; }
.fam-0 { --fam: #2f55d4; } .fam-1 { --fam: #0e7c66; } .fam-2 { --fam: #b4472a; } .fam-3 { --fam: #7a4fc4; }
.fam-4 { --fam: #1f8a4c; } .fam-5 { --fam: #c27c0e; } .fam-6 { --fam: #1d6fa5; } .fam-7 { --fam: #9b3b6a; }
.tcard.fam { border-left: 4px solid var(--fam); }
.fam-line { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; font-weight: 600; color: var(--fam); }
.fam-key { flex: none; padding: 1px 6px; border-radius: 5px; background: color-mix(in srgb, var(--fam) 14%, transparent); }
.fam-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parent-progress { display: flex; align-items: center; gap: 8px; }
.parent-progress .progress { flex: 1; min-width: 60px; }
.home-parents { margin-top: 20px; }
.parent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; padding: 0 16px 16px; }
.parent-item { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-left: 4px solid var(--fam); border-radius: 8px; color: var(--text); }
.parent-item:hover { text-decoration: none; background: var(--surface-2); }
.parent-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 640px) { .fbar-search { width: 100%; } .fpop { width: min(280px, calc(100vw - 32px)); } }

.fam-btn { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 6px; }
.fam-btn:hover .fam-key, .fam-btn:hover .progress { filter: brightness(1.08); }
.fam-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.board.fam-focus .tcard:not(.fam-hi) { opacity: .4; }
.board .tcard { transition: opacity .12s, box-shadow .12s; }
.tcard.fam-hi { box-shadow: 0 0 0 2px var(--brand), var(--shadow); }
.fam-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }

.fpanel-sub { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.fgroup.draft { border-color: var(--brand); }
.fadd { align-self: flex-start; }
.fpick { padding: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }
.fpick-head { display: flex; align-items: center; justify-content: space-between; }
.fpick-list { max-height: 320px; overflow: auto; display: flex; flex-direction: column; }
.fpick-group { padding: 8px 6px 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.fpick-item { text-align: left; padding: 7px 8px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; cursor: pointer; }
.fpick-item:hover, .fpick-item:focus-visible { background: var(--surface-2); outline: none; }
.fpanel-foot { display: flex; justify-content: space-between; gap: 8px; }
.seg-links { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.board, .sidebar { scrollbar-width: none; }
.board::-webkit-scrollbar, .sidebar::-webkit-scrollbar { display: none; }
.api-doc { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 12px; }
.api-doc h3 { margin-top: 8px; }
.api-doc p, .api-doc ul { margin: 0; line-height: 1.55; }
.api-doc ul { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.api-doc td code { white-space: nowrap; }
.api-toc { display: flex; flex-direction: column; gap: 8px; }
a.tab { text-decoration: none; }
.page-tabs { margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.page-tabs::-webkit-scrollbar { display: none; }
.page-tabs .tab { white-space: nowrap; }
.stage-list { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.stage-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.stage-row:last-child { border-bottom: 0; }
.stage-order { display: flex; align-items: center; gap: 4px; padding-top: 6px; }
.stage-pos { min-width: 18px; text-align: center; font-weight: 700; color: var(--muted); }
.stage-main { flex: 1 1 360px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.stage-fields { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 8px; }
.stage-actions { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 2px; }
@media (max-width: 600px) { .stage-fields { grid-template-columns: 1fr; } }
.bell-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
