:root {
  --ink: #172033;
  --muted: #687187;
  --line: #e2e7f0;
  --panel: #ffffff;
  --bg: #f5f7fb;
  --blue: #2858d8;
  --blue-dark: #1d3fa2;
  --blue-soft: #eaf0ff;
  --green: #16835f;
  --green-soft: #e6f6ef;
  --amber: #a76608;
  --amber-soft: #fff3d8;
  --red: #b63c42;
  --red-soft: #ffebed;
  --shadow: 0 18px 55px rgba(34, 50, 84, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: inherit; }
.site-header { height: 76px; padding: 0 max(24px, calc((100vw - 1180px)/2)); display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #3468f0, #16398d); font-weight: 800; box-shadow: 0 9px 22px rgba(40,88,216,.25); }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.header-note { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.logout-form { display: inline; }
.logout-form button { padding: 0; border: 0; color: var(--blue); background: transparent; font: inherit; font-weight: 750; cursor: pointer; }
.page-shell { max-width: 1180px; margin: 0 auto; padding: 56px 24px 80px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 48px; align-items: end; margin-bottom: 46px; }
.eyebrow { display: inline-block; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 12px 0 16px; font-size: clamp(35px, 5vw, 58px); line-height: 1.06; letter-spacing: -.045em; }
h2 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: -.025em; }
.lead { max-width: 780px; color: var(--muted); font-size: 18px; }
.feature-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.feature-row span { padding: 8px 11px; border: 1px solid #dbe3f4; border-radius: 999px; background: #fff; color: #4e5a72; font-size: 12px; font-weight: 700; }
.profile-card, .upload-card, .process-card, .recent-section, .review-section, .changes-section { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.profile-card { padding: 26px; background: linear-gradient(160deg, #172347, #253b79); color: #fff; border: 0; }
.profile-card__head { display: flex; align-items: center; gap: 8px; color: #cdd8f8; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #6ee7b7; box-shadow: 0 0 0 5px rgba(110,231,183,.11); }
.profile-card h2 { margin-top: 18px; }
.profile-card p { color: #cbd5ef; font-size: 14px; }
.profile-stats { margin: 22px 0 0; }
.profile-stats div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.12); }
.profile-stats dt { color: #b8c5e5; font-size: 12px; }
.profile-stats dd { margin: 0; font-size: 13px; font-weight: 750; text-align: right; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 24px; }
.upload-card, .process-card { padding: 30px; }
.section-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 26px; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.section-heading--compact { margin: 0 0 22px; }
.step-number { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-weight: 800; font-size: 12px; }
.field-block { display: block; margin: 18px 0; }
.field-block > span { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 750; }
.field-block input, .field-block select { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #cfd7e6; border-radius: 11px; color: var(--ink); background: #fff; font: inherit; outline: none; transition: border .15s, box-shadow .15s; }
.field-block input:focus, .field-block select:focus { border-color: #6c8de8; box-shadow: 0 0 0 4px rgba(40,88,216,.1); }
.field-block small, .file-drop small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.field-error { display: block; margin-top: 7px; color: var(--red); font-size: 12px; }
.file-drop { min-height: 132px; padding: 24px; display: grid; place-items: center; text-align: center; border: 1.5px dashed #aebbd4; border-radius: 15px; background: #f9fbff; cursor: pointer; transition: background .15s, border .15s; }
.file-drop:hover { background: #f1f5ff; border-color: #7896e6; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop__icon { padding: 5px 8px; margin-bottom: 8px; border-radius: 6px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.button { min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 11px; font: inherit; font-size: 13px; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button--primary { color: #fff; background: var(--blue); box-shadow: 0 8px 20px rgba(40,88,216,.2); }
.button--primary:hover { background: var(--blue-dark); }
.button--ghost { color: var(--blue); border-color: #cbd7f6; background: #fff; }
.button--wide { width: 100%; margin-top: 8px; }
.button-loading { display: none; }
.button.is-loading .button-label { display: none; }
.button.is-loading .button-loading { display: inline; }
.process-list { margin: 0; padding: 0; list-style: none; counter-reset: steps; }
.process-list li { position: relative; padding: 0 0 24px 44px; counter-increment: steps; }
.process-list li::before { content: counter(steps); position: absolute; left: 0; top: 0; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 900; }
.process-list li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 31px; bottom: 3px; width: 1px; background: var(--line); }
.process-list strong, .process-list span { display: block; }
.process-list strong { font-size: 14px; }
.process-list span { color: var(--muted); font-size: 13px; }
.recent-section { margin-top: 24px; padding: 28px 30px; }
.job-list { display: grid; gap: 8px; }
.job-row { display: flex; align-items: center; gap: 13px; padding: 13px; border-radius: 13px; text-decoration: none; transition: background .15s; }
.job-row:hover { background: #f6f8fc; }
.file-chip { width: 44px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: #edf1f8; color: #536079; font-size: 10px; font-weight: 900; }
.job-row__main { min-width: 0; flex: 1; }
.job-row__main strong, .job-row__main small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.job-row__main small { color: var(--muted); font-size: 12px; }
.row-arrow { color: #8a95aa; }
.status-badge { display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 999px; color: #4e5c73; background: #edf1f6; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-badge--ready, .status-badge--done { color: var(--green); background: var(--green-soft); }
.status-badge--failed { color: var(--red); background: var(--red-soft); }
.status-badge--processing, .status-badge--analyzing, .status-badge--planning, .status-badge--interrupted { color: var(--amber); background: var(--amber-soft); }
.status-badge--planned { color: var(--green); background: var(--green-soft); }
.status-badge--large { padding: 9px 13px; font-size: 12px; }
.breadcrumbs { display: flex; gap: 9px; color: var(--muted); font-size: 12px; }
.breadcrumbs a { color: var(--blue); text-decoration: none; }
.job-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 30px 0 28px; }
.job-header h1 { max-width: 800px; margin: 7px 0; font-size: clamp(30px, 4vw, 46px); overflow-wrap: anywhere; }
.job-header p { margin: 0; color: var(--muted); }
.job-header__actions { display: flex; align-items: center; gap: 10px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.metric { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.metric span, .metric small, .metric strong { display: block; }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { margin: 5px 0; font-size: 30px; line-height: 1; }
.metric small { color: #929caf; font-size: 11px; }
.review-section, .changes-section { padding: 30px; }
.review-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.review-toolbar h2 { margin-top: 5px; }
.review-hint { margin: 4px 0 0; color: var(--muted); font-size: 13px; max-width: 60ch; }
.diagnostics { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; background: var(--surface-muted, #f7f8fa); }
.diagnostics h3 { margin: 0 0 8px; font-size: 14px; }
.diagnostics ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.diagnostics li { margin-bottom: 4px; }
.plan-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.plan-chip { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 12px; color: var(--muted); }
.plan-list { display: grid; gap: 12px; }
.plan-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.plan-card--drop { border-color: var(--red); }
.plan-card--split, .plan-card--merge_next { border-color: var(--accent, #4a6cf7); }
.plan-card__head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 12px; color: var(--muted); }
.plan-action { font-weight: 600; color: var(--text, #1b1f2a); text-transform: uppercase; letter-spacing: .04em; }
.plan-note { margin: 8px 0 6px; font-size: 14px; }
.diagnostics--warn { border-color: var(--amber, #c98a12); background: #fff8ec; }
.diagnostics--warn p { margin: 0; font-size: 13px; color: var(--muted); }
.source-list ul { margin: 8px 0 0; padding-left: 18px; }
.source-list li { margin-bottom: 8px; font-size: 13px; }
.source-list li p { margin: 4px 0 0; color: var(--muted); }
.source-list em { color: var(--red); font-style: normal; font-size: 12px; margin-left: 6px; }
.source-credit { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; }
.field-toggle { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; cursor: pointer; }
.field-toggle strong { display: block; font-size: 14px; }
.field-toggle small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.field-toggle input { margin-top: 3px; }
.error-panel--resume { border-color: var(--amber); background: var(--amber-soft); }
.error-panel__hint { font-size: 13px; color: var(--muted); }
.result-panel__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.result-note { margin: 10px 2px 0; font-size: 12px; color: var(--muted); }
.case-noise { margin-top: 8px; font-size: 12px; color: var(--amber); display: flex; flex-wrap: wrap; gap: 4px; }
.case-noise b { font-weight: 600; }
.case-noise-summary { margin: 6px 0 0; font-size: 12px; color: var(--amber); }
.foreign-terms { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; }
.foreign-terms b { font-weight: 600; }
.foreign-terms-summary { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.watermark-summary { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.watermark-note { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; }
.parsing-report { margin: 0 0 20px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.parsing-report summary { cursor: pointer; color: var(--muted); }
.parsing-report ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); }
.parsing-report li { margin-bottom: 4px; }
.error-panel__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
.progress-line { margin-top: 14px; }
.progress-bar { height: 6px; border-radius: 999px; background: rgba(0,0,0,.08); overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--amber); }
.progress-line small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.resume-hint { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-top: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; }
.resume-hint p { margin: 0; font-size: 13px; color: var(--muted); max-width: 60ch; }
.toolbar-actions { display: flex; gap: 14px; }
.text-button { padding: 0; color: var(--blue); border: 0; background: transparent; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.fragment-list, .change-list { display: grid; gap: 12px; }
.fragment-card { display: grid; grid-template-columns: 46px 1fr; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.fragment-card__rail { padding-top: 20px; text-align: center; background: #f7f9fc; border-right: 1px solid var(--line); }
.fragment-card__rail input { width: 17px; height: 17px; accent-color: var(--blue); }
.lock-icon { width: 21px; height: 21px; display: inline-grid; place-items: center; border-radius: 50%; color: #8f9aaf; background: #e7ebf1; font-weight: 900; }
.fragment-card__body { min-width: 0; padding: 18px 20px; }
.fragment-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--muted); font-size: 11px; }
.confidence { padding: 4px 8px; border-radius: 999px; font-weight: 800; }
.confidence--high { color: var(--red); background: var(--red-soft); }
.confidence--medium { color: var(--amber); background: var(--amber-soft); }
.confidence--low { color: #7a6208; background: #fff9cb; }
.fragment-text { margin: 12px 0 0; white-space: pre-wrap; }
.fragment-card details { margin-top: 12px; color: var(--muted); font-size: 12px; }
.fragment-card details p { padding: 12px; color: #4d5870; background: #f6f8fb; border-radius: 10px; }
.fragment-reason { margin-bottom: 0; color: var(--red); font-size: 12px; }
.fragment-card--protected, .fragment-card--unmatched, .fragment-card--kept { opacity: .76; }
.levels-note { margin: 0 2px 20px; font-size: 12px; color: var(--muted); }
.sticky-action { position: sticky; bottom: 18px; z-index: 10; margin: 18px auto 0; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 900px; color: #fff; background: #172347; border-radius: 15px; box-shadow: 0 18px 46px rgba(23,35,71,.28); }
.sticky-action strong, .sticky-action span { display: block; }
.sticky-action span { color: #bdc9e7; font-size: 11px; }
.result-panel { padding: 26px 28px; display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; color: #fff; background: linear-gradient(135deg, #12644c, #17926b); border-radius: 20px; box-shadow: var(--shadow); }
.result-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; background: rgba(255,255,255,.15); font-size: 26px; font-weight: 900; }
.result-panel h2 { margin: 4px 0; }
.result-panel p { margin: 0; color: #d1f2e6; font-size: 13px; }
.result-panel .eyebrow { color: #a9e9d1; }
.result-panel .button { color: #12644c; background: #fff; box-shadow: none; }
.changes-section { margin-top: 24px; }
.change-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; }
.change-card--skipped { background: #fafbfc; }
.change-card__head { display: flex; justify-content: space-between; gap: 14px; font-size: 12px; }
.operation { padding: 4px 8px; border-radius: 999px; color: var(--green); background: var(--green-soft); }
.operation--skip { color: var(--red); background: var(--red-soft); }
.operation--remark { color: var(--amber); background: var(--amber-soft); }
.header-link { color: var(--blue); font-weight: 750; text-decoration: none; }
.header-link:hover { text-decoration: underline; }
.hero-grid--compact { margin-bottom: 26px; align-items: start; }
.range-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.range-chip { padding: 7px 12px; border: 1px solid #dbe3f4; border-radius: 999px; background: #fff; color: #4e5a72; font-size: 12px; font-weight: 750; text-decoration: none; }
.range-chip--active { color: var(--blue); border-color: #a9c0f5; background: var(--blue-soft); }
.usage-warning { margin: 0 0 18px; padding: 12px 16px; border: 1px solid #f2dcb0; border-radius: 12px; background: var(--amber-soft); color: var(--amber); font-size: 13px; }
.usage-empty { margin: 0; color: var(--muted); font-size: 13px; }
.table-scroll { overflow-x: auto; }
.usage-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.usage-table th { padding: 8px 10px; color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; text-align: right; white-space: nowrap; }
.usage-table th:first-child, .usage-table td:first-child { text-align: left; }
.usage-table td { padding: 10px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.usage-table small { display: block; color: var(--muted); font-size: 11px; }
.day-list { display: grid; gap: 6px; }
.day-row { display: grid; grid-template-columns: 92px minmax(80px, 1fr) 190px 130px; align-items: center; gap: 14px; padding: 9px 4px; border-top: 1px solid var(--line); font-size: 13px; }
.day-row__date { color: var(--muted); font-size: 12px; }
.day-row__bar { height: 8px; border-radius: 999px; background: #eef2f9; overflow: hidden; }
.day-row__bar b { display: block; height: 100%; background: var(--blue); }
.day-row__tokens, .day-row__cost { text-align: right; }
.day-row small { display: block; color: var(--muted); font-size: 11px; }
.job-spend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.job-spend div { padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: #f9fbff; }
.job-spend span { display: block; color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.job-spend strong { font-size: 15px; }
.change-note { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; }
.change-note--remark { display: block; color: var(--amber); }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 13px; }
.diff-grid > div { padding: 14px; border-radius: 11px; background: #f7f9fc; }
.diff-grid span { color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.diff-grid p { margin: 7px 0 0; white-space: pre-wrap; font-size: 13px; }
.change-card small { display: block; margin-top: 10px; color: var(--muted); }
.error-panel, .waiting-panel { padding: 30px; border-radius: 18px; }
.error-panel { color: #75272d; background: var(--red-soft); border: 1px solid #f4c8cc; }
.error-panel strong { font-size: 20px; }
.waiting-panel { display: flex; align-items: center; gap: 18px; background: #fff; border: 1px solid var(--line); }
.waiting-panel h2, .waiting-panel p { margin: 0; }
.waiting-panel p { color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid #dbe4fa; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.messages { position: fixed; right: 22px; top: 92px; z-index: 40; display: grid; gap: 8px; max-width: 420px; }
.message { padding: 13px 16px; border-radius: 11px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; }
.message--success { color: var(--green); border-color: #bfe8d8; }
.message--error { color: var(--red); border-color: #f2c8cb; }
.site-footer { max-width: 1180px; margin: 0 auto; padding: 0 24px 40px; color: var(--muted); font-size: 11px; text-align: center; }
.login-shell { min-height: calc(100vh - 240px); display: grid; place-items: center; }
.login-card { width: min(440px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.login-card h1 { margin: 8px 0 12px; font-size: 38px; }
.login-card > p { color: var(--muted); font-size: 14px; }
@media (max-width: 900px) {
  .hero-grid, .workspace-grid { grid-template-columns: 1fr; }
  .hero-grid { gap: 24px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .job-header { align-items: flex-start; flex-direction: column; }
  .result-panel { grid-template-columns: auto 1fr; }
  .result-panel .button { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .site-header { height: 66px; padding: 0 16px; }
  .header-note { display: none; }
  .page-shell { padding: 34px 14px 60px; }
  h1 { font-size: 36px; }
  .form-columns, .metrics-grid, .diff-grid { grid-template-columns: 1fr; }
  .upload-card, .process-card, .review-section, .changes-section, .recent-section { padding: 20px; border-radius: 17px; }
  .job-row .status-badge { display: none; }
  .job-header__actions, .review-toolbar, .sticky-action { width: 100%; align-items: stretch; flex-direction: column; }
  .toolbar-actions { flex-wrap: wrap; }
  .fragment-card { grid-template-columns: 40px 1fr; }
  .fragment-card__body { padding: 15px; }
  .sticky-action { bottom: 8px; }
  .result-panel { grid-template-columns: 1fr; }
  .messages { left: 12px; right: 12px; top: 76px; }
}
