:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --paper: #fff;
  --ink: #17261f;
  --muted: #52635a;
  --subtle: #596a61;
  --border: #dce4dd;
  --line: #e9eeea;
  --green: #176246;
  --green-dark: #114b35;
  --green-light: #ebf6ee;
  --shadow: 0 1px 2px #1c33200c, 0 8px 24px #1c332006;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  font-synthesis: none;
  font-size: 15px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 3px solid #428969; outline-offset: 3px; }
::selection { background: #bfe5cc; color: var(--green-dark); }
svg { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; border: 0; }

.app-header { background: var(--paper); border-bottom: 1px solid var(--border); }
.header-inner, .workspace { width: min(1176px, calc(100% - 72px)); margin-inline: auto; }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand, .header-actions, .board-tools { display: flex; align-items: center; }
.brand { gap: 12px; color: inherit; text-decoration: none; flex: none; }
.brand-icon { width: 40px; height: 40px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 11px; box-shadow: inset 0 1px #ffffff32, 0 2px 4px #173d2920; }
.brand-icon svg { width: 21px; height: 21px; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 15px; font-weight: 740; letter-spacing: .02em; }
.brand-copy small { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.header-actions { gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 650; white-space: nowrap; transition: background .14s, border-color .14s, box-shadow .14s; }
.btn svg { width: 16px; height: 16px; }
.btn-quiet, .btn-secondary { background: var(--paper); border-color: var(--border); }
.btn-quiet:hover, .btn-secondary:hover { background: #f0f4f0; border-color: #c9d7cd; }
.btn-primary { color: #fff; background: var(--green); border-color: var(--green); box-shadow: 0 2px 4px #16433116; }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }

.account-summary { max-width: 145px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.access-screen { min-height: calc(100dvh - 73px); display: grid; justify-items: center; align-content: start; padding: clamp(36px, 10vh, 105px) 16px 34px; background: radial-gradient(ellipse at 50% 0%, #eaf3ea, transparent 68%); }
.auth-card { width: min(100%, 438px); padding: 29px 31px 31px; border: 1px solid var(--border); border-radius: 16px; background: var(--paper); box-shadow: 0 1px 2px #1c33200c, 0 16px 40px #183b2210; }
.auth-card h1 { margin: 0; font-size: 27px; font-weight: 760; letter-spacing: -.035em; line-height: 1.25; }
.auth-card > p { margin: 9px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.auth-card .eyebrow { margin-bottom: 11px; }
.auth-form { display: grid; gap: 13px; margin-top: 22px; }
.auth-form .btn-primary { min-height: 43px; }
#access-retry { margin-top: 15px; }
#access-loading { color: var(--muted); font-size: 14px; line-height: 1.6; }

.workspace { padding-block: 40px 20px; }
.intro { margin-bottom: 27px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; color: var(--green); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.signal { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #27855e; box-shadow: 0 0 0 3px #d9eee1; margin-left: 3px; }
.intro h1 { margin: 0; font-size: clamp(29px, 3.4vw, 42px); font-weight: 780; letter-spacing: -.035em; line-height: 1.18; }
.intro p:not(.eyebrow) { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }

.overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 24px; }
.stat { text-align: left; display: grid; justify-items: start; gap: 7px; min-width: 0; min-height: 112px; padding: 15px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); transition: border-color .14s, background .14s; }
button.stat:hover { border-color: #a7c3ae; background: #fcfefc; }
.stat[aria-pressed='true'], .stat.active { border-color: #83aa91; background: #f7fcf8; box-shadow: inset 0 0 0 1px #83aa9160; }
.stat-top { display: inline-flex; align-items: center; gap: 8px; }
.stat-label { color: #43554b; font-weight: 680; font-size: 13px; }
.stat-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--status-dot, #859b8b); }
.stat-value { align-self: center; font-size: 31px; font-weight: 710; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-hint { color: var(--subtle); font-size: 11px; line-height: 1.35; }
.status-open { --status-dot: #b17417; --status-bg: #fff3df; --status-ink: #794707; }
.status-progress { --status-dot: #356bc0; --status-bg: #eaf1fe; --status-ink: #245397; }
.status-verify { --status-dot: #8759b9; --status-bg: #f3eafb; --status-ink: #69328f; }
.status-closed { --status-dot: #27855e; --status-bg: #e8f6ed; --status-ink: #176143; }

.board { background: var(--paper); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.board-head { padding: 20px 22px 16px; display: flex; align-items: center; justify-content: space-between; gap: 15px 22px; flex-wrap: wrap; }
.board-head h2 { margin: 0; font-size: 19px; font-weight: 750; letter-spacing: -.02em; }
.board-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.board-tools { gap: 8px; }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search input, .assignee-filter { height: 38px; border: 1px solid var(--border); border-radius: 8px; background: #fbfcfa; font-size: 13px; }
.search input { width: 215px; padding: 0 10px 0 34px; }
.search input::placeholder { color: #596b61; }
.assignee-filter { max-width: 145px; padding: 0 24px 0 10px; text-overflow: ellipsis; cursor: pointer; }
.status-tabs { display: flex; align-items: center; gap: 6px; padding: 0 22px 12px; border-bottom: 1px solid var(--line); overflow: auto; scrollbar-width: thin; }
.tab { flex: none; background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 6px 10px; min-height: 32px; font-size: 12px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.tab:hover { background: #f2f6f2; }
.tab[aria-pressed='true'], .tab.active { color: var(--green-dark); background: var(--green-light); border-color: #dceee1; }
.tab span { margin-left: 4px; opacity: .85; font-variant-numeric: tabular-nums; }
.board-content { min-height: 278px; }
.table-wrap { overflow-x: auto; border-radius: 0 0 14px 14px; }
.bug-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.bug-table th { padding: 11px 10px; background: #f7f9f7; color: var(--muted); white-space: nowrap; font-size: 11px; font-weight: 700; }
.bug-table td { padding: 12px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.bug-table th:first-child, .bug-table td:first-child { padding-left: 22px; }
.bug-table th:last-child, .bug-table td:last-child { padding-right: 22px; }
.bug-table tbody tr:hover { background: #f7fbf8; }
.bug-table td:first-child { width: 38%; min-width: 155px; }
.bug-title-btn { display: grid; justify-items: start; gap: 4px; border: 0; padding: 1px 0; border-radius: 4px; background: transparent; text-align: left; }
.bug-title-btn:hover .bug-title { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.bug-title { color: var(--ink); line-height: 1.35; font-weight: 680; overflow-wrap: anywhere; }
.bug-id { color: var(--subtle); font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 11px; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 8px; color: var(--status-ink, var(--ink)); background: var(--status-bg, var(--line)); white-space: nowrap; font-size: 11px; font-weight: 670; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--status-dot, #859b8b); flex: none; }
.badge .stat-dot { display: none; }
.priority { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 640; white-space: nowrap; }
.priority-high { color: #9c332a; }
.priority-normal { color: #6c5529; }
.priority-low { color: #4d675b; }
.priority svg { width: 14px; height: 14px; }
.person { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.person > :last-child { max-width: 14em; white-space: normal; overflow-wrap: anywhere; }
.avatar, .event-avatar { display: inline-grid; place-items: center; width: 23px; height: 23px; flex: none; border-radius: 50%; color: #255f46; background: #e7f3eb; font-weight: 730; font-size: 11px; }
.person-1 { color: #285680; background: #e9f1fa; }
.person-2 { color: #634382; background: #f1eaf8; }
.person-3 { color: #765317; background: #f8f0df; }
.muted { color: var(--muted); }
.bug-table .muted { font-size: 12px; }
.row-chevron { color: #607468; }
.row-chevron svg { width: 15px; height: 15px; }

.empty { display: grid; min-height: 278px; justify-items: center; align-content: center; padding: 24px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; margin-bottom: 13px; background: var(--green-light); color: var(--green); }
.empty-icon svg { width: 23px; height: 23px; }
.empty h3 { margin: 0; font-weight: 730; font-size: 16px; }
.empty p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.empty button { margin-top: 15px; }
.workspace-footer { display: flex; justify-content: space-between; align-items: center; gap: 9px 16px; flex-wrap: wrap; margin-top: 15px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.workspace-footer p { margin: 0; }

.dialog-card { width: min(100% - 28px, 580px); max-width: none; max-height: min(91dvh, 900px); padding: 0; border: 1px solid var(--border); border-radius: 16px; color: var(--ink); background: var(--paper); box-shadow: 0 16px 60px #0d2b2270; overscroll-behavior: contain; }
.dialog-card::backdrop { background: #13271f72; }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 19px 23px; border-bottom: 1px solid var(--line); background: var(--paper); }
.dialog-head h2 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.dialog-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.icon-button { display: grid; place-items: center; width: 33px; height: 33px; flex: none; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 23px; line-height: 1; }
.icon-button:hover { background: var(--green-light); color: var(--green-dark); }
.dialog-content { display: grid; gap: 14px; padding: 20px 23px; }
.dialog-foot { position: sticky; bottom: 0; z-index: 1; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 13px 23px; border-top: 1px solid var(--line); background: var(--paper); }
.field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 700; }
.field > span b { margin-left: 1px; color: #8d2d23; }
.field input, .field select, .field textarea { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fbfcfa; font-size: 14px; }
.field textarea { min-height: 76px; line-height: 1.5; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #617169; }
.field small { font-size: 11px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-error { margin: 0; color: #8d2d23; background: #fff0ed; border: 1px solid #f3d5d0; border-radius: 7px; padding: 8px 10px; font-size: 13px; overflow-wrap: anywhere; }
.detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; margin: 0; color: var(--muted); font-size: 12px; }
.description { margin: 0; padding: 13px 14px; border-radius: 8px; background: #f6f8f5; color: #34473d; line-height: 1.65; font-size: 14px; }
.description h3 { margin: 0 0 5px; color: var(--ink); font-size: 13px; }
.description p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.history { border-top: 1px solid var(--line); padding-top: 12px; }
.history h3 { margin: 0 0 10px; font-size: 14px; }
.history-list { list-style: none; padding: 0; margin: 0; }
.history-event { display: flex; align-items: flex-start; gap: 9px; padding: 8px 0; font-size: 13px; }
.history-event + .history-event { border-top: 1px solid var(--line); }
.event-avatar { width: 25px; height: 25px; }
.event-info { min-width: 0; flex: 1; }
.event-info p { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.history-event time { color: var(--subtle); font-size: 11px; white-space: nowrap; }
.account-section { display: grid; gap: 10px; min-width: 0; }
.account-section + .account-section { padding-top: 16px; border-top: 1px solid var(--line); }
.account-section h3 { margin: 0; font-size: 15px; font-weight: 720; }
.account-section p:not(.form-error) { margin: 0; font-size: 13px; line-height: 1.55; }
.account-identity { font-weight: 680; overflow-wrap: anywhere; }
.account-form { display: grid; gap: 11px; }
.account-form > .btn { justify-self: start; }
.account-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
#account-feedback { flex: 1 1 150px; margin: 0; color: var(--green); font-size: 13px; }
.toast { position: fixed; z-index: 3; inset: auto max(20px, calc((100vw - 1176px) / 2)) 20px auto; max-width: calc(100vw - 40px); padding: 11px 15px; border-radius: 9px; background: #174e38; color: #fff; box-shadow: 0 4px 12px #12372635; font-size: 13px; }

@media (max-width: 840px) {
  .header-inner, .workspace { width: calc(100% - 40px); }
  .bug-table .col-updated { display: none; }
  .stat { padding: 13px; }
}

@media (max-width: 580px) {
  .header-inner, .workspace { width: calc(100% - 28px); }
  .header-inner { min-height: 60px; gap: 8px; }
  .brand { gap: 7px; }
  .brand-icon { width: 33px; height: 33px; border-radius: 8px; }
  .brand-icon svg { width: 18px; height: 18px; }
  .brand-copy strong { font-size: 13px; }
  .brand-copy small { display: none; }
  .header-actions { gap: 5px; }
  .account-summary { display: none; }
  .header-actions .btn { padding-inline: 8px; min-height: 36px; gap: 3px; font-size: 12px; }
  .header-actions .btn svg { width: 13px; height: 13px; }
  .access-screen { min-height: calc(100dvh - 61px); }
  .auth-card { padding: 23px; }
  .workspace { padding-top: 25px; }
  .intro { margin-bottom: 19px; }
  .intro p:not(.eyebrow) { font-size: 13px; }
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 15px; }
  .stat { min-height: 87px; gap: 5px; border-radius: 9px; padding: 10px 12px; }
  .stat-value { font-size: 25px; }
  .board-head { display: grid; padding: 15px 13px 10px; }
  .board-tools { gap: 6px; min-width: 0; }
  .search { flex: 1; min-width: 0; }
  .search input { width: 100%; }
  .assignee-filter { max-width: 110px; padding-left: 6px; }
  .status-tabs { padding: 0 10px 9px; gap: 3px; }
  .tab { padding-inline: 7px; }
  .bug-table th, .bug-table td { padding-inline: 6px; }
  .bug-table th:first-child, .bug-table td:first-child { padding-left: 13px; min-width: 110px; }
  .bug-table th:last-child, .bug-table td:last-child { padding-right: 13px; }
  .bug-table .col-priority, .bug-table .col-reporter, .bug-table .col-chevron { display: none; }
  .person .avatar { display: none; }
  .person > :last-child { max-width: 7em; }
  .board-content, .empty { min-height: 235px; }
  .dialog-head, .dialog-content, .dialog-foot { padding-inline: 15px; }
  .history-event time { white-space: normal; }
}

@media (max-width: 350px) {
  .header-actions .btn-quiet svg { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
