:root {
  font-family: Inter, Arial, "Microsoft YaHei", sans-serif;
  color: #243447;
  background: #f3f7f8;
  --teal: #13708a;
  --teal-dark: #0d5266;
  --navy: #183a5a;
  --pale: #e9f7fb;
  --line: #d5e2e7;
  --muted: #607382;
}
* { box-sizing: border-box; min-width: 0; }
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #edf7f9 0, #f7f9fa 260px); }
button, input, select { font: inherit; }
button { min-height: 46px; border: 1px solid #98b1bd; border-radius: 10px; background: #fff; color: var(--navy); padding: 10px 16px; cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--teal); color: #fff; border-color: var(--teal); font-weight: 750; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(19, 112, 138, .2); outline-offset: 2px; }
input, select { width: 100%; max-width: 100%; min-height: 44px; border: 1px solid #afc2ca; border-radius: 9px; padding: 9px 11px; color: #243447; background: white; }
label { display: grid; gap: 6px; color: #405561; font-size: 13px; font-weight: 700; }
.shell { width: min(900px, calc(100% - 28px)); margin: 28px auto 48px; }
.hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.hero h1 { margin: 4px 0 8px; color: var(--navy); font-size: clamp(27px, 5vw, 42px); line-height: 1.12; }
.hero p { margin: 0; color: #526977; line-height: 1.55; }
.eyebrow { color: var(--teal) !important; font-weight: 800; letter-spacing: .1em; font-size: 12px; }
.network-badge { flex: none; border: 1px solid #8fc8d7; color: var(--teal-dark); border-radius: 999px; padding: 8px 12px; background: #effbfe; font-size: 13px; }
.card { margin-top: 16px; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 8px 26px rgba(24,58,90,.06); }
.section-heading { display: flex; gap: 12px; align-items: flex-start; }
.section-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: white; background: var(--teal); font-weight: 800; }
.section-heading h2 { margin: 1px 0 4px; color: var(--navy); font-size: 21px; }
.section-heading p { margin: 0; color: var(--muted); line-height: 1.45; }
.config-grid, .dialog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.show-key { display: flex; align-items: center; gap: 7px; width: max-content; margin-top: 10px; font-weight: 500; }
.show-key input { width: 16px; min-height: auto; }
.status-line { margin: 12px 0 0; color: var(--teal-dark); font-weight: 700; }
.fine-print { margin: 8px 0 0; color: #738691; font-size: 12px; line-height: 1.45; }
.file-picker { margin-top: 18px; min-height: 116px; display: grid; place-items: center; align-content: center; gap: 7px; text-align: center; border: 2px dashed #8db9c5; border-radius: 13px; background: #f4fbfd; color: var(--muted); cursor: pointer; padding: 20px; }
.file-picker:hover { background: #eaf8fb; border-color: var(--teal); }
.file-picker-title { color: var(--teal-dark); font-size: 18px; font-weight: 800; }
.file-picker input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; pointer-events: none; }
.file-status { margin-top: 12px; color: var(--muted); }
.mapping-ok { margin-top: 10px; padding: 10px 12px; background: #eaf7ef; color: #17623b; border-radius: 9px; font-weight: 700; }
.main-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.large { min-height: 54px; font-size: 17px; font-weight: 750; }
.progress-panel { margin-top: 20px; }
.progress-head { display: flex; align-items: baseline; justify-content: space-between; }
.progress-head strong { color: var(--teal-dark); font-size: 25px; }
.progress-track { height: 14px; background: #dce8ed; border-radius: 999px; overflow: hidden; margin-top: 8px; }
#progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, #1787a5, #31a3bd); transition: width .25s ease; }
#progress-text { color: var(--muted); line-height: 1.5; }
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-top: 16px; }
.summary div { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fbfdfe; }
.summary strong { display: block; font-size: 22px; color: var(--navy); }
.summary span { color: var(--muted); font-size: 13px; }
.notice { margin-top: 16px; background: #fff8df; border: 1px solid #e8d78e; border-radius: 12px; padding: 13px 16px; color: #655a30; line-height: 1.5; }
.hidden { display: none !important; }
.login-body { display: grid; place-items: center; padding: 20px; }
.login-shell { width: min(430px, 100%); }
.login-card { background: rgba(255,255,255,.97); border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: 0 18px 60px rgba(24,58,90,.13); }
.login-card h1 { margin: 8px 0; color: var(--navy); font-size: 30px; }
.login-intro { margin: 0; color: var(--muted); }
.login-form { display: grid; gap: 15px; margin-top: 24px; }
.login-error { min-height: 20px; margin: -3px 0; color: #a3262a; font-size: 14px; }
.login-button { width: 100%; min-height: 50px; }
.error-text { color: #a3262a; min-height: 20px; }
.table-wrap { overflow: auto; max-height: 320px; margin-top: 14px; border: 1px solid #bdd0d8; border-radius: 9px; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { position: sticky; top: 0; background: var(--teal); color: white; text-align: left; padding: 9px 11px; }
td { padding: 8px 11px; border-bottom: 1px solid #b9dfe9; }
tbody tr:nth-child(odd) { background: var(--pale); }
dialog { width: min(860px, calc(100% - 24px)); max-height: calc(100vh - 24px); border: 0; border-radius: 16px; padding: 22px; box-shadow: 0 24px 80px rgba(7,31,48,.32); }
dialog::backdrop { background: rgba(18,43,57,.55); backdrop-filter: blur(2px); }
.dialog-heading { display: flex; justify-content: space-between; gap: 16px; }
.dialog-heading h2 { margin: 0 0 4px; color: var(--navy); }
.dialog-heading p { margin: 0; color: var(--muted); }
.dialog-close { border: 0; min-height: 38px; font-size: 25px; padding: 0 10px; }
.dialog-confirm { width: 100%; margin-top: 16px; }
#toast { position: fixed; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); max-width: min(420px, calc(100% - 36px)); background: #213548; color: white; padding: 12px 16px; border-radius: 9px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; z-index: 10; }
#toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 680px) {
  .shell { width: calc(100% - 20px); margin: 16px 10px 40px; padding-bottom: env(safe-area-inset-bottom); }
  .hero { display: block; }
  .network-badge { display: inline-block; margin-top: 12px; }
  .card { padding: 17px; border-radius: 13px; }
  .config-grid, .dialog-grid { grid-template-columns: 1fr; }
  .main-actions { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr 1fr; }
  dialog { padding: 17px; }
  .file-picker { min-height: 104px; }
}
