* { box-sizing: border-box; }
:root { --bg: #fafafa; --paper: #fff; --ink: #262626; --muted: #737373; --line: #e5e5e5; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, summary { touch-action: manipulation; }
button, summary { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #737373; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 18px; font-weight: 600; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 500; }
input, select, textarea { width: 100%; min-width: 0; padding: 7px 10px; border: 1px solid #d4d4d4; border-radius: 5px; color: var(--ink); background: #fff; }
textarea { resize: vertical; min-height: 180px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #d4d4d4; outline-offset: 1px; }
input:disabled, select:disabled, textarea:disabled { background: #f5f5f5; color: var(--muted); }
label { display: block; margin: 18px 0 6px; font-size: 13px; }
.muted, .field-help, .hint { color: var(--muted); }
.small, .field-help, .hint { font-size: 12px; }
.field-help { margin-top: 7px; overflow-wrap: anywhere; }
.primary, .secondary, .quiet { border: 1px solid transparent; border-radius: 5px; padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.primary { color: #fff; background: #262626; border-color: #262626; }
.primary:hover:not(:disabled) { background: #080808; }
.secondary { color: #404040; background: #fff; border-color: #d4d4d4; }
.quiet { color: var(--muted); background: transparent; }
.secondary:hover:not(:disabled), .quiet:hover:not(:disabled) { background: #ededed; color: var(--ink); }
.icon-button { background: none; border: 0; color: var(--muted); font-size: 23px; padding: 0 5px; }
.app { display: grid; grid-template-columns: 208px minmax(0,1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 12px 14px; background: #f5f5f5; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; align-items: baseline; gap: 7px; padding: 0 12px; font-size: 19px; font-weight: 650; margin-bottom: 28px; }
.brand span { font-size: 11px; font-weight: 400; color: var(--muted); }
.brand:hover { text-decoration: none; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: 6px; background: transparent; text-align: left; color: #525252; margin-bottom: 4px; }
.nav-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active { color: #171717; background: #e8e8e8; font-weight: 550; }
.nav-item:hover { background: #ededed; }
.nav-item b { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted); }
.later-module { display: flex; align-items: center; gap: 10px; margin: 22px 12px 0; padding-top: 18px; border-top: 1px solid var(--line); color: #858585; font-size: 13px; }
.later-module span { width: 18px; text-align: center; font-size: 19px; }
.later-module small { margin-left: auto; font-size: 11px; }
.sidebar-bottom { margin-top: auto; padding: 12px 0 0; }
.external-link { display: flex; justify-content: space-between; padding: 8px 12px; color: #525252; font-size: 13px; }
.sidebar-bottom .quiet { margin-top: 6px; }
main { min-width: 0; }
.workspace { max-width: 808px; margin: 0 auto; padding: 24px 24px 48px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; min-height: 32px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.section-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tabs { display: flex; gap: 5px; }
.tab { padding: 4px 10px; background: none; border: 0; border-radius: 5px; font-size: 13px; color: var(--muted); }
.tab.active { background: #eaeaea; color: var(--ink); }
.card-list { display: flex; flex-direction: column; gap: 12px; }
.memo-card, .task-card, .report-card { padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card-top b { font-size: 13px; font-weight: 500; }
.type-icon { color: var(--muted); font-size: 14px; }
.card-top .date { color: var(--muted); font-size: 12px; }
.pill { display: inline-flex; align-items: center; font-size: 11px; color: #525252; background: #f3f3f3; border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.card-top .pill { margin-left: auto; }
.pill.error { border: 1px solid #737373; font-weight: 600; }
.memo-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.8; }
.source-line { margin-top: 10px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }
.card-bottom > div { display: flex; gap: 6px; flex-wrap: wrap; }
.card-bottom > a { font-size: 12px; color: var(--muted); }
.card-bottom .primary, .card-bottom .secondary, .card-bottom .quiet { font-size: 12px; padding: 4px 9px; }
.task-stage { font-size: 13px; overflow-wrap: anywhere; }
.task-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.empty { padding: 50px 12px; text-align: center; color: var(--muted); }
.empty strong { display: block; font-size: 14px; font-weight: 400; }
.empty p { font-size: 12px; margin-top: 8px; }
.report-toolbar, .report-toolbar form { display: flex; gap: 10px; align-items: center; }
.report-toolbar { justify-content: space-between; flex-wrap: wrap; }
.report-toolbar input { width: 150px; font-size: 13px; }
.report-period { margin: 8px 0 16px; }
.notice { background: #f0f0f0; border-radius: 5px; color: #525252; font-size: 12px; padding: 9px 12px; margin-bottom: 14px; overflow-wrap: anywhere; }
.settings-section { padding: 0 0 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); max-width: 560px; }
.settings-section:last-child { border-bottom: 0; }
.settings-section .section-top { margin-bottom: 0; }
.settings-section details { margin-top: 14px; }
summary { font-size: 13px; color: #525252; }
details input { margin-top: 8px; }
.model-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.model-label .quiet { font-size: 12px; padding: 3px 0; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.details { display: grid; grid-template-columns: 84px 1fr; gap: 12px 16px; font-size: 13px; margin: 18px 0 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.error { color: #262626; font-weight: 500; }
dialog { border: 1px solid #d4d4d4; border-radius: 8px; max-width: 800px; width: calc(100% - 32px); padding: 22px; color: var(--ink); max-height: 90vh; }
dialog::backdrop { background: #00000055; }
.dialog-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.preview-content { border: 1px solid var(--line); border-radius: 5px; padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; max-height: 56vh; overflow: auto; }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.dialog-actions a { font-size: 13px; }
.dialog-actions input { width: 100%; }
.dialog-actions select { width: 190px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #262626; color: #fff; border-radius: 5px; padding: 10px 16px; font-size: 13px; z-index: 1000; max-width: 90vw; }
.login-view { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: 340px; max-width: calc(100vw - 40px); }
.login-card h1 { margin-bottom: 24px; }
.login-card button { width: 100%; margin: 18px 0 10px; }
.login-card .error { margin-top: 10px; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
@media (max-width: 800px) {
  .app { grid-template-columns: 168px minmax(0,1fr); }
  .brand { flex-wrap: wrap; gap: 0 6px; }
  .workspace { padding: 22px 20px 40px; }
}
@media (max-width: 600px) {
  .app { display: block; }
  .sidebar { position: static; height: auto; padding: 14px 12px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { font-size: 17px; margin-bottom: 12px; padding: 0 8px; gap: 6px; }
  .sidebar nav { display: flex; gap: 4px; }
  .nav-item { justify-content: center; padding: 7px 5px; gap: 6px; margin: 0; font-size: 13px; }
  .nav-item b, .later-module { display: none; }
  .sidebar-bottom { position: absolute; top: 9px; right: 10px; padding: 0; display: flex; align-items: center; }
  .sidebar-bottom .external-link { display: none; }
  .sidebar-bottom .quiet { margin: 0; font-size: 12px; }
  .workspace { padding: 18px 14px 36px; }
  .page-heading { margin-bottom: 16px; }
  .memo-card, .task-card, .report-card { padding: 14px; }
  .card-bottom { flex-wrap: wrap; }
  .report-toolbar input { width: 143px; }
  .header-actions { gap: 3px; }
  .dialog-actions { justify-content: flex-start; }
}
