:root {
  --ink: #15231f;
  --muted: #65736e;
  --paper: #f4f6f1;
  --card: #ffffff;
  --line: #dce3de;
  --green: #176b4b;
  --green-dark: #0f4e37;
  --green-soft: #e3f1e9;
  --amber: #a35e09;
  --amber-soft: #fff0d8;
  --red: #a13737;
  --red-soft: #fde7e4;
  --shadow: 0 20px 60px rgba(24, 48, 39, .09);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.55 Inter, "Segoe UI", Arial, sans-serif; }
a { color: inherit; }
.site-header { height: 72px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 750; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: white; background: var(--green); border-radius: 11px; letter-spacing: -.04em; }
.user-block { display: flex; align-items: center; gap: 18px; color: var(--muted); }
.user-block a { color: var(--green-dark); font-weight: 650; }
.page-shell { width: min(1180px, calc(100% - 40px)); min-height: calc(100vh - 130px); margin: 0 auto; padding: 58px 0 70px; }
footer { padding: 20px; color: var(--muted); text-align: center; font-size: 13px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 18px; font-size: clamp(36px, 5vw, 66px); line-height: 1.03; letter-spacing: -.045em; }
h2 { margin-bottom: 8px; }
.eyebrow { margin-bottom: 14px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.lead { max-width: 720px; color: var(--muted); font-size: 19px; }
.muted { color: var(--muted); font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.hero, .result-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: 36px; }
.bounds-chip { min-width: 240px; padding: 18px 20px; color: var(--green-dark); background: var(--green-soft); border-radius: 16px; font-size: 13px; }
.bounds-chip strong { display: block; margin-top: 3px; font-size: 16px; }
.upload-card { padding: 24px; }
.drop-zone { min-height: 270px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; cursor: pointer; border: 2px dashed #aebcb5; border-radius: 16px; background: #fafbf9; transition: .2s ease; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--green); background: var(--green-soft); transform: translateY(-1px); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone strong { font-size: 20px; }
.drop-zone small, .drop-zone span { color: var(--muted); }
.upload-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 8px; color: var(--green); background: white; border: 1px solid var(--line); border-radius: 50%; font-size: 30px; }
.file-summary { margin: 18px 0 0; padding: 12px 16px; color: var(--green-dark); background: var(--green-soft); border-radius: 10px; }
.button { display: inline-flex; min-height: 48px; padding: 12px 22px; align-items: center; justify-content: center; border: 0; border-radius: 11px; cursor: pointer; font: inherit; font-weight: 750; text-decoration: none; transition: .18s ease; }
.button-primary { color: white; background: var(--green); }
.button-primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .65; }
.upload-card .button { width: 100%; margin-top: 18px; }
.button-wide { width: 100%; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.info-card { padding: 22px; border-top: 1px solid var(--line); }
.info-card > span { color: var(--green); font-size: 12px; font-weight: 800; }
.info-card h2 { margin-top: 24px; font-size: 19px; }
.info-card p { margin: 0; color: var(--muted); font-size: 14px; }
.login-card, .error-card { width: min(590px, 100%); margin: 6vh auto; padding: clamp(28px, 5vw, 52px); }
.login-card h1, .error-card h1 { font-size: clamp(34px, 6vw, 52px); }
.alert { margin: 20px 0; padding: 14px 16px; background: var(--amber-soft); border-radius: 10px; }
.alert-error { color: var(--red); background: var(--red-soft); }
.login-card .muted { margin: 22px 0 0; text-align: center; }
.result-heading h1 { margin-bottom: 0; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.metric { padding: 22px; background: white; border: 1px solid var(--line); border-radius: 16px; }
.metric strong { display: block; font-size: 32px; line-height: 1; }
.metric span { display: block; margin-top: 9px; color: var(--muted); font-size: 13px; }
.metric-success strong { color: var(--green); }
.metric-warning strong { color: var(--amber); }
.report-card { padding: 24px; box-shadow: none; }
.card-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.card-title-row span { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 10px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
th { color: var(--muted); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }
.file-cell { max-width: 300px; overflow-wrap: anywhere; }
.status { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #edf0ee; font-size: 11px; font-weight: 800; }
.status-converted { color: var(--green-dark); background: var(--green-soft); }
.status-error { color: var(--red); background: var(--red-soft); }
.status-unsupported { color: var(--amber); background: var(--amber-soft); }
.back-link { display: inline-block; margin-top: 24px; color: var(--green-dark); font-weight: 700; }
.error-card { text-align: center; }
.error-symbol { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 20px; color: var(--red); background: var(--red-soft); border-radius: 50%; font-size: 30px; font-weight: 800; }

@media (min-width: 900px) and (max-height: 700px) {
  body { font-size: 14px; line-height: 1.4; }
  .site-header { height: 52px; }
  .brand { gap: 9px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .page-shell { min-height: calc(100vh - 82px); padding: 16px 0 12px; }
  footer { padding: 6px 20px; font-size: 11px; }
  .hero { align-items: center; gap: 24px; margin-bottom: 12px; }
  .eyebrow { margin-bottom: 5px; font-size: 10px; }
  h1 { margin-bottom: 7px; font-size: 34px; }
  .lead { max-width: 780px; margin-bottom: 0; font-size: 14px; }
  .bounds-chip { min-width: 220px; padding: 10px 14px; border-radius: 12px; font-size: 11px; }
  .bounds-chip strong { font-size: 13px; }
  .upload-card { padding: 12px; border-radius: 16px; }
  .drop-zone { min-height: 132px; gap: 3px; border-radius: 12px; }
  .drop-zone strong { font-size: 16px; }
  .upload-icon { width: 38px; height: 38px; margin-bottom: 2px; font-size: 22px; }
  .file-summary { margin-top: 8px; padding: 7px 12px; }
  .button { min-height: 38px; padding: 8px 18px; }
  .upload-card .button { margin-top: 8px; }
  .info-grid { gap: 14px; margin-top: 10px; }
  .info-card { padding: 9px 14px; }
  .info-card h2 { margin: 3px 0 2px; font-size: 15px; }
  .info-card p { font-size: 12px; line-height: 1.3; }
}

@media (max-width: 760px) {
  .site-header { padding: 0 18px; }
  .user-block span { display: none; }
  .page-shell { width: min(100% - 28px, 1180px); padding-top: 38px; }
  .hero, .result-heading { align-items: stretch; flex-direction: column; }
  .bounds-chip { min-width: 0; }
  .info-grid, .summary-grid { grid-template-columns: 1fr 1fr; }
  .result-heading .button { width: 100%; }
}

@media (max-width: 460px) {
  h1 { font-size: 39px; }
  .info-grid, .summary-grid { grid-template-columns: 1fr; }
  .upload-card { padding: 14px; }
  .drop-zone { min-height: 235px; padding: 20px; text-align: center; }
  .card-title-row { align-items: flex-start; flex-direction: column; gap: 0; }
}
