:root {
  --roots-ink: #221f1b;
  --roots-muted: #716a60;
  --roots-paper: #f7f5f0;
  --roots-line: #d9d3c8;
  --roots-red: #9d2b24;
  --roots-red-dark: #741d19;
  --roots-gold: #a67a31;
  --roots-blue: #315f72;
  --roots-white: #fff;
}

.roots-page { background: #eeece7; color: var(--roots-ink); }
.roots-page .content-main { padding-top: 0; }
.roots-hero { background: #262522; color: #fff; border-bottom: 4px solid var(--roots-red); }
.roots-hero-inner { min-height: 310px; display: grid; grid-template-columns: minmax(0, 1fr) 180px; align-items: center; gap: 60px; padding-top: 64px; padding-bottom: 56px; }
.roots-hero h1 { max-width: 760px; margin: 8px 0 18px; font-family: ui-serif, "Songti SC", STSong, serif; font-size: clamp(38px, 5vw, 64px); line-height: 1.12; font-weight: 700; letter-spacing: 0; }
.roots-hero p:not(.content-kicker) { max-width: 780px; margin: 0; color: #d7d3cb; font-size: 19px; line-height: 1.9; }
.roots-hero .content-kicker { color: #d5b16d; }
.roots-hero-seal { width: 152px; height: 176px; justify-self: end; border: 1px solid #ae8b4f; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; }
.roots-hero-seal::before, .roots-hero-seal::after { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(213,177,109,.38); }
.roots-hero-seal::after { inset: 16px; }
.roots-hero-seal span { font-family: ui-serif, "Songti SC", STSong, serif; font-size: 68px; line-height: 1; color: #d5b16d; }
.roots-hero-seal small { margin-top: 14px; font-size: 13px; color: #e9e3d8; }

.roots-loading { min-height: 260px; display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--roots-muted); font-size: 17px; }
.roots-loading-mark { width: 28px; height: 28px; border: 2px solid var(--roots-line); border-top-color: var(--roots-red); border-radius: 50%; animation: roots-spin .75s linear infinite; }
@keyframes roots-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .roots-loading-mark { animation: none; border-color: var(--roots-red); } }

.roots-login { margin-top: 28px; margin-bottom: 72px; min-height: 220px; padding: 42px 48px; background: var(--roots-white); border-top: 3px solid var(--roots-red); display: flex; justify-content: space-between; align-items: center; gap: 40px; box-shadow: 0 10px 32px rgba(48,42,34,.07); }
.roots-login h2 { margin: 4px 0 12px; font-family: ui-serif, "Songti SC", STSong, serif; font-size: 32px; }
.roots-login p:not(.content-kicker) { max-width: 720px; margin: 0; color: var(--roots-muted); font-size: 17px; line-height: 1.8; }

.roots-workspace { padding-bottom: 80px; }
.roots-workspace-head { margin-top: 26px; min-height: 118px; padding: 24px 30px; background: var(--roots-white); border-left: 5px solid var(--roots-red); display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.roots-workspace-head h2 { margin: 2px 0 5px; font-family: ui-serif, "Songti SC", STSong, serif; font-size: 30px; }
.roots-workspace-head p { margin: 0; color: var(--roots-muted); font-size: 16px; }
.roots-overline { color: var(--roots-red) !important; font-weight: 700; }
.roots-completeness { width: 116px; height: 70px; flex: 0 0 auto; border-left: 1px solid var(--roots-line); display: flex; flex-direction: column; justify-content: center; align-items: flex-end; }
.roots-completeness strong { color: var(--roots-red); font-size: 27px; }
.roots-completeness span { color: var(--roots-muted); font-size: 13px; }

.roots-evidence-chain { margin: 0; padding: 0 28px; min-height: 108px; list-style: none; background: #302f2c; color: #fff; display: grid; grid-template-columns: repeat(4, 1fr); }
.roots-evidence-chain li { min-width: 0; padding: 22px 16px; position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 11px; align-content: center; }
.roots-evidence-chain li:not(:last-child)::after { content: ""; width: 34px; height: 1px; position: absolute; top: 50%; right: -17px; background: #77736c; }
.roots-evidence-chain li > span { grid-row: 1 / 3; width: 30px; height: 30px; border: 1px solid #9c978e; border-radius: 50%; display: grid; place-items: center; color: #d5b16d; font-size: 13px; }
.roots-evidence-chain strong { font-size: 16px; }
.roots-evidence-chain small { margin-top: 4px; color: #aaa69f; font-size: 13px; }
.roots-evidence-chain li.complete > span { background: var(--roots-red); border-color: var(--roots-red); color: #fff; }
.roots-evidence-chain li.active strong { color: #e4bd76; }

.roots-workspace-grid { display: grid; grid-template-columns: minmax(520px, .95fr) minmax(480px, 1.05fr); align-items: start; gap: 20px; margin-top: 20px; }
.roots-dossier, .roots-results { min-width: 0; background: var(--roots-white); border: 1px solid var(--roots-line); }
.roots-dossier { padding: 28px; }
.roots-results { min-height: 720px; padding: 28px; position: sticky; top: 92px; }
.roots-section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--roots-line); }
.roots-section-heading p { margin: 0 0 3px; color: var(--roots-red); font-size: 13px; font-weight: 700; }
.roots-section-heading h3 { margin: 0; font-family: ui-serif, "Songti SC", STSong, serif; font-size: 25px; }
.roots-text-button { min-height: 40px; padding: 6px 0; border: 0; background: transparent; color: var(--roots-blue); font: inherit; font-weight: 700; cursor: pointer; }
.roots-text-button:hover { text-decoration: underline; }
.roots-form-note { margin: 15px 0 0; padding: 11px 14px; background: #f0f5f6; border-left: 3px solid var(--roots-blue); color: #48616a; font-size: 14px; line-height: 1.6; }

.roots-dossier fieldset { min-width: 0; margin: 26px 0 0; padding: 0; border: 0; }
.roots-dossier legend, .roots-legend-row { width: 100%; margin-bottom: 13px; padding: 0; font-size: 18px; font-weight: 750; }
.roots-legend-row { display: flex; align-items: center; justify-content: space-between; }
.roots-legend-row legend { width: auto; margin: 0; }
.roots-fields { display: grid; gap: 15px; }
.roots-fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.roots-fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.roots-fields label { min-width: 0; display: grid; gap: 7px; color: #4d4943; font-size: 15px; font-weight: 650; }
.roots-fields label > span { min-height: 23px; }
.roots-fields label em { padding: 2px 5px; background: #ece9e2; color: #7a7368; font-size: 11px; font-style: normal; font-weight: 500; }
.roots-span-2 { grid-column: span 2; }
.roots-fields input, .roots-fields textarea, .roots-evidence-row input, .roots-evidence-row select, .roots-review-controls select, .roots-review-controls textarea { width: 100%; min-width: 0; border: 1px solid #cfc9bd; border-radius: 3px; background: #fff; color: var(--roots-ink); font: inherit; font-size: 16px; }
.roots-fields input, .roots-evidence-row input, .roots-evidence-row select, .roots-review-controls select { height: 46px; padding: 0 12px; }
.roots-fields textarea, .roots-review-controls textarea { padding: 10px 12px; line-height: 1.6; resize: vertical; }
.roots-fields input:focus, .roots-fields textarea:focus, .roots-evidence-row input:focus, .roots-evidence-row select:focus, .roots-review-controls select:focus, .roots-review-controls textarea:focus { outline: 3px solid rgba(49,95,114,.17); border-color: var(--roots-blue); }
.roots-field-help { margin: -3px 0 12px; color: var(--roots-muted); font-size: 13px; line-height: 1.6; }

.roots-owned-evidence { display: grid; gap: 10px; }
.roots-evidence-row { display: grid; grid-template-columns: 110px minmax(120px, .7fr) minmax(160px, 1fr) 36px; gap: 8px; align-items: center; }
.roots-icon-button { width: 36px; height: 36px; padding: 0; border: 0; background: transparent; color: #796f65; font-size: 25px; cursor: pointer; }
.roots-icon-button:hover { color: var(--roots-red); }
.roots-form-status { min-height: 24px; margin: 18px 0 0; color: var(--roots-muted); font-size: 14px; }
.roots-form-status.error { color: var(--roots-red-dark); }
.roots-form-status.success { color: #2b6c4e; }
.roots-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.roots-result-total { text-align: right; }
.roots-result-total strong { display: block; color: var(--roots-red); font-size: 25px; line-height: 1; }
.roots-result-total span { color: var(--roots-muted); font-size: 12px; }
.roots-result-summary { min-height: 62px; display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; border: 1px solid var(--roots-line); }
.roots-result-summary span { padding: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--roots-muted); font-size: 12px; }
.roots-result-summary span:not(:last-child) { border-right: 1px solid var(--roots-line); }
.roots-result-summary strong { color: var(--roots-ink); font-size: 20px; }
.roots-filter-bar { margin: 16px 0; display: flex; gap: 6px; overflow-x: auto; }
.roots-filter-bar button { min-height: 38px; padding: 0 13px; border: 1px solid var(--roots-line); background: #fff; color: #5a554d; font: inherit; font-size: 14px; white-space: nowrap; cursor: pointer; }
.roots-filter-bar button.active { border-color: var(--roots-red); background: var(--roots-red); color: #fff; }
.roots-result-list { display: grid; gap: 12px; }
.roots-empty { min-height: 390px; padding: 50px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px dashed #c9c2b6; background: var(--roots-paper); }
.roots-empty > span { width: 74px; height: 86px; margin-bottom: 20px; border: 1px solid #b98c50; display: grid; place-items: center; font-family: ui-serif, "Songti SC", STSong, serif; font-size: 38px; color: var(--roots-gold); }
.roots-empty h4 { margin: 0 0 8px; font-size: 20px; }
.roots-empty p { max-width: 380px; margin: 0; color: var(--roots-muted); font-size: 15px; line-height: 1.7; }

.roots-candidate { border: 1px solid var(--roots-line); border-left: 4px solid #9a9388; background: #fff; }
.roots-candidate[data-confidence="high"] { border-left-color: var(--roots-red); }
.roots-candidate[data-confidence="medium"] { border-left-color: var(--roots-gold); }
.roots-candidate.reviewed { background: #fcfbf7; }
.roots-candidate-main { padding: 18px; }
.roots-candidate-top { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 14px; }
.roots-score { width: 58px; height: 58px; border: 1px solid var(--roots-line); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.roots-score strong { color: var(--roots-red); font-size: 21px; line-height: 1; }
.roots-score span { margin-top: 3px; color: var(--roots-muted); font-size: 10px; }
.roots-candidate h4 { margin: 0 0 4px; font-size: 19px; line-height: 1.35; }
.roots-candidate-subtitle { margin: 0; color: var(--roots-muted); font-size: 13px; line-height: 1.55; }
.roots-match-evidence { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.roots-match-evidence span { padding: 4px 7px; background: #f1eee8; color: #534c42; font-size: 12px; }
.roots-candidate-excerpt { margin: 13px 0 0; color: #5f5a52; font-size: 14px; line-height: 1.65; }
.roots-candidate-source { margin: 13px 0 0; color: #7d756b; font-size: 12px; }
.roots-candidate-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.roots-candidate-actions a, .roots-review-toggle { min-height: 38px; padding: 0 12px; border: 1px solid #bcb4a7; background: #fff; color: #35322e; font: inherit; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; text-decoration: none; cursor: pointer; }
.roots-candidate-actions a:first-child { border-color: var(--roots-blue); color: var(--roots-blue); }
.roots-review-controls { padding: 16px 18px; border-top: 1px solid var(--roots-line); background: var(--roots-paper); display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.roots-review-controls textarea { min-height: 46px; height: 46px; }
.roots-review-controls button { min-height: 46px; padding: 0 14px; border: 0; background: var(--roots-red); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.roots-review-controls button:hover { background: var(--roots-red-dark); }
.roots-decision { margin-top: 10px; color: var(--roots-blue); font-size: 13px; font-weight: 700; }
.roots-public-method { border-top: 1px solid var(--roots-line); }

@media (max-width: 1120px) {
  .roots-workspace-grid { grid-template-columns: 1fr; }
  .roots-results { position: static; min-height: 560px; }
}

@media (max-width: 760px) {
  .roots-hero-inner { min-height: 290px; grid-template-columns: 1fr; gap: 22px; padding-top: 42px; padding-bottom: 40px; }
  .roots-hero h1 { font-size: 38px; }
  .roots-hero p:not(.content-kicker) { font-size: 17px; line-height: 1.75; }
  .roots-hero-seal { display: none; }
  .roots-login { padding: 30px 22px; flex-direction: column; align-items: stretch; }
  .roots-workspace { padding-left: 12px; padding-right: 12px; }
  .roots-workspace-head { padding: 20px; }
  .roots-workspace-head h2 { font-size: 25px; }
  .roots-completeness { width: 88px; }
  .roots-evidence-chain { grid-template-columns: repeat(4, minmax(82px, 1fr)); padding: 0; overflow-x: auto; }
  .roots-evidence-chain li { min-width: 108px; padding: 17px 10px; grid-template-columns: 28px minmax(0, 1fr); }
  .roots-evidence-chain small { display: none; }
  .roots-evidence-chain li:not(:last-child)::after { display: none; }
  .roots-dossier, .roots-results { padding: 20px 16px; }
  .roots-fields-3, .roots-fields-2 { grid-template-columns: 1fr; }
  .roots-span-2 { grid-column: auto; }
  .roots-evidence-row { grid-template-columns: 100px minmax(0, 1fr) 36px; }
  .roots-evidence-row input[name="evidenceUrl"] { grid-column: 1 / 3; }
  .roots-evidence-row .roots-icon-button { grid-column: 3; grid-row: 1; }
  .roots-form-actions { flex-direction: column-reverse; }
  .roots-form-actions .content-button { width: 100%; justify-content: center; }
  .roots-review-controls { grid-template-columns: 1fr; }
  .roots-review-controls textarea { height: 70px; }
}
