:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #182941;
  background: #f4f7fb;
  font-size: 15px;
  line-height: 1.55;
  --blue: #0555c7;
  --navy: #102745;
  --muted: #53657e;
  --line: #dce5ef;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
[hidden] { display: none !important; }
a { color: var(--blue); }
button, input { font: inherit; }
button, a, input { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #2580ed; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { color: var(--navy); font-size: clamp(2rem, 4vw, 2.85rem); line-height: 1.12; letter-spacing: -.045em; margin-bottom: .6rem; }
h2 { font-size: 1.26rem; line-height: 1.25; letter-spacing: -.025em; margin-bottom: .35rem; }
h3 { font-size: 1.02rem; line-height: 1.35; margin-bottom: .3rem; }
p { margin-bottom: 0; }
.skip-link { position: absolute; z-index: 5; top: -5rem; left: 1rem; padding: .75rem 1rem; background: white; }
.skip-link:focus { top: 1rem; }

.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 0 34px; background: #0d223e; color: white; }
.brand { color: white; display: flex; align-items: center; gap: 11px; font-size: 1.28rem; font-weight: 730; line-height: 1.05; letter-spacing: -.035em; text-decoration: none; }
.brand small { display: block; color: #bfcfe3; font-size: .72rem; margin-top: .36rem; font-weight: 500; letter-spacing: .025em; }
.workspace-label { display: flex; align-items: center; gap: .55rem; color: #e5eef9; font-size: .82rem; border: 1px solid #3a516d; border-radius: 999px; padding: .32rem .72rem; }
.workspace-dot { width: .45rem; height: .45rem; border-radius: 50%; background: #6fd6c7; }
.layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: calc(100dvh - 76px); }
.sidebar { background: white; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; padding: 32px 16px 26px; }
.sidebar h2 { text-transform: uppercase; color: #617087; font-size: .69rem; margin: 0 0 .65rem .7rem; font-weight: 780; letter-spacing: .11em; }
.nav-link { display: flex; align-items: center; gap: .65rem; border-radius: 9px; margin-bottom: .24rem; padding: .62rem .7rem; color: #344a64; text-decoration: none; font-weight: 630; font-size: .88rem; }
.nav-link:hover { background: #f2f6fb; }
.nav-link[aria-current="page"] { color: #064aab; background: #e9f2ff; }
.nav-count { margin-left: auto; font-size: .72rem; padding: 0 .36rem; background: #e4edf8; border-radius: 5px; color: #24466e; }
.sidebar-note { font-size: .77rem; color: #617087; margin: 2rem .7rem 0; }
main { width: min(100%, 1260px); margin: 0 auto; padding: 30px clamp(24px, 4vw, 64px) 46px; }
.breadcrumb { display: flex; align-items: center; gap: .6rem; margin-bottom: 27px; font-size: .83rem; color: #53657e; }
.breadcrumb a { text-decoration: none; color: #455e7c; }
.breadcrumb a:hover { text-decoration: underline; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.2rem; margin-bottom: 27px; }
.page-heading p, .panel-heading p { color: var(--muted); }
.page-heading .button { flex: none; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: .52rem; padding: .62rem .92rem; min-height: 41px; border: 1px solid transparent; border-radius: 8px; font-weight: 680; font-size: .87rem; text-decoration: none; cursor: pointer; }
.button.primary { color: white; background: var(--blue); }
.button.primary:hover { background: #06459f; }
.button.secondary { color: var(--navy); background: white; border-color: #ccd9e9; }
.button.secondary:hover { background: #f2f7fe; border-color: #90acd3; }
.button.danger { color: white; background: #a02832; }
.button:disabled { cursor: not-allowed; opacity: .58; }
.button.primary:disabled { background: #426b9f; }
.link-button { color: #0751b7; background: transparent; border: 0; padding: 0; text-decoration: underline; text-underline-offset: .16em; cursor: pointer; text-align: left; }
.steps { list-style: none; display: flex; margin: 0 0 19px; padding: 0; align-items: center; background: white; border: 1px solid var(--line); border-radius: 12px; }
.steps li { position: relative; display: flex; align-items: center; gap: .62rem; color: #52647d; flex: 1; padding: .85rem 1rem; font-size: .87rem; font-weight: 610; }
.steps li + li { border-left: 1px solid #e7edf5; }
.step-number { display: grid; place-items: center; flex: 0 0 27px; height: 27px; color: #53657e; background: #edf2f8; border-radius: 50%; font-size: .76rem; font-weight: 750; }
.steps li[aria-current="step"] { color: #074da9; }
.steps li[aria-current="step"] .step-number { background: var(--blue); color: white; }
.steps li.complete .step-number { color: #13664f; background: #def1e8; }

.panel { background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 3px #10274506; overflow: hidden; }
.panel-heading { padding: 22px 24px 0; }
.file-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; padding: 20px 24px; }
.file-card { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: .63rem; padding: 15px; border: 1px dashed #b9cbe0; border-radius: 11px; background: #f8fbff; }
.file-card.dragging, .file-card:focus-within { border-color: #176ada; background: #eef5ff; }
.file-card.selected { border: 1px solid #97c6b5; background: #f5fcf8; }
.file-card.invalid { border-color: #d69ba2; background: #fff9fa; }
.file-card .file-description { color: #5c6e85; font-size: .81rem; min-height: 2.5em; }
.file-card .file-meta { color: #34516d; margin-top: auto; overflow-wrap: anywhere; font-size: .76rem; }
.file-card .file-meta.invalid { color: #8c2531; }
.file-card .file-meta strong { display: block; color: #245747; }
.file-card input { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.file-card input:focus-visible + label { outline: 3px solid #2580ed; outline-offset: 3px; }
.file-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; font-size: .8rem; }
.file-actions .button { padding: .36rem .53rem; min-height: 34px; }
.file-actions .link-button { color: #4a637e; }
.icon-box { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 9px; color: #0756bd; background: #e6f0fd; }
.icon { display: inline-block; width: 16px; height: 16px; flex: 0 0 16px; position: relative; vertical-align: middle; }
.icon-file::before, .icon-records::before { content: ""; position: absolute; inset: 1px 3px; border: 1.6px solid currentColor; border-radius: 2px; }
.icon-file::after, .icon-records::after { content: ""; position: absolute; width: 5px; height: 1.5px; background: currentColor; top: 6px; left: 5.5px; box-shadow: 0 3px currentColor; }
.icon-upload::before, .icon-download::before { content: ""; position: absolute; inset: 9px 1px 1px; border: 1.6px solid currentColor; border-top: 0; border-radius: 0 0 2px 2px; }
.icon-upload::after, .icon-download::after { content: "↑"; position: absolute; font: 680 16px/12px "Segoe UI", sans-serif; left: 3px; top: -1px; }
.icon-download::after { content: "↓"; }
.icon-lock::before { content: ""; position: absolute; inset: 7px 2px 1px; border: 1.6px solid currentColor; border-radius: 2px; }
.icon-lock::after { content: ""; position: absolute; inset: 1px 5px 8px; border: 1.6px solid currentColor; border-radius: 5px 5px 0 0; border-bottom: 0; }
.panel-footer { border-top: 1px solid #e5ecf5; display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; gap: .85rem; background: #fbfdff; }
.file-limit, .privacy-note { color: var(--muted); font-size: .81rem; }
.privacy-note { margin-top: 18px; display: flex; align-items: flex-start; gap: .5rem; }
.privacy-note .icon { margin-top: 2px; }
.status { margin-top: 15px; padding: .72rem .88rem; border: 1px solid #a9c6e6; border-radius: 9px; color: #244b78; background: #edf5ff; }
.status.success { background: #effaf4; border-color: #a6d0bd; color: #175940; }
.status.error { background: #fff3f4; border-color: #e3b1b6; color: #8c2531; }

.preview-panel { margin-top: 18px; scroll-margin-top: 14px; }
.preview-content { padding: 14px 24px 20px; }
.preview-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin: 0 0 .9rem; }
.metric { padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 9px; background: #f7faff; margin: 0; }
.metric dt { font-weight: 670; }
.metric dd { margin: .25rem 0 0; color: var(--muted); font-size: .82rem; }
.metric strong { color: #12325a; font-size: 1.12rem; }
.review-note { color: var(--muted); font-size: .87rem; margin: .55rem 0; }
.issues { margin: 12px 0 0; padding: .75rem; border: 1px solid #e4c48c; background: #fff9ee; border-radius: 8px; }
.issues summary { cursor: pointer; font-weight: 690; color: #744604; }
.issues ul { padding-left: 1.25rem; margin-bottom: 0; }
.issues li { margin: .35rem 0; font-size: .85rem; }
.issues .error-item { color: #8a2631; }

.empty { text-align: center; padding: 3rem 1.5rem; }
.empty > .icon { color: var(--blue); margin-bottom: .6rem; transform: scale(1.4); }
.empty p { color: var(--muted); margin-bottom: .9rem; }
.record-tabs { display: flex; flex-wrap: wrap; gap: .2rem .95rem; padding: .6rem 1.2rem 0; border-bottom: 1px solid var(--line); }
.record-tabs button { background: white; padding: .55rem .18rem; border: 0; border-bottom: 3px solid transparent; color: #4a607a; cursor: pointer; font-weight: 650; }
.record-tabs button[aria-pressed="true"] { color: #064aab; border-bottom-color: var(--blue); }
.table-tools { display: flex; gap: .3rem .7rem; flex-wrap: wrap; align-items: center; padding: .85rem 1.2rem; }
.table-tools > label { font-size: .86rem; font-weight: 640; }
.table-tools input[type="search"] { min-width: min(250px, 100%); padding: .48rem .58rem; border: 1px solid #b2c4d9; color: #203852; border-radius: 6px; }
.table-tools .filter { display: flex; align-items: center; gap: .32rem; color: var(--muted); margin-left: .2rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .65rem 1.15rem; border-top: 1px solid #e6edf4; overflow-wrap: anywhere; }
th { background: #f3f7fc; color: #334d6c; font-size: .82rem; }
td { font-size: .89rem; }
td:first-child { color: #53657e; }
td .link-button { font-weight: 650; }
tbody tr:hover { background: #f9fbff; }
.table-empty { padding: 1rem 1.2rem; border-top: 1px solid var(--line); color: var(--muted); }
.pagination { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem 1.2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.pagination > div { display: flex; gap: .45rem; }
.pagination .button { min-height: 34px; padding: .32rem .6rem; }
.warning-text { color: #875100; }

dialog { padding: 0; width: min(640px, calc(100% - 2rem)); max-height: 88dvh; border: 1px solid #bdcde0; border-radius: 13px; color: #182941; box-shadow: 0 20px 80px #12274442; }
dialog::backdrop { background: #10274580; }
.dialog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.dialog-top h2 { margin-bottom: 0; overflow-wrap: anywhere; }
.dialog-kind { color: var(--muted); font-size: .8rem; margin-bottom: .24rem; }
.dialog-body { padding: 1rem 1.2rem; }
.dialog-body > section + section { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; border-top: 1px solid var(--line); padding: .8rem 1.2rem; }
.details { display: grid; grid-template-columns: minmax(110px, .7fr) minmax(0, 1.4fr); gap: .35rem .75rem; margin: .6rem 0; font-size: .87rem; }
.details dt { font-weight: 630; color: #4a607a; }
.details dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.dialog-body details summary { cursor: pointer; color: var(--blue); font-size: .87rem; }

@media (max-width: 1020px) {
  .layout { grid-template-columns: 190px minmax(0, 1fr); }
  main { padding-inline: 24px; }
  .file-grid { padding-inline: 16px; }
  .file-card { padding: 12px; }
}
@media (max-width: 800px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 5px 18px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: .3rem; }
  .sidebar h2, .sidebar-note { display: none; }
  .nav-link { margin: 0; }
  .topbar { min-height: 65px; padding-inline: 19px; }
}
@media (max-width: 570px) {
  main { padding: 17px 14px 28px; }
  .breadcrumb { margin-bottom: 16px; }
  .page-heading { flex-direction: column; align-items: flex-start; margin-bottom: 17px; }
  .steps li { padding: .52rem .4rem; font-size: .73rem; gap: .3rem; }
  .step-number { flex-basis: 21px; height: 21px; font-size: .65rem; }
  .file-grid { grid-template-columns: 1fr; gap: 8px; padding: 13px; }
  .file-card { gap: .4rem; }
  .file-card .file-description { min-height: 0; }
  .panel-heading, .panel-footer, .preview-content { padding-inline: 14px; }
  .preview-metrics { grid-template-columns: 1fr; }
  .table-tools { align-items: flex-start; flex-direction: column; }
  .table-tools input[type="search"] { width: 100%; }
}
