/* CargoTXT application polish: clearer hierarchy without changing workflows. */
:root {
  --bg: #0c131b;
  --panel: #14202a;
  --head: #1a2935;
  --line: #30414d;
  --line2: #40515e;
  --ink: #f0f3f5;
  --muted: #afbbc4;
  --accent: #f28a43;
}

body { font-size: 15px; line-height: 1.55; }
.topbar { height: 64px; padding: 0; position: relative; z-index: 25; }
.topbar-inner { width: 100%; max-width: 1200px; height: 100%; margin: 0 auto; padding: 0 24px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.brand { color: var(--ink); text-decoration: none; }
.brand:hover .brand-wordmark { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.brand .brand-wordmark { font-size: 22px; }
.brand-mark { width: 32px; height: 27px; }
.brand > span:last-child { font-size: 13px; }
.system-label { font-size: 12px; }
.language-control { display: block; position: relative; }
.language-control summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 0 8px; border: 0; list-style: none; color: var(--ink); font-size: 13px; cursor: pointer; }
.language-control summary::-webkit-details-marker { display: none; }
.language-control summary:hover, .language-control[open] summary { color: var(--accent); }
.language-control summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.language-chevron { font-size: 17px; line-height: 1; }
.language-options { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 138px; padding: 5px; border: 1px solid var(--line2); border-radius: 4px; background: var(--panel); box-shadow: 0 10px 24px #0008; }
.language-options button { display: block; width: 100%; min-height: 38px; padding: 7px 10px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); text-align: left; font: 13px var(--sans); cursor: pointer; }
.language-options button:hover, .language-options button[aria-pressed="true"] { background: var(--head); color: var(--ink); }
.language-options button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.public-top-nav { display: flex; align-items: center; justify-content: center; gap: 18px; min-width: 0; margin-left: auto; }
.public-top-nav a { color: var(--muted); font-size: 12px; text-decoration: none; white-space: nowrap; }
.public-top-nav a:hover { color: var(--ink); }
.public-top-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
body.auth-view .topbar { height: auto; min-height: 64px; }
body.auth-view .system-label { display: none; }

.workspace { max-width: 1600px; margin: 0 auto; border: 0; }
.breadcrumb {
  padding: 16px clamp(20px, 3vw, 42px) 0;
  background: transparent;
  border: 0;
  font-size: 12px;
  letter-spacing: 0;
}
.content { padding: 30px clamp(20px, 3vw, 42px) 52px; }
.page-header { margin-bottom: 27px; }
.page-header h1 { font-size: clamp(29px, 2.5vw, 36px); font-weight: 650; letter-spacing: -.035em; }
.page-header p:not(.eyebrow), .account-page .page-header p:not(.eyebrow) {
  font-size: 14px;
  line-height: 1.65;
  max-width: 72ch;
}
.eyebrow { font-size: 12px; letter-spacing: .075em; }
.goal { background: var(--head); border-color: var(--line); padding: 11px 15px; }
.goal span { font-size: 11px; }
.goal strong { font-size: 18px; font-variant-numeric: tabular-nums; }

.panel { border-color: var(--line); border-radius: 6px; }
.panel-header { height: auto; min-height: 51px; padding: 10px 18px; background: var(--panel); border-color: var(--line); }
.panel-header h2 { font-size: 16px; font-weight: 650; }
.panel-header span { font-size: 11px; letter-spacing: .025em; }
.panel-body { padding: 21px; }
.button {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 650;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.button:hover:not(:disabled) { border-color: var(--accent); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button.primary:hover:not(:disabled) { background: #f5a066; border-color: #f5a066; filter: none; }

.upload-layout { grid-template-columns: minmax(0, 1.45fr) minmax(290px, .72fr); gap: 20px; align-items: start; }
.document-mode-label { font-size: 13px; margin-bottom: 16px; }
.document-mode-label select { min-height: 46px; padding: 10px 12px; font: 14px var(--sans); border-radius: 4px; }
.dropzone {
  min-height: 340px;
  padding: 35px 24px;
  background: #101c26;
  border: 2px dashed #47606d;
  border-radius: 6px;
  transition: background-color .18s ease, border-color .18s ease;
}
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent); background: #172633; }
.dropzone.is-over, .dropzone.has-file { background: #2a211d; }
.drop-icon { width: 60px; height: 60px; margin-bottom: 20px; border-radius: 4px; }
.dropzone h3 { max-width: 30ch; font-size: clamp(20px, 1.65vw, 24px); font-weight: 650; line-height: 1.35; text-wrap: balance; }
.dropzone p { font-size: 14px; margin-bottom: 18px; }
.dropzone small { font: 12px/1.5 var(--sans); }
.upload-controls { margin-top: 18px; }
.api-key-label, .api-key-label span { font-size: 13px; }
.api-key-label input { min-height: 44px; padding: 10px 12px; border-radius: 4px; }
.scope-list li { grid-template-columns: 28px 1fr; gap: 12px; padding: 15px 0; }
.scope-list strong { font-size: 14px; font-weight: 650; }
.scope-list p { font-size: 13px; line-height: 1.55; }
.scope-note { margin-top: 17px; padding: 14px 16px; font-size: 13px; line-height: 1.6; }

body.public-mode .app-shell { max-width: 1200px; grid-template-columns: 238px minmax(0, 1fr); }
body.public-mode .workspace { min-height: calc(100dvh - 64px); }
body > footer { max-width: 1200px; }
.account-nav {
  min-height: calc(100dvh - 64px);
  padding: 29px 16px 20px;
  background: #111c25;
  border-color: var(--line);
  gap: 5px;
}
.nav-group-label { padding: 0 11px 9px; font: 700 11px var(--sans); letter-spacing: .08em; }
.nav-group-label.account-group { padding-top: 25px; }
.nav-item { min-height: 48px; padding: 10px 11px; border-radius: 4px; font-size: 14px; gap: 10px; }
.nav-item > span { font-size: 18px; width: 20px; }
.nav-item:hover { background: #22333e; }
.nav-item.active { background: #2b302d; box-shadow: inset 3px 0 var(--accent); }
.nav-footnote { font-size: 12px; line-height: 1.55; }
.nav-count { font-size: 11px; }

.usage-section { margin-bottom: 34px; }
.usage-summary > div { padding: 23px 24px; gap: 7px; }
.usage-summary small, .usage-summary span { font-size: 13px; }
.usage-summary strong, .usage-summary strong span { font-size: 24px; font-weight: 650; }
.pricing-heading { margin-bottom: 18px; }
.pricing-heading h2 { font-size: 25px; font-weight: 650; letter-spacing: -.025em; }
.pricing-heading-actions > p { font-size: 13px; line-height: 1.55; }
.currency-control { font-size: 12px; }
.currency-control select { min-height: 40px; font-size: 14px; border-radius: 4px; }
.plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.plan-card { min-height: 365px; padding: 23px 24px 0; }
.plan-card.featured { padding-top: 21px; }
.plan-label, .plan-state { font-size: 12px; }
.plan-card h3 { font-size: 25px; font-weight: 680; margin-top: 15px; }
.plan-subtitle { font-size: 14px; min-height: 0; }
.plan-price { min-height: 83px; }
.plan-price strong { font-size: 32px; }
.plan-price span, .plan-allotment span { font-size: 13px; }
.plan-allotment strong { font-size: 16px; font-weight: 650; }
.plan-card ul { gap: 10px; margin-bottom: 23px; }
.plan-card li { grid-template-columns: 17px minmax(0, 1fr); font-size: 13px; line-height: 1.5; }
.plan-card-bottom { margin-inline: -24px; padding: 13px 24px; font-size: 12px; }
.plan-card-bottom:has(.plan-preview-button) { padding: 10px 18px; }
.plan-preview-button { min-height: 42px; font-size: 13px; }
.pricing-example { padding: 14px 18px; font-size: 13px; }
.pricing-currency-policy, .pricing-foot p { font-size: 13px; }
.pricing-foot strong { font-size: 14px; }

.auth-intro h1 { font-size: clamp(32px, 3.2vw, 44px); font-weight: 680; letter-spacing: -.04em; }
.auth-intro > p:not(.eyebrow) { font-size: 15px; line-height: 1.7; }
.auth-card { margin-top: 12px; }
.auth-card label, .key-form label, .recovery-card label { font-size: 13px; }
.auth-card input, .key-form input, .recovery-card input { min-height: 46px; font-size: 14px; border-radius: 4px; }
.auth-note, .settings-card .panel-body > p { font-size: 13px; }
.form-message { font-size: 13px; }

.documents-table, .containers table, .batch-summary-table { font-size: 13px; }
.documents-table th, .documents-table td, .containers th, .containers td { padding-block: 13px; }
.documents-table tbody tr:hover, .containers tbody tr:hover { background: #1c2d38; }
.empty-state { padding: 23px; font-size: 14px; }
.field-row .label, .field-row .value { font-size: 13px; }
.field-row .state { font-size: 12px; }
.field-groups { padding-inline: 17px; }
.batch-results-heading h2 { font-size: 25px; }
.result-file-heading h3 { font-size: 19px; }
.batch-summary-stats small { font-size: 12px; }
.batch-summary-stats strong { font-size: 21px; }
.feedback-compose label, .feedback-compose select, .feedback-compose input[type=text], .feedback-compose textarea { font-size: 13px; }

@media (max-width: 1050px) {
  body.public-mode .app-shell { grid-template-columns: 205px minmax(0, 1fr); }
  .account-nav { padding-inline: 10px; }
  .upload-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  body.auth-view .topbar-inner { flex-wrap: wrap; padding-block: 10px; gap: 10px 16px; }
  body.auth-view .public-top-nav { order: 3; width: 100%; justify-content: flex-start; gap: 18px; margin-left: 0; overflow-x: auto; padding: 3px 0 5px; }
  body.auth-view .topbar-actions { margin-left: auto; }
}

@media (max-width: 760px) {
  body.public-mode .app-shell { display: block; }
  .account-nav { top: 64px; min-height: 0; }
  .mobile-menu:not([hidden]) { min-height: 40px; min-width: 44px; }
  .auth-page { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  .topbar { height: 58px; }
  body.auth-view .topbar { min-height: 58px; }
  .topbar-inner { padding-inline: 16px; }
  .brand .brand-wordmark { font-size: 18px; }
  .account-nav { top: 58px; }
  .workspace { margin: 0; }
  .breadcrumb { padding: 13px 16px 0; }
  .content { padding: 22px 16px 42px; }
  .page-header { margin-bottom: 21px; }
  .page-header h1 { font-size: 29px; }
  .page-header p:not(.eyebrow) { font-size: 13px; }
  .panel-body { padding: 16px; }
  .dropzone { min-height: 280px; padding: 26px 14px; }
  .dropzone h3 { font-size: 20px; }
  .dropzone p { font-size: 13px; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-card { min-height: 0; }
  .usage-summary > div { padding: 17px 18px; }
  .pricing-heading h2 { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .button, .dropzone { transition: none; }
}
