:root {
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Helvetica Neue", sans-serif;
  --radius: 8px;
  --radius-sm: 4px;
  --sidebar: 240px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}
[data-theme="light"] {
  --bg: #ffffff; --bg-sunken: #f7f8f9; --bg-raised: #ffffff; --bg-hover: #f1f2f4; --bg-pressed: #dcdfe4;
  --bg-column: #f1f2f4; --bg-card: #ffffff; --bg-overlay: rgba(9, 30, 66, 0.54);
  --text: #172b4d; --text-subtle: #44546f; --text-muted: #626f86; --text-inverse: #ffffff;
  --border: #dcdfe4; --border-strong: #b7bec8;
  --brand: #0b6e66; --brand-hover: #095a54; --brand-subtle: #e3f4f2; --brand-text: #0b6e66;
  --danger: #c9372c; --danger-subtle: #ffeceb; --warning: #a54800; --warning-subtle: #fff3eb;
  --success: #216e4e; --success-subtle: #dcfff1; --shadow: 0 1px 1px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
  --shadow-lg: 0 8px 12px rgba(9, 30, 66, 0.15), 0 0 1px rgba(9, 30, 66, 0.31);
}
[data-theme="light"] { color-scheme: light; }
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1d2125; --bg-sunken: #161a1d; --bg-raised: #22272b; --bg-hover: #2c333a; --bg-pressed: #38414a;
  --bg-column: #161a1d; --bg-card: #22272b; --bg-overlay: rgba(3, 4, 4, 0.64);
  --text: #b6c2cf; --text-subtle: #9fadbc; --text-muted: #8c9bab; --text-inverse: #1d2125;
  --border: #38414a; --border-strong: #4a545e;
  --brand: #2fb3a7; --brand-hover: #5fd0c4; --brand-subtle: #0e3532; --brand-text: #5fd0c4;
  --danger: #f87168; --danger-subtle: #42221f; --warning: #fea362; --warning-subtle: #38291e;
  --success: #4bce97; --success-subtle: #164b35; --shadow: 0 1px 1px rgba(3, 4, 4, 0.5), 0 0 1px rgba(3, 4, 4, 0.5);
  --shadow-lg: 0 8px 12px rgba(3, 4, 4, 0.36), 0 0 1px rgba(3, 4, 4, 0.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font: 14px/1.43 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 16px; height: 16px; flex: 0 0 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
kbd { font: 11px/1 var(--font); padding: 2px 5px; border: 1px solid var(--border); border-radius: 3px; color: var(--text-muted); background: var(--bg-sunken); }

.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius-sm); border: 0; background: var(--bg-hover); color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap; transition: background 0.12s var(--ease); }
.btn:hover { background: var(--bg-pressed); }
.btn.primary { background: var(--brand); color: var(--text-inverse); }
.btn.primary:hover { background: var(--brand-hover); }
.btn.subtle { background: transparent; }
.btn.subtle:hover { background: var(--bg-hover); }
.btn.danger { background: var(--danger); color: var(--text-inverse); }
.btn.big { height: 40px; padding: 0 20px; font-size: 15px; }
.btn.sm { height: 28px; padding: 0 8px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-subtle); cursor: pointer; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.sm { width: 24px; height: 24px; }

.login { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg-sunken); padding: 16px; }
.login-box { max-width: 420px; text-align: center; background: var(--bg-raised); padding: 40px 32px; border-radius: 12px; box-shadow: var(--shadow-lg); }
.login-box h1 { margin: 16px 0 8px; font: 700 28px/1.2 Sora, var(--font); letter-spacing: -0.02em; }
.login-box p { color: var(--text-subtle); margin: 0 0 24px; }
.login-logo, .brand-logo { display: inline-grid; place-items: center; width: 56px; height: 56px; flex: 0 0 auto; }
.login-logo svg, .brand-logo svg { width: 100%; height: 100%; display: block; }

.app { display: grid; grid-template-columns: var(--sidebar) 1fr; height: 100vh; }
.sidebar { display: flex; flex-direction: column; background: var(--bg-sunken); border-right: 1px solid var(--border); padding: 16px 8px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand-logo { width: 32px; height: 32px; }
.brand-name { font-family: Sora, var(--font); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 12px; color: var(--text-muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); padding: 12px 8px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--radius-sm); color: var(--text-subtle); font-weight: 500; cursor: pointer; text-decoration: none; }
.nav-item:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav-item.on { background: var(--brand-subtle); color: var(--brand-text); }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.sidebar-foot { margin-top: auto; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.search { position: relative; flex: 1; max-width: 520px; display: flex; align-items: center; }
.search input { width: 100%; height: 36px; padding: 0 40px 0 34px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg); outline: none; }
.search input:focus { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.search-icon { position: absolute; left: 10px; color: var(--text-muted); display: flex; }
.search kbd { position: absolute; right: 10px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.sync { font-size: 12px; color: var(--text-muted); margin-right: 6px; white-space: nowrap; }
.avatar-btn { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 16px 24px 8px; flex: 0 0 auto; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--text-muted); }
.page-head h2 { margin: 2px 0 0; font-size: 22px; font-weight: 600; color: var(--text); }
.page-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.filterbar { display: flex; align-items: center; gap: 8px; padding: 4px 24px 12px; flex-wrap: wrap; flex: 0 0 auto; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg); color: var(--text-subtle); font-weight: 500; cursor: pointer; }
.fchip:hover { background: var(--bg-hover); }
.fchip.on { background: var(--brand-subtle); border-color: var(--brand); color: var(--brand-text); }
.fchip .n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: var(--text-inverse); font-size: 11px; font-weight: 700; }
.ftoggle { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: var(--radius-sm); color: var(--text-subtle); cursor: pointer; user-select: none; }
.ftoggle:hover { background: var(--bg-hover); }
.ftoggle input { margin: 0; accent-color: var(--brand); }
.avatars-filter { display: flex; align-items: center; padding-right: 8px; }
.avatars-filter .avatar { margin-left: -6px; cursor: pointer; box-shadow: 0 0 0 2px var(--bg); transition: transform 0.1s; }
.avatars-filter .avatar:first-child { margin-left: 0; }
.avatars-filter .avatar:hover { transform: translateY(-2px); z-index: 2; }
.avatars-filter .avatar.on { box-shadow: 0 0 0 2px var(--brand); z-index: 1; }

.view { flex: 1; min-height: 0; overflow: auto; padding: 0 24px 24px; }
.view.board-view { padding: 0 16px 16px; overflow: hidden; display: flex; flex-direction: column; }

.avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #626f86; color: #fff; font-size: 10px; font-weight: 700; overflow: hidden; flex: 0 0 auto; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 32px; height: 32px; font-size: 12px; }
.avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.avatar-stack { display: flex; flex-direction: row-reverse; justify-content: flex-end; }
.avatar-stack .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--bg-card); }

.lozenge { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; white-space: nowrap; background: var(--bg-pressed); color: var(--text-subtle); }
.lozenge.todo { background: var(--bg-pressed); color: var(--text-subtle); }
.lozenge.progress { background: var(--brand-subtle); color: var(--brand-text); }
.lozenge.done { background: var(--success-subtle); color: var(--success); }
.lozenge.blocked { background: var(--danger-subtle); color: var(--danger); }
.label-pill { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 3px; font-size: 11px; font-weight: 600; color: #1d2125; white-space: nowrap; }
.type-icon { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 3px; color: #fff; flex: 0 0 16px; }
.type-icon svg { width: 11px; height: 11px; stroke: #fff; stroke-width: 2.6; fill: none; }
.prio { display: inline-flex; flex: 0 0 auto; }
.prio svg { width: 16px; height: 16px; stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.key { font-size: 12px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.key.done { text-decoration: line-through; }

.board-tools { display: flex; align-items: center; gap: 8px; }
.board { flex: 1; min-height: 0; overflow: auto; }
.lane { margin-bottom: 8px; }
.lane-head { position: sticky; left: 0; display: flex; align-items: center; gap: 8px; padding: 8px 4px; font-weight: 600; cursor: pointer; user-select: none; }
.lane-head .count { color: var(--text-muted); font-weight: 400; font-size: 13px; }
.lane-head svg { transition: transform 0.15s; }
.lane.collapsed .lane-head svg { transform: rotate(-90deg); }
.lane.collapsed .columns { display: none; }
.columns { display: flex; gap: 8px; align-items: flex-start; }
.column { flex: 0 0 272px; display: flex; flex-direction: column; background: var(--bg-column); border-radius: 6px; max-height: calc(100vh - 230px); }
.board.lanes .column { max-height: none; }
.column-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 8px 12px; font-size: 12px; font-weight: 700; color: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.02em; }
.column-head .count { font-weight: 500; color: var(--text-muted); }
.column-head .wip-over { color: var(--danger); }
.column-head .grow { flex: 1; }
.column.done-col .column-head::after { content: ""; }
.cards { flex: 1; overflow-y: auto; padding: 0 6px 6px; min-height: 40px; display: flex; flex-direction: column; gap: 6px; }
.column-foot { padding: 0 6px 6px; }
.add-card { width: 100%; justify-content: flex-start; background: transparent; color: var(--text-subtle); }
.add-card:hover { background: var(--bg-hover); }
.quick-add textarea { width: 100%; min-height: 64px; padding: 8px; border-radius: var(--radius-sm); border: 2px solid var(--brand); background: var(--bg-card); resize: none; outline: none; }
.quick-add .row { display: flex; gap: 6px; margin-top: 6px; align-items: center; }

.card { position: relative; background: var(--bg-card); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 10px 10px 8px; cursor: pointer; transition: background 0.1s; }
.card:hover { background: var(--bg-hover); }
.card.selected { box-shadow: 0 0 0 2px var(--brand); }
.card.is-epic { border-left: 3px solid #9f8fef; }
.prod-strip { position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; pointer-events: none; }
.card.is-epic .prod-strip { border-top-left-radius: 0; }
.card.has-strip { padding-top: 13px; }
.epic.has-strip { position: relative; padding-top: 19px; }
.epic .prod-strip { border-radius: var(--radius) var(--radius) 0 0; }
.prod-mark { display: inline-block; flex: none; width: 4px; height: 16px; border-radius: 2px; }
.key-cell { display: inline-flex; align-items: center; gap: 8px; }
.card .title { margin: 0 0 8px; word-break: break-word; color: var(--text); }
.card .labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.card .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card .meta .grow { flex: 1; }
.card .epic-tag { display: inline-flex; max-width: 100%; height: 18px; align-items: center; padding: 0 6px; border-radius: 3px; background: #dfd8fd; color: #352c63; font-size: 11px; font-weight: 600; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="dark"] .card .epic-tag { background: #2b273f; color: #b8acf6; }
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.badge svg { width: 14px; height: 14px; }
.badge.due-over { color: var(--danger); font-weight: 600; }
.badge.due-soon { color: var(--warning); font-weight: 600; }
.badge.complete { color: var(--success); }
.progress { height: 6px; border-radius: 3px; background: var(--bg-pressed); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--success); border-radius: 3px; transition: width 0.3s var(--ease); }
.card .progress { margin-top: 8px; height: 4px; }
.sortable-ghost { opacity: 0.35; }
.sortable-drag { transform: rotate(2deg); box-shadow: var(--shadow-lg) !important; }
.column.drop-hint .cards { outline: 2px dashed var(--brand); outline-offset: -4px; border-radius: 6px; }

.empty { text-align: center; color: var(--text-muted); padding: 48px 16px; }
.empty h3 { color: var(--text); margin: 12px 0 4px; }

.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { position: sticky; top: 0; z-index: 1; background: var(--bg-sunken); text-align: left; font-size: 12px; font-weight: 600; color: var(--text-subtle); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; cursor: pointer; user-select: none; }
table.grid th.sorted { color: var(--brand-text); }
table.grid td { padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
table.grid td.title-cell { white-space: normal; min-width: 280px; }
table.grid tr.row { cursor: pointer; }
table.grid tr.row:hover td { background: var(--bg-hover); }
table.grid tr.row.checked td { background: var(--brand-subtle); }
table.grid tr.group td { background: var(--bg-sunken); font-weight: 600; padding: 10px; }
table.grid input[type="checkbox"] { accent-color: var(--brand); }
.cell-flex { display: flex; align-items: center; gap: 6px; }
.bulkbar { position: sticky; bottom: 12px; margin: 12px auto 0; width: max-content; max-width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius); background: var(--bg-raised); box-shadow: var(--shadow-lg); border: 1px solid var(--border); flex-wrap: wrap; z-index: 5; }

.epics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.epic { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.epic-head { display: flex; align-items: flex-start; gap: 10px; }
.epic-head h3 { margin: 0; font-size: 16px; line-height: 1.3; cursor: pointer; }
.epic-head h3:hover { color: var(--brand-text); }
.epic-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.epic .progress { height: 8px; }
.stacked { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--bg-pressed); }
.stacked span { height: 100%; }
.epic-children { display: flex; flex-direction: column; border-top: 1px solid var(--border); padding-top: 8px; max-height: 260px; overflow: auto; }
.child-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: var(--radius-sm); cursor: pointer; }
.child-row:hover { background: var(--bg-hover); }
.child-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.roadmap { border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; position: relative; }
.rm-grid { display: grid; min-width: max-content; }
.rm-head { position: sticky; top: 0; z-index: 2; display: grid; background: var(--bg-sunken); border-bottom: 1px solid var(--border); }
.rm-month { font-size: 12px; font-weight: 600; color: var(--text-subtle); padding: 8px; border-left: 1px solid var(--border); text-transform: capitalize; }
.rm-row { display: grid; border-bottom: 1px solid var(--border); min-height: 44px; }
.rm-label { position: sticky; left: 0; z-index: 1; background: var(--bg); padding: 10px 12px; display: flex; align-items: center; gap: 8px; border-right: 1px solid var(--border); cursor: pointer; min-width: 0; }
.rm-label .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-track { position: relative; }
.rm-bar { position: absolute; top: 10px; height: 24px; border-radius: 4px; padding: 0 8px; display: flex; align-items: center; font-size: 12px; font-weight: 600; color: #1d2125; white-space: nowrap; overflow: hidden; cursor: pointer; box-shadow: var(--shadow); }
.rm-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 1; pointer-events: none; }
.rm-nodate { margin-top: 16px; }

.dash { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.tile { grid-column: span 3; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.tile .k { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.tile .v { font-size: 30px; font-weight: 700; margin-top: 6px; color: var(--text); }
.tile .s { font-size: 12px; color: var(--text-muted); }
.tile.danger .v { color: var(--danger); }
.panel { grid-column: span 6; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-width: 0; }
.panel.wide { grid-column: span 12; }
.panel h3 { margin: 0 0 12px; font-size: 15px; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; cursor: pointer; }
.bar-row:hover .bar-track { opacity: 0.85; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-subtle); }
.bar-track { height: 18px; border-radius: 3px; background: var(--bg-pressed); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s var(--ease); }
.bar-row .num { text-align: right; font-weight: 600; }
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .when { color: var(--text-muted); font-size: 12px; }
.week-chart { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; padding-top: 8px; }
.week { display: flex; flex-direction: column; min-width: 0; }
.week-bars { height: 140px; display: flex; align-items: flex-end; justify-content: center; gap: 4px; border-bottom: 1px solid var(--border); }
.week-bar { position: relative; width: 22px; min-height: 2px; border-radius: 3px 3px 0 0; }
.week-bar.created, .legend-dot.created { background: #579dff; }
.week-bar.done, .legend-dot.done { background: #4bce97; }
.week-bar.zero { opacity: 0.35; }
.week-val { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 2px; font-size: 11px; font-weight: 600; color: var(--text-subtle); }
.week-label { margin-top: 6px; text-align: center; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 400; color: var(--text-subtle); margin-left: 12px; }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; }
@media (max-width: 600px) { .week-bar { width: 12px; } .week-bars { gap: 2px; } .week-label { font-size: 10px; } }

.overlay { position: fixed; inset: 0; z-index: 50; background: var(--bg-overlay); display: flex; align-items: center; justify-content: center; padding: 32px 16px; overflow: hidden; animation: fade 0.15s var(--ease); }
.overlay { overscroll-behavior: contain; }
.modal.static { animation: none; }
body.modal-open { overflow: hidden; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.modal { width: 100%; max-width: 1080px; max-height: 100%; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-raised); border-radius: var(--radius); box-shadow: var(--shadow-lg); animation: pop 0.18s var(--ease); }
.modal > * { flex: none; }
.modal > .issue, .modal > .form, .modal > .help-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.modal.sm { max-width: 560px; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 8px 24px; }
.modal-head .grow { flex: 1; }
.modal > .issue { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-top: 1px solid var(--border); overflow: hidden; }
.issue-main { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 24px 24px; }
.issue-side { width: 340px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: var(--bg-sunken); border-left: 1px solid var(--border); transition: width 0.18s var(--ease); }
.issue-side.collapsed { width: 48px; }
.side-inner { padding: 16px; }
.issue-side.collapsed .side-inner { padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.issue-side.collapsed .side-toggle svg { transform: rotate(180deg); }
.side-vertical { writing-mode: vertical-rl; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-subtle); }
.side-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.side-top .grow { flex: 1; }
.side-section { border-top: 1px solid var(--border); padding: 4px 0; }
.side-head { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; padding: 10px 2px; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; border-radius: var(--radius-sm); }
.side-head:hover { color: var(--brand); }
.side-head .grow { flex: 1; text-align: left; }
.side-head svg { color: var(--text-subtle); }
.issue-side .dl { padding: 0 2px 10px; }
.date-wrap { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.date-text { border: 0; background: transparent; font: inherit; color: var(--text); padding: 4px 6px; margin-left: -6px; border-radius: var(--radius-sm); cursor: pointer; }
.date-text:hover { background: var(--bg-hover); }
.date-text.empty { color: var(--text-muted); }
.date-text.over { color: var(--danger); font-weight: 600; }
.date-text.soon { color: #b38600; font-weight: 600; }
.date-text.complete { color: var(--success); }
.date-input { height: 32px; padding: 0 8px; width: auto; }
.issue-title { width: 100%; font-size: 24px; font-weight: 600; line-height: 1.3; border: 2px solid transparent; border-radius: var(--radius-sm); padding: 4px 6px; margin: 0 0 12px -8px; background: transparent; resize: none; overflow: hidden; outline: none; color: var(--text); }
.issue-title:hover { background: var(--bg-hover); }
.issue-title:focus { border-color: var(--brand); background: var(--bg); }
.section { margin-bottom: 24px; }
.section-title { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.section-title .grow { flex: 1; }
.md { line-height: 1.6; word-break: break-word; cursor: text; padding: 6px 8px; margin-left: -8px; border-radius: var(--radius-sm); }
.md:hover { background: var(--bg-hover); }
.md h1, .md h2, .md h3 { margin: 16px 0 8px; font-size: 16px; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { padding-left: 22px; margin: 0 0 10px; }
.md code { background: var(--bg-sunken); padding: 1px 4px; border-radius: 3px; font-size: 13px; }
.md pre { background: var(--bg-sunken); padding: 10px; border-radius: var(--radius-sm); overflow: auto; }
.md blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--border-strong); color: var(--text-subtle); }
.md.placeholder { color: var(--text-muted); }
textarea.field, input.field, select.field { width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); padding: 8px 10px; outline: none; }
textarea.field { min-height: 160px; resize: vertical; line-height: 1.5; }
textarea.field:focus, input.field:focus, select.field:focus { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.edit-actions { display: flex; gap: 8px; margin-top: 8px; }
.checklist { margin-bottom: 16px; }
.checklist-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 600; }
.checklist-head .grow { flex: 1; }
.check-item { display: flex; align-items: flex-start; gap: 10px; padding: 5px 6px; border-radius: var(--radius-sm); }
.check-item:hover { background: var(--bg-hover); }
.check-item input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; flex: 0 0 16px; cursor: pointer; }
.check-item.done span { text-decoration: line-through; color: var(--text-muted); }
.check-item a { word-break: break-all; }
.add-item { display: flex; gap: 8px; margin-top: 6px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 12px; }
.tab { padding: 6px 10px; border: 0; background: none; cursor: pointer; color: var(--text-subtle); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab.on { color: var(--brand-text); border-bottom-color: var(--brand); }
.comment { display: flex; gap: 10px; margin-bottom: 16px; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { font-size: 13px; margin-bottom: 2px; }
.comment-meta b { color: var(--text); }
.comment-text { background: var(--bg-sunken); padding: 8px 10px; border-radius: var(--radius-sm); }
.comment-text p:last-child { margin-bottom: 0; }
.new-comment { display: flex; gap: 10px; margin-bottom: 20px; }
.new-comment textarea { min-height: 70px; }
.child-list { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.child-list .child-row { border-bottom: 1px solid var(--border); border-radius: 0; padding: 8px 10px; }
.child-list .child-row:last-child { border-bottom: 0; }

.dl { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; padding: 12px 14px; align-items: center; }
.dl > dt { color: var(--text-subtle); font-size: 13px; font-weight: 500; }
.dl > dd { margin: 0; min-width: 0; }
.picker { display: flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 6px; margin-left: -6px; border-radius: var(--radius-sm); cursor: pointer; flex-wrap: wrap; }
.picker:hover { background: var(--bg-hover); }
.picker .placeholder { color: var(--text-muted); }
.status-select { appearance: none; border: 0; border-radius: 3px; padding: 6px 28px 6px 10px; font-weight: 700; font-size: 13px; cursor: pointer; text-transform: uppercase; background-repeat: no-repeat; background-position: right 8px center; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23626f86' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.status-select:hover { filter: brightness(0.95); }
.status-select.st-progress, .status-select.st-blocked, .status-select.st-done { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.issue-side .meta-foot { font-size: 12px; color: var(--text-muted); padding: 12px 2px 0; line-height: 1.7; border-top: 1px solid var(--border); }

.menu { position: fixed; z-index: 80; min-width: 220px; max-width: 320px; max-height: 420px; overflow: auto; background: var(--bg-raised); border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--border); padding: 6px 0; animation: pop 0.12s var(--ease); }
.menu-search { padding: 4px 8px 6px; }
.menu-search input { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); outline: none; }
.menu-group { padding: 8px 12px 4px; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 7px 12px; cursor: pointer; color: var(--text); }
.menu-item:hover, .menu-item.active { background: var(--bg-hover); }
.menu-item.on { color: var(--brand-text); }
.menu-item .check { width: 16px; height: 16px; border: 2px solid var(--border-strong); border-radius: 3px; display: grid; place-items: center; flex: 0 0 16px; }
.menu-item.on .check { background: var(--brand); border-color: var(--brand); }
.menu-item.on .check svg { stroke: var(--text-inverse); width: 11px; height: 11px; stroke-width: 3; }
.menu-item .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 0; }
.menu-foot { display: flex; justify-content: space-between; padding: 6px 12px 2px; }

.form { padding: 8px 24px 24px; display: grid; gap: 14px; }
.form label.l { display: block; font-size: 12px; font-weight: 600; color: var(--text-subtle); margin-bottom: 4px; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 24px 16px; align-items: center; border-top: 1px solid var(--border); }
.form-foot .grow { flex: 1; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 15px; border: 1px solid var(--border-strong); background: var(--bg); cursor: pointer; font-size: 13px; font-weight: 500; }
.seg button.on { background: var(--brand); border-color: var(--brand); color: var(--text-inverse); }
.seg button .dot { width: 9px; height: 9px; border-radius: 50%; }

.toasts { position: fixed; left: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px; padding: 12px 14px; border-radius: var(--radius); background: var(--bg-raised); box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: pop 0.2s var(--ease); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.ok { border-left: 4px solid var(--success); }
.toast .grow { flex: 1; }

.skeleton { background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-pressed) 50%, var(--bg-hover) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; padding: 8px 24px 24px; align-items: center; }

.only-mobile { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform 0.2s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .only-mobile { display: inline-grid; }
  .search kbd, .sync { display: none; }
  .page-head, .filterbar { padding-left: 16px; padding-right: 16px; }
  .view { padding: 0 16px 16px; }
  .modal > .issue { display: block; overflow-y: auto; }
  .issue-main, .issue-side { overflow: visible; }
  .issue-side, .issue-side.collapsed { width: auto; border-left: 0; border-top: 1px solid var(--border); border-radius: 0; }
  .side-toggle { display: none; }
  .issue-side.collapsed .side-inner { display: block; padding: 16px; }
  .tile { grid-column: span 6; }
  .panel { grid-column: span 12; }
  .epics-grid { grid-template-columns: 1fr; }
  .form .row2, .form .row3 { grid-template-columns: 1fr; }
  .overlay { padding: 0; }
  .modal { border-radius: 0; height: 100%; max-width: none; }
}
@media (max-width: 520px) {
  .topbar { gap: 8px; padding: 0 8px; }
  #create-btn span { display: none; }
  .column { flex-basis: 85vw; }
  .tile { grid-column: span 12; }
}
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.danger-text { color: var(--danger); }
.form .invalid select { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.card .parent-tag { display: inline-flex; max-width: 100%; height: 18px; align-items: center; gap: 4px; padding: 0 6px; border-radius: 3px; background: var(--bg-hover); color: var(--text-subtle); font-size: 11px; font-weight: 600; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phase-strip { display: grid; gap: 6px; margin: 10px 0 14px; }
.phase-step { border-radius: var(--radius-sm); padding: 8px 10px; background: var(--bg-hover); min-width: 0; }
.phase-step-label { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phase-step-state { font-size: 11px; color: var(--text-subtle); margin-top: 1px; }
.phase-step.st-done { background: color-mix(in srgb, var(--success) 18%, transparent); }
.phase-step.st-done .phase-step-label, .phase-step.st-done .phase-step-state { color: var(--success); }
.phase-step.st-progress, .phase-step.current { background: color-mix(in srgb, var(--brand) 16%, transparent); }
.phase-step.st-progress .phase-step-label, .phase-step.st-progress .phase-step-state, .phase-step.current .phase-step-label { color: var(--brand); }
.phase-bar { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; margin-top: 6px; }
.phase-bar span { display: block; height: 100%; background: var(--brand); }
.phase-step.st-done .phase-bar span { background: var(--success); }
.phase-strip.compact { margin: 2px 0; gap: 4px; }
.phase-strip.compact .phase-step { padding: 5px 8px; }
.phase-block { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.phase-block.current { border: 2px solid var(--brand); padding: 9px 11px; }
.phase-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.phase-head .grow { flex: 1; }
.phase-name { font-weight: 600; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phase-count { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 3px; background: var(--bg-hover); color: var(--text-subtle); flex: none; }
.phase-count.done { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.phase-count.progress { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.phase-cards { min-height: 36px; }
.phase-cards:empty::before { content: "Arraste cards para cá."; display: block; padding: 10px; font-size: 12px; color: var(--text-muted); text-align: center; }
.phase-more { margin-top: 6px; }
