:root {
  color-scheme: light;
  --ink: #14283d;
  --muted: #65778a;
  --navy: #123b5d;
  --navy-2: #0d2d48;
  --cyan: #08a6c7;
  --cyan-soft: #e8f8fb;
  --line: #d9e2e9;
  --panel: #ffffff;
  --canvas: #f1f5f8;
  --success: #16815c;
  --success-soft: #eaf7f1;
  --warning: #b96910;
  --error: #b83b42;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); min-height: 100vh; font-size: 16px; }
button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 76px; padding: 0 clamp(20px, 4vw, 56px); display: flex; align-items: center; gap: 14px;
  background: linear-gradient(105deg, var(--navy-2), var(--navy)); color: white; box-shadow: 0 3px 14px #173d5d2a;
}
.brand-mark { width: 42px; height: 42px; border: 1px solid #ffffff50; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #6be0ed; }
.topbar h1 { margin: 0; font-size: 1.22rem; letter-spacing: .01em; }
.topbar p { margin: 3px 0 0; color: #bed0de; font-size: .84rem; }
.privacy-chip { margin-left: auto; display: flex; align-items: center; gap: 7px; border: 1px solid #7ecbd45d; border-radius: 999px; padding: 7px 12px; color: #d8f7fb; font-size: .83rem; }
.privacy-chip svg { width: 17px; height: 17px; fill: currentColor; }

.workspace { max-width: 1440px; margin: 0 auto; padding: 30px clamp(18px, 4vw, 52px) 24px; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, .8fr); gap: 24px; }
.main-panel, .settings-card, .safety-note { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.main-panel { padding: clamp(20px, 3vw, 30px); min-height: 620px; }
.settings-panel { display: flex; flex-direction: column; gap: 16px; }
.settings-card { padding: 25px; box-shadow: 0 10px 30px #183b5610; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 18px; }
.section-heading.compact { align-items: center; }
.step { display: block; color: var(--cyan); font-size: .72rem; font-weight: 800; letter-spacing: .14em; margin-bottom: 5px; }
.step.success { color: var(--success); }
h2 { font-size: 1.18rem; margin: 0; }
.settings-card h2 { font-size: 1.25rem; margin-bottom: 22px; }

.button { border: 0; border-radius: 8px; padding: 10px 15px; font-weight: 700; transition: .18s ease; }
.button:focus-visible, input:focus-visible, .drop-zone:focus-visible { outline: 3px solid #08a6c744; outline-offset: 2px; }
.button:disabled { cursor: not-allowed; opacity: .46; }
.button.ghost { color: var(--muted); background: transparent; font-size: .9rem; }
.button.ghost:not(:disabled):hover { background: #edf3f6; color: var(--ink); }
.button.ghost.report { color: #4c6578; background: #f0f5f7; }
.button.secondary { background: var(--cyan-soft); color: #087f98; }
.button.secondary:hover { background: #d8f2f6; }
.button.primary { width: 100%; margin-top: 22px; padding: 13px 16px; display: flex; align-items: center; justify-content: center; gap: 9px; background: linear-gradient(135deg, #087e9a, var(--cyan)); color: white; box-shadow: 0 8px 20px #079bb029; }
.button.primary:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 10px 24px #079bb03d; }
.button.primary svg { width: 20px; height: 20px; fill: currentColor; }

.drop-zone { min-height: 202px; border: 1.5px dashed #98b4c5; border-radius: 12px; background: #f8fbfd; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 25px; transition: .18s ease; cursor: pointer; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--cyan); background: var(--cyan-soft); transform: translateY(-1px); }
.upload-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: #e0f4f8; color: #068aa5; margin-bottom: 11px; }
.upload-icon svg { width: 27px; height: 27px; fill: currentColor; }
.drop-zone strong { font-size: 1.04rem; }
.drop-zone span { margin-top: 5px; color: var(--muted); font-size: .94rem; }
.drop-zone small { margin-top: 13px; color: #8293a2; font-size: .78rem; }

.file-list { display: grid; gap: 9px; margin-top: 14px; }
.file-row { display: grid; grid-template-columns: minmax(170px, 1.5fr) repeat(3, minmax(66px, .5fr)) 34px; align-items: center; gap: 10px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.file-name { min-width: 0; }
.file-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .91rem; }
.file-name span, .file-stat span { color: var(--muted); font-size: .74rem; }
.file-stat strong { display: block; font-size: .88rem; }
.remove-file { width: 30px; height: 30px; border: 0; border-radius: 7px; color: #8695a1; background: transparent; font-size: 1.2rem; }
.remove-file:hover { color: var(--error); background: #fff0f1; }
.empty-hint { margin-top: 20px; display: flex; gap: 12px; color: var(--muted); font-size: .83rem; }
.hint-line { flex: 1; display: flex; gap: 7px; align-items: center; }
.hint-line span { width: 21px; height: 21px; border-radius: 50%; display: inline-grid; place-items: center; flex: 0 0 auto; background: #e5edf2; color: var(--navy); font-weight: 800; font-size: .7rem; }

.field-label { display: block; font-size: .89rem; font-weight: 700; margin-bottom: 7px; }
.text-input { width: 100%; border: 1px solid #cbd8e0; border-radius: 8px; padding: 11px 12px; color: var(--ink); background: #fbfdfe; }
.text-input:focus { border-color: var(--cyan); }
.field-help { margin: 6px 0 0; color: var(--muted); font-size: .77rem; }
.divider { height: 1px; background: var(--line); margin: 21px 0; }
.options { border: 0; padding: 0; margin: 0; }
.options legend { font-size: .89rem; font-weight: 700; margin-bottom: 9px; }
.options label { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; color: #34495c; font-size: .87rem; line-height: 1.35; cursor: pointer; }
.options input { appearance: none; width: 18px; height: 18px; flex: 0 0 auto; margin: 0; border: 1.5px solid #a6b8c4; border-radius: 4px; background: white; display: grid; place-content: center; }
.options input::before { content: ""; width: 9px; height: 5px; border-left: 2px solid white; border-bottom: 2px solid white; transform: rotate(-45deg) scale(0); margin-top: -2px; transition: transform .1s; }
.options input:checked { background: var(--cyan); border-color: var(--cyan); }
.options input:checked::before { transform: rotate(-45deg) scale(1); }
.safety-note { padding: 17px; display: flex; gap: 12px; color: #37536a; background: #f7fbfd; }
.safety-note svg { width: 27px; height: 27px; flex: 0 0 auto; fill: #1687a0; }
.safety-note strong { font-size: .86rem; }
.safety-note p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }

.progress-wrap { margin-top: 13px; display: flex; align-items: center; gap: 10px; }
.progress-track { height: 6px; flex: 1; border-radius: 999px; background: #dce8ed; overflow: hidden; }
.progress-bar { width: 0; height: 100%; background: var(--cyan); transition: width .2s; }
.progress-wrap span { min-width: 80px; color: var(--muted); font-size: .76rem; text-align: right; }
.results { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 24px; }
.result-summary { display: flex; gap: 10px; margin-bottom: 12px; }
.result-actions { display: flex; gap: 8px; align-items: center; }
.summary-pill { border-radius: 999px; padding: 6px 10px; font-size: .76rem; font-weight: 700; background: var(--success-soft); color: var(--success); }
.summary-pill.warn { background: #fff5e8; color: var(--warning); }
.result-list { display: grid; gap: 9px; }
.result-row { border: 1px solid var(--line); border-radius: 9px; padding: 13px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 11px; align-items: center; }
.result-icon { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--success); font-weight: 800; }
.result-row.error .result-icon { background: var(--error); }
.result-detail { min-width: 0; }
.result-detail strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.result-detail span { color: var(--muted); font-size: .76rem; }
.download-button { border: 1px solid #b8dbe2; background: white; color: #087e96; border-radius: 7px; padding: 8px 11px; font-size: .78rem; font-weight: 700; }
.download-button:hover { background: var(--cyan-soft); }
.warning-list { grid-column: 2 / -1; margin: 0; padding-left: 18px; color: var(--warning); font-size: .76rem; }
.hidden { display: none !important; }
.toast { position: fixed; left: 50%; bottom: 25px; transform: translate(-50%, 20px); background: #152d42; color: white; padding: 11px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: .2s; box-shadow: 0 10px 30px #0d273c45; font-size: .86rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
footer { text-align: center; color: #80909e; padding: 2px 20px 25px; font-size: .76rem; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .settings-panel { grid-row: 1; }
  .main-panel { min-height: auto; }
}
@media (max-width: 620px) {
  .topbar { height: 68px; padding: 0 16px; }
  .privacy-chip { width: 34px; height: 34px; padding: 0; justify-content: center; }
  .privacy-chip span, .privacy-chip { font-size: 0; }
  .workspace { padding: 16px 12px; }
  .main-panel, .settings-card { padding: 18px; border-radius: 11px; }
  .file-row { grid-template-columns: minmax(0, 1fr) 55px 34px; }
  .file-stat:nth-of-type(2), .file-stat:nth-of-type(3) { display: none; }
  .empty-hint { display: none; }
  .result-row { grid-template-columns: 26px minmax(0, 1fr); }
  .download-button { grid-column: 2; justify-self: start; }
  .section-heading.compact { align-items: flex-start; flex-direction: column; }
}
