:root {
  --ink: #20201e;
  --muted: #77736d;
  --soft: #a39e96;
  --paper: #f4f2ed;
  --surface: #fffefa;
  --line: #e3dfd7;
  --accent: #7e2836;
  --accent-soft: #f5e9ea;
  --success: #47664d;
  --danger: #9d332f;
  --shadow: 0 18px 50px rgba(40, 36, 31, 0.07);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, textarea, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 32px 22px 24px; background: #ebe8e1; border-right: 1px solid var(--line); }
.wordmark { display: flex; align-items: baseline; gap: 9px; padding: 0 10px; color: var(--ink); text-decoration: none; }
.wordmark span { font: 800 21px/1 Arial, sans-serif; letter-spacing: .02em; }
.wordmark small { color: var(--soft); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.primary-nav { display: grid; gap: 5px; margin-top: 50px; }
.primary-nav a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 13px; color: #5e5b56; border-radius: 10px; text-decoration: none; font-size: 13px; font-weight: 650; }
.primary-nav a span { width: 18px; color: var(--soft); font-size: 15px; text-align: center; }
.primary-nav a:hover { background: rgba(255,255,255,.55); }
.primary-nav a.active { color: var(--ink); background: var(--surface); box-shadow: 0 4px 16px rgba(48,42,35,.05); }
.primary-nav a.active span { color: var(--accent); }
.sidebar-foot { margin-top: auto; padding: 0 10px; }
.demo-badge { display: inline-flex; padding: 6px 8px; color: var(--accent); background: var(--accent-soft); border-radius: 6px; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.sidebar-foot p { margin: 10px 0 0; color: var(--soft); font-size: 10px; }
.workspace { min-width: 0; }
.assistant-workspace { width: min(940px, calc(100% - 64px)); margin: 0 auto; padding: 42px 0 32px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.eyebrow { margin: 0 0 5px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.topbar h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 25px; font-weight: 500; }
.status-dot { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.status-dot i { width: 7px; height: 7px; background: #5d865e; border-radius: 99px; box-shadow: 0 0 0 4px #e2ece1; }
.assistant-intro { margin: auto 0; padding: 70px 0 80px; text-align: center; }
.assistant-mark, .mini-mark { display: grid; place-items: center; color: white; background: var(--ink); font-family: Georgia, serif; }
.assistant-mark { width: 52px; height: 52px; margin: 0 auto 24px; border-radius: 15px; font-size: 24px; box-shadow: 0 9px 24px rgba(37,34,30,.16); }
.assistant-intro h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(32px, 5vw, 47px); font-weight: 500; letter-spacing: -.03em; }
.assistant-intro > p { max-width: 580px; margin: 16px auto 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.quick-prompts { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; max-width: 720px; margin: 34px auto 0; }
.quick-prompts button { padding: 10px 14px; color: #5e5a54; background: rgba(255,255,255,.68); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 11px; transition: .18s ease; }
.quick-prompts button:hover { color: var(--accent); background: white; border-color: #cfc8bd; transform: translateY(-1px); }
.conversation { flex: 1; display: grid; align-content: start; gap: 18px; padding: 58px 0 30px; }
.message { max-width: 820px; }
.user-message { justify-self: end; display: flex; align-items: flex-start; gap: 10px; }
.user-message span { display: grid; place-items: center; flex: 0 0 26px; height: 26px; color: white; background: #8c8881; border-radius: 8px; font-size: 10px; }
.user-message p { margin: 0; padding: 13px 16px; background: #e8e4dc; border-radius: 14px 4px 14px 14px; font-size: 13px; line-height: 1.65; }
.ai-message { width: min(100%, 820px); padding: 25px 27px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.message-author { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.mini-mark { width: 25px; height: 25px; border-radius: 7px; font-size: 12px; }
.answer-loading { display: flex; align-items: center; gap: 11px; padding: 30px 0 8px; color: var(--muted); font-size: 12px; }
.answer-loading i { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 99px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.answer-copy { margin: 25px 0 22px; font-family: Georgia, "Songti SC", serif; font-size: 18px; line-height: 1.9; white-space: pre-wrap; }
.answer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 14px 0; color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; }
.answer-meta strong { color: var(--ink); font-weight: 650; }
.confidence-pill { padding: 6px 8px; color: var(--success); background: #eaf0e9; border-radius: 6px; font-weight: 750; }
.confidence-pill.low { color: var(--danger); background: #f7e8e6; }
.human-warning { display: flex; align-items: center; gap: 16px; margin-top: 22px; padding: 14px 16px; color: var(--danger); background: #fbefed; border-left: 3px solid var(--danger); border-radius: 8px; }
.human-warning strong { flex: 0 0 auto; font-size: 12px; }
.human-warning span { color: #7b5651; font-size: 11px; line-height: 1.55; }
.sources-panel { border-top: 1px solid var(--line); }
.sources-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 7px; cursor: pointer; list-style: none; font-size: 11px; font-weight: 700; }
.sources-panel summary::-webkit-details-marker { display: none; }
.sources-panel summary small { color: var(--soft); font-weight: 500; }
.citations { display: grid; gap: 8px; padding: 10px 0 4px; }
.citation-card { padding: 15px; background: var(--paper); border-radius: 10px; }
.citation-card > div { display: flex; align-items: center; gap: 9px; }
.citation-card > div span { color: var(--accent); font: 700 9px Arial, sans-serif; }
.citation-card > div strong { font-size: 11px; }
.source-location { margin: 5px 0 0 27px; color: var(--soft); font-size: 9px; }
.source-content { margin: 12px 0 0; padding-top: 11px; color: #59554f; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.7; white-space: pre-wrap; }
.empty-state { margin: 8px 0; color: var(--muted); font-size: 11px; }
.text-action { margin-top: 14px; padding: 0; color: var(--accent); background: none; border: 0; cursor: pointer; font-size: 10px; font-weight: 700; }
.composer-card { position: sticky; bottom: 18px; padding: 15px 16px 12px; background: var(--surface); border: 1px solid #d9d4ca; border-radius: 15px; box-shadow: 0 16px 44px rgba(45,40,34,.12); }
.composer-card textarea { display: block; width: 100%; min-height: 58px; padding: 3px 2px 10px; color: var(--ink); background: transparent; border: 0; outline: 0; resize: none; font-size: 14px; line-height: 1.6; }
.composer-card textarea::placeholder { color: #aaa59c; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.composer-actions > span { color: var(--soft); font-size: 9px; }
.send-button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; color: white; background: var(--ink); border: 0; border-radius: 9px; cursor: pointer; font-size: 11px; font-weight: 700; }
.send-button:disabled { opacity: .45; cursor: wait; }
.send-button b { font-size: 14px; font-weight: 400; }
.boundary-note { margin: 12px 0 0; color: var(--soft); text-align: center; font-size: 9px; }

/* Training and feedback */
.page-workspace { width: min(1040px, calc(100% - 72px)); margin: 0 auto; padding: 48px 0 80px; }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 38px; }
.page-header h1 { margin: 7px 0 0; font: 500 clamp(32px, 5vw, 48px)/1.1 Georgia, "Songti SC", serif; letter-spacing: -.03em; }
.page-header p { max-width: 520px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.progress-card { display: grid; grid-template-columns: auto minmax(120px, 1fr) auto; align-items: center; gap: 20px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.progress-card strong { font: 500 28px Georgia, serif; }
.progress-stat { display: grid; gap: 3px; }
.progress-stat small { color: var(--soft); font-size: 9px; font-weight: 700; }
.progress-stat.week { text-align: right; }
.progress-track { height: 5px; overflow: hidden; background: #e9e5dd; border-radius: 99px; }
.progress-track i { display: block; width: 0; height: 100%; background: var(--accent); transition: width .25s ease; }
.progress-card > span { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.day-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 28px 0 16px; }
.day-tabs button { padding: 9px 15px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 700; }
.day-tabs button.active { color: var(--ink); background: var(--surface); border-color: var(--line); }
.task-list { display: grid; gap: 11px; }
.task-card { padding: 21px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.task-head { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 14px; }
.task-index { display: grid; place-items: center; width: 30px; height: 30px; color: var(--accent); background: var(--accent-soft); border-radius: 9px; font: 700 10px Arial, sans-serif; }
.task-title h2 { margin: 0; font-size: 14px; }
.task-title p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.complete-button { padding: 9px 12px; color: var(--ink); background: transparent; border: 1px solid #ccc7be; border-radius: 8px; cursor: pointer; font-size: 10px; font-weight: 700; }
.complete-button.done { color: var(--success); background: #edf2ec; border-color: #d6e1d5; cursor: default; }
.course-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 17px 0 0 48px; color: var(--muted); font-size: 10px; }
.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 0 48px; }
.course-block { padding: 15px 16px; color: #5c5852; background: var(--paper); border-radius: 9px; font-size: 11px; line-height: 1.65; }
.course-block h3 { margin: 0 0 9px; color: var(--ink); font-size: 11px; }
.course-block ul { margin: 0; padding-left: 17px; }
.course-block li + li { margin-top: 6px; }
.training-risk { margin: 14px 0 0 48px; padding: 11px 13px; color: var(--danger); background: #fbefed; border-left: 3px solid var(--danger); border-radius: 7px; font-size: 10px; line-height: 1.6; }
.course-source { margin: 13px 0 0 48px; border-top: 1px solid var(--line); }
.course-source summary { display: flex; justify-content: space-between; padding: 13px 0 4px; cursor: pointer; color: var(--muted); font-size: 10px; font-weight: 700; }
.course-source summary span { color: var(--soft); font-weight: 500; }
.course-source-body { padding: 10px 13px; color: #5c5852; background: var(--paper); border-radius: 8px; font-size: 10px; line-height: 1.7; }
.course-source-body p { margin: 0; }
.course-source-body p + p { margin-top: 8px; }
.course-source-body strong { display: inline-block; min-width: 62px; color: var(--ink); }
.feedback-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.form-card, .context-card { padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { color: var(--muted); font-size: 10px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; padding: 12px 13px; color: var(--ink); background: white; border: 1px solid #d8d3ca; border-radius: 8px; outline: none; font-size: 12px; }
.field textarea { min-height: 112px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #9b9187; box-shadow: 0 0 0 3px #eeeae3; }
.primary-button { width: 100%; padding: 12px; color: white; background: var(--ink); border: 0; border-radius: 9px; cursor: pointer; font-size: 11px; font-weight: 750; }
.primary-button:disabled { opacity: .45; }
.context-card h2 { margin: 0 0 18px; font: 500 21px Georgia, serif; }
.context-item { padding: 14px 0; border-top: 1px solid var(--line); }
.context-item:first-of-type { border-top: 0; }
.context-item small { color: var(--soft); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.context-item p { margin: 7px 0 0; font-size: 11px; line-height: 1.7; }
.submit-result { margin-top: 16px; padding: 14px; color: var(--success); background: #edf2ec; border-radius: 9px; font-size: 11px; line-height: 1.6; }

/* Role SOP center */
.sop-workspace { width: min(1120px, calc(100% - 72px)); }
.sop-hero { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 30px; padding: 18px 0 10px; }
.sop-hero h1, .role-hero h1, .not-found h1 { margin: 6px 0 0; font: 500 clamp(38px, 6vw, 60px)/1.04 Georgia, "Songti SC", serif; letter-spacing: -.045em; }
.sop-hero-note { display: flex; align-items: baseline; gap: 9px; padding: 15px 18px; background: var(--ink); border-radius: 12px; color: white; }
.sop-hero-note strong { font: 500 30px/1 Georgia, serif; }
.sop-hero-note span { color: #cbc8c0; font-size: 10px; }
.sop-intro-card { position: relative; overflow: hidden; padding: 34px 38px; color: white; background: var(--ink); border-radius: 18px; box-shadow: var(--shadow); }
.sop-intro-card::after { content: "SOP"; position: absolute; right: 22px; bottom: -28px; color: rgba(255,255,255,.045); font: 800 116px/1 Arial, sans-serif; letter-spacing: -.08em; }
.sop-intro-card .section-kicker { color: #c7afa9; }
.sop-intro-card h2 { position: relative; z-index: 1; max-width: 690px; margin: 11px 0 0; font: 500 clamp(24px, 4vw, 36px)/1.25 Georgia, "Songti SC", serif; }
.sop-intro-card p { position: relative; z-index: 1; max-width: 720px; margin: 14px 0 0; color: #bcb8b0; font-size: 12px; line-height: 1.8; }
.role-section { margin-top: 46px; }
.role-section.future { padding-top: 34px; border-top: 1px solid var(--line); }
.section-kicker { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 6px 0 0; font: 500 27px/1.15 Georgia, "Songti SC", serif; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 10px; }
.role-grid { display: grid; gap: 13px; }
.role-grid.current { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.future-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.role-card { min-width: 0; padding: 23px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 15px; text-decoration: none; box-shadow: 0 12px 34px rgba(42,38,33,.045); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
a.role-card:hover { transform: translateY(-3px); border-color: #cfc7bb; box-shadow: 0 18px 40px rgba(42,38,33,.08); }
.role-card-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.role-monogram { display: grid; place-items: center; width: 38px; height: 38px; color: white; background: var(--accent); border-radius: 11px; font: 500 17px Georgia, serif; }
.role-monogram.muted { color: #8f8a82; background: #ece9e2; }
.ready-pill, .planned-pill { display: inline-flex; padding: 6px 8px; border-radius: 6px; font-size: 8px; font-weight: 800; letter-spacing: .06em; }
.ready-pill { color: var(--success); background: #e9f0e8; }
.planned-pill { color: #827d74; background: #ebe8e1; }
.role-card h2 { margin: 24px 0 0; font: 500 27px Georgia, "Songti SC", serif; }
.role-card p { min-height: 38px; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.role-card-action { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; padding-top: 14px; color: var(--accent); border-top: 1px solid var(--line); font-size: 10px; font-weight: 750; }
.role-card-action b { font-size: 15px; font-weight: 400; }
.role-card.planned { background: rgba(255,254,250,.48); box-shadow: none; }
.role-card.planned h2 { font-size: 22px; }

.sop-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 28px; color: var(--muted); text-decoration: none; font-size: 10px; font-weight: 700; }
.sop-back:hover { color: var(--accent); }
.role-hero { display: grid; grid-template-columns: minmax(0, 1fr) 190px; align-items: end; gap: 38px; padding: 10px 0 36px; }
.role-hero-copy > p:last-child { max-width: 780px; margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.85; }
.role-switcher { display: grid; gap: 8px; padding: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.role-switcher small { color: var(--soft); font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.role-switcher a { display: flex; justify-content: space-between; color: var(--ink); text-decoration: none; font-size: 11px; font-weight: 700; }
.role-switcher a span { color: var(--accent); }
.source-banner { display: flex; align-items: center; gap: 13px; padding: 12px 15px; color: #5e5a54; background: #ebe8e1; border-radius: 9px; }
.source-banner span { flex: 0 0 auto; padding: 5px 7px; color: var(--success); background: #f9fbf8; border-radius: 5px; font-size: 8px; font-weight: 800; }
.source-banner p { margin: 0; font-size: 9px; line-height: 1.6; }
.sop-toc { position: sticky; top: 0; z-index: 4; display: flex; gap: 4px; margin: 24px 0 8px; padding: 8px; overflow-x: auto; background: rgba(244,242,237,.92); border: 1px solid var(--line); border-radius: 11px; backdrop-filter: blur(10px); }
.sop-toc a { flex: 0 0 auto; padding: 8px 11px; color: var(--muted); border-radius: 7px; text-decoration: none; font-size: 9px; font-weight: 700; }
.sop-toc a:hover { color: var(--accent); background: var(--surface); }
.sop-section { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 26px; padding: 54px 0; scroll-margin-top: 64px; border-bottom: 1px solid var(--line); }
.section-index { padding-top: 4px; color: #a8a299; font: 700 10px Arial, sans-serif; letter-spacing: .08em; }
.source-ref { color: var(--soft); font-size: 8px; font-weight: 650; }
.overview-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 13px; }
.content-card { padding: 23px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.content-card.feature { color: white; background: var(--ink); border-color: var(--ink); }
.content-card h3, .error-card h3 { margin: 0 0 14px; font: 500 18px Georgia, "Songti SC", serif; }
.content-card p { margin: 0; color: #cbc7bf; font-size: 12px; line-height: 1.85; }
.sop-bullet-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.sop-bullet-list li { position: relative; padding-left: 16px; color: #5f5b55; font-size: 11px; line-height: 1.65; }
.sop-bullet-list li::before { content: ""; position: absolute; top: .65em; left: 0; width: 5px; height: 5px; background: var(--accent); border-radius: 99px; }
.daily-task-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 17px; }
.daily-task-strip div { padding: 14px; background: #ebe8e1; border-radius: 9px; }
.daily-task-strip span { color: var(--accent); font: 800 8px Arial, sans-serif; }
.daily-task-strip p { margin: 7px 0 0; font-size: 10px; line-height: 1.55; }
.workflow-list { display: grid; gap: 8px; }
.sop-phase { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.sop-phase summary { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; padding: 17px 19px; cursor: pointer; list-style: none; }
.sop-phase summary::-webkit-details-marker { display: none; }
.sop-phase summary strong { font-size: 12px; }
.sop-phase summary small { color: var(--soft); font-size: 8px; }
.sop-phase summary i { color: var(--accent); font-size: 16px; font-style: normal; transition: transform .18s ease; }
.sop-phase[open] summary i { transform: rotate(45deg); }
.phase-number { display: grid; place-items: center; width: 30px; height: 30px; color: var(--accent); background: var(--accent-soft); border-radius: 8px; font: 800 9px Arial, sans-serif; }
.phase-content { padding: 4px 20px 22px 65px; }
.phase-group + .phase-group { margin-top: 23px; padding-top: 20px; border-top: 1px solid var(--line); }
.phase-group h4 { margin: 0 0 12px; color: var(--accent); font-size: 10px; }
.numbered-detail-list { display: grid; gap: 12px; margin: 0; padding: 0; counter-reset: detail; list-style: none; }
.numbered-detail-list li { position: relative; padding-left: 30px; color: #58544e; counter-increment: detail; font-size: 11px; line-height: 1.75; }
.numbered-detail-list li::before { content: counter(detail, decimal-leading-zero); position: absolute; top: 1px; left: 0; color: #a29c93; font: 700 8px/1.7 Arial, sans-serif; }
.standard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.standard-grid article { display: grid; grid-template-columns: 30px 1fr; gap: 13px; padding: 19px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.standard-grid article > span { color: var(--accent); font: 800 9px Arial, sans-serif; }
.standard-grid p { margin: 0; color: #55514b; font-size: 11px; line-height: 1.75; }
.error-card { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 18px; padding: 24px; color: #6c403c; background: #fbefed; border: 1px solid #efd8d4; border-radius: 13px; }
.error-mark { display: grid; place-items: center; width: 42px; height: 42px; color: white; background: var(--danger); border-radius: 11px; font: 700 19px Georgia, serif; }
.error-list { display: grid; gap: 9px; margin: 0; padding-left: 18px; }
.error-list li { font-size: 11px; line-height: 1.7; }
.deliverable-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.deliverable-list > div { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 15px 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.deliverable-list span { color: var(--success); font-size: 11px; font-weight: 800; }
.deliverable-list p { margin: 0; font-size: 11px; line-height: 1.6; }
.not-found { max-width: 560px; margin: 18vh auto 0; text-align: center; }
.not-found > p:last-of-type { color: var(--muted); font-size: 12px; }
.not-found a { display: inline-flex; margin-top: 18px; padding: 10px 14px; color: white; background: var(--ink); border-radius: 8px; text-decoration: none; font-size: 10px; }

/* KPI performance framework */
.kpi-workspace { width: min(1180px, calc(100% - 72px)); }
.kpi-hero { display: flex; align-items: end; justify-content: space-between; gap: 32px; padding: 10px 0 34px; }
.kpi-hero h1 { margin: 6px 0 0; font: 500 clamp(38px, 6vw, 58px)/1.05 Georgia, "Songti SC", serif; letter-spacing: -.045em; }
.kpi-hero > div:first-child > p:last-child { max-width: 760px; margin: 16px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.framework-status { flex: 0 0 155px; display: grid; grid-template-columns: 9px 1fr; gap: 4px 9px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.framework-status i { width: 8px; height: 8px; margin-top: 2px; background: var(--success); border-radius: 99px; box-shadow: 0 0 0 4px #e4ece3; }
.framework-status span { font-size: 10px; font-weight: 750; }
.framework-status small { grid-column: 2; color: var(--soft); font-size: 8px; }
.kpi-boundary-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 16px; padding: 21px 23px; color: white; background: var(--ink); border-radius: 14px; }
.kpi-boundary-card > span { display: grid; place-items: center; width: 40px; height: 40px; color: var(--ink); background: #e8ddd2; border-radius: 11px; font-size: 18px; }
.kpi-boundary-card strong { font: 500 17px Georgia, "Songti SC", serif; }
.kpi-boundary-card p { margin: 6px 0 0; color: #bdb9b1; font-size: 10px; line-height: 1.7; }
.kpi-role-section, .kpi-cycle-section { margin-top: 42px; }
.kpi-role-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.kpi-role-grid article { display: grid; gap: 10px; min-width: 0; padding: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.kpi-role-grid span { color: var(--accent); font: 800 8px Arial, sans-serif; }
.kpi-role-grid strong { font: 500 19px Georgia, "Songti SC", serif; }
.kpi-role-grid small { color: var(--soft); font-size: 8px; line-height: 1.5; }
.kpi-board { margin-top: 46px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.kpi-board-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 24px 26px 19px; }
.kpi-board-head h2 { margin: 6px 0 0; font: 500 25px Georgia, "Songti SC", serif; }
.kpi-create-button { padding: 10px 13px; color: #99938a; background: #ece9e2; border: 0; border-radius: 8px; font-size: 9px; font-weight: 700; }
.kpi-filters { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; align-items: end; gap: 10px; padding: 17px 26px; background: #f1efe9; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kpi-filters label { display: grid; gap: 7px; }
.kpi-filters label span { color: var(--muted); font-size: 8px; font-weight: 750; }
.kpi-filters input, .kpi-filters select { width: 100%; min-height: 38px; padding: 9px 11px; color: var(--ink); background: white; border: 1px solid #d7d1c8; border-radius: 8px; outline: none; font-size: 10px; }
.kpi-filters input:focus, .kpi-filters select:focus { border-color: #a69d92; box-shadow: 0 0 0 3px #e6e1da; }
.kpi-filters > button { min-height: 38px; padding: 0 13px; color: var(--accent); background: var(--surface); border: 1px solid #d7d1c8; border-radius: 8px; cursor: pointer; font-size: 9px; font-weight: 750; }
.kpi-scope-summary { padding: 12px 26px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 9px; }
.kpi-table-wrap { overflow-x: auto; }
.kpi-table { width: 100%; min-width: 920px; border-collapse: collapse; }
.kpi-table th { padding: 13px 14px; color: var(--muted); background: #faf9f5; border-bottom: 1px solid var(--line); text-align: left; font-size: 8px; font-weight: 800; white-space: nowrap; }
.kpi-table td { padding: 0; }
.kpi-empty-state { display: grid; justify-items: center; padding: 52px 24px 58px; text-align: center; }
.kpi-empty-state > span { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 14px; color: var(--soft); background: var(--paper); border-radius: 11px; font-size: 17px; }
.kpi-empty-state strong { font: 500 18px Georgia, "Songti SC", serif; }
.kpi-empty-state p { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.kpi-cycle-section { padding-bottom: 14px; }
.kpi-cycle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kpi-cycle-grid article { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 4px 14px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.kpi-cycle-grid article > span { grid-row: 1 / 3; display: grid; place-items: center; width: 44px; height: 44px; color: white; background: var(--accent); border-radius: 11px; font: 500 18px Georgia, serif; }
.kpi-cycle-grid strong { font-size: 11px; }
.kpi-cycle-grid p { margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.kpi-cycle-grid small { grid-column: 2; margin-top: 7px; color: var(--soft); font-size: 8px; }

/* Reneriva internal home */
.home-body { min-height: 100vh; background: #efede7; }
.internal-home { width: min(1180px, calc(100% - 64px)); margin: 0 auto; padding: 30px 0 26px; }
.home-topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.home-topbar .wordmark { padding: 0; }
.home-topbar .wordmark span { font-size: 19px; letter-spacing: .06em; }
.home-topbar > div { display: flex; align-items: center; gap: 12px; }
.home-topbar > div > small { color: var(--soft); font-size: 8px; }
.home-hero { padding: clamp(72px, 12vh, 126px) 0 60px; }
.home-hero h1 { margin: 9px 0 0; font: 500 clamp(55px, 9vw, 94px)/.98 Georgia, "Songti SC", serif; letter-spacing: -.055em; }
.home-hero > p:last-child { max-width: 610px; margin: 22px 0 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.home-module-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.home-module-card { grid-column: span 2; display: flex; flex-direction: column; min-height: 260px; padding: 23px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; box-shadow: 0 12px 34px rgba(42,38,33,.035); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.home-module-card.featured { grid-column: span 4; color: white; background: var(--ink); border-color: var(--ink); }
.home-module-card:hover { transform: translateY(-3px); border-color: #cbc3b8; box-shadow: 0 18px 44px rgba(42,38,33,.08); }
.home-module-card > div { display: flex; align-items: center; justify-content: space-between; }
.home-module-card > div span { color: var(--accent); font: 800 8px Arial, sans-serif; }
.home-module-card.featured > div span { color: #d0aaa9; }
.home-module-card > div i { display: grid; place-items: center; width: 34px; height: 34px; color: var(--accent); background: var(--accent-soft); border-radius: 10px; font-size: 14px; font-style: normal; }
.home-module-card.featured > div i { color: var(--ink); background: #e9ddd4; }
.home-module-card h2 { margin: 34px 0 0; font: 500 clamp(23px, 3vw, 32px) Georgia, "Songti SC", serif; }
.home-module-card p { max-width: 520px; margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.75; }
.home-module-card.featured p { color: #bbb7af; }
.home-module-card b { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 17px; color: var(--accent); border-top: 1px solid var(--line); font-size: 9px; }
.home-module-card.featured b { color: #e1c0ba; border-top-color: #3e3c38; }
.home-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 28px; padding-top: 18px; color: var(--soft); border-top: 1px solid var(--line); font-size: 8px; }

/* Brand center */
.brand-workspace { width: min(1180px, calc(100% - 72px)); }
.brand-list-hero { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: 10px 0 38px; }
.brand-list-hero h1, .brand-detail-copy h1 { margin: 7px 0 0; font: 500 clamp(42px, 7vw, 68px)/1 Georgia, "Songti SC", serif; letter-spacing: -.05em; }
.brand-list-hero > div:first-child > p:last-child { max-width: 650px; margin: 16px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.brand-count { flex: 0 0 auto; display: flex; align-items: baseline; gap: 9px; padding: 16px 19px; color: white; background: var(--ink); border-radius: 12px; }
.brand-count strong { font: 500 31px/1 Georgia, serif; }
.brand-count span { color: #c9c5bd; font-size: 9px; }
.brand-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding: 17px 19px; background: #ebe8e1; border-radius: 12px; }
.brand-toolbar label { display: grid; gap: 7px; width: min(430px, 100%); }
.brand-toolbar label span { color: var(--muted); font-size: 8px; font-weight: 750; }
.brand-toolbar input { min-height: 40px; padding: 10px 12px; color: var(--ink); background: var(--surface); border: 1px solid #d5cfc5; border-radius: 8px; outline: none; font-size: 11px; }
.brand-toolbar input:focus { border-color: #9b9187; box-shadow: 0 0 0 3px #ddd7cf; }
.brand-toolbar > small { color: var(--soft); font-size: 9px; }
.brand-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.brand-card { overflow: hidden; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 15px; text-decoration: none; box-shadow: 0 12px 34px rgba(42,38,33,.045); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.brand-card:hover { transform: translateY(-3px); border-color: #c9c0b5; box-shadow: 0 19px 44px rgba(42,38,33,.09); }
.brand-card-image { display: block; width: 100%; height: 218px; object-fit: cover; background: #e8e4dc; }
.brand-image-placeholder { display: grid; place-content: center; gap: 10px; text-align: center; background: linear-gradient(145deg, #e5e0d7, #f6f3ed); }
.brand-image-placeholder span { color: #918a80; font: 500 36px Georgia, "Songti SC", serif; }
.brand-image-placeholder small { color: #b1aaa0; font-size: 7px; font-weight: 800; letter-spacing: .16em; }
.brand-card-copy { display: flex; flex-direction: column; min-height: 255px; padding: 21px; }
.brand-card-copy > span { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.brand-card-copy h2 { margin: 9px 0 0; font: 500 25px Georgia, "Songti SC", serif; }
.brand-card-copy > p { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.brand-card-copy > div { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 15px; }
.brand-card-copy > div small, .brand-tags span { padding: 5px 7px; color: #726d66; background: #efebe4; border-radius: 999px; font-size: 7px; }
.brand-card-copy b { margin-top: auto; padding-top: 16px; color: var(--accent); border-top: 1px solid var(--line); font-size: 9px; }
.brand-detail-hero { display: grid; grid-template-columns: minmax(320px, .9fr) minmax(0, 1.1fr); align-items: stretch; gap: 34px; padding: 6px 0 34px; }
.brand-detail-visual { min-height: 430px; overflow: hidden; border-radius: 17px; background: #e9e5de; }
.brand-hero-image { display: block; width: 100%; height: 100%; min-height: 430px; object-fit: cover; }
.brand-detail-copy { align-self: center; }
.brand-detail-copy > p:not(.eyebrow) { max-width: 590px; margin: 17px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.brand-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.brand-ai-button { display: inline-flex; align-items: center; gap: 9px; margin-top: 28px; padding: 12px 14px; color: #8d877f; background: #e7e3dc; border: 0; border-radius: 9px; font-size: 10px; font-weight: 750; }
.brand-ai-button > span { color: var(--accent); }
.brand-ai-button small { padding-left: 8px; color: #aba59c; border-left: 1px solid #cfc9c0; font-size: 7px; }
.brand-source-banner { margin-top: 2px; }
.brand-profile-section, .brand-collection-section, .brand-products-section, .brand-more-section { padding: 50px 0; border-bottom: 1px solid var(--line); }
.brand-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.brand-info-card { min-height: 160px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.brand-info-card span { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.brand-info-card p { margin: 14px 0 0; color: #55514b; font-size: 11px; line-height: 1.8; }
.brand-collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.brand-collection-grid article { min-height: 165px; padding: 21px; color: white; background: var(--ink); border-radius: 12px; }
.brand-collection-grid article.pending { color: var(--ink); background: #e9e5dd; }
.brand-collection-grid span { color: #d3aaa8; font: 800 8px Arial, sans-serif; letter-spacing: .12em; }
.brand-collection-grid .pending span { color: var(--accent); }
.brand-collection-grid h3 { margin: 19px 0 0; font: 500 19px Georgia, "Songti SC", serif; }
.brand-collection-grid p { margin: 9px 0 0; color: #bbb7af; font-size: 10px; line-height: 1.7; }
.brand-collection-grid .pending p { color: var(--muted); }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.product-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.product-card > img { display: block; width: 100%; height: 245px; object-fit: cover; background: #eeeae3; }
.product-card-body { padding: 19px; }
.product-card h3 { margin: 0 0 17px; font: 500 19px/1.35 Georgia, "Songti SC", serif; }
.product-card dl { display: grid; gap: 11px; margin: 0; }
.product-card dl > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 9px; padding-top: 10px; border-top: 1px solid var(--line); }
.product-card dt { color: var(--soft); font-size: 8px; font-weight: 750; }
.product-card dd { margin: 0; color: #57534d; font-size: 9px; line-height: 1.65; }
.source-missing { color: #a69f96; }
.product-source { display: block; margin-top: 17px; padding-top: 12px; color: var(--soft); border-top: 1px solid var(--line); font-size: 7px; line-height: 1.6; }
.brand-empty-state { padding: 48px 28px; text-align: center; background: #eae6df; border-radius: 13px; }
.brand-empty-state > span { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.brand-empty-state h3 { margin: 13px 0 0; font: 500 21px Georgia, "Songti SC", serif; }
.brand-empty-state p { max-width: 630px; margin: 10px auto 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.brand-more-section { border-bottom: 0; }
.brand-more-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.brand-more-links a { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 17px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.brand-more-links span { grid-column: 1 / -1; color: var(--soft); font-size: 7px; }
.brand-more-links strong { font: 500 15px Georgia, "Songti SC", serif; }
.brand-more-links b { color: var(--accent); font-weight: 400; }
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .primary-nav { grid-template-columns: repeat(6, 1fr); margin-top: 17px; }
  .primary-nav a { justify-content: center; padding: 0 8px; font-size: 11px; }
  .primary-nav a span, .sidebar-foot { display: none; }
  .assistant-workspace, .page-workspace { width: min(100% - 32px, 720px); padding-top: 28px; }
  .assistant-intro { padding: 60px 0; }
  .feedback-layout { grid-template-columns: 1fr; }
  .page-header { display: block; }
  .page-header p { margin-top: 12px; }
  .course-grid { grid-template-columns: 1fr; }
  .sop-workspace { width: min(100% - 32px, 720px); }
  .future-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-hero { grid-template-columns: 1fr; }
  .role-switcher { width: min(240px, 100%); }
  .sop-section { grid-template-columns: 1fr; gap: 10px; }
  .section-index { display: none; }
  .daily-task-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-workspace { width: min(100% - 32px, 720px); }
  .brand-workspace { width: min(100% - 32px, 720px); }
  .brand-grid, .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-detail-hero { grid-template-columns: 1fr; }
  .brand-detail-visual { min-height: 360px; }
  .brand-hero-image { min-height: 360px; }
  .brand-more-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-role-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-filters { grid-template-columns: 1fr 1fr; }
  .home-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-module-card, .home-module-card.featured { grid-column: span 1; }
  .home-module-card.featured { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .primary-nav { grid-template-columns: repeat(3, 1fr); }
  .primary-nav a { min-height: 40px; font-size: 10px; }
  .wordmark { justify-content: center; }
  .topbar .status-dot { display: none; }
  .ai-message { padding: 20px; }
  .answer-meta { align-items: flex-start; flex-direction: column; }
  .task-head { grid-template-columns: 30px 1fr; }
  .complete-button { grid-column: 2; justify-self: start; }
  .course-meta, .course-grid, .training-risk, .course-source { margin-left: 0; }
  .progress-card { grid-template-columns: 1fr 1fr; }
  .progress-track { grid-column: 1 / -1; grid-row: 2; }
  .sop-hero { align-items: flex-start; flex-direction: column; }
  .sop-intro-card { padding: 28px 24px; }
  .role-grid.current, .future-grid, .overview-grid, .standard-grid, .deliverable-list { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .daily-task-strip { grid-template-columns: 1fr; }
  .sop-phase summary { grid-template-columns: 32px minmax(0, 1fr) 16px; }
  .sop-phase summary small { display: none; }
  .phase-content { padding-left: 20px; }
  .kpi-hero { align-items: flex-start; flex-direction: column; }
  .framework-status { width: 170px; }
  .kpi-role-grid, .kpi-cycle-grid { grid-template-columns: 1fr; }
  .kpi-filters { grid-template-columns: 1fr; }
  .kpi-board-head { align-items: flex-start; flex-direction: column; }
  .internal-home { width: min(100% - 32px, 520px); padding-top: 20px; }
  .home-topbar > div > small { display: none; }
  .home-hero { padding: 66px 0 42px; }
  .home-module-grid { grid-template-columns: 1fr; }
  .home-module-card, .home-module-card.featured { grid-column: 1; min-height: 230px; }
  .home-footer { flex-direction: column; }
  .brand-list-hero, .brand-toolbar { align-items: flex-start; flex-direction: column; }
  .brand-grid, .brand-info-grid, .brand-collection-grid, .product-grid, .brand-more-links { grid-template-columns: 1fr; }
  .brand-detail-visual, .brand-hero-image { min-height: 310px; }
}
