/* Work Hub UI system — compact, neutral, consistent. See UI_SPEC.md. */
:root {
  color-scheme: light;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --text: #20242c;
  --text-secondary: #596273;
  --text-muted: #667085;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --canvas: #f5f6f8;
  --line: #e4e7ec;
  --line-strong: #cbd2dc;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #eef4ff;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --success: #18794e;
  --success-soft: #edfdf3;
  --warning: #854d0e;
  --warning-soft: #fffbeb;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --radius-control: 6px;
  --radius-panel: 8px;
  --control-height: 32px;
  --task-columns: minmax(0, 1fr) 96px 88px 96px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--text); font: 400 13px/20px var(--font-ui); letter-spacing: 0; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button { transition: background-color 120ms ease, border-color 120ms ease; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b7ccff; outline-offset: 0; border-color: var(--accent); }
input, select, textarea { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-control); padding: 5px 10px; min-height: var(--control-height); min-width: 0; color: var(--text); width: 100%; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
input:disabled, select:disabled, textarea:disabled { color: var(--text-secondary); background: var(--surface-soft); opacity: 1; }
textarea { resize: vertical; min-height: 64px; line-height: 22px; }
label { display: block; font-size: 12px; line-height: 18px; font-weight: 500; margin-bottom: var(--space-4); }
label input, label select, label textarea { display: block; margin-top: var(--space-1); font-size: 13px; line-height: 20px; font-weight: 400; }
label small { display: block; margin-top: var(--space-1); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 20px; line-height: 28px; margin-bottom: var(--space-1); font-weight: 600; letter-spacing: 0; }
h2 { font-size: 16px; line-height: 24px; margin-bottom: 0; font-weight: 600; }
h3 { font-size: 14px; line-height: 22px; margin-bottom: var(--space-1); font-weight: 500; }
p { margin-bottom: var(--space-3); }
a { color: inherit; text-decoration: none; }
.muted { color: var(--text-muted); font-weight: 400; }
.small, small { font-size: 12px; line-height: 18px; }
.eyebrow { font-size: 12px; line-height: 18px; font-weight: 500; letter-spacing: 0; color: var(--text-muted); margin-bottom: var(--space-2); }
.primary, .secondary, .danger, .icon-button, .text-button { display: inline-flex; align-items: center; justify-content: center; min-height: var(--control-height); gap: var(--space-2); border: 1px solid transparent; border-radius: var(--radius-control); padding: 5px 12px; font-size: 13px; line-height: 20px; font-weight: 500; white-space: nowrap; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text-secondary); }
.secondary:hover { background: #f2f4f7; }
.danger { color: var(--danger); background: var(--danger-soft); }
.danger:hover { border-color: #fda29b; }
.icon-button { background: transparent; font-size: 22px; line-height: 24px; min-width: 32px; padding: 3px; }
.text-button { background: transparent; color: var(--text-secondary); padding: 5px 8px; }
.text-button:hover, .icon-button:hover { background: #f2f4f7; }
.shell { display: grid; grid-template-columns: 184px minmax(0, 1fr); min-height: 100dvh; }
.main { min-width: 0; }
.sidebar { position: sticky; top: 0; height: 100dvh; padding: var(--space-6) var(--space-3) var(--space-4); display: flex; flex-direction: column; background: var(--surface-soft); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: var(--space-2); font-size: 16px; line-height: 24px; font-weight: 600; padding: 0 var(--space-2); margin-bottom: var(--space-6); }
.brand small { display: none; }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--radius-control); background: #253046; color: #fff; font-size: 16px; line-height: 24px; font-weight: 600; }
.sidebar nav { margin: 0; }
.nav { width: 100%; display: flex; align-items: center; text-align: left; gap: var(--space-2); min-height: 32px; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--text-secondary); padding: 6px 10px; font-size: 13px; line-height: 20px; margin-bottom: var(--space-1); }
.nav:hover { background: #eef0f4; }
.nav.active { background: #e9effa; color: var(--accent); font-weight: 500; }
.nav.project { font-size: 12px; line-height: 18px; }
.nav .project-dot { width: 4px; height: 4px; border-radius: 50%; background: #8c96a6; flex-shrink: 0; }
.nav .count { margin-left: auto; color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.secondary-navigation { margin-top: var(--space-4); }
.nav-disclosure { margin-bottom: var(--space-2); }
.nav-disclosure > summary { padding: 6px 10px; min-height: 32px; color: var(--text-secondary); font-size: 12px; line-height: 20px; list-style: none; border-radius: var(--radius-control); display: flex; align-items: center; gap: var(--space-2); }
.nav-disclosure > summary::-webkit-details-marker { display: none; }
.nav-disclosure > summary:after { content: ''; width: 5px; height: 5px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); margin: -3px 2px 0 auto; }
.nav-disclosure[open] > summary:after { transform: rotate(225deg); margin-top: 3px; }
.nav-disclosure.has-selection > summary { color: var(--accent); background: var(--accent-soft); }
.nav-disclosure .count { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.nav-disclosure nav { padding-top: var(--space-1); }
.side-bottom { margin-top: auto; }
.account { display: flex; gap: var(--space-2); align-items: center; border-top: 1px solid var(--line); padding-top: var(--space-4); margin-top: var(--space-4); font-size: 12px; }
.account > div { min-width: 0; overflow-wrap: anywhere; }
.account strong { font-weight: 500; }
.account small { display: block; color: var(--text-muted); font-size: 12px; }
.account form { margin-left: auto; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; background: #e9edf2; color: var(--text-secondary); font-size: 12px; }
.topbar { min-height: 48px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 8px 24px; background: var(--surface); font-size: 12px; color: var(--text-secondary); }
.topbar > div { display: flex; align-items: center; gap: var(--space-4); flex-shrink: 0; }
#breadcrumb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.sync:before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--success); margin-right: 6px; vertical-align: 1px; }
.sync.offline { color: var(--danger); }.sync.offline:before { background: var(--danger); }
.page { padding: 24px; max-width: 1248px; margin: auto; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); margin-bottom: var(--space-4); }
.page-heading p:last-child { margin-bottom: 0; font-size: 12px; line-height: 18px; }
#date-label, #task-source { display: none; }
.task-controls { display: flex; align-items: center; gap: var(--space-6); justify-content: space-between; margin-bottom: var(--space-3); }
.task-toolbar { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.task-tabs { display: flex; gap: var(--space-1); }
.task-tabs button { min-height: 32px; padding: 6px 10px; border: 0; background: transparent; color: var(--text-secondary); border-radius: var(--radius-control); font-size: 13px; line-height: 20px; white-space: nowrap; }
.task-tabs button.selected { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
#task-count { font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.search-toolbar { display: flex; gap: var(--space-2); width: 280px; max-width: 42%; flex-shrink: 0; }
.search-toolbar input { min-width: 0; flex: 1; font-size: 13px; }
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); background: var(--surface); border: 1px solid var(--line); padding: var(--space-4); border-radius: var(--radius-panel); margin-bottom: var(--space-3); }
.filters label { margin: 0; }
.filter-actions { display: flex; justify-content: space-between; grid-column: 1 / -1; gap: var(--space-2); }
.filter-actions button { font-size: 12px; }
.task-table-head, .task-card { display: grid; grid-template-columns: var(--task-columns); align-items: center; gap: var(--space-4); padding-left: var(--space-4); padding-right: var(--space-4); }
.task-table-head { min-height: 32px; padding-top: 6px; padding-bottom: 6px; background: #f2f4f7; border: 1px solid var(--line); border-radius: 8px 8px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 18px; }
.task-table-head > :last-child { text-align: right; }
.task-grid { display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); overflow: hidden; }
#task-list.task-grid { border-top: 0; border-radius: 0 0 8px 8px; }
.task-card { width: 100%; min-width: 0; min-height: 56px; padding-top: var(--space-2); padding-bottom: var(--space-2); background: var(--surface); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; }
.task-card:last-child { border-bottom: 0; }
.task-card:hover { background: #f8faff; }
.task-card:focus-visible { outline-offset: -2px; }
.task-main { min-width: 0; }
.task-title { display: flex; align-items: flex-start; gap: var(--space-2); }
.task-title h3 { min-width: 0; margin: 0; font-size: 13px; line-height: 20px; font-weight: 500; overflow-wrap: anywhere; }
.task-title .pill { flex-shrink: 0; }
.task-meta { font-size: 12px; line-height: 18px; margin-top: 2px; color: var(--text-muted); overflow-wrap: anywhere; }
.task-owner { color: var(--text-secondary); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
.task-state { min-width: 0; }
.status, .pill { display: inline-flex; align-items: center; justify-content: center; padding: 1px 6px; border-radius: 4px; font-size: 12px; line-height: 18px; font-weight: 400; white-space: nowrap; background: #f2f4f7; color: var(--text-secondary); }
.status.doing, .P1 { color: #175cd3; background: #eff8ff; }
.status.done { color: var(--success); background: var(--success-soft); }
.status.waiting { color: var(--warning); background: var(--warning-soft); }
.status.blocked, .P0 { color: var(--danger); background: var(--danger-soft); }
.P2, .neutral { color: var(--text-secondary); background: #f2f4f7; }
.task-due { color: var(--text-secondary); font-size: 12px; line-height: 18px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.task-due.late, .late { color: var(--danger); }
.empty { padding: 32px 16px; text-align: center; color: var(--text-muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-panel); grid-column: 1 / -1; }
.task-grid > .empty { border: 0; }
.load-more { display: flex; margin: 12px auto 0; font-size: 12px; background: transparent; border-color: transparent; }
.kanban { display: flex; gap: var(--space-3); overflow-x: auto; align-items: flex-start; padding-bottom: var(--space-3); }
.kanban-column { min-width: 248px; width: 280px; flex-shrink: 0; background: #edf0f4; border-radius: var(--radius-panel); padding: var(--space-2); }
.kanban-column > h3 { padding: 4px 4px 8px; color: var(--text-secondary); font-size: 13px; line-height: 20px; }
.kanban-column .task-card { grid-template-columns: 1fr auto; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-control); margin-bottom: var(--space-2); }
.kanban-column .task-card:last-child { margin-bottom: 0; }
.kanban-column .task-main { grid-column: 1 / -1; }.kanban-column .task-due { grid-column: 2; }.kanban-column .task-state { grid-column: 2; grid-row: 2; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); margin-bottom: var(--space-4); }
.section-heading .muted { font-size: 12px; line-height: 18px; margin-bottom: 0; }
.panel { padding: var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); }
.panel .small { margin-top: var(--space-3); margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-4); }
.activity { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 0 var(--space-4); }
.activity-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.activity-row:last-child { border-bottom: 0; }
.activity-dot { width: 5px; height: 5px; border-radius: 50%; background: #8c96a6; flex-shrink: 0; }
.activity-row time { margin-left: auto; color: var(--text-muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#activity-section { margin-top: 0; }
.upload-area { border: 1px dashed var(--line-strong); padding: var(--space-4); border-radius: var(--radius-control); margin-bottom: var(--space-4); }
.upload-area input { border: 0; padding: 0; }.upload-area p { font-size: 12px; margin: 12px 0 0; }
#import-list { display: grid; gap: var(--space-2); }
#import-list button { text-align: left; background: var(--surface); border: 1px solid var(--line); padding: var(--space-3) var(--space-4); border-radius: var(--radius-control); }
#import-section > .section-heading { margin-top: var(--space-6); }
.message { padding: var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); margin: 12px 0; }
.message pre { font: 400 13px/22px var(--font-ui); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; color: var(--text-secondary); }
.message-head { display: flex; gap: var(--space-3); font-size: 12px; color: var(--text-muted); margin-bottom: var(--space-2); }
.message button { margin-top: var(--space-2); }
.segmented { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); }
#report h2 { margin: 24px 0 12px; }
.team-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin: 16px 0; }
.member-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.member-card .section-heading { align-items: flex-start; }.member-card h2 { margin-bottom: var(--space-1); }
.project-checks label { display: flex; align-items: center; gap: var(--space-2); font-weight: 400; }
.project-checks input { width: 16px; height: 16px; min-height: 0; margin: 0; }
#invite-result h2 { margin-bottom: var(--space-2); }
#invite-link { font-size: 12px; }
#member-projects { padding: var(--space-3); background: var(--surface-soft); border-radius: var(--radius-control); margin-bottom: var(--space-4); }
#team-section > .panel > .section-heading { margin-bottom: var(--space-2); }
#team-section > .panel .muted { margin-top: var(--space-1); }
.quiet-details > summary { padding: 4px 0; }.quiet-details .small { margin-top: var(--space-2); }
dialog { border: 1px solid var(--line-strong); border-radius: var(--radius-panel); padding: 0; width: min(640px, calc(100vw - 32px)); max-height: 92dvh; background: var(--surface); box-shadow: 0 16px 48px #10182826; }
dialog::backdrop { background: #10182866; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--line); gap: var(--space-3); }
.dialog-header .eyebrow { margin-bottom: var(--space-1); }.dialog-header h2 { font-size: 16px; line-height: 24px; }
.dialog-body { padding: 20px; }
.dialog-actions { display: flex; gap: var(--space-2); align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-soft); position: sticky; bottom: 0; }
.spacer { flex: 1; }
summary { font-size: 12px; line-height: 20px; color: var(--text-secondary); padding: 8px 0; }
.task-details { border-top: 1px solid var(--line); }.task-details > summary { padding: 10px 0; }.task-details[open] > summary { margin-bottom: var(--space-2); }
.history-row { border-left: 2px solid var(--line-strong); padding: 4px 0 4px 12px; margin: 12px 0; font-size: 12px; }
.history-row pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 400 12px/20px var(--font-ui); color: var(--text-secondary); }
#task-dates { margin: 8px 0; }
.error { color: var(--danger); font-size: 12px; line-height: 20px; }
.confirm-label { display: flex; align-items: center; gap: var(--space-2); background: var(--accent-soft); padding: var(--space-3); border-radius: var(--radius-control); }
.confirm-label input { display: inline; width: 16px; height: 16px; min-height: 0; margin: 0; }
footer { display: flex; justify-content: center; gap: var(--space-2); color: var(--text-muted); font-size: 12px; line-height: 18px; padding: 24px 0 0; }
.login-page { display: grid; place-items: center; min-height: 100dvh; background: var(--canvas); }
.login-card { width: min(400px, calc(100% - 32px)); padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); }
.login-card .brand-mark { margin-bottom: var(--space-6); width: 32px; height: 32px; }
.login-card h1 { font-size: 20px; line-height: 28px; }.login-card > .muted { font-size: 13px; margin-bottom: var(--space-6); }
.login-card .wide { width: 100%; margin-top: var(--space-2); justify-content: space-between; }
.login-note { font-size: 12px; line-height: 18px; color: var(--text-muted); text-align: center; margin: 24px 0 0; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 30; background: #253046; color: #fff; padding: 10px 16px; border-radius: var(--radius-control); box-shadow: 0 4px 16px #10182826; max-width: calc(100vw - 32px); font-size: 13px; line-height: 20px; }
[hidden] { display: none !important; }
@media (max-width: 1100px) {
  :root { --task-columns: minmax(0, 1fr) 80px 80px 88px; }
  .task-card, .task-table-head { gap: var(--space-3); }
  .task-controls { gap: var(--space-4); }.search-toolbar { width: 240px; }
  .page { padding: 20px; }.topbar { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 840px) {
  .task-controls { flex-wrap: wrap; gap: var(--space-2); }.task-toolbar { flex: 1; justify-content: space-between; }
  .search-toolbar { width: 100%; max-width: 100%; }.team-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { display: block; }.sidebar { height: auto; position: relative; padding: 12px 16px 8px; border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 0 4px; }
  .brand { grid-column: 1 / -1; margin: 0 0 12px; padding: 0; font-size: 16px; }
  .sidebar #navigation { grid-column: 1; grid-row: 2; display: flex; align-items: center; gap: 4px; }
  .sidebar #navigation .nav { margin: 0; padding: 6px 8px; width: auto; font-size: 12px; white-space: nowrap; }
  .secondary-navigation { grid-column: 2; grid-row: 2; display: flex; gap: 0; align-items: center; margin: 0; }
  .nav-disclosure { margin: 0; position: relative; }.nav-disclosure > summary { padding: 6px 8px; font-size: 12px; gap: 8px; }
  .nav-disclosure .count { display: none; }
  .nav-disclosure nav { position: absolute; right: 0; top: 100%; z-index: 10; width: 216px; max-height: 50dvh; overflow-y: auto; padding: 8px; margin-top: 4px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); box-shadow: 0 8px 24px #1018281f; }
  .nav-disclosure .nav { white-space: normal; width: 100%; }
  .side-bottom { position: absolute; right: 12px; top: 10px; }.account { border: 0; padding: 0; margin: 0; }.account > .avatar, .account > div { display: none; }
  .account form { margin: 0; }.account .text-button { font-size: 12px; }
  .topbar { padding: 8px 16px; }.topbar > div { gap: var(--space-2); }.topbar .primary { font-size: 12px; padding: 5px 8px; }
  .page { padding: 16px; }.page-heading { margin-bottom: var(--space-4); }
  .task-toolbar { width: 100%; }.task-controls { display: block; }.search-toolbar { margin-top: var(--space-2); }
  .task-tabs button { padding: 6px 10px; font-size: 13px; }
  .filters { grid-template-columns: 1fr 1fr; padding: var(--space-3); }.filters label:has(#owner-filter) { grid-column: 1 / -1; }
  .task-table-head { display: none; }#task-list.task-grid { border: 1px solid var(--line); border-radius: var(--radius-panel); }
  .task-card { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px; }
  .task-main { grid-column: 1 / -1; }.task-state { grid-column: 2; grid-row: 2; text-align: right; }.task-owner { grid-column: 1; grid-row: 2; }.task-due { grid-column: 2; grid-row: 3; }
  .task-due:empty, .task-due.no-date { display: none; }.task-meta { margin-top: 2px; }.task-title h3 { font-size: 14px; line-height: 22px; }
  .task-title { justify-content: space-between; }.task-title .pill { margin-top: 1px; }
  .form-grid { gap: 0 var(--space-3); }.task-details .form-grid { grid-template-columns: 1fr; }
  .section-heading { flex-wrap: wrap; gap: var(--space-3); }.activity-row { flex-wrap: wrap; }.activity-row time { margin-left: 17px; }
  .message-head { flex-wrap: wrap; gap: 4px 12px; }.panel { padding: var(--space-4); }
  dialog { width: calc(100vw - 24px); max-height: 94dvh; }.dialog-header { padding: 12px 16px; }.dialog-body { padding: 16px; }.dialog-actions { padding: 12px; flex-wrap: wrap; }
  .dialog-actions button { font-size: 12px; padding: 5px 8px; }.login-card { padding: 24px; }
  footer { padding-top: var(--space-4); }
}
@media (max-width: 360px) {
  .sidebar { padding-left: 12px; padding-right: 12px; }.page, .topbar { padding-left: 12px; padding-right: 12px; }.sync { font-size: 12px; }.topbar > div { gap: 6px; }
  .nav-disclosure > summary { padding-left: 6px; padding-right: 6px; }.sidebar #navigation .nav { padding-left: 6px; padding-right: 6px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (pointer: coarse) {
  :root { --control-height: 44px; }
  .nav, .nav-disclosure > summary, .task-tabs button, summary { min-height: 44px; }
  input, select, textarea, label input, label select, label textarea, #invite-link, .search-toolbar input { font-size: 16px; }
  .project-checks label { min-height: 44px; margin-bottom: 4px; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }

/* Integration is confined to the existing import page. */
#import-section > .panel { margin-bottom: var(--space-3); }
.sync-details { margin-top: var(--space-3); }
.sync-details summary { cursor: pointer; }
.sync-details form { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
.ai-review-item { border-top: 1px solid var(--line); padding: var(--space-3) 0; }
.ai-review-item h3 { margin: 0 0 var(--space-2); font-size: 13px; font-weight: 600; }
.ai-review-item pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; max-height: 160px; overflow: auto; }
.ai-review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.ai-review-fields { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 4px 12px; margin: 8px 0; }
.ai-review-fields dt { color: var(--text-secondary); }
.ai-review-fields dd { margin: 0; overflow-wrap: anywhere; }
#review-title { flex-shrink: 0; white-space: nowrap; }
#ai-review-filter { width: auto; min-width: 180px; max-width: 100%; }

/* UI refinement: presentation only; shared status and action semantics unchanged. */
:root { --radius-panel: 6px; --control-height: 32px; }
body { font-size: 13px; line-height: 1.5; }
button,input,select,textarea { font-family: inherit; }
h1 { font-size: 22px; line-height: 30px; } h2 { font-size: 15px; line-height: 22px; }
.page-heading { margin-bottom: 20px; }.panel { padding: 16px; }
.task-grid { gap: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.task-grid .task-card { display: grid; grid-template-columns: minmax(0,1fr) 112px 106px 92px; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.task-grid .task-card:last-child { border-bottom: 0; }
.task-grid .task-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.task-grid .task-meta { order: -1; margin: 0; width: 32px; flex-shrink: 0; font-size: 11px; color: #808898; }
.task-grid .task-title { min-width: 0; flex: 1; align-items: center; }
.task-grid .task-title h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; line-height: 20px; font-weight: 500; }
.task-grid .task-title .pill { flex-shrink: 0; font-size: 10px; padding: 1px 5px; margin: 0; }
.pill.P0 { background: #fff4df; color: #8a5a00; border-color: #f3dfb5; }
.task-table-head { grid-template-columns: minmax(0,1fr) 112px 106px 92px; gap: 12px; padding: 8px 12px; font-size: 11px; }
.task-owner,.task-due { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-summary { display: grid; grid-template-columns: 1fr 2fr 1fr; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 24px; background: white; }
.home-summary > * { text-align: left; padding: 16px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; min-width: 0; }
.home-summary > :last-child { border-right: 0; }.home-summary span { display: block; color: #667085; font-size: 12px; }.home-summary strong { display: block; font-size: 24px; margin-top: 6px; font-weight: 600; }.home-summary p { margin: 4px 0 0; font-size: 11px; color: #667085; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#home-section > .section-heading { margin: 20px 0 10px; }
.home-projects { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 10px; }.home-projects button { text-align: left; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }.home-projects strong,.home-projects span { display: block; }.home-projects strong { font-size: 13px; font-weight: 500; }.home-projects span { color: #667085; font-size: 11px; margin-top: 6px; }
.review-line { display: grid; grid-template-columns: minmax(0,1fr) 110px 100px; gap: 16px; align-items: center; }.review-main { min-width: 0; }.review-main h3,.review-change { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.review-main h3 { margin: 0 0 4px; }.review-change { margin: 0; font-size: 12px; color: #667085; }.review-line time,.review-owner { font-size: 12px; color: #667085; overflow-wrap: anywhere; }.review-details > summary { font-size: 12px; color: #526277; padding: 6px 0 0; cursor: pointer; }.review-details[open] { padding-bottom: 6px; }.review-details pre { background: #f7f8fa; padding: 12px; border-radius: 4px; }.ai-review-item { padding: 14px 0; }
#task-dialog { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(580px,100vw); height: 100dvh; max-height: 100dvh; max-width: 100vw; border-radius: 0; border: 0; border-left: 1px solid var(--line); padding: 0; box-shadow: -12px 0 36px #10182818; }
#task-form { height: 100%; display: flex; flex-direction: column; }#task-dialog .dialog-header,#task-dialog .dialog-actions { flex-shrink: 0; }#task-dialog .dialog-body { flex: 1; overflow-y: auto; min-height: 0; }#task-dialog .dialog-actions { margin-top: auto; background: #fff; border-top: 1px solid var(--line); }
@media(max-width:760px){
 .home-summary { grid-template-columns: 1fr 1fr; }.home-summary > :nth-child(2) { border-right: 0; }.home-summary > button { grid-column: 1 / -1; border-top: 1px solid var(--line); }.home-summary > * { padding: 12px; }.home-summary strong { font-size: 20px; }
 .task-grid .task-card { grid-template-columns: minmax(0,1fr) 78px; gap: 3px 8px; padding: 9px 10px; min-height: 62px; }.task-grid .task-main { grid-column: 1; grid-row: 1; gap: 5px; }.task-grid .task-meta { width: 25px; font-size: 10px; }.task-grid .task-title { display: block; }.task-grid .task-title h3 { font-size: 13px; line-height: 20px; }.task-grid .task-title .pill { display: none; }.task-grid .task-owner { grid-column: 1; grid-row: 2; padding-left: 30px; font-size: 11px; }.task-grid .task-state { grid-column: 2; grid-row: 1; text-align: right; }.task-grid .task-due { grid-column: 2; grid-row: 2; text-align: right; font-size: 10px; }.task-grid .task-due.no-date { display: block; }
 .review-line { grid-template-columns: 1fr auto; gap: 6px; }.review-main { grid-column: 1 / -1; }.review-owner { grid-column: 1; }.review-line time { text-align: right; }.review-details > summary { min-height: 36px; display: flex; align-items: center; }.home-projects { grid-template-columns: 1fr 1fr; gap: 8px; }.home-projects button { padding: 10px; }
 #navigation { flex-wrap: wrap; }#task-dialog { width: 100vw; }.dialog-actions { padding-bottom: max(12px,env(safe-area-inset-bottom)); }
}

@media(max-width:760px){.sidebar #navigation { grid-column:1 / -1; grid-row:2; flex-wrap:nowrap; }.secondary-navigation {grid-column:2;grid-row:1;}.task-grid .task-card[data-priority="P0"] .task-owner::after { content:" · 高优先级";color:#8a5a00;font-size:10px;}}
@media(max-width:760px){.sidebar {grid-template-columns:auto 1fr;row-gap:8px;}.sidebar .brand {grid-column:1;grid-row:1;margin:0;}.sidebar .brand > span:nth-child(2) {display:none;}.secondary-navigation {justify-content:flex-end;padding-right:36px;}}
