:root {
  color-scheme: light;
  --navy: #10243a;
  --navy-soft: #183b57;
  --blue: #1769aa;
  --blue-deep: #12588f;
  --blue-soft: #eaf4fb;
  --cyan: #9bd9ef;
  --bg: #f3f6fa;
  --paper: #ffffff;
  --ink: #172b42;
  --muted: #718096;
  --line: #e4eaf1;
  --green: #16845b;
  --green-soft: #e8f6ef;
  --red: #c23b45;
  --red-soft: #fff0f0;
  --shadow: 0 8px 26px rgba(16, 36, 58, 0.055);
  font-family: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1280px, calc(100% - 48px)); margin-inline: auto; }

.masthead {
  color: #fff;
  background: radial-gradient(ellipse at 84% 4%, rgba(53, 133, 177, .42), transparent 35%), linear-gradient(115deg, #10243a 2%, #174b70 100%);
  padding: 27px 0 31px;
  position: relative;
  overflow: hidden;
}
.masthead::after {
  content: ""; position: absolute; right: -56px; bottom: -121px; width: 420px; height: 220px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 50%; transform: rotate(-14deg); pointer-events: none;
}
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 22px; position: relative; z-index: 1; }
.brand-lockup { display: flex; align-items: center; gap: 17px; }
.brand-mark { width: 54px; height: 54px; flex: 0 0 auto; filter: drop-shadow(0 5px 12px rgba(0,0,0,.16)); }
.eyebrow { color: var(--cyan); font-size: 10px; letter-spacing: 2px; font-weight: 800; }
h1 { margin: 5px 0 3px; font-size: clamp(24px, 3vw, 30px); line-height: 1.18; font-weight: 800; letter-spacing: -.55px; }
.masthead-subtitle { color: #c6d6e5; margin: 0; font-size: 13px; }
.privacy-chip { display: inline-flex; align-items: center; gap: 9px; color: #e4f5ec; border: 1px solid rgba(182, 235, 210, .28); background: rgba(14, 73, 67, .24); border-radius: 999px; padding: 10px 14px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.privacy-dot { width: 7px; height: 7px; border-radius: 50%; background: #55d79b; box-shadow: 0 0 0 4px rgba(85,215,155,.13); }

.page-content { padding-top: 22px; padding-bottom: 28px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 19px; margin-bottom: 15px; box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.section-title-group { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.step-number { width: 29px; height: 29px; display: inline-flex; justify-content: center; align-items: center; flex: 0 0 auto; border: 1px solid #d8e8f3; background: #f0f7fc; color: var(--blue); border-radius: 9px; font-size: 10px; font-weight: 900; letter-spacing: .4px; }
h2 { color: var(--ink); font-size: 16px; line-height: 1.25; margin: 1px 0 3px; font-weight: 800; }
.section-subtitle { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 9px; min-height: 39px; padding: 10px 14px; cursor: pointer; font-size: 12px; font-weight: 750; text-decoration: none; transition: background .18s ease, transform .18s ease, box-shadow .18s ease; }
.button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(23,105,170,.24); outline-offset: 2px; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--blue); box-shadow: 0 4px 10px rgba(23,105,170,.16); }
.button-primary:hover { background: var(--blue-deep); }
.button-secondary { color: #1c527b; background: #eaf2f8; }
.button-secondary:hover, .button-quiet:hover { background: #dcebf5; }
.button-quiet { color: #1c527b; background: #edf4f9; min-height: 36px; padding: 9px 12px; }
.button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.upload-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(225px, .75fr); gap: 16px; align-items: stretch; }
.dropzone { min-height: 123px; position: relative; display: flex; align-items: center; gap: 14px; border: 1.5px dashed #a9c3d7; background: linear-gradient(110deg, #f6fbff, #fbfdff); border-radius: 12px; padding: 17px; cursor: pointer; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.dropzone:hover, .dropzone.is-dragging { border-color: var(--blue); background: #f1f9ff; box-shadow: inset 0 0 0 1px rgba(23,105,170,.08); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.upload-icon { width: 43px; height: 43px; display: grid; place-items: center; border: 1px solid #d9eaf5; border-radius: 12px; background: #eaf5fc; color: var(--blue); flex: 0 0 auto; }
.upload-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.drop-copy { display: grid; gap: 5px; min-width: 0; flex: 1; }
.drop-copy strong { font-size: 12px; color: var(--ink); }
.drop-copy small { font-size: 11px; color: var(--muted); }
.upload-side { min-height: 123px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 9px; padding: 4px 2px; }
.local-note { display: flex; align-items: flex-start; gap: 9px; }
.local-note-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 900; flex: 0 0 auto; }
.local-note strong { display: block; margin: 1px 0 2px; color: #315a4b; font-size: 11px; }
.local-note p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.status-line { min-height: 15px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.status-line[data-state="success"] { color: var(--green); font-weight: 700; }
.status-line[data-state="error"] { color: var(--red); font-weight: 700; }
.status-line[data-state="loading"] { color: var(--blue); font-weight: 700; }

.compact-heading { margin-bottom: 15px; }
.row-count { flex: 0 0 auto; padding: 6px 10px; color: #51677d; background: #f3f6f9; border: 1px solid #e6edf2; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(135px, 1fr)); gap: 12px; }
.field label { display: block; margin-bottom: 6px; color: #607286; font-size: 10px; font-weight: 800; letter-spacing: .55px; text-transform: uppercase; }
.field select, .field input { display: block; width: 100%; height: 39px; border: 1px solid #dbe4ec; border-radius: 8px; padding: 9px 10px; color: var(--ink); background: #fff; font-size: 12px; }
.field select { appearance: auto; }
.field select:disabled, .field input:disabled { background: #f7f9fb; color: #8a98a8; }

.summary-section { margin: 19px 0 17px; }
.section-kicker { display: flex; align-items: center; gap: 8px; margin: 0 0 10px 2px; color: #788a9b; font-size: 9px; letter-spacing: 1.45px; font-weight: 850; }
.kicker-line { width: 19px; height: 2px; background: #62a9d7; border-radius: 4px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpi { position: relative; min-height: 135px; background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 15px 16px; box-shadow: 0 4px 14px rgba(16,36,58,.035); overflow: hidden; }
.kpi::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #2e88c5, #8dc8e8); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #607286; font-size: 11px; font-weight: 800; }
.kpi-service { display: inline-flex; align-items: center; gap: 7px; }
.kpi-service-mark { width: 7px; height: 7px; background: #56a6d8; border-radius: 2px; transform: rotate(45deg); }
.pill, .tag { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 8px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 900; letter-spacing: .25px; white-space: nowrap; }
.pill.full, .tag.full { background: var(--red-soft); color: var(--red); }
.pill::before, .tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.hplus { margin: 11px 0 3px; color: var(--blue); font-size: 30px; line-height: 1; letter-spacing: -.7px; font-weight: 900; }
.remaining { color: var(--muted); font-size: 10px; line-height: 1.55; }
.remaining b { color: #43596e; font-variant-numeric: tabular-nums; }
.empty-card { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 78px; border: 1px dashed #d5e1ea; border-radius: 12px; color: var(--muted); background: rgba(255,255,255,.55); font-size: 11px; }
.empty-card-mark { color: #91abc0; font-size: 20px; font-weight: 500; }

.detail-heading { margin-bottom: 13px; }
.table-note { display: inline-flex; align-items: center; gap: 7px; color: #8291a0; font-size: 10px; white-space: nowrap; }
.table-note-dot { width: 6px; height: 6px; background: #6fb0dc; border-radius: 50%; }
.table-wrap { overflow: auto; border: 1px solid #e9eef3; border-radius: 10px; }
table { width: 100%; min-width: 820px; border-collapse: collapse; }
th { padding: 11px 10px; background: #f5f8fb; color: #64788d; text-align: left; font-size: 9px; letter-spacing: .45px; text-transform: uppercase; white-space: nowrap; }
th:first-child { padding-left: 14px; }
td { padding: 11px 10px; border-top: 1px solid #edf1f5; color: #3c5064; font-size: 11px; white-space: nowrap; }
td:first-child { padding-left: 14px; color: #233d55; font-weight: 750; }
td.numeric, th.numeric { text-align: right; font-variant-numeric: tabular-nums; }
td .tag { padding: 4px 7px; font-size: 8px; }
.empty-cell { padding: 28px 12px !important; text-align: center; color: var(--muted) !important; font-weight: 500 !important; }
.calculation-note { display: flex; align-items: flex-start; gap: 8px; padding: 12px 2px 0; color: #7a8998; }
.note-symbol { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; margin-top: 1px; border: 1px solid #aab9c7; border-radius: 50%; color: #71869a; font-size: 9px; font-weight: 800; flex: 0 0 auto; }
.calculation-note p { margin: 0; font-size: 9px; line-height: 1.65; }
.calculation-note b { color: #556a7d; }
.page-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 3px 3px 0; color: #8998a6; font-size: 9px; }
.footer-separator { padding-inline: 4px; color: #bac5ce; }
.page-footer a { color: #607d95; text-decoration: none; }
.page-footer a:hover { color: var(--blue); text-decoration: underline; }

.license-page { padding: 32px 0; }
.license-card { max-width: 800px; margin: 0 auto; padding: 26px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.license-card h1 { color: var(--ink); font-size: 24px; }
.license-card h2 { margin-top: 22px; }
.license-card p, .license-card li { color: #53687d; font-size: 13px; line-height: 1.7; }
.license-card a { color: var(--blue); }
.license-card pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 14px; border-radius: 9px; background: #f4f7fa; color: #53687d; font-size: 11px; line-height: 1.55; }
.back-link { display: inline-block; margin-bottom: 18px; color: #c8e0f1; font-size: 12px; text-decoration: none; }

@media (max-width: 850px) {
  .shell { width: min(100% - 32px, 720px); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-layout { grid-template-columns: 1fr; }
  .upload-side { min-height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .status-line { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 26px); }
  .masthead { padding: 20px 0 22px; }
  .masthead-inner { align-items: flex-start; flex-direction: column; gap: 13px; }
  .brand-lockup { gap: 12px; }
  .brand-mark { width: 44px; height: 44px; }
  .eyebrow { font-size: 8px; letter-spacing: 1.5px; }
  h1 { font-size: 23px; }
  .masthead-subtitle { max-width: 270px; font-size: 11px; }
  .privacy-chip { padding: 7px 10px; font-size: 9px; }
  .page-content { padding-top: 13px; }
  .panel { padding: 14px; margin-bottom: 12px; border-radius: 12px; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; gap: 10px; margin-bottom: 13px; }
  .section-subtitle { max-width: 270px; font-size: 10px; }
  .button-secondary { min-height: 34px; padding: 8px 10px; font-size: 10px; }
  .dropzone { min-height: 126px; display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 10px; padding: 13px; }
  .upload-icon { width: 39px; height: 39px; }
  .drop-copy strong { font-size: 11px; }
  .drop-copy small { font-size: 9px; }
  .pick-button { grid-column: 1 / -1; width: 100%; min-height: 35px; }
  .upload-side { grid-template-columns: 1fr; gap: 9px; }
  .status-line { grid-column: auto; }
  .filters { gap: 10px; }
  .field label { font-size: 9px; }
  .field select, .field input { height: 38px; padding: 8px; font-size: 11px; }
  .cards { grid-template-columns: 1fr; gap: 9px; }
  .kpi { min-height: 120px; padding: 14px; }
  .hplus { font-size: 27px; }
  .table-note { display: none; }
  .row-count { padding: 5px 8px; font-size: 9px; }
  .page-footer { align-items: flex-start; font-size: 8px; }
  .license-card { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}


/* Cloud sharing and administrator controls */
[hidden] { display: none !important; }
.access-note { display: flex; flex-direction: column; gap: 4px; margin: 0 0 15px; padding: 11px 13px; border: 1px solid #f0d8a8; border-radius: 10px; background: #fff9ed; color: #6b5731; font-size: 11px; line-height: 1.5; }
.access-note strong { color: #805d1f; font-size: 11px; }
.sync-panel { display: flex; align-items: flex-start; gap: 10px; padding: 10px 11px; width: 100%; border: 1px solid #e6edf2; border-radius: 10px; background: #f8fafc; }
.sync-indicator { width: 8px; height: 8px; margin-top: 4px; flex: 0 0 auto; border-radius: 50%; background: #91a2b2; }
.sync-indicator[data-state="online"] { background: #16845b; box-shadow: 0 0 0 4px rgba(22,132,91,.10); }
.sync-indicator[data-state="pending"] { background: #d49a2a; box-shadow: 0 0 0 4px rgba(212,154,42,.12); }
.sync-indicator[data-state="error"] { background: #c23b45; box-shadow: 0 0 0 4px rgba(194,59,69,.10); }
.sync-copy { display: grid; gap: 3px; min-width: 0; }
.sync-copy strong { color: #26445e; font-size: 11px; }
.sync-copy span { color: #758698; font-size: 10px; line-height: 1.4; }
.admin-bar { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; }
.admin-status { color: #6d7f90; font-size: 10px; line-height: 1.4; }
.admin-buttons, .upload-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.admin-buttons .button, .upload-actions .button { min-height: 34px; padding: 8px 11px; font-size: 10px; }
.pending-file { max-width: 100%; padding: 7px 9px; border-radius: 7px; background: #eef6fb; color: #41657f; font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.upload-actions { width: 100%; }
@media (max-width: 850px) {
  .upload-side { display: flex; align-items: stretch; }
  .admin-bar { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
  .access-note { font-size: 10px; }
  .sync-panel { padding: 9px; }
  .upload-actions { display: grid; grid-template-columns: 1fr; }
  .upload-actions .button { width: 100%; }
}
