/* =====================================================================
   Human Review — Design System
   Minimalist, white background, generous spacing, desktop-first.
   ===================================================================== */

:root {
    --brand-primary: #111827;
    --brand-accent: #2563EB;
    --accent-1: #6D5DFB;
    --accent-2: #C13FE0;
    --accent-gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    --color-bg: #FFFFFF;
    --color-surface: #F9FAFB;
    --color-border: #E5E7EB;
    --color-text: #111827;
    --color-text-muted: #6B7280;
    --color-success: #059669;
    --color-success-bg: #ECFDF5;
    --color-danger: #DC2626;
    --color-danger-bg: #FEF2F2;
    --color-warning: #D97706;
    --color-warning-bg: #FFFBEB;
    --color-info: #2563EB;
    --color-info-bg: #EFF6FF;
    --radius: 14px;
    --radius-sm: 10px;
    --spacing-unit: 8px;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    font-size: 15px;
}

a { color: var(--accent-1); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.01em; color: var(--brand-primary); margin: 0 0 16px; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 16px; }

/* ---------------------------------------------------------------
   Layout
   --------------------------------------------------------------- */
.topnav { border-bottom: 1px solid var(--color-border); background: var(--color-bg); position: sticky; top: 0; z-index: 50; }
.topnav-inner { max-width: 1200px; margin: 0 auto; padding: 14px 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: 0.01em; color: var(--brand-primary); }
.brand-logo { height: 32px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-gradient); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex-shrink: 0; }
.topnav-user { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* Sub-nav: a distinct strip below the main bar, holding all section
   links as scrollable tabs — keeps the top row clean regardless of
   how many modules exist, and scales to more modules without redesign. */
.topnav-subnav { border-top: 1px solid var(--color-border); background: var(--color-surface); }
.topnav-subnav-inner { max-width: 1200px; margin: 0 auto; padding: 0 32px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; }
.topnav-subnav-inner::-webkit-scrollbar { height: 4px; }
.topnav-subnav-inner a { display: flex; align-items: center; gap: 6px; padding: 11px 14px; font-size: 13px; font-weight: 600; color: var(--color-text-muted); white-space: nowrap; border-bottom: 2px solid transparent; flex-shrink: 0; }
.topnav-subnav-inner a:hover { color: var(--brand-primary); text-decoration: none; }
.topnav-subnav-inner a.is-active { color: var(--accent-1); border-bottom-color: var(--accent-1); }

@media (max-width: 640px) {
    .topnav-inner { padding: 12px 16px; gap: 12px; }
    .topnav-subnav-inner { padding: 0 16px; }
    .user-name { display: none; }
}

.lang-toggle { display: flex; align-items: center; border: 1px solid var(--color-border); border-radius: 999px; overflow: hidden; font-size: 12px; font-weight: 700; }
.lang-toggle a { padding: 6px 12px; color: var(--color-text-muted); text-decoration: none; }
.lang-toggle a.is-active { background: var(--accent-1); color: #fff; }
.lang-toggle a:hover:not(.is-active) { background: var(--color-surface); }
.credits-badge { display: flex; align-items: center; gap: 5px; background: #F1EEFF; color: var(--accent-1); font-weight: 700; font-size: 13px; padding: 5px 12px; border-radius: 999px; text-decoration: none; }
.credits-badge:hover { background: #E5E0FF; text-decoration: none; }
.credits-badge svg { width: 15px; height: 15px; }
.earn-credits-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--color-border); font-size: 13px; }
.dashboard-card-cost { margin: 6px 0 0; font-size: 12px; font-weight: 700; color: var(--accent-1); }

.new-upload-dropdown { position: relative; }
.new-upload-menu { display: none; position: absolute; top: calc(100% + 8px); right: 0; width: 280px; background: #fff; border: 1px solid var(--color-border); border-radius: 12px; box-shadow: 0 20px 40px -16px rgba(17,24,39,0.25); overflow: hidden; z-index: 40; }
.new-upload-menu.is-open { display: block; }
.new-upload-menu a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--color-border); text-decoration: none; }
.new-upload-menu a:last-child { border-bottom: none; }
.new-upload-menu a:hover { background: var(--color-surface); text-decoration: none; }
.new-upload-menu-title { font-size: 14px; font-weight: 700; color: var(--color-text); }
.new-upload-menu-desc { font-size: 12px; color: var(--color-text-muted); }
@media (max-width: 600px) {
    .new-upload-menu { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; border-radius: 16px 16px 0 0; box-shadow: 0 -12px 32px -8px rgba(17,24,39,0.25); }
    .new-upload-menu a { padding: 16px; }
}

.review-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 8px; }
.review-type-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px; border: 2px solid var(--color-border); border-radius: var(--radius-sm); cursor: pointer; background: var(--color-bg); text-align: left; }
.review-type-card:hover { border-color: var(--accent-1); }
.review-type-card.is-selected { border-color: var(--accent-1); background: #F1EEFF; }
.review-type-radio { position: absolute; opacity: 0; pointer-events: none; }
.review-type-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--color-surface); display: flex; align-items: center; justify-content: center; color: var(--accent-1); margin-bottom: 4px; }
.review-type-icon svg { width: 18px; height: 18px; }
.review-type-name { font-weight: 700; font-size: 14px; color: var(--brand-primary); }
.review-type-tagline { font-size: 12px; font-weight: 600; color: var(--accent-1); }
.review-type-desc { font-size: 12px; color: var(--color-text-muted); line-height: 1.4; }
.review-type-cost { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 12px; font-weight: 800; color: #92400E; background: #FEF3C7; border: 1px solid #FDE68A; padding: 4px 11px; border-radius: 999px; }
.review-type-cost svg { width: 13px; height: 13px; flex-shrink: 0; color: #D97706; }
@media (max-width: 700px) { .review-type-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------
   Revision Engine
   --------------------------------------------------------------- */
.revision-checkbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 16px; }
@media (max-width: 500px) { .revision-checkbox-grid { grid-template-columns: 1fr; } }
.revision-checkbox-item { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 0; cursor: pointer; }
.revision-checkbox-item input { width: auto; margin: 0; }

.revision-confidence-card { border-left: 5px solid var(--color-border); }
.revision-confidence-card.confidence-high { border-left-color: var(--color-success); background: var(--color-success-bg); }
.revision-confidence-card.confidence-medium { border-left-color: #D97706; background: #FFFBEB; }
.revision-confidence-card.confidence-low { border-left-color: var(--color-danger); background: var(--color-danger-bg); }
.revision-confidence-card.confidence-high h3, .revision-confidence-card.confidence-high div { color: var(--color-success); }
.revision-confidence-card.confidence-medium h3, .revision-confidence-card.confidence-medium div { color: #B45309; }
.revision-confidence-card.confidence-low h3, .revision-confidence-card.confidence-low div { color: var(--color-danger); }

.score-evolution-row { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 4px; }
.score-evolution-point { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.score-evolution-dot { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--color-surface); border: 2px solid var(--color-border); font-weight: 700; font-size: 14px; color: var(--color-text); text-decoration: none; }
.score-evolution-point.is-current .score-evolution-dot { border-color: var(--accent-1); background: #F1EEFF; color: var(--accent-1); }
.score-evolution-dot:hover { border-color: var(--accent-1); text-decoration: none; }
.score-evolution-date { font-size: 11px; color: var(--color-text-muted); white-space: nowrap; }
.score-evolution-link { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 12px; min-width: 60px; }
.score-evolution-arrow { color: var(--color-text-muted); font-size: 18px; }

.testimonial-star-picker { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.testimonial-star-picker input { position: absolute; opacity: 0; width: 0; height: 0; }
.testimonial-star-picker label { font-size: 28px; line-height: 1; color: var(--color-border); cursor: pointer; transition: color 0.1s ease; }
.testimonial-star-picker input:checked ~ label,
.testimonial-star-picker label:hover,
.testimonial-star-picker label:hover ~ label { color: #F59E0B; }

/* ---------------------------------------------------------------
   Authenticity Analysis
   --------------------------------------------------------------- */
.authenticity-metric { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.authenticity-metric-label { font-size: 12px; font-weight: 700; letter-spacing: 0.03em; color: var(--color-text-muted); text-transform: uppercase; }
.authenticity-metric-value { font-size: 32px; font-weight: 800; color: var(--brand-primary); }

.evidence-explorer-canvas { position: relative; display: inline-block; max-width: 100%; border-radius: 8px; overflow: hidden; }
.evidence-explorer-canvas img { display: block; max-width: 100%; height: auto; }
.evidence-marker { position: absolute; border: 2px solid #F59E0B; border-radius: 4px; background: rgba(245, 158, 11, 0.12); }
.evidence-marker-number { position: absolute; top: -10px; left: -10px; width: 20px; height: 20px; border-radius: 50%; background: #F59E0B; color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.evidence-legend { margin: 16px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.7; }
.evidence-legend li { margin-bottom: 6px; }

.creation-method-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.creation-method-label { width: 190px; flex-shrink: 0; font-size: 13px; }
.creation-method-bar-track { flex: 1; height: 8px; border-radius: 999px; background: var(--color-surface); overflow: hidden; }
.creation-method-bar-fill { height: 100%; border-radius: 999px; background: var(--accent-1); }
.creation-method-pct { width: 40px; text-align: right; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.user-name { color: var(--color-text-muted); font-size: 14px; }

.page-container { max-width: 1200px; margin: 0 auto; padding: 40px 32px; min-height: 70vh; }
.page-container-narrow { max-width: 560px; margin: 0 auto; padding: 64px 32px; }
.page-container-medium { max-width: 820px; margin: 0 auto; padding: 64px 32px; }

.site-footer { border-top: 1px solid var(--color-border); margin-top: 64px; }
.site-footer-inner { max-width: 1200px; margin: 0 auto; padding: 24px 32px; display: flex; justify-content: space-between; color: var(--color-text-muted); font-size: 13px; flex-wrap: wrap; gap: 12px; }
.site-footer-credit { text-align: center; padding: 0 32px 20px; color: var(--color-text-muted); font-size: 12px; }
.site-footer-credit a { color: var(--accent-1); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--color-text-muted); }

/* ---------------------------------------------------------------
   Cards & Grid
   --------------------------------------------------------------- */
.card { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px; box-shadow: 0 2px 8px -4px rgba(17,24,39,0.06); }
.grid { display: grid; gap: 24px; }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; } }

.stat-card { padding: 24px; }
.stat-icon { width: 38px; height: 38px; border-radius: 10px; background: #F1EEFF; color: var(--accent-1); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.stat-icon svg { width: 19px; height: 19px; }
.stat-icon-success { background: var(--color-success-bg); color: var(--color-success); }
.stat-icon-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.stat-card .stat-value { font-size: 32px; font-weight: 800; color: var(--brand-primary); }
.stat-card .stat-label { color: var(--color-text-muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px; }

/* ---------------------------------------------------------------
   Forms
   --------------------------------------------------------------- */
label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 6px; color: var(--brand-primary); }
input[type="text"], input[type="email"], input[type="date"], input[type="number"], input[type="password"],
select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 6px;
    font-family: var(--font-sans); font-size: 14px; margin-bottom: 16px; background: var(--color-bg); color: var(--color-text);
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.form-group { margin-bottom: 16px; }
.form-help { font-size: 12px; color: var(--color-text-muted); margin-top: -12px; margin-bottom: 16px; }

.file-upload-field { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.file-upload-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.file-upload-label { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; background: var(--color-surface); color: var(--brand-primary); border: 1px solid var(--color-border); cursor: pointer; margin: 0; }
.file-upload-label:hover { background: #F1EEFF; border-color: var(--accent-1); color: var(--accent-1); }
.file-upload-label svg { width: 16px; height: 16px; }
.file-upload-input:focus-visible + .file-upload-label { outline: 2px solid var(--accent-1); outline-offset: 2px; }
.file-upload-filename { font-size: 13px; color: var(--color-text-muted); }

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */
.btn { display: inline-block; padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 14px; border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent-gradient); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: var(--color-surface); color: var(--brand-primary); border-color: var(--color-border); border-radius: 999px; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-success { background: var(--color-success); color: #fff; }
.btn-warning { background: var(--color-warning); color: #fff; }
.btn-ghost { background: transparent; color: var(--color-text-muted); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------------------------------------------------------------
   Badges / Alerts
   --------------------------------------------------------------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-info { background: var(--color-info-bg); color: var(--color-info); }
.badge-neutral { background: var(--color-surface); color: var(--color-text-muted); }
.badge-ai { background: #F1EEFF; color: var(--accent-1); }

.alert { padding: 14px 16px; border-radius: 6px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: var(--color-success-bg); color: var(--color-success); }
.alert-error { background: var(--color-danger-bg); color: var(--color-danger); }
.alert-info { background: var(--color-info-bg); color: var(--color-info); }

/* ---------------------------------------------------------------
   Tables
   --------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--color-border); font-size: 14px; }
th { color: var(--color-text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: var(--color-surface); }

/* ---------------------------------------------------------------
   Review screen
   --------------------------------------------------------------- */
.review-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 1000px) { .review-layout { grid-template-columns: 1fr; } }

.image-preview-wrap { border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; background: var(--color-surface); }
.image-preview-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--color-border); }
.image-preview-canvas { position: relative; overflow: auto; max-height: 640px; text-align: center; background: #0000000d; }
.image-preview-canvas img { max-width: 100%; transition: transform 0.15s ease; cursor: zoom-in; }
.image-open-original { position: absolute; top: 10px; right: 10px; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(255,255,255,0.92); color: var(--color-text); box-shadow: 0 2px 8px rgba(17,24,39,0.15); }
.image-open-original:hover { background: #fff; color: var(--accent-1); }
.image-open-original svg { width: 16px; height: 16px; }

.criterion-row { border: 1px solid var(--color-border); border-radius: 6px; padding: 16px; margin-bottom: 12px; }
.criterion-row.is-ai-suggested { border-color: #DDD6FE; background: #FAF9FF; }
.criterion-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.criterion-name { font-weight: 600; }
.criterion-ai-note { font-size: 12px; color: #7C3AED; margin-bottom: 8px; }
.criterion-legal { color: var(--color-danger); font-size: 11px; font-weight: 700; text-transform: uppercase; margin-left: 6px; }

input[type="range"] { width: 100%; margin-bottom: 4px; }
.score-value { font-weight: 700; color: var(--brand-accent); float: right; }

.overall-score-box { text-align: center; padding: 24px; }
.overall-score-box .score-big { font-size: 48px; font-weight: 700; color: var(--brand-primary); }

/* ---------------------------------------------------------------
   Report page (client visual report)
   --------------------------------------------------------------- */
.report-status-hero { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.report-status-icon { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.report-status-icon svg { width: 26px; height: 26px; }
.report-status-icon.status-rejected { background: var(--color-danger-bg); color: var(--color-danger); }
.report-status-icon.status-approved { background: var(--color-success-bg); color: var(--color-success); }
.report-status-icon.status-pending { background: var(--color-warning-bg); color: var(--color-warning); }
.report-status-icon.status-waiting { background: var(--color-info-bg); color: var(--color-info); }
.report-status-title { font-size: 22px; font-weight: 800; margin: 0; }
.report-status-title.text-rejected { color: var(--color-danger); }
.report-status-title.text-approved { color: var(--color-success); }
.report-status-title.text-pending { color: var(--color-warning); }
.report-status-title.text-waiting { color: var(--color-info); }
.report-status-sub { color: var(--color-text-muted); font-size: 14px; margin: 2px 0 0; }

.score-card-value { display: flex; align-items: baseline; gap: 4px; margin: 6px 0 4px; }
.score-card-value .score-num { font-size: 40px; font-weight: 800; }
.score-card-value .score-denom { font-size: 15px; color: var(--color-text-muted); font-weight: 600; }
.score-bar-track { height: 8px; border-radius: 999px; background: var(--color-surface); overflow: hidden; margin: 12px 0 8px; }
.score-bar-fill { height: 100%; border-radius: 999px; }

.problem-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-top: 1px solid var(--color-border); }
.problem-row:first-child { border-top: none; }
.problem-icon { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.problem-icon svg { width: 15px; height: 15px; }
.problem-icon.severity-bad { background: var(--color-danger-bg); color: var(--color-danger); }
.problem-icon.severity-warn { background: var(--color-warning-bg); color: var(--color-warning); }
.problem-icon.severity-good { background: var(--color-success-bg); color: var(--color-success); }
.problem-title { font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.problem-desc { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }
.problem-score { font-weight: 700; font-size: 13px; flex-shrink: 0; }
.problem-score.severity-bad { color: var(--color-danger); }
.problem-score.severity-warn { color: var(--color-warning); }
.problem-score.severity-good { color: var(--color-success); }
.show-more-toggle { display: block; width: 100%; text-align: center; background: none; border: none; border-top: 1px solid var(--color-border); padding: 12px 0 0; margin-top: 8px; color: var(--accent-1); font-weight: 700; font-size: 13px; cursor: pointer; }

.next-steps-banner { border-radius: var(--radius-sm); padding: 14px 16px; text-align: center; font-weight: 700; margin-bottom: 16px; }
.next-steps-banner.status-rejected { background: var(--color-danger-bg); color: var(--color-danger); }
.next-steps-banner.status-approved { background: var(--color-success-bg); color: var(--color-success); }
.next-steps-banner.status-pending { background: var(--color-warning-bg); color: var(--color-warning); }
.next-steps-banner .banner-sub { display: block; font-weight: 500; font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }

.recommend-list { list-style: none; padding: 0; margin: 0; }
.recommend-list li { display: flex; gap: 10px; padding: 8px 0; font-size: 14px; }
.recommend-list li svg { width: 16px; height: 16px; color: var(--accent-1); flex-shrink: 0; margin-top: 2px; }

/* ---------------------------------------------------------------
   Prompt Optimizer module
   --------------------------------------------------------------- */
.prompt-history-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--color-text); margin-bottom: 2px; }
.prompt-history-item:hover { background: var(--color-surface); text-decoration: none; }
.prompt-history-item.is-active { background: #F1EEFF; color: var(--accent-1); font-weight: 700; }

.prompt-editor-textarea { width: 100%; min-height: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.6; padding: 14px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); resize: vertical; background: var(--color-surface); }
.prompt-editor-textarea[readonly] { background: var(--color-surface); color: var(--color-text); }
.prompt-editor-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.prompt-copy-feedback { color: var(--color-success); font-size: 13px; margin: 8px 0 0; }

.version-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--color-border); font-size: 13px; flex-wrap: wrap; }
.version-row:first-child { border-top: none; }

.diff-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.8; padding: 14px; background: var(--color-surface); border-radius: var(--radius-sm); border: 1px solid var(--color-border); white-space: pre-wrap; }
.diff-added { background: var(--color-success-bg); color: var(--color-success); text-decoration: none; }
.diff-removed { background: var(--color-danger-bg); color: var(--color-danger); text-decoration: line-through; }

/* ---------------------------------------------------------------
   Multi-Prompt Strategy Engine
   --------------------------------------------------------------- */
.strategy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 960px) { .strategy-grid { grid-template-columns: 1fr; } }

.strategy-card { position: relative; background: var(--color-bg); border: 1px solid var(--color-border); border-left: 5px solid var(--color-border); border-radius: var(--radius); padding: 22px; box-shadow: 0 4px 14px -6px rgba(17,24,39,0.12); }
.strategy-card.is-recommended { border-color: var(--accent-1); box-shadow: 0 14px 28px -12px rgba(109,93,251,0.4); }
.strategy-card.strategy-color-minimal { border-left-color: #6B7280; }
.strategy-card.strategy-color-balanced { border-left-color: var(--accent-1); }
.strategy-card.strategy-color-maximum { border-left-color: #DC2626; }
.strategy-recommended-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent-gradient); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.strategy-meta-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.strategy-score-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 8px 0; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); margin-bottom: 10px; }
.strategy-reason { font-size: 12px; color: var(--accent-1); background: #F1EEFF; padding: 8px 10px; border-radius: 6px; margin-bottom: 10px; }
.strategy-preview { font-size: 12px; color: var(--color-text-muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--color-surface); border: 1px solid var(--color-border); padding: 10px; border-radius: 6px; max-height: 90px; overflow: hidden; margin-bottom: 12px; line-height: 1.5; }
.strategy-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.strategy-editor-wrap { border: 1px solid var(--color-border); border-left: 5px solid var(--color-border); border-radius: var(--radius); margin-bottom: 24px; overflow: hidden; box-shadow: 0 2px 10px -6px rgba(17,24,39,0.1); }
.strategy-editor-wrap.strategy-color-minimal { border-left-color: #6B7280; }
.strategy-editor-wrap.strategy-color-balanced { border-left-color: var(--accent-1); }
.strategy-editor-wrap.strategy-color-maximum { border-left-color: #DC2626; }
.strategy-editor-toggle { display: block; width: 100%; text-align: left; padding: 16px 20px; background: var(--color-surface); border: none; border-bottom: 1px solid var(--color-border); font-weight: 700; cursor: pointer; font-size: 14px; }
.strategy-editor-wrap.is-collapsed .strategy-editor-toggle { border-bottom: none; }
.strategy-editor-toggle:hover { background: #F1EEFF; }
.strategy-editor-body { padding: 20px; }
.strategy-editor-body .prompt-editor { border: none; box-shadow: none; padding: 0; }

/* ---------------------------------------------------------------
   Cookie banner
   --------------------------------------------------------------- */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: var(--brand-primary); color: #fff; z-index: 100; }
.cookie-banner-inner { max-width: 1000px; margin: 0 auto; padding: 20px 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cookie-banner-inner p { margin: 0; font-size: 13px; color: #D1D5DB; }
.cookie-banner-inner a { color: #fff; text-decoration: underline; }
.cookie-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-customize-panel { max-width: 1000px; margin: 0 auto; padding: 0 32px 20px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.cookie-customize-panel label { color: #D1D5DB; font-weight: 400; display: flex; align-items: center; gap: 6px; margin: 0; }

/* ---------------------------------------------------------------
   Misc
   --------------------------------------------------------------- */
.text-muted { color: var(--color-text-muted); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.gap-8 { gap: 8px; } .gap-16 { gap: 16px; }

@media print {
    .topnav, .site-footer, .cookie-banner, .no-print { display: none !important; }
    body { font-size: 12px; }
}

/* ---------------------------------------------------------------
   Submit loader overlay
   --------------------------------------------------------------- */
.hr-loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
}
.hr-loader-overlay.is-active { display: flex; }
.hr-loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-border);
    border-top-color: var(--brand-accent);
    border-radius: 50%;
    animation: hr-spin 0.8s linear infinite;
}
.hr-loader-text {
    font-size: 15px;
    color: var(--brand-primary);
    font-weight: 600;
}
.hr-loader-subtext {
    font-size: 13px;
    color: var(--color-text-muted);
    max-width: 320px;
    text-align: center;
}
@keyframes hr-spin {
    to { transform: rotate(360deg); }
}
