:root {
  --ink: #17211d;
  --muted: #66736d;
  --line: #dce4df;
  --paper: #f3f5f0;
  --panel: #ffffff;
  --accent: #e75c34;
  --accent-dark: #c84522;
  --green: #1f7a53;
  --shadow: 0 24px 70px rgba(26, 45, 36, .09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgba(231, 92, 52, .12), transparent 25rem),
    linear-gradient(180deg, #f8f8f4 0%, var(--paper) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button { color: inherit; }

.shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 30px 0 48px; }
.topbar, .brand, .panel-heading, .actions, .list-footer, footer { display: flex; align-items: center; }
.topbar { justify-content: space-between; margin-bottom: 70px; }
.brand { gap: 13px; }
.brand-mark {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  color: white; background: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .08em;
}
.eyebrow, .step { margin: 0 0 5px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 0; font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.status { display: flex; align-items: center; gap: 9px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.7); color: var(--muted); font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #d29b31; box-shadow: 0 0 0 4px rgba(210,155,49,.12); }
.status-ready .status-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(31,122,83,.12); }
.status-error .status-dot { background: #c53d3d; box-shadow: 0 0 0 4px rgba(197,61,61,.12); }

.hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 30px; margin-bottom: 42px; }
.hero h2 { max-width: 760px; margin: 0; font: 500 clamp(38px, 6vw, 70px)/1.02 Georgia, "Times New Roman", serif; letter-spacing: -.035em; }
.hero-copy { max-width: 660px; margin: 22px 0 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.metric { min-width: 130px; padding: 0 0 7px 25px; border-left: 1px solid var(--line); }
.metric span { display: block; font: 500 38px/1 Georgia, serif; }
.metric small { display: block; margin-top: 7px; color: var(--muted); }

.panel { margin-top: 20px; padding: 30px; border: 1px solid rgba(204,215,208,.9); border-radius: 24px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.panel-heading { justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.panel-heading h3 { margin: 0; font: 500 28px/1.2 Georgia, serif; }
.hint { color: var(--muted); font-size: 13px; }
.download-controls { display: flex; align-items: center; gap: 12px; }
.download-controls label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.download-controls input { width: 82px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; }
.download-controls input:focus { outline: 2px solid rgba(231,92,52,.2); border-color: var(--accent); }
.expiry-note { margin: -10px 0 18px; padding: 11px 13px; border-radius: 10px; color: var(--muted); background: #f6f8f5; font-size: 12px; line-height: 1.55; }
.token-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.token-grid label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
.token-grid input { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.token-grid input:focus { outline: 2px solid rgba(231,92,52,.2); border-color: var(--accent); }
.token-note { margin: 12px 0 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.drop-zone {
  display: flex; flex-direction: column; align-items: center; width: 100%; padding: 42px 20px;
  border: 1.5px dashed #b8c6be; border-radius: 18px; background: #f8faf7; cursor: pointer; transition: .2s ease;
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--accent); background: #fff8f4; transform: translateY(-1px); }
.upload-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border-radius: 50%; color: white; background: var(--accent); font-size: 23px; }
.drop-title { font-weight: 750; }
.drop-subtitle { margin-top: 6px; color: var(--muted); font-size: 13px; }
.selected-file { align-items: center; gap: 14px; margin-top: 15px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.selected-file:not([hidden]) { display: flex; }
.file-badge { padding: 10px 8px; border-radius: 9px; background: #ebefeb; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.file-info { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.file-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font-size: 24px; }
.icon-button:hover { background: #edf0ed; color: var(--ink); }
.progress-area { margin-top: 20px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.progress-track { overflow: hidden; height: 7px; border-radius: 99px; background: #e9ede9; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .15s ease; }
.actions { gap: 18px; margin-top: 22px; }
.button { border: 0; border-radius: 11px; padding: 11px 17px; cursor: pointer; font-weight: 750; font-size: 13px; transition: .18s ease; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button.primary { color: white; background: var(--accent); box-shadow: 0 8px 20px rgba(231,92,52,.18); }
.button.primary:hover:not(:disabled) { background: var(--accent-dark); transform: translateY(-1px); }
.button.secondary { border: 1px solid var(--line); background: white; }
.button.secondary:hover:not(:disabled) { border-color: #aab8b0; background: #f7f9f7; }
.message { margin: 0; color: var(--muted); font-size: 13px; }
.message.error { color: #b22f2f; }
.message.success { color: var(--green); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 16px 12px; border-bottom: 1px solid #edf0ed; font-size: 13px; }
td:first-child { max-width: 540px; overflow-wrap: anywhere; }
td:first-child strong { display: block; font-size: 14px; }
td:first-child small { display: block; margin-top: 5px; color: var(--muted); font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
td:last-child { text-align: right; }
.object-actions { display: flex; justify-content: flex-end; align-items: center; gap: 7px; white-space: nowrap; }
.download-button, .copy-button { padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-weight: 800; font-size: 12px; }
.download-button { color: var(--accent-dark); }
.copy-button { border: 1px solid var(--line); color: var(--ink); background: white; }
.download-button:hover { text-decoration: underline; }
.copy-button:hover { border-color: #aab8b0; background: #f7f9f7; }
.download-button:disabled, .copy-button:disabled { cursor: wait; opacity: .55; }
.empty-state { padding: 55px 20px; text-align: center; }
.empty-state:not([hidden]) { display: flex; flex-direction: column; align-items: center; }
.empty-state span { font: 400 36px Georgia, serif; color: #aab4ae; }
.empty-state strong { margin-top: 10px; }
.empty-state p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.list-footer { justify-content: space-between; min-height: 40px; padding-top: 18px; }
footer { justify-content: space-between; padding: 28px 6px 0; color: var(--muted); font-size: 12px; }
footer a { color: var(--ink); text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 720px) {
  .shell { width: min(100% - 24px, 1120px); padding-top: 18px; }
  .topbar { margin-bottom: 48px; }
  .hero { grid-template-columns: 1fr; }
  .metric { display: none; }
  .panel { padding: 21px 16px; border-radius: 18px; }
  .hint { display: none; }
  .panel-heading { align-items: flex-start; }
  .download-controls { align-items: flex-end; flex-direction: column; }
  .download-controls label { align-items: flex-start; flex-direction: column; gap: 4px; }
  .token-grid { grid-template-columns: 1fr; }
  th:nth-child(2), td:nth-child(2) { display: none; }
  .actions { align-items: flex-start; flex-direction: column; }
}
