:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #142740; background: #f3f6fa; font-synthesis: none;
  --navy:#10243d; --blue:#155ec0; --muted:#53677f; --line:#dce5f0; --paper:#fff;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin:0; min-width: 320px; }
button, input, select { font:inherit; }
button, summary { cursor:pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible { outline:3px solid #2c78d4; outline-offset:3px; }
button { color:inherit; }
a { color:#155cb4; }
.sr-only, .skip:not(:focus) { position:absolute; clip-path:inset(50%); width:1px; height:1px; overflow:hidden; white-space:nowrap; }
.skip:focus { position:absolute; top:12px; left:12px; background:white; padding:10px; z-index:2; }
.shell { min-height:100dvh; display:grid; grid-template-columns:224px minmax(0,1fr); }
.sidebar { min-height:100dvh; position:sticky; top:0; height:100dvh; display:flex; flex-direction:column; background:var(--navy); color:white; padding:26px 16px 20px; }
.brand { display:flex; flex-direction:column; gap:12px; padding:0 10px; }
.brand img { width:147px; height:69px; object-fit:contain; padding:5px 9px; border-radius:9px; background:#fff; display:block; }
.brand span { font-size:.85rem; letter-spacing:.10em; text-transform:uppercase; color:#b1c4dc; font-weight:650; }
nav { display:grid; gap:6px; margin-top:36px; }
nav button { display:flex; gap:11px; align-items:center; width:100%; background:none; border:1px solid transparent; padding:11px 12px; border-radius:9px; color:#ccdaeb; text-align:left; }
nav button:hover { background:#1a3553; }
nav button[aria-current] { color:white; background:#1d4975; border-color:#2d5681; font-weight:650; }
.ico { width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; flex:none; vertical-align:middle; }
.profile { margin-top:auto; border-top:1px solid #2c4562; padding:17px 8px 0; display:flex; align-items:center; gap:10px; }
.profile strong, .profile div span { display:block; }
.profile div span { font-size:.8rem; color:#bfd0e4; margin-top:3px; }
.avatar { display:grid; place-items:center; width:37px; height:37px; border-radius:50%; background:#294d74; font-size:.83rem; font-weight:700; }
main { padding:34px clamp(22px, 3.15vw, 56px) 50px; max-width:1600px; width:100%; margin:0 auto; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:13px; }
h1, h2, h3, p { margin:0; }
h1 { font-size:clamp(2.05rem,4vw,3rem); line-height:1.07; letter-spacing:-.045em; }
h2 { font-size:1.23rem; letter-spacing:-.024em; }
h3 { font-size:1.02rem; letter-spacing:-.01em; }
.date-line { color:var(--muted); font-size:.875rem; margin-bottom:6px; }
.mode, .tabs { display:inline-flex; align-items:center; gap:3px; padding:4px; background:#e8eff8; border:1px solid #d8e3ef; border-radius:9px; }
.mode button, .tabs button { white-space:nowrap; border:0; background:transparent; padding:7px 11px; border-radius:6px; font-size:.875rem; color:#425874; font-weight:650; }
.mode button[aria-pressed=true], .tabs button[aria-pressed=true] { background:#fff; color:#143b67; box-shadow:0 1px 3px #132b4821; }
.source { color:var(--muted); font-size:.875rem; min-height:24px; margin-bottom:18px; }
.source.test { color:#775219; }
.overview { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-bottom:20px; }
.metric { display:flex; align-items:center; gap:13px; padding:16px; background:var(--paper); border:1px solid var(--line); border-radius:12px; }
.metric-icon { display:grid; place-items:center; background:#e8f2ff; color:#155da9; border-radius:10px; width:41px; height:41px; flex:none; }
.metric:nth-child(2) .metric-icon { color:#91541b; background:#fdf0df; }
.metric:nth-child(3) .metric-icon { color:#276958; background:#e7f5ef; }
.metric strong { display:block; font-size:1.6rem; font-variant-numeric:tabular-nums; line-height:1; }
.metric span:not(.metric-icon) { display:block; font-size:.875rem; color:var(--muted); margin-top:5px; }
.dashboard { display:grid; grid-template-columns:minmax(0,1.52fr) minmax(275px,1fr); align-items:start; gap:16px; }
.stack { display:grid; gap:16px; min-width:0; }
.panel { min-width:0; background:var(--paper); border:1px solid var(--line); border-radius:13px; overflow:hidden; }
.panel-head { min-height:58px; padding:14px 16px; display:flex; justify-content:space-between; align-items:center; gap:10px; border-bottom:1px solid #e8eef5; }
.panel-head button, .text-button { color:#185baa; background:transparent; border:0; border-radius:5px; padding:5px; font-size:.875rem; font-weight:650; min-height:34px; }
.panel-head button:hover, .text-button:hover { background:#e9f2fe; }
.row { padding:11px 16px; min-height:63px; display:flex; justify-content:space-between; align-items:center; gap:10px; border-bottom:1px solid #e8eef5; }
.row:last-child { border-bottom:0; }
.row-title { text-align:left; min-width:0; padding:0; color:#152940; background:none; border:0; font-weight:650; line-height:1.31; overflow-wrap:anywhere; }
.row-title:hover { color:var(--blue); text-decoration:underline; }
.row-sub { color:var(--muted); font-size:.84rem; line-height:1.32; margin-top:3px; overflow-wrap:anywhere; }
.row-sub.deadline { color:#a0473a; }
.row-main { min-width:0; flex:1; }
.status { display:inline-flex; font-size:.81rem; line-height:1.2; font-weight:650; align-items:center; white-space:nowrap; border-radius:20px; background:#edf1f6; color:#42566d; padding:5px 8px; }
.status.open { color:#14569b; background:#eaf3ff; }
.status.work { color:#7e4b12; background:#fff1d9; }
.status.done { color:#20624a; background:#e5f4ed; }
.status.commit { color:#624397; background:#f0eafd; }
.status.stop { color:#8c3e37; background:#ffefeb; }
.blank { padding:18px 16px; color:var(--muted); font-size:.95rem; line-height:1.55; }
.filters { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.search { flex:1; position:relative; min-width:150px; }
.search .ico { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--muted); }
.search input { width:100%; min-height:44px; padding:10px 12px 10px 40px; background:white; border:1px solid #cedae8; border-radius:9px; color:var(--navy); }
.workbench { display:grid; grid-template-columns:minmax(270px, .9fr) minmax(0, 1.1fr); align-items:start; gap:14px; }
.workbench .row { justify-content:stretch; }
.workbench .row.selected { background:#edf5ff; box-shadow:inset 3px 0 #2672c7; }
.list-rows { max-height:min(65vh,680px); overflow:auto; }
.detail { min-height:190px; }
.detail-intro { padding:17px 16px 13px; display:grid; gap:9px; }
.detail-intro h2 { overflow-wrap:anywhere; }
.detail-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.detail-actions a, .complete-button { font-size:.875rem; font-weight:650; border-radius:8px; padding:8px 11px; text-decoration:none; min-height:37px; display:inline-flex; align-items:center; gap:7px; }
.detail-actions a { color:#19599e; background:#eef5ff; border:1px solid #cddff4; }
.complete-button { border:1px solid #195db3; background:#195db3; color:white; }
.complete-button.reopen { background:white; color:#19599e; }
.complete-button:disabled { opacity:.65; cursor:wait; }
.meta { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:0 16px 16px; }
.meta div { background:#f2f6fb; border-radius:8px; padding:9px 10px; font-size:.875rem; overflow-wrap:anywhere; }
.meta span { display:block; color:var(--muted); font-size:.81rem; margin-bottom:3px; }
.detail-section { border-top:1px solid #e8eef5; padding:0 16px; }
.detail-section summary { padding:13px 0; font-weight:680; }
.detail-section p { color:#314a65; white-space:pre-line; overflow-wrap:anywhere; line-height:1.53; padding-bottom:14px; }
.detail-section .row { padding-left:0; padding-right:0; }
.detail-section .row:last-child { padding-bottom:13px; }
.doclink { font-weight:620; text-decoration-thickness:1px; text-underline-offset:2px; overflow-wrap:anywhere; }
.quick { border:1px solid #cfddee; color:#185baa; display:grid; place-items:center; background:white; border-radius:7px; width:39px; height:39px; flex:none; }
.quick:hover { background:#e8f2ff; }
.alert { padding:12px 14px; background:#fff2ec; color:#84382e; border:1px solid #f0cebc; border-radius:8px; margin-bottom:12px; line-height:1.4; }
@media (max-width:1040px) {
  .shell { grid-template-columns:176px minmax(0,1fr); }
  .brand img { width:125px; height:62px; }
  .sidebar { padding-left:12px; padding-right:12px; }
  .dashboard { grid-template-columns:minmax(0,1.25fr) minmax(245px,1fr); }
}
@media (max-width:820px) {
  .shell { display:block; }
  .sidebar { position:static; min-height:0; height:auto; flex-direction:row; align-items:center; padding:10px 15px; gap:12px; }
  .brand { padding:0; }
  .brand img { width:104px; height:43px; border-radius:5px; padding:3px 5px; }
  .brand span, .profile { display:none; }
  nav { display:flex; gap:4px; margin:0 0 0 auto; }
  nav button { width:auto; padding:7px 9px; font-size:.87rem; min-height:39px; gap:5px; }
  nav .ico { width:16px; height:16px; }
  main { padding:21px 16px 34px; }
}
@media (max-width:635px) {
  .dashboard, .workbench { grid-template-columns:1fr; }
  .overview { gap:6px; margin-bottom:12px; }
  .metric { padding:10px 8px; gap:5px; align-items:flex-start; }
  .metric-icon { display:none; }
  .metric strong { font-size:1.45rem; }
  .metric span:not(.metric-icon) { font-size:.79rem; }
  .row { padding-left:12px; padding-right:12px; }
  .panel-head { padding-left:12px; padding-right:12px; }
  .topbar { align-items:flex-end; gap:6px; }
  .mode button { padding:7px 6px; font-size:.8rem; }
  .source { margin-bottom:11px; }
  .filters { flex-wrap:wrap; }
  .search { flex-basis:100%; }
  .list-rows { max-height:48vh; }
}
@media (max-width:380px) {
  .sidebar { padding-left:10px; padding-right:10px; gap:5px; }
  nav button { padding-inline:6px; }
  nav .ico { display:none; }
  .status { white-space:normal; max-width:88px; }
}
@media (max-width:440px) {
  nav .ico { display:none; }
  nav button { padding-inline:7px; }
  .sidebar { gap:6px; }
}

.login-page { min-height:100dvh; display:grid; place-items:center; padding:20px; background:#112541; }
.login-card { width:min(100%,400px); border-radius:17px; background:white; padding:clamp(22px,6vw,34px); margin:0; box-shadow:0 14px 44px #07132255; }
.login-card img { object-fit:contain; display:block; margin:0 0 15px; }
.login-card h1 { font-size:2.05rem; }
.login-card > p { margin:7px 0 21px; color:var(--muted); }
.login-card form { display:grid; gap:9px; }
.login-card label { font-size:.94rem; font-weight:650; }
.login-card input { min-height:46px; border:1px solid #9db3cd; color:var(--navy); border-radius:8px; padding:8px 11px; font-size:1.15rem; }
.login-card button { min-height:44px; border:0; border-radius:8px; background:#155ec0; color:white; font-weight:700; margin-top:5px; }
.login-card button:hover { background:#124e9f; }
.top-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:8px; }
.logout-button { background:white; border:1px solid #d8e3ef; border-radius:8px; padding:8px 10px; min-height:36px; font-size:.875rem; font-weight:650; }
.logout-button:hover { background:#edf5ff; }
@media (max-width:635px) { .top-actions { gap:4px; } .logout-button { padding-inline:7px; font-size:.8rem; } }

.login-card [data-passkey] { width:100%; margin-top:10px; background:#eaf2fd; color:#194579; }
.login-card [data-passkey]:hover { background:#dceafa; }
[data-passkey-message]:empty { display:none; }
[data-passkey-message] { margin:0 0 10px; color:#315576; }
