/* Auth + Onboarding + Dashboard */

/* ========== AUTH SPLIT LAYOUT ========== */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
}

.auth-side {
  background: var(--ink);
  color: var(--bg);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
@media (max-width: 900px) {
  .auth-side { display: none; }
}
.auth-side::after {
  content: "REDOVISNING";
  position: absolute;
  bottom: -40px;
  left: -20px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(140px, 22vw, 240px);
  letter-spacing: -0.04em;
  color: rgba(250, 248, 244, 0.04);
  white-space: nowrap;
  pointer-events: none;
  line-height: 1;
}
.auth-logo {
  font-family: var(--font-display);
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.auth-logo .brand-logo-image {
  display: block;
  height: 34px;
  max-width: min(230px, 70vw);
  object-fit: contain;
  width: auto;
}
.auth-logo .logo-mark {
  width: 26px; height: 26px;
  background: var(--bg);
  border-radius: 50%;
  position: relative;
}
.auth-logo .logo-mark::after {
  content: "";
  position: absolute;
  inset: 6px 6px 6px auto;
  width: 8px;
  background: var(--copper);
  border-radius: 0 999px 999px 0;
}
.auth-side-quote {
  position: relative;
  z-index: 1;
  max-width: 480px;
}
.auth-side-quote .kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper-soft);
  margin-bottom: 24px;
}
.auth-side-quote h2 {
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 0 0 24px;
}
.auth-side-quote h2 em { font-style: italic; color: var(--copper-soft); }
.auth-side-quote p {
  font-size: var(--fs-base);
  color: rgba(250, 248, 244, 0.65);
  line-height: 1.55;
  margin: 0;
}
.auth-side-foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(250, 248, 244, 0.4);
}

.auth-main {
  padding: 48px;
  display: flex;
  flex-direction: column;
}
@media (max-width: 600px) { .auth-main { padding: 32px 24px; } }
.auth-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: auto;
}
.auth-top .back {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color .2s;
}
.auth-top .back:hover { color: var(--copper); }
.auth-top .alt {
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.auth-top .alt a { color: var(--copper); text-decoration: underline; text-underline-offset: 3px; }

.auth-card {
  width: 100%;
  max-width: 440px;
  margin: 80px auto;
}
.auth-card .num {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 18px;
}
.auth-card h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 60px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  font-weight: 400;
  margin: 0 0 16px;
}
.auth-card h1 em { font-style: italic; color: var(--copper); }
.auth-card .lede {
  font-size: var(--fs-md);
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0 0 36px;
  max-width: 36ch;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.magic-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all .2s;
}
.magic-btn:hover { background: var(--bg-2); border-color: var(--ink-3); }
.magic-btn .ico { width: 16px; height: 16px; color: var(--copper); }

.auth-foot {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
  display: flex;
  justify-content: space-between;
}

.admin-auth-side::after {
  content: "ADMIN";
}

.admin-auth-card .lede {
  max-width: 40ch;
}

.admin-access-note {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-3);
  font-size: var(--fs-sm);
  line-height: 1.45;
  margin-top: 22px;
  padding: 13px 14px;
}

/* form blocks shared with subpages.css already; extend */
.form-row .help {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-4);
  margin-top: 6px;
}
.form-row.error input { border-color: var(--copper); }
.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 20px 0;
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.checkbox-row input { margin-top: 3px; accent-color: var(--ink); }
.checkbox-row a { color: var(--copper); text-decoration: underline; text-underline-offset: 3px; }

.btn-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 22px;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: background .2s;
}
.btn-block:hover { background: var(--copper); }

/* Plan radio (signup) */
.plan-radio {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}
.plan-radio label {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  align-items: center;
  background: var(--paper);
}
.plan-radio label:hover { border-color: var(--ink-3); }
.plan-radio input { display: none; }
.plan-radio .dot {
  width: 18px; height: 18px;
  border: 1px solid var(--ink-3);
  border-radius: 50%;
  position: relative;
}
.plan-radio input:checked + .dot {
  border-color: var(--ink);
}
.plan-radio input:checked + .dot::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--copper);
  border-radius: 50%;
}
.plan-radio input:checked ~ .body { color: var(--ink); }
.plan-radio input:checked ~ .price-mini strong { color: var(--ink); }
.plan-radio label:has(input:checked) {
  border-color: var(--ink);
  background: var(--bg-2);
}
.plan-radio .body strong {
  display: block;
  font-weight: 500;
  font-size: var(--fs-base);
  letter-spacing: -0.005em;
}
.plan-radio .body span {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.plan-radio .price-mini {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.01em;
}
.plan-radio .price-mini strong { font-weight: 400; color: var(--ink); }
.plan-radio .price-mini .sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-4);
  text-transform: uppercase;
  display: block;
  text-align: right;
}

/* ========== ONBOARDING ========== */
.onb {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.onb-nav {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.onb-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.onb-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.onb-progress .bar {
  width: 240px;
  height: 3px;
  background: var(--line-2);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.onb-progress .bar .fill {
  height: 100%;
  background: var(--copper);
  transition: width .4s ease;
}
@media (max-width: 700px) { .onb-progress .bar { width: 120px; } }

.onb-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0;
}
@media (max-width: 980px) {
  .onb-body { grid-template-columns: 1fr; }
}
.onb-aside {
  padding: 80px 56px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg);
}
@media (max-width: 980px) {
  .onb-aside { padding: 48px 24px 24px; border-right: none; border-bottom: 1px solid var(--line); }
}
.onb-aside .step-num {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 18px;
}
.onb-aside h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  font-weight: 400;
  margin: 0 0 20px;
  max-width: 12ch;
}
.onb-aside h1 em { font-style: italic; color: var(--copper); }
.onb-aside .lede {
  font-size: var(--fs-md);
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0 0 32px;
  max-width: 38ch;
}
.onb-aside .checklist {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  border-top: 1px solid var(--line);
}
.onb-aside .checklist li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  align-items: center;
}
.onb-aside .checklist li.done { color: var(--ink); }
.onb-aside .checklist li.active { color: var(--copper); }
.onb-aside .checklist .glyph {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
}
.onb-aside .checklist li.done .glyph {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.onb-aside .checklist li.active .glyph {
  border-color: var(--copper);
  color: var(--copper);
}

.onb-form {
  padding: 80px 56px;
  background: var(--paper);
  border-left: 1px solid var(--line);
}
@media (max-width: 980px) {
  .onb-form { padding: 48px 24px; border-left: none; }
}
.onb-form .form-section {
  max-width: 560px;
}
.onb-form h2 {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.01em;
  font-weight: 400;
  margin: 0 0 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.onb-form .form-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  gap: 12px;
  align-items: center;
}
.onb-form .form-actions .skip {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.onb-form .form-actions .skip:hover { color: var(--copper); }

/* segment radio (system used) */
.segment {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  overflow: hidden;
}
@media (max-width: 600px) { .segment { grid-template-columns: repeat(2, 1fr); } }
.segment label {
  padding: 14px 12px;
  border-left: 1px solid var(--line-2);
  cursor: pointer;
  text-align: center;
  font-size: var(--fs-sm);
  background: var(--bg);
  transition: all .2s;
}
.segment label:first-child { border-left: none; }
.segment input { display: none; }
.segment label:has(input:checked) {
  background: var(--ink);
  color: var(--bg);
}
@media (max-width: 600px) {
  .segment label:nth-child(3) { border-left: none; border-top: 1px solid var(--line-2); }
  .segment label:nth-child(4) { border-top: 1px solid var(--line-2); }
}

/* number-toggle */
.number-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  overflow: hidden;
}
.number-stepper button {
  width: 40px; height: 40px;
  background: var(--bg);
  border: none;
  font-family: var(--font-mono);
  font-size: 16px;
  cursor: pointer;
  color: var(--ink);
  transition: background .2s;
}
.number-stepper button:hover { background: var(--bg-2); }
.number-stepper input {
  width: 60px;
  text-align: center;
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.01em;
  outline: none;
}

/* ========== CONNECT FORTNOX ========== */
.connect-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 560px;
}
.connect-card .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 24px;
}
.connect-card .badge .dot {
  width: 6px; height: 6px;
  background: var(--sage);
  border-radius: 50%;
}
.connect-card h2 {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: -0.01em;
  font-weight: 400;
  margin: 0 0 16px;
  line-height: 1.15;
}
.connect-card .body {
  font-size: var(--fs-base);
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0 0 28px;
}
.connect-trust {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  border-top: 1px solid var(--line);
}
.connect-trust li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 14px;
  align-items: start;
  font-size: var(--fs-sm);
}
.connect-trust .ico {
  width: 18px; height: 18px;
  color: var(--copper);
  margin-top: 2px;
}
.connect-trust strong { display: block; font-weight: 500; }
.connect-trust span { color: var(--ink-3); font-size: var(--fs-xs); }

/* ========== COMPLETE ========== */
.complete {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.complete-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  position: relative;
  overflow: hidden;
}
.complete-body::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(184, 91, 42, 0.06) 0%, transparent 60%);
  pointer-events: none;
}
.complete-inner {
  text-align: center;
  max-width: 640px;
  position: relative;
}
.complete-mark {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 32px;
  position: relative;
}
.complete-mark::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid var(--copper);
  opacity: 0.5;
  animation: pulse-ring 2s infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.3); opacity: 0; }
}
.complete-inner .kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 18px;
}
.complete-inner h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 84px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  font-weight: 400;
  margin: 0 0 24px;
}
.complete-inner h1 em { font-style: italic; color: var(--copper); }
.complete-inner p {
  font-size: var(--fs-md);
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0 auto 40px;
  max-width: 52ch;
}

.next-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 56px auto 0;
  max-width: 720px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
}
@media (max-width: 700px) { .next-steps { grid-template-columns: 1fr; } }
.next-step {
  padding: 24px;
  border-left: 1px solid var(--line);
}
.next-step:first-child { border-left: none; }
@media (max-width: 700px) {
  .next-step { border-left: none; border-top: 1px solid var(--line); }
  .next-step:first-child { border-top: none; }
}
.next-step .num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 12px;
}
.next-step strong {
  display: block;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.01em;
  font-weight: 400;
  margin-bottom: 6px;
}
.next-step span {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  line-height: 1.5;
}

/* ========== DASHBOARD ========== */
.dash {
  min-height: 100vh;
  background: var(--bg);
}
.dash-nav {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.dash-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dash-nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}
.dash-nav-links a {
  padding: 8px 14px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  border-radius: 6px;
  transition: background .2s;
}
.dash-nav-links a:hover { background: var(--bg-2); }
.dash-nav-links a.active {
  background: var(--bg-2);
  color: var(--ink);
  font-weight: 500;
}
@media (max-width: 700px) { .dash-nav-links a:not(.active) { display: none; } }
.dash-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-user .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--copper);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}
.dash-user .who {
  font-size: var(--fs-sm);
  line-height: 1.2;
}
.dash-user .who strong { font-weight: 500; display: block; }
.dash-user .who span { color: var(--ink-3); font-size: 11px; }
.dash-logout-button {
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  min-height: 32px;
  padding: 6px 11px;
  transition:
    background .2s,
    border-color .2s,
    color .2s;
  white-space: nowrap;
}
.dash-logout-button:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.dash-logout-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.mobile-portal-nav {
  display: none;
}

.portal-review-mobile-cta {
  display: none;
}

.mobile-container {
  width: 100%;
}

.dash-hero {
  padding: 56px 0 32px;
}
.dash-hero .greeting-num {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.dash-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 4.5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 0 0 12px;
}
.dash-hero h1 em { font-style: italic; color: var(--copper); }
.dash-hero p {
  font-size: var(--fs-md);
  color: var(--ink-2);
  margin: 0;
  max-width: 56ch;
}

.portal-action-block {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(184, 91, 42, 0.08), transparent 45%),
    var(--paper);
  border: 1px solid rgba(184, 91, 42, 0.18);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 42px rgba(21, 20, 15, 0.055);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-top: 8px;
  padding: 28px;
}

.portal-action-block.clear {
  background: var(--paper);
  border-color: var(--line);
}

.portal-action-block.review {
  background:
    linear-gradient(135deg, rgba(184, 91, 42, 0.11), transparent 48%),
    var(--paper);
}

.portal-action-eyebrow {
  color: var(--copper);
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.portal-action-block h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 8px;
}

.portal-action-block p {
  color: var(--ink-2);
  font-size: var(--fs-md);
  margin: 0;
  max-width: 58ch;
}

.portal-action-block .btn-pill {
  flex: 0 0 auto;
}

.portal-receipt-habit-panel,
.portal-year-end-panel,
.portal-month-status-panel,
.portal-missing-items-panel {
  align-items: center;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 34px rgba(21, 20, 15, 0.04);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-top: 14px;
  padding: 22px 24px;
}

.portal-month-status-panel.closed {
  border-color: rgba(47, 125, 79, 0.22);
}

.portal-month-status-panel.needs_input {
  border-color: rgba(184, 91, 42, 0.22);
}

.portal-year-end-panel.ready {
  border-color: rgba(47, 125, 79, 0.22);
}

.portal-year-end-panel.approaching {
  border-color: rgba(184, 91, 42, 0.2);
}

.portal-receipt-habit-panel h3,
.portal-year-end-panel h3,
.portal-month-status-panel h3,
.portal-missing-items-panel h3 {
  font-family: var(--font-display);
  font-size: clamp(26px, 2.5vw, 34px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 6px;
}

.portal-receipt-habit-panel p,
.portal-year-end-panel p,
.portal-month-status-panel p {
  color: var(--ink-2);
  font-size: var(--fs-md);
  margin: 0 0 8px;
}

.portal-receipt-habit-panel strong,
.portal-year-end-panel strong,
.portal-month-status-panel strong {
  color: var(--copper);
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: 6px;
}

.portal-year-end-panel.ready strong {
  color: #2f7d4f;
}

.portal-month-status-panel.closed strong {
  color: #2f7d4f;
}

.portal-month-facts {
  display: grid;
  flex: 0 0 min(320px, 42%);
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.portal-month-facts div {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.portal-month-facts dt {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.portal-month-facts dd {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  margin: 0;
}

.portal-missing-items-panel {
  align-items: stretch;
  display: block;
}

.portal-missing-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.portal-missing-item {
  align-items: center;
  background: rgba(184, 91, 42, 0.055);
  border: 1px solid rgba(184, 91, 42, 0.16);
  border-radius: 14px;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr auto;
  padding: 14px 16px;
}

.portal-missing-item strong,
.portal-missing-item span {
  display: block;
}

.portal-missing-item span {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.45;
  margin-top: 3px;
}

.portal-missing-item a {
  color: var(--copper);
  font-weight: 700;
  white-space: nowrap;
}

.portal-core-value-line {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.05;
  margin: 18px 0 12px;
}

.portal-alerts-panel,
.portal-insights-panel,
.portal-cost-leaks-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 42px rgba(21, 20, 15, 0.045);
  margin-top: 8px;
  padding: 24px;
}

.portal-insights-panel,
.portal-cost-leaks-panel {
  margin-top: 14px;
}

.portal-alert-list {
  display: grid;
  gap: 10px;
}

.portal-insight-list {
  display: grid;
  gap: 8px;
}

.portal-cost-leak-list {
  display: grid;
  gap: 8px;
}

.portal-insight-item,
.portal-cost-leak-item {
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  display: grid;
  font-size: 14px;
  gap: 10px;
  grid-template-columns: 8px 1fr;
  line-height: 1.45;
  padding: 13px 15px;
}

.portal-cost-leak-item {
  background: rgba(184, 91, 42, 0.055);
  border-color: rgba(184, 91, 42, 0.16);
}

.portal-insight-dot,
.portal-cost-leak-dot {
  background: var(--copper);
  border-radius: 999px;
  height: 7px;
  width: 7px;
}

.portal-cost-leak-dot {
  height: 8px;
  width: 8px;
}

.portal-alert-item {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 14px;
  grid-template-columns: 34px 1fr auto;
  padding: 14px 16px;
}

.portal-alert-item.cost_spike,
.portal-alert-item.vat {
  background: rgba(184, 91, 42, 0.055);
  border-color: rgba(184, 91, 42, 0.16);
}

.portal-alert-item.inactivity {
  background: rgba(79, 92, 77, 0.055);
}

.portal-alert-icon {
  align-items: center;
  background: rgba(184, 91, 42, 0.12);
  border-radius: 999px;
  color: var(--copper);
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 12px;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.portal-alert-item.inactivity .portal-alert-icon {
  background: rgba(79, 92, 77, 0.12);
  color: var(--sage);
}

.portal-alert-item strong,
.portal-alert-empty strong {
  display: block;
  font-weight: 500;
  margin-bottom: 3px;
}

.portal-alert-item span,
.portal-alert-empty span {
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.45;
}

.portal-alert-item a {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.portal-alert-item a:hover {
  color: var(--copper);
}

.portal-alert-empty {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}

.portal-comments-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
}

.portal-comment-list {
  display: grid;
  gap: 8px;
}

.portal-comment-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}

.portal-comment-item span {
  color: var(--copper);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
}

.portal-comment-item p {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
}

.portal-form-field {
  display: grid;
  gap: 8px;
}

.portal-form-field > span,
.portal-form-field label {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}

.portal-form-control {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-sizing: border-box;
  color: var(--ink);
  font: inherit;
  min-height: 48px;
  padding: 12px 14px;
  width: 100%;
}

.portal-form-control:focus {
  border-color: rgba(184, 91, 42, 0.44);
  outline: 3px solid rgba(184, 91, 42, 0.12);
}

.dash-status-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 40px;
}
.dash-status-row.action-metrics,
.dash-status-row.system-status-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dash-status-row.action-metrics {
  margin-top: 18px;
}

.dash-status-row.system-status-row {
  margin-top: 0;
}

@media (max-width: 980px) { .dash-status-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .dash-status-row { grid-template-columns: 1fr; } }

.status-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  position: relative;
  transition: border-color .2s;
}
.status-card:hover { border-color: var(--ink-3); }
.status-card .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.status-card .label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.status-card .pill {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.status-card .pill.green { background: rgba(79, 92, 77, 0.12); color: var(--sage); }
.status-card .pill.copper { background: rgba(184, 91, 42, 0.1); color: var(--copper); }
.status-card .pill.neutral { background: var(--bg-2); color: var(--ink-3); }
.status-card .big {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}
.status-card .big em { font-style: italic; color: var(--copper); }
.status-card .big-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.status-card .foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.status-card .foot a { color: var(--ink); display: inline-flex; gap: 4px; align-items: center; }
.status-card .foot a:hover { color: var(--copper); }

.status-card.compact {
  min-height: 170px;
}

/* dashboard panels */
.dash-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-top: 40px;
  margin-bottom: 80px;
}
@media (max-width: 900px) { .dash-row { grid-template-columns: 1fr; } }

.system-status-section {
  margin-bottom: 80px;
  margin-top: -56px;
}

@media (max-width: 768px) {
  .portal-container {
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    width: 100%;
  }

  .mobile-container {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  .dash main > .portal-container:not(.dash-hero) {
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }

  .mobile-container > * {
    max-width: 100%;
  }

  .dash main > .portal-container > *,
  .dash main > .portal-container .dash-panel,
  .portal-container .status-card,
  .portal-container .portal-action-block,
  .portal-container .portal-receipt-habit-panel,
  .portal-container .portal-year-end-panel,
  .portal-container .portal-month-status-panel,
  .portal-container .portal-missing-items-panel,
  .portal-container .portal-alerts-panel,
  .portal-container .portal-insights-panel,
  .portal-container .portal-cost-leaks-panel,
  .portal-container .upload-card,
  .portal-container .recent-upload-card {
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
  }

  .portal-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .dash {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .dash-nav {
    padding: 10px 0;
  }

  .dash-nav-links {
    display: none;
  }

  .dash-user .who {
    display: none;
  }

  .dash-user {
    gap: 8px;
  }

  .dash-user .avatar {
    height: 30px;
    width: 30px;
  }

  .dash-logout-button {
    font-size: 12px;
    min-height: 34px;
    padding: 7px 10px;
  }

  .dash-hero {
    padding: 28px 0 18px;
  }

  .dash-hero.mobile-container,
  .dash-hero.portal-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .dash-hero .greeting-num {
    margin-bottom: 10px;
  }

  .dash-hero h1 {
    font-size: clamp(34px, 10vw, 42px);
    margin-bottom: 10px;
  }

  .dash-hero p {
    font-size: 15px;
    line-height: 1.45;
  }

  .mobile-portal-nav {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 26px rgba(21, 20, 15, 0.12);
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    left: 16px;
    padding: 7px;
    position: fixed;
    right: 16px;
    z-index: 120;
  }

  .mobile-portal-nav a {
    border-radius: 13px;
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 600;
    min-width: 0;
    padding: 10px 6px;
    text-align: center;
  }

  .mobile-portal-nav a.active {
    background: var(--ink);
    color: var(--bg);
  }

  .portal-action-block {
    align-items: stretch;
    border-radius: 14px;
    box-shadow: 0 18px 42px rgba(21, 20, 15, 0.08);
    flex-direction: column;
    gap: 14px;
    margin-top: 2px;
    padding: 20px;
  }

  .portal-action-block .btn-pill {
    justify-content: center;
    min-height: 50px;
    width: 100%;
  }

  .portal-action-block h2 {
    font-size: clamp(30px, 9vw, 38px);
  }

  .portal-action-block p {
    font-size: 15px;
    line-height: 1.45;
  }

  .portal-receipt-habit-panel,
  .portal-year-end-panel,
  .portal-month-status-panel,
  .portal-missing-items-panel {
    align-items: stretch;
    border-radius: 14px;
    flex-direction: column;
    gap: 14px;
    margin-top: 8px;
    padding: 18px;
  }

  .portal-receipt-habit-panel .btn-pill,
  .portal-year-end-panel .btn-pill {
    justify-content: center;
    width: 100%;
  }

  .portal-receipt-habit-panel h3,
  .portal-year-end-panel h3,
  .portal-month-status-panel h3,
  .portal-missing-items-panel h3 {
    font-size: clamp(26px, 8vw, 34px);
  }

  .portal-receipt-habit-panel p,
  .portal-year-end-panel p,
  .portal-month-status-panel p {
    font-size: 15px;
    line-height: 1.45;
  }

  .portal-month-facts {
    flex-basis: auto;
    width: 100%;
  }

  .portal-month-facts div {
    padding: 12px;
  }

  .portal-month-facts dd {
    font-size: 24px;
  }

  .portal-missing-item {
    align-items: start;
    grid-template-columns: 1fr;
    padding: 13px 14px;
  }

  .portal-comments-panel {
    border-radius: 14px;
    padding: 16px;
  }

  .portal-core-value-line {
    font-size: 22px;
    margin: 10px 0 8px;
  }

  .portal-alerts-panel,
  .portal-insights-panel,
  .portal-cost-leaks-panel {
    border-radius: 14px;
    margin-top: 8px;
    padding: 16px;
    width: 100%;
  }

  .portal-alerts-panel {
    box-shadow: 0 12px 30px rgba(21, 20, 15, 0.055);
  }

  .portal-insights-panel {
    background: rgba(255, 255, 255, 0.74);
    box-shadow: none;
  }

  .portal-alert-item {
    align-items: start;
    grid-template-columns: 30px 1fr;
    padding: 13px 14px;
  }

  .portal-alert-item a {
    grid-column: 2;
  }

  .dash-status-row.action-metrics {
    margin-top: 14px;
  }

  .dash-status-row,
  .dash-status-row.action-metrics,
  .dash-status-row.system-status-row {
    gap: 10px;
    grid-template-columns: 1fr;
    margin-top: 14px;
  }

  .status-card {
    border-radius: 14px;
    min-height: auto;
    padding: 16px;
    width: 100%;
  }

  .status-card .head {
    margin-bottom: 14px;
  }

  .status-card .big {
    font-size: 36px;
  }

  .dash-row {
    gap: 10px;
    margin-bottom: 22px;
    margin-top: 14px;
  }

  .dashboard-secondary-upload-panel {
    display: none;
  }

  .dash-status-row.action-metrics .status-card .foot a {
    display: none;
  }

  .system-status-section {
    margin-bottom: 24px;
    margin-top: 18px;
  }

  .dash-panel {
    border-radius: 14px;
    padding: 16px;
    width: 100%;
  }

  .activity-row {
    align-items: start;
    grid-template-columns: 1fr;
  }
}

.dash-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.dash-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.dash-panel-head h3 {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.01em;
  font-weight: 400;
  margin: 0;
}
.dash-panel-head .meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.activity-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
  align-items: center;
}
.activity-row:last-child { border-bottom: none; }
.activity-row .when {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.activity-row .what strong {
  font-weight: 500;
  display: block;
}
.activity-row .what span { color: var(--ink-3); font-size: 12px; }
.activity-row .by {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.upload-zone {
  margin-top: 20px;
  padding: 28px;
  border: 1px dashed var(--ink-3);
  border-radius: var(--radius-lg);
  text-align: center;
  background: var(--bg);
}
.upload-zone strong {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.01em;
  font-weight: 400;
  display: block;
  margin-bottom: 4px;
}
.upload-zone span {
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.upload-zone .btn-pill {
  margin-top: 16px;
  display: inline-block;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 500;
}

/* ========== PORTAL UPLOAD ========== */
.upload-page {
  background:
    radial-gradient(circle at 20% 0%, rgba(184, 91, 42, 0.05), transparent 32%),
    linear-gradient(180deg, #fffdf9 0%, var(--bg) 48%, var(--bg-2) 100%);
}
.upload-page .dash-nav {
  background: rgba(255, 253, 249, 0.92);
  box-shadow: 0 10px 30px rgba(21, 20, 15, 0.04);
}
.upload-page .dash-nav-inner {
  min-height: 58px;
}
.upload-shell {
  padding-top: 54px;
  padding-bottom: 80px;
}
.upload-hero {
  align-items: center;
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  margin-bottom: 32px;
}
.upload-hero .greeting-num {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  margin-bottom: 28px;
  text-transform: uppercase;
}
.upload-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 0 0 20px;
}
.upload-hero h1 em {
  color: var(--copper);
  font-style: italic;
}
.upload-hero p {
  color: var(--ink-2);
  font-size: var(--fs-md);
  line-height: 1.55;
  margin: 0;
  max-width: 620px;
}

.upload-hero .upload-start-guidance {
  color: var(--ink);
  font-weight: 600;
  margin-top: 12px;
}
.upload-trust-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(21, 20, 15, 0.045);
  display: grid;
  gap: 14px;
  grid-template-columns: auto 1fr;
  justify-self: end;
  max-width: 340px;
  padding: 16px;
}
.upload-trust-card .trust-icon {
  align-items: center;
  background: radial-gradient(circle at 30% 20%, #ffffff 0%, var(--bg-2) 72%);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(21, 20, 15, 0.07);
  color: var(--copper);
  display: flex;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  height: 48px;
  justify-content: center;
  line-height: 1;
  width: 48px;
}
.upload-trust-card .trust-icon svg {
  fill: none;
  height: 22px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 22px;
}
.upload-trust-card strong {
  display: block;
  font-weight: 600;
  margin-bottom: 3px;
}
.upload-trust-card div > span {
  color: var(--ink-3);
  display: block;
  font-size: var(--fs-sm);
  line-height: 1.45;
}
.upload-alert {
  margin-bottom: 18px;
}
.upload-success-card {
  align-items: flex-start;
  background: rgba(47, 125, 79, 0.08);
  border: 1px solid rgba(47, 125, 79, 0.18);
  border-radius: 12px;
  color: var(--ink);
  display: grid;
  gap: 8px;
  letter-spacing: normal;
  padding: 16px;
  text-transform: none;
}
.upload-success-card strong {
  color: #2f7d4f;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
}
.upload-success-card span {
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  line-height: 1.45;
}
.upload-success-card .btn-pill {
  justify-self: start;
  margin-top: 4px;
}
.upload-quick-actions {
  display: none;
  gap: 10px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
}
.upload-camera-input {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}
.upload-camera-button,
.upload-secondary-file-button {
  align-items: center;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font-size: var(--fs-sm);
  font-weight: 700;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  text-align: center;
}
.upload-camera-button {
  background: var(--ink);
  box-shadow: 0 14px 30px rgba(21, 20, 15, 0.16);
  color: var(--bg);
}
.upload-secondary-file-button {
  background: var(--paper);
  border: 1px solid var(--line-2);
  color: var(--ink);
}
.upload-camera-button[aria-disabled="true"],
.upload-secondary-file-button[aria-disabled="true"] {
  cursor: wait;
  opacity: 0.72;
}
.upload-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(21, 20, 15, 0.07);
  display: grid;
  gap: 34px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  margin-bottom: 22px;
  padding: 30px;
}
.upload-dropzone {
  align-items: center;
  background: rgba(255, 253, 249, 0.72);
  border: 1.5px dashed rgba(21, 20, 15, 0.3);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 315px;
  padding: 34px;
  text-align: center;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.upload-dropzone.is-dragging {
  background: rgba(184, 91, 42, 0.06);
  border-color: var(--copper);
  box-shadow: inset 0 0 0 1px rgba(184, 91, 42, 0.16);
}
.upload-dropzone input[type="file"] {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}
.upload-file-icon {
  align-items: center;
  background: rgba(184, 91, 42, 0.09);
  border-radius: 50%;
  color: var(--copper);
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 11px;
  height: 72px;
  justify-content: center;
  letter-spacing: 0.05em;
  margin-bottom: 22px;
  width: 72px;
}
.upload-dropzone strong {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
}
.upload-dropzone-mobile {
  display: none;
}
.upload-dropzone-desktop {
  display: inline;
}
.upload-or,
.upload-hint {
  color: var(--ink-3);
  display: block;
  font-size: var(--fs-sm);
}
.upload-or {
  margin: 8px 0 14px;
}
.upload-hint {
  margin-top: 14px;
}
.upload-select-button,
.upload-submit-button {
  align-items: center;
  background: linear-gradient(180deg, var(--copper-soft), var(--copper));
  border: none;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(184, 91, 42, 0.18);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: var(--fs-sm);
  font-weight: 600;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
}
.upload-select-button:hover,
.upload-submit-button:hover {
  background: var(--ink);
}
.upload-submit-button {
  margin-top: 14px;
}
.upload-submit-button:disabled {
  background: var(--bg-3);
  box-shadow: none;
  color: var(--ink-4);
  cursor: not-allowed;
}
.selected-file {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
  max-width: min(100%, 480px);
  padding: 9px 12px;
}
.selected-file span {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selected-file small {
  color: var(--ink-3);
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 10px;
}
.upload-guidance {
  align-content: center;
  border-left: 1px solid var(--line);
  display: grid;
  gap: 14px;
  padding-left: 34px;
}
.guidance-item {
  align-items: center;
  background: transparent;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: auto 1fr;
  min-height: 76px;
  padding: 12px 0;
}
.guidance-item:last-child {
  border-bottom: none;
}
.guidance-item .guidance-icon {
  align-items: center;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(21, 20, 15, 0.055);
  color: var(--ink);
  display: flex;
  font-family: var(--font-mono);
  font-size: 12px;
  height: 48px;
  justify-content: center;
  line-height: 1;
  width: 48px;
}
.guidance-item .guidance-icon svg {
  fill: none;
  height: 22px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  width: 22px;
}
.guidance-item strong {
  display: block;
  font-weight: 600;
  margin: 2px 0 6px;
}
.guidance-item div > span {
  color: var(--ink-3);
  display: block;
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.manual-fields {
  border-top: 1px solid var(--line);
  grid-column: 1 / -1;
  padding-top: 20px;
}
.manual-fields summary {
  cursor: pointer;
  font-weight: 600;
}
.manual-fields .help-text {
  color: var(--ink-3);
  font-size: var(--fs-sm);
  margin: 8px 0 18px;
}
.manual-fields-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.manual-fields .field label {
  color: var(--ink-3);
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  margin-bottom: 7px;
  text-transform: uppercase;
}
.manual-fields .field input,
.manual-fields .field select {
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--ink);
  font-size: var(--fs-sm);
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}
.manual-fields .field input:focus,
.manual-fields .field select:focus {
  border-color: var(--ink);
  outline: none;
}
.recent-upload-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(21, 20, 15, 0.06);
  padding: 24px 30px;
}
.recent-upload-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 16px;
}
.recent-upload-head h2 {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}
.recent-upload-head a {
  border: 1px solid var(--line-2);
  border-radius: 6px;
  font-size: var(--fs-sm);
  padding: 7px 12px;
}
.recent-upload-row {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  padding: 12px 0;
}
.recent-file-badge {
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--copper);
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 11px;
  height: 56px;
  justify-content: center;
  width: 56px;
}
.recent-main strong,
.recent-main small {
  display: block;
}
.recent-main strong {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-main small {
  color: var(--ink-3);
  font-size: var(--fs-sm);
}
.recent-status {
  background: rgba(184, 91, 42, 0.09);
  border-radius: 999px;
  color: var(--copper);
  font-size: 12px;
  padding: 4px 12px;
  white-space: nowrap;
}
.recent-arrow {
  color: var(--ink);
  font-size: 22px;
}
.recent-empty {
  color: var(--ink-3);
  display: grid;
  font-size: var(--fs-sm);
  gap: 2px;
  padding: 22px 0 8px;
}
.recent-empty strong {
  color: var(--ink);
  font-weight: 600;
}
@media (max-width: 980px) {
  .upload-hero,
  .upload-card {
    grid-template-columns: 1fr;
  }
  .upload-guidance {
    border-left: none;
    border-top: 1px solid var(--line);
    grid-template-columns: repeat(3, 1fr);
    padding-left: 0;
    padding-top: 24px;
  }
  .guidance-item {
    align-items: start;
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .upload-shell {
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
    padding-top: 18px;
  }

  .upload-hero {
    gap: 12px;
    margin-bottom: 14px;
  }

  .upload-hero .greeting-num {
    margin-bottom: 12px;
  }

  .upload-hero h1 {
    font-size: clamp(34px, 10vw, 44px);
    margin-bottom: 8px;
  }

  .upload-hero p {
    font-size: 15px;
    line-height: 1.45;
  }

  .upload-trust-card {
    justify-self: stretch;
    max-width: none;
  }
  .upload-card,
  .recent-upload-card {
    border-radius: 14px;
    padding: 16px;
    width: 100%;
  }
  .upload-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .upload-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    grid-template-columns: none;
  }
  .upload-camera-button {
    font-size: 16px;
    min-height: 56px;
    width: 100%;
  }
  .upload-secondary-file-button {
    box-shadow: none;
    min-height: 44px;
    width: 100%;
  }
  .upload-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .upload-quick-actions {
    order: 1;
  }
  .upload-guidance,
  .manual-fields-grid {
    grid-template-columns: 1fr;
  }
  .upload-guidance {
    order: 2;
  }
  .upload-guidance,
  .upload-dropzone,
  .manual-fields {
    display: none;
  }
  .guidance-item {
    grid-template-columns: auto 1fr;
  }
  .upload-dropzone {
    border-radius: 14px;
    min-height: auto;
    order: 3;
    padding: 16px;
    width: 100%;
  }
  .upload-file-icon {
    height: 44px;
    margin-bottom: 10px;
    width: 44px;
  }
  .upload-dropzone strong {
    font-size: 17px;
  }
  .upload-dropzone-mobile {
    display: inline;
  }
  .upload-dropzone-desktop {
    display: none;
  }
  .upload-dropzone .upload-select-button,
  .upload-dropzone .upload-or {
    display: none;
  }
  .manual-fields {
    order: 4;
  }
  .recent-upload-row {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .recent-status,
  .recent-arrow {
    justify-self: start;
    margin-left: 72px;
  }
  .recent-upload-head {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }
}
