:root {
  color-scheme: light;
  --ink: #102a43;
  --muted: #627d98;
  --line: #d9e2ec;
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --primary: #176b87;
  --primary-dark: #0f4c5c;
  --accent: #e57c4b;
  --success: #26836a;
  --warning: #b66b16;
  --danger: #b84a5a;
  --shadow: 0 16px 45px rgba(16, 42, 67, .09);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 8% -10%, rgba(23,107,135,.12), transparent 28rem),
    var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 50; background: #fff; padding: 12px; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.auth-gate { min-height: calc(100vh - 74px); min-height: calc(100dvh - 74px); display: grid; place-items: center; padding: 28px 18px 48px; background: radial-gradient(circle at 50% 0%, #eef6f8 0, #f7f9fb 55%, #edf2f5 100%); }
.auth-card { width: min(100%, 420px); padding: 34px; border: 1px solid #dce6eb; border-radius: 24px; background: rgba(255,255,255,.96); box-shadow: 0 24px 70px rgba(15,42,67,.12); }
.auth-mark { margin-bottom: 20px; }
.auth-card h1 { margin: 5px 0 8px; font-size: clamp(28px, 7vw, 38px); color: var(--ink); }
.auth-copy { margin: 0 0 24px; color: var(--muted); line-height: 1.65; }
.auth-card label { display: grid; gap: 8px; margin-top: 16px; color: var(--ink); font-size: 14px; font-weight: 750; }
.auth-card input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #cbd8df; border-radius: 12px; background: #fff; color: var(--ink); font: inherit; }
.auth-card input:focus { outline: 3px solid rgba(31,122,140,.16); border-color: var(--teal); }
.auth-card .button { width: 100%; margin-top: 22px; min-height: 48px; }
.auth-error { min-height: 22px; margin: 12px 0 0; color: #a83b3b; font-size: 14px; }
.cloud-mode #addProjectButton,
.cloud-mode #mobileAddButton,
.cloud-mode .edit-button,
.cloud-mode #importInput,
.cloud-mode #resetButton { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(217,226,236,.85);
  background: rgba(245,247,250,.88);
  backdrop-filter: blur(18px);
}
.brand-wrap { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: #fff; background: linear-gradient(145deg, var(--primary), var(--primary-dark)); font-weight: 800; box-shadow: 0 8px 20px rgba(23,107,135,.25); }
.brand { font-weight: 800; letter-spacing: -.03em; }
.sync-state { color: var(--muted); font-size: 12px; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--warning); }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 100px; }
.hero { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 34px; }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(32px, 5vw, 56px); letter-spacing: -.055em; line-height: 1.05; }
h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.hero-copy { margin: 12px 0 0; color: var(--muted); font-size: 17px; }

.button { min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 14px; font-weight: 750; transition: transform .18s, box-shadow .18s, background .18s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 10px 24px rgba(23,107,135,.22); }
.button-primary:hover { background: var(--primary-dark); }
.button-ghost { border-color: var(--line); background: rgba(255,255,255,.72); color: var(--ink); }
.button-secondary { border-color: var(--line); background: #fff; color: var(--ink); text-align: center; }
.button-danger { border-color: #f2ccd2; color: var(--danger); background: #fff7f8; }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); font-size: 22px; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.summary-card { padding: 22px; border: 1px solid rgba(217,226,236,.9); border-radius: 20px; background: rgba(255,255,255,.82); box-shadow: 0 10px 35px rgba(16,42,67,.045); }
.summary-label { color: var(--muted); font-size: 13px; font-weight: 700; }
.summary-value { display: block; margin-top: 6px; font-size: 32px; font-weight: 850; letter-spacing: -.045em; }
.summary-value small { color: var(--muted); font-size: 14px; font-weight: 650; }

.focus-panel { padding: 28px; border-radius: var(--radius); color: #fff; background: linear-gradient(130deg, #102a43 0%, #164e63 100%); box-shadow: var(--shadow); }
.focus-panel .eyebrow { color: #7dd3c7; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.focus-hint { padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.1); color: #cbdbe8; font-size: 12px; }
.task-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.task-item { position: relative; min-height: 118px; padding: 17px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: rgba(255,255,255,.08); }
.task-index { color: #7dd3c7; font-size: 12px; font-weight: 850; }
.task-title { margin: 8px 0 2px; font-size: 14px; font-weight: 750; color: #dbe8f1; }
.task-action { margin: 0; font-size: 16px; font-weight: 750; }

.projects-section { margin-top: 42px; }
.projects-heading { margin-bottom: 20px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.search-box { display: flex; align-items: center; gap: 10px; min-width: 280px; padding: 0 15px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.search-box input { width: 100%; min-height: 46px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.chip { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; color: var(--muted); background: rgba(255,255,255,.75); font-weight: 700; }
.chip.active { border-color: var(--ink); color: #fff; background: var(--ink); }
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.project-card { position: relative; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 12px 32px rgba(16,42,67,.045); transition: transform .2s, box-shadow .2s; cursor: pointer; }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.project-card:focus-visible { outline: 3px solid rgba(23,107,135,.28); outline-offset: 3px; }
.card-top { display: flex; justify-content: space-between; gap: 12px; }
.status-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #e7f5f3; color: var(--success); }
.status-badge.under_review, .status-badge.waiting { color: #75551b; background: #fff5d9; }
.status-badge.revision { color: #874421; background: #fff0e7; }
.status-badge.analysis { color: #315c99; background: #edf4ff; }
.priority-dot { width: 10px; height: 10px; margin-top: 9px; border-radius: 50%; background: #9fb3c8; }
.priority-dot.high { background: var(--accent); }
.priority-dot.medium { background: #e6b04b; }
.project-card h3 { margin: 15px 0 3px; font-size: 21px; letter-spacing: -.035em; }
.journal { margin: 0; color: var(--muted); font-size: 13px; }
.progress-row { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.progress-track { flex: 1; height: 8px; overflow: hidden; border-radius: 999px; background: #e9eff4; }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #40a69a); }
.progress-number { min-width: 38px; text-align: right; font-size: 13px; font-weight: 800; }
.next-box { margin-top: 18px; padding: 14px; border-radius: 15px; background: #f5f8fa; }
.next-label { margin: 0 0 4px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.next-action { margin: 0; font-size: 14px; font-weight: 720; }
.blocker { margin: 10px 0 0; color: var(--danger); font-size: 12px; }
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; color: var(--muted); font-size: 12px; }
.card-actions { display: flex; align-items: center; gap: 12px; }
.detail-link { color: var(--primary); font-weight: 800; }
.edit-button { border: 0; color: var(--muted); background: transparent; font-weight: 800; }
.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }

.dialog { width: min(620px, calc(100% - 28px)); max-height: 90vh; padding: 26px; border: 0; border-radius: 26px; color: var(--ink); box-shadow: 0 30px 90px rgba(16,42,67,.28); }
.dialog::backdrop { background: rgba(16,42,67,.55); backdrop-filter: blur(4px); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.dialog form > label, .field-row label { display: grid; gap: 7px; margin-bottom: 16px; color: var(--muted); font-size: 13px; font-weight: 700; }
.dialog input, .dialog select { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; outline: 0; color: var(--ink); background: #fff; }
.dialog input:focus, .dialog select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23,107,135,.12); }
.dialog input[type="range"] { padding: 0; accent-color: var(--primary); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.small-dialog { width: min(480px, calc(100% - 28px)); }
.dialog-copy { color: var(--muted); }
.settings-actions { display: grid; gap: 10px; margin-top: 20px; }
.file-button { display: grid; place-items: center; }
.file-button input { display: none; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translate(-50%, 120px); padding: 12px 18px; border-radius: 14px; color: #fff; background: var(--ink); box-shadow: var(--shadow); opacity: 0; transition: .25s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* Paper detail */
.back-button { margin-bottom: 22px; padding: 10px 0; border: 0; color: var(--primary); background: transparent; font-weight: 800; }
.detail-hero { padding: clamp(26px, 5vw, 48px); border-radius: 30px; color: #fff; background: radial-gradient(circle at 92% 0, rgba(125,211,199,.25), transparent 28rem), linear-gradient(135deg, #102a43, #164e63); box-shadow: var(--shadow); }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.detail-type { padding: 6px 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: #d7e5ee; font-size: 12px; font-weight: 750; }
.detail-hero h1 { max-width: 850px; margin-top: 20px; }
.detail-overview-label { margin: 24px 0 6px; color: #7dd3c7; font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.detail-summary { max-width: 920px; margin: 0; color: #edf5f8; font-size: 18px; font-weight: 650; line-height: 1.7; }
.flow-story { margin-top: 22px; padding: 20px 22px; border: 1px solid rgba(255,255,255,.12); border-radius: 20px; background: rgba(255,255,255,.07); }
.flow-story .detail-overview-label { margin-top: 0; }
.flow-narrative { margin: 0; color: #dce8ee; font-size: 15px; line-height: 2; }
.flow-segment { border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.flow-segment.current { color: #fff; background: rgba(125,211,199,.13); box-shadow: 0 0 0 3px rgba(125,211,199,.13); }
.flow-segment.waiting { color: #fff4cf; background: rgba(229,165,61,.12); box-shadow: 0 0 0 3px rgba(229,165,61,.12); }
.flow-marker { display: inline-grid; place-items: center; width: 21px; height: 21px; margin-right: 5px; border-radius: 50%; color: #fff; background: #829ab1; font-size: 11px; vertical-align: 1px; }
.flow-segment.done .flow-marker { background: var(--success); }
.flow-segment.current .flow-marker { background: #40a69a; }
.flow-segment.waiting .flow-marker { color: #553807; background: #f3c66d; }
.flow-label { color: #fff; }
.detail-focus-grid { display: grid; grid-template-columns: .65fr 1.35fr; gap: 12px; margin-top: 30px; }
.detail-focus-card, .detail-blocker { padding: 18px; border: 1px solid rgba(255,255,255,.11); border-radius: 18px; background: rgba(255,255,255,.08); }
.detail-focus-card .next-label { color: #9fc3cf; }
.hero-progress { display: block; margin-bottom: 10px; font-size: 32px; }
.detail-next { display: block; font-size: 17px; line-height: 1.45; }
.detail-blocker { grid-column: 1 / -1; display: grid; grid-template-columns: 75px 1fr; gap: 10px; color: #ffe2d3; font-size: 14px; }
.detail-section { margin-top: 24px; padding: 28px; border: 1px solid var(--line); border-radius: 26px; background: rgba(255,255,255,.9); box-shadow: 0 12px 35px rgba(16,42,67,.045); }
.detail-percent { color: var(--muted); font-size: 13px; font-weight: 750; }

/* Research argument chain */
.argument-section { background: linear-gradient(180deg, #f6fbfc, #fff); }
.argument-chain { display: flex; align-items: stretch; overflow-x: auto; margin-top: 26px; padding: 4px 2px 16px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.argument-node { display: grid; flex: 0 0 205px; align-content: start; gap: 8px; min-height: 210px; padding: 17px; border: 1px solid #dce4eb; border-radius: 18px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; scroll-snap-align: start; }
.argument-node:hover, .argument-node:focus-visible { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(16,42,67,.09); outline: none; }
.argument-node.settled { border-top: 4px solid #3f9d72; }.argument-node.discussing { border-top: 4px solid #247d9c; }.argument-node.data-pending { border-top: 4px solid #d9982c; }.argument-node.evidence-needed { border-top: 4px solid #c85b45; }.argument-node.open { border-top: 4px solid #8799a8; }
.argument-index { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: #fff; background: #627d98; font-size: 11px; font-weight: 850; }
.argument-status { width: max-content; padding: 4px 8px; border-radius: 999px; color: #526b7f; background: #eef3f6; font-size: 10px; font-weight: 850; }
.argument-status.settled { color: #17603f; background: #e2f3e9; }.argument-status.discussing { color: #135f7a; background: #e3f1f6; }.argument-status.data-pending { color: #7a5312; background: #fff2cf; }.argument-status.evidence-needed { color: #9c3f2e; background: #fde9e5; }
.argument-node strong { font-size: 16px; }.argument-node p { margin: 0; color: #334e68; font-size: 13px; line-height: 1.58; }.argument-node small { margin-top: auto; color: var(--muted); }
.argument-connector { display: grid; flex: 0 0 30px; place-items: center; color: #9aa9b6; font-size: 20px; }
.argument-legend, .evidence-legend { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.argument-legend span, .evidence-legend span { display: flex; align-items: center; gap: 5px; }.argument-legend i, .evidence-legend i { width: 9px; height: 9px; border-radius: 50%; background: #9aa9b6; }
.argument-legend i.settled { background: #3f9d72; }.argument-legend i.discussing { background: #247d9c; }.argument-legend i.data-pending { background: #d9982c; }.argument-legend i.evidence-needed { background: #c85b45; }

/* Manuscript intellectual map */
.structure-map { display: flex; align-items: stretch; overflow-x: auto; margin-top: 26px; padding: 4px 2px 16px; scrollbar-width: thin; scroll-snap-type: x proximity; }
.structure-node { position: relative; display: grid; flex: 0 0 178px; align-content: start; gap: 7px; min-height: 190px; padding: 17px; border: 1px solid #dce4eb; border-top: 4px solid #9aa9b6; border-radius: 18px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; scroll-snap-align: start; }
.structure-node:hover, .structure-node:focus-visible { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(16,42,67,.09); outline: none; }
.structure-node.settled { border-top-color: #3f9d72; }.structure-node.discussing { border-top-color: #247d9c; }.structure-node.partial { border-top-color: #7f6bb2; }.structure-node.open { border-top-color: #d9982c; }.structure-node.not-started { border-top-color: #9aa9b6; }
.structure-index { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; background: #9aa9b6; font-size: 11px; font-weight: 850; }
.structure-node.settled .structure-index { background: #3f9d72; }.structure-node.discussing .structure-index { background: #247d9c; }.structure-node.partial .structure-index { background: #7f6bb2; }.structure-node.open .structure-index { background: #d9982c; }
.structure-node strong { font-size: 16px; }
.structure-node small { color: #526b7f; font-size: 12px; line-height: 1.55; }
.structure-status { width: max-content; padding: 4px 7px; border-radius: 999px; color: #526b7f; background: #eef3f6; font-size: 10px; font-weight: 800; }
.structure-node.settled .structure-status { color: #17603f; background: #e2f3e9; }.structure-node.discussing .structure-status { color: #135f7a; background: #e3f1f6; }.structure-node.partial .structure-status { color: #58438b; background: #eee9f8; }.structure-node.open .structure-status { color: #7a5312; background: #fff2cf; }
.structure-connector { display: grid; flex: 0 0 30px; place-items: center; color: #9aa9b6; font-size: 20px; }
.structure-legend { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.structure-legend span { display: flex; align-items: center; gap: 5px; }.structure-legend i { width: 9px; height: 9px; border-radius: 50%; background: #9aa9b6; }
.structure-legend i.settled { background: #3f9d72; }.structure-legend i.discussing { background: #247d9c; }.structure-legend i.partial { background: #7f6bb2; }.structure-legend i.open { background: #d9982c; }
.structure-details { display: grid; gap: 18px; margin-top: 24px; }
.structure-detail-card { overflow: hidden; scroll-margin-top: 82px; border: 1px solid #dfe7ed; border-left: 5px solid #9aa9b6; border-radius: 20px; background: #fff; }
.structure-detail-card.settled { border-left-color: #3f9d72; }.structure-detail-card.discussing { border-left-color: #247d9c; }.structure-detail-card.partial { border-left-color: #7f6bb2; }.structure-detail-card.open { border-left-color: #d9982c; }
.structure-detail-summary { position: relative; padding: 22px 62px 22px 24px; cursor: pointer; list-style: none; }
.structure-detail-summary::-webkit-details-marker { display: none; }
.structure-detail-summary::after { content: '+'; position: absolute; top: 24px; right: 25px; color: var(--primary); font-size: 24px; font-weight: 600; }
.structure-detail-card[open] .structure-detail-summary::after { content: '−'; }
.structure-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.structure-detail-header h3 { margin: 2px 0 0; font-size: 24px; }.section-number { margin: 0; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.map-status { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; color: #526b7f; background: #eef3f6; font-size: 11px; font-weight: 850; }
.map-status.settled { color: #17603f; background: #e2f3e9; }.map-status.discussing { color: #135f7a; background: #e3f1f6; }.map-status.partial { color: #58438b; background: #eee9f8; }.map-status.open { color: #7a5312; background: #fff2cf; }
.section-thesis { margin: 14px 0 0; padding: 14px 16px; border-radius: 13px; color: #243b53; background: #f2f6f8; font-size: 15px; font-weight: 750; line-height: 1.6; }
.imrad-detail-body { padding: 21px 24px 24px; border-top: 1px solid #e5ebef; background: #fbfcfd; }
.imrad-detail-list { display: grid; gap: 11px; margin: 0; padding-left: 21px; color: #334e68; font-size: 14px; line-height: 1.7; }
.intellectual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.intellectual-block { padding: 16px; border: 1px solid #e5ebef; border-radius: 15px; background: #fbfcfd; }
.intellectual-block h4 { margin: 0 0 10px; color: #526b7f; font-size: 12px; }.intellectual-block ul { display: grid; gap: 7px; margin: 0; padding-left: 18px; color: #334e68; font-size: 13px; line-height: 1.55; }
.intellectual-block.decisions { border-color: #cee7d8; background: #f2faf5; }.intellectual-block.decisions h4 { color: #24734e; }
.intellectual-block.open-questions { border-color: #f0dfba; background: #fffaf0; }.intellectual-block.open-questions h4 { color: #9a6818; }
.intellectual-block.draft-evidence { border-color: #ddd5f0; background: #f8f5fc; }.intellectual-block.draft-evidence h4 { color: #69539b; }
.empty-intellectual { margin: 0; color: var(--muted); font-size: 13px; }
.section-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 15px; color: var(--muted); font-size: 11px; }.section-sources b { color: #526b7f; }.section-sources span { padding: 5px 8px; border-radius: 8px; background: #eef3f6; }

.researcher-notes-panel { margin-top: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.78); }
.researcher-notes-panel > summary { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; cursor: pointer; list-style: none; }
.researcher-notes-panel > summary::-webkit-details-marker { display: none; }
.researcher-notes-panel > summary span:first-child { display: grid; gap: 4px; }
.researcher-notes-panel > summary b { color: #334e68; font-size: 16px; }
.researcher-notes-panel > summary small { color: var(--muted); }
.researcher-notes-panel[open] > summary > span:last-child { transform: rotate(45deg); }
.researcher-notes-body { padding: 0 18px 18px; border-top: 1px solid var(--line); }
.researcher-notes-body .detail-section { box-shadow: none; }

/* Paragraph role map */
.paragraph-map { display: grid; gap: 24px; margin-top: 24px; }
.paragraph-group { padding: 22px; border: 1px solid #e1e8ee; border-radius: 20px; background: #f8fafb; }
.paragraph-group-header h3 { margin: 3px 0 0; font-size: 21px; }
.paragraph-timeline { display: grid; gap: 13px; margin-top: 18px; }
.paragraph-card { scroll-margin-top: 82px; padding: 18px; border: 1px solid #dfe7ed; border-left: 4px solid #8799a8; border-radius: 16px; background: #fff; }
.paragraph-card.drafted { border-left-color: #3f9d72; }.paragraph-card.outlined { border-left-color: #7f6bb2; }.paragraph-card.discussing { border-left-color: #247d9c; }.paragraph-card.data-pending { border-left-color: #d9982c; }
.paragraph-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }.paragraph-card-header > div { display: flex; align-items: center; gap: 10px; }.paragraph-card-header h4 { margin: 0; font-size: 17px; }
.paragraph-number { display: grid; place-items: center; min-width: 34px; height: 27px; border-radius: 8px; color: #fff; background: #526b7f; font-size: 11px; font-weight: 850; }
.paragraph-status { padding: 5px 8px; border-radius: 999px; color: #526b7f; background: #eef3f6; font-size: 10px; font-weight: 850; }.paragraph-status.drafted { color: #17603f; background: #e2f3e9; }.paragraph-status.outlined { color: #58438b; background: #eee9f8; }.paragraph-status.discussing { color: #135f7a; background: #e3f1f6; }.paragraph-status.data-pending { color: #7a5312; background: #fff2cf; }
.paragraph-core { margin: 13px 0; color: #243b53; font-size: 15px; font-weight: 750; line-height: 1.55; }
.paragraph-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }.paragraph-detail-grid > section { padding: 13px; border-radius: 12px; background: #f5f8fa; }.paragraph-detail-grid h5, .claim-evidence-grid h5 { margin: 0 0 8px; color: #526b7f; font-size: 11px; }.paragraph-detail-grid ul, .claim-evidence-grid ul { display: grid; gap: 6px; margin: 0; padding-left: 16px; color: #334e68; font-size: 12px; line-height: 1.5; }
.paragraph-detail-grid .paragraph-decisions { background: #f0f8f3; }.paragraph-detail-grid .paragraph-needs { background: #fff8ea; }
.paragraph-claim-links { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 13px; }.paragraph-claim-links b { color: #526b7f; font-size: 11px; }.paragraph-claim-links button { padding: 6px 9px; border: 1px solid #cadde5; border-radius: 9px; color: #176b87; background: #f1f8fa; font-size: 11px; text-align: left; cursor: pointer; }

/* Claim–evidence matrix */
.claim-section { background: #fbfcfd; }.claim-matrix { display: grid; gap: 15px; margin-top: 24px; }
.claim-card { scroll-margin-top: 82px; padding: 20px; border: 1px solid #dfe7ed; border-left: 5px solid #8799a8; border-radius: 18px; background: #fff; }
.claim-card.verified { border-left-color: #3f9d72; }.claim-card.internal-data { border-left-color: #247d9c; }.claim-card.indirect { border-left-color: #6d87b5; }.claim-card.hypothesis { border-left-color: #9b6eb5; }.claim-card.data-pending { border-left-color: #d9982c; }.claim-card.evidence-gap { border-left-color: #c85b45; }.claim-card.conflicted { border-left-color: #b23b3b; background: #fffafa; }
.claim-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }.claim-header > div { display: flex; align-items: flex-start; gap: 10px; }.claim-header h3 { margin: 0; font-size: 17px; line-height: 1.45; }
.claim-number { display: grid; flex: 0 0 34px; place-items: center; height: 28px; border-radius: 8px; color: #fff; background: #334e68; font-size: 11px; font-weight: 850; }
.evidence-status { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; color: #526b7f; background: #eef3f6; font-size: 10px; font-weight: 850; }.evidence-status.verified { color: #17603f; background: #e2f3e9; }.evidence-status.internal-data { color: #135f7a; background: #e3f1f6; }.evidence-status.indirect { color: #405b8e; background: #e9eef8; }.evidence-status.hypothesis { color: #70478b; background: #f1e8f7; }.evidence-status.data-pending { color: #7a5312; background: #fff2cf; }.evidence-status.evidence-gap, .evidence-status.conflicted { color: #9c3f2e; background: #fde9e5; }
.claim-location { margin: 11px 0 13px 44px; padding: 0; border: 0; color: var(--primary); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.claim-evidence-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }.claim-evidence-grid > section { padding: 13px; border: 1px solid #e5ebef; border-radius: 12px; background: #f8fafb; }.claim-evidence-grid .evidence-counter { border-color: #f0dfba; background: #fffaf0; }.claim-evidence-grid .evidence-language { border-color: #cee7d8; background: #f2faf5; }.claim-evidence-grid .evidence-language h5 { color: #24734e; }.claim-evidence-grid .evidence-language li { font-weight: 750; }
.evidence-legend i.verified { background: #3f9d72; }.evidence-legend i.internal-data { background: #247d9c; }.evidence-legend i.indirect { background: #6d87b5; }.evidence-legend i.hypothesis { background: #9b6eb5; }.evidence-legend i.data-pending { background: #d9982c; }.evidence-legend i.evidence-gap { background: #c85b45; }.evidence-legend i.conflicted { background: #b23b3b; }

/* Operational information is deliberately secondary */
.operations-panel { margin-top: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.72); }
.operations-panel > summary { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; cursor: pointer; list-style: none; }.operations-panel > summary::-webkit-details-marker { display: none; }
.operations-panel > summary span:first-child { display: grid; gap: 3px; }.operations-panel > summary b { color: #334e68; }.operations-panel > summary small { color: var(--muted); }.operations-panel[open] > summary > span:last-child { transform: rotate(45deg); }
.operations-focus { display: grid; grid-template-columns: .65fr 1.35fr; gap: 12px; padding: 0 24px 18px; }.operations-focus .detail-focus-card, .operations-focus .detail-blocker { border-color: #e1e8ee; color: #334e68; background: #f8fafb; }.operations-focus .detail-focus-card .next-label { color: #627d98; }.operations-focus .detail-blocker { color: #9c3f21; }
.operations-block { margin: 0 24px 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.workflow-diagram { display: flex; align-items: center; overflow-x: auto; margin-top: 30px; padding: 10px 4px 18px; scrollbar-width: thin; }
.workflow-node { display: grid; flex: 0 0 96px; place-items: center; align-content: start; min-height: 105px; text-align: center; }
.workflow-circle { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 9px; border: 2px solid #cbd5df; border-radius: 50%; color: var(--muted); background: #fff; font-weight: 850; }
.workflow-node strong { font-size: 13px; }
.workflow-node small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.workflow-node.done .workflow-circle { border-color: var(--success); color: #fff; background: var(--success); }
.workflow-node.current .workflow-circle { border-color: var(--primary); color: #fff; background: var(--primary); box-shadow: 0 0 0 7px rgba(23,107,135,.1); }
.workflow-node.waiting .workflow-circle { border-color: #e5a53d; color: #7a5312; background: #fff2cf; }
.workflow-node.blocked .workflow-circle { border-color: var(--danger); color: #fff; background: var(--danger); }
.workflow-line { flex: 1 0 28px; height: 3px; margin: 0 -14px 62px; background: #dce4eb; }
.workflow-line.done { background: var(--success); }
.workflow-line.current { background: linear-gradient(90deg, var(--primary), #dce4eb); }
.diagram-legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 11px; }
.diagram-legend span { display: flex; align-items: center; gap: 5px; }
.diagram-legend i { width: 9px; height: 9px; border-radius: 50%; background: #cbd5df; }
.diagram-legend i.done { background: var(--success); }.diagram-legend i.current { background: var(--primary); }.diagram-legend i.waiting { background: #e5a53d; }
.manuscript-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.manuscript-card { padding: 16px; border: 1px solid #e1e8ee; border-radius: 16px; background: #f8fafb; }
.manuscript-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.manuscript-top span { color: var(--muted); font-weight: 800; }
.notes-section { background: #f9fbfc; }
.note-groups { display: grid; gap: 18px; margin-top: 24px; }
.note-group { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.note-group-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.note-group-header h3 { margin: 0; font-size: 19px; }
.obsidian-link { flex: 0 0 auto; color: var(--primary); font-size: 12px; font-weight: 800; text-decoration: none; }
.note-section-grid { display: grid; gap: 1px; background: var(--line); }
.note-card { background: #fff; }
.note-card summary { position: relative; padding: 17px 48px 17px 22px; font-weight: 800; cursor: pointer; list-style: none; }
.note-card summary::-webkit-details-marker { display: none; }
.note-card summary::after { content: '+'; position: absolute; right: 22px; color: var(--primary); font-size: 20px; }
.note-card[open] summary::after { content: '−'; }
.note-body { padding: 0 22px 22px; color: #334e68; font-size: 14px; }
.note-body p { margin: 9px 0; }
.note-list { display: grid; gap: 9px; margin: 14px 0 0; padding: 0; list-style: none; }
.note-list li { position: relative; padding-left: 18px; }
.note-list li:not(.completed):not(.pending)::before { content: '•'; position: absolute; left: 2px; color: var(--primary); }
.note-list li.completed { color: var(--muted); text-decoration: line-through; }
.check-icon { display: inline-block; width: 20px; margin-left: -18px; color: var(--primary); font-weight: 850; }
.fatal-error { max-width: 560px; margin: 80px auto; padding: 28px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); }

.bottom-nav { display: none; }

@media (max-width: 820px) {
  .page-shell { width: min(100% - 28px, 680px); padding-top: 32px; }
  .hero { align-items: start; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .task-list { grid-template-columns: 1fr; }
  .task-item { min-height: auto; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-box { min-width: 0; }
  .project-grid { grid-template-columns: 1fr; }
  .detail-focus-grid { grid-template-columns: 1fr; }
  .operations-focus { grid-template-columns: 1fr; }
  .paragraph-detail-grid { grid-template-columns: 1fr; }
  .claim-evidence-grid { grid-template-columns: 1fr 1fr; }
  .detail-blocker { grid-column: auto; }
  .manuscript-progress { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  body { padding-bottom: 72px; }
  .topbar { min-height: 64px; padding: 10px 14px; }
  .topbar .button { display: none; }
  .brand-mark { width: 38px; height: 38px; }
  .page-shell { width: calc(100% - 24px); padding: 25px 0 40px; }
  .hero { display: block; }
  .hero .button { width: 100%; margin-top: 20px; }
  h1 { font-size: 36px; }
  .hero-copy { font-size: 15px; }
  .summary-card { padding: 17px; }
  .summary-value { font-size: 27px; }
  .focus-panel { padding: 22px; border-radius: 21px; }
  .projects-section { margin-top: 34px; }
  .project-card { padding: 20px; border-radius: 21px; }
  .filter-chips { margin-right: -12px; padding-right: 12px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .dialog { padding: 21px; border-radius: 22px; }
  .detail-hero { padding: 24px 20px; border-radius: 22px; }
  .detail-hero h1 { font-size: 32px; }
  .detail-summary { font-size: 15px; }
  .flow-story { padding: 17px; }
  .flow-narrative { font-size: 14px; line-height: 2.05; }
  .detail-focus-grid { margin-top: 22px; }
  .detail-blocker { grid-template-columns: 1fr; gap: 4px; }
  .detail-section { padding: 21px 18px; border-radius: 22px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .argument-chain { flex-direction: column; overflow: visible; gap: 0; padding-bottom: 4px; }
  .argument-node { grid-template-columns: 30px 1fr auto; grid-template-rows: auto auto auto; flex: 0 0 auto; min-height: 0; padding: 14px; border-top-width: 1px; border-left: 4px solid #8799a8; }
  .argument-node.settled { border-left-color: #3f9d72; }.argument-node.discussing { border-left-color: #247d9c; }.argument-node.data-pending { border-left-color: #d9982c; }.argument-node.evidence-needed { border-left-color: #c85b45; }
  .argument-index { grid-row: 1 / 4; }.argument-node .argument-status { align-self: center; }.argument-node strong { grid-column: 2 / 4; }.argument-node p { grid-column: 2 / 4; }.argument-node small { grid-column: 2 / 4; }
  .argument-connector { flex: 0 0 22px; transform: rotate(90deg); font-size: 16px; }
  .argument-legend { margin-top: 16px; }
  .structure-map { flex-direction: column; overflow: visible; gap: 0; padding-bottom: 4px; }
  .structure-node { grid-template-columns: 30px 1fr auto; grid-template-rows: auto auto; flex: 0 0 auto; min-height: 0; padding: 14px; border-top-width: 1px; border-left: 4px solid #9aa9b6; }
  .structure-node.settled { border-left-color: #3f9d72; }.structure-node.discussing { border-left-color: #247d9c; }.structure-node.partial { border-left-color: #7f6bb2; }.structure-node.open { border-left-color: #d9982c; }
  .structure-index { grid-row: 1 / 3; }.structure-node strong { align-self: center; }.structure-node .structure-status { align-self: center; }.structure-node small { grid-column: 2 / 4; }
  .structure-connector { flex: 0 0 22px; transform: rotate(90deg); font-size: 16px; }
  .structure-legend { margin-top: 16px; }
  .structure-detail-card { padding: 18px 15px; border-left-width: 4px; }
  .structure-detail-header h3 { font-size: 21px; }
  .section-thesis { font-size: 14px; }
  .intellectual-grid { grid-template-columns: 1fr; }
  .intellectual-block { padding: 14px; }
  .paragraph-group { padding: 16px 13px; }
  .paragraph-card { padding: 15px 13px; }
  .paragraph-card-header, .claim-header { flex-direction: column; }
  .paragraph-card-header > div, .claim-header > div { width: 100%; }
  .claim-card { padding: 17px 14px; }
  .claim-evidence-grid { grid-template-columns: 1fr; }
  .claim-location { margin-left: 0; }
  .evidence-legend { margin-top: 16px; }
  .operations-panel > summary { padding: 18px; }
  .operations-focus { padding: 0 18px 16px; }
  .operations-block { margin: 0 18px 20px; }
  .workflow-diagram { flex-direction: column; align-items: stretch; overflow: visible; padding-left: 3px; }
  .workflow-node { grid-template-columns: 52px 1fr; grid-template-rows: auto auto; flex: 0 0 auto; justify-items: start; align-items: center; min-height: 54px; text-align: left; }
  .workflow-circle { grid-row: 1 / 3; margin: 0 10px 0 0; }
  .workflow-node small { margin-top: 0; }
  .workflow-line { flex: 0 0 24px; width: 3px; height: 24px; margin: -4px 0 -4px 20px; }
  .manuscript-progress { grid-template-columns: 1fr 1fr; gap: 9px; }
  .manuscript-card { padding: 13px; }
  .note-group-header { align-items: flex-start; flex-direction: column; padding: 18px; }
  .note-card summary { padding-left: 18px; }
  .note-body { padding: 0 18px 18px; }
  .bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 30; display: grid; grid-template-columns: repeat(3, 1fr); padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(18px); }
  .bottom-nav a, .bottom-nav button { display: grid; place-items: center; gap: 1px; min-height: 50px; border: 0; color: var(--muted); background: transparent; font-size: 11px; font-weight: 750; text-decoration: none; }
  .bottom-nav span { font-size: 19px; }
  .bottom-nav .active { color: var(--primary); }
  .detail-open .bottom-nav { display: none; }
  .detail-open { padding-bottom: 0; }
  .toast { bottom: 86px; width: calc(100% - 28px); text-align: center; }
}

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