@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap");

:root {
  color-scheme: light;
  --background: #FAFCF8;
  --foreground: #111827;
  --card: #FFFFFF;
  --card-foreground: #111827;
  --primary: oklch(0.8871 0.2122 128.5041);
  --primary-foreground: oklch(0 0 0);
  --secondary: #344258;
  --secondary-foreground: #F8FAFC;
  --muted: #EEF2F3;
  --muted-foreground: #374151;
  --placeholder: #4B5563;
  --accent: #F2F8E9;
  --destructive: #7F1D1D;
  --border: #7C899B;
  --ring: #3B6500;
  --hero-base: #FAFCF8;
  --hero-glow: #EDF6D9;
  --surface-alt: #F5F7F4;
  --result-background: #F0F8DD;
  --selected-background: #EFF9DD;
  --status-foreground: #28520A;
  --feature-yellow: #F2F4C5;
  --feature-blue: #E8F1F7;
  --feature-peach: #F8EDE4;
  --feature-green: #E7F4EA;
  --delivered-background: #DDF8DE;
  --delivered-foreground: #14532D;
  --transit-background: #E6F1FF;
  --transit-foreground: #173F68;
  --delayed-background: #FFF2CC;
  --delayed-foreground: #713F12;
  --radius: 1rem;
  --shadow: 0 12px 30px hsl(220 35% 15% / 0.08);
  --font-sans: "DM Sans", Inter, system-ui, sans-serif;
  --font-display: Manrope, Inter, system-ui, sans-serif;
}

.dark {
  color-scheme: dark;
  --background: #0F172A;
  --foreground: #F8FAFC;
  --card: #172033;
  --card-foreground: #F8FAFC;
  --secondary: #334155;
  --secondary-foreground: #F8FAFC;
  --muted: #1E293B;
  --muted-foreground: #E2E8F0;
  --placeholder: #CBD5E1;
  --accent: #20382D;
  --destructive: #FFB4AB;
  --border: #64748B;
  --ring: #B8F20C;
  --hero-base: #0F172A;
  --hero-glow: #20382D;
  --surface-alt: #111C31;
  --result-background: #1F3528;
  --selected-background: #263A24;
  --status-foreground: #D7FF8A;
  --feature-yellow: #2C351C;
  --feature-blue: #1B3043;
  --feature-peach: #3C2A24;
  --feature-green: #1D362B;
  --delivered-background: #183C2B;
  --delivered-foreground: #C8FACC;
  --transit-background: #183450;
  --transit-foreground: #D8ECFF;
  --delayed-background: #493713;
  --delayed-foreground: #FFF0B3;
  --shadow: 0 12px 34px hsl(0 0% 0% / 0.38);
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    color-scheme: dark;
    --background: #0F172A;
    --foreground: #F8FAFC;
    --card: #172033;
    --card-foreground: #F8FAFC;
    --secondary: #334155;
    --secondary-foreground: #F8FAFC;
    --muted: #1E293B;
    --muted-foreground: #E2E8F0;
    --placeholder: #CBD5E1;
    --accent: #20382D;
    --destructive: #FFB4AB;
    --border: #64748B;
    --ring: #B8F20C;
    --hero-base: #0F172A;
    --hero-glow: #20382D;
    --surface-alt: #111C31;
    --result-background: #1F3528;
    --selected-background: #263A24;
    --status-foreground: #D7FF8A;
    --feature-yellow: #2C351C;
    --feature-blue: #1B3043;
    --feature-peach: #3C2A24;
    --feature-green: #1D362B;
    --delivered-background: #183C2B;
    --delivered-foreground: #C8FACC;
    --transit-background: #183450;
    --transit-foreground: #D8ECFF;
    --delayed-background: #493713;
    --delayed-foreground: #FFF0B3;
    --shadow: 0 12px 34px hsl(0 0% 0% / 0.38);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--foreground); font-family: var(--font-sans); font-size: 1rem; line-height: 1.55; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
svg { display: block; }
.ph-icon { flex: 0 0 20px; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ph-icon.heading-icon { flex-basis: 24px; width: 24px; height: 24px; }
.icon-text { display: inline-flex; align-items: center; gap: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 4px solid var(--ring); outline-offset: 4px; }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; padding: 12px 16px; background: var(--foreground); color: var(--background); border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.shell { width: min(calc(100% - 32px), 1180px); margin-inline: auto; }
.shell-narrow { width: min(calc(100% - 32px), 920px); margin-inline: auto; }

.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in oklch, var(--background) 90%, transparent); border-bottom: 1px solid color-mix(in oklch, var(--border) 75%, transparent); backdrop-filter: blur(16px); }
.nav { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 1.3rem/1 var(--font-display); text-decoration: none; letter-spacing: -0.04em; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: var(--primary-foreground); background: var(--primary); border-radius: 12px; transform: rotate(-5deg); }
.brand-mark svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linejoin: round; }
.brand-dot { color: oklch(0.65 0.2 128); }
.nav-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.language-switch { display: flex; padding: 4px; background: var(--muted); border: 1px solid var(--border); border-radius: 999px; }
.language-option { min-width: 38px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 999px; color: var(--foreground); background: transparent; font-weight: 800; cursor: pointer; }
.language-option.is-active { background: var(--foreground); color: var(--background); }
.theme-toggle { width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border: 2px solid var(--foreground); border-radius: 50%; background: var(--card); color: var(--foreground); cursor: pointer; }
.theme-toggle svg { grid-area: 1 / 1; width: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.theme-sun { display: none; }
.dark .theme-moon { display: none; }
.dark .theme-sun { display: block; }
.admin-back-home { min-height: 48px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 2px solid var(--foreground); border-radius: 13px; background: var(--card); color: var(--foreground); font-weight: 800; text-decoration: none; transition: background .16s ease, color .16s ease, transform .16s ease; }
.admin-back-home:hover { background: var(--muted); }
.admin-back-home:active { transform: translateY(2px); background: var(--surface-alt); }
.admin-link { min-height: 48px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 2px solid var(--foreground); border-radius: 12px; font-weight: 800; text-decoration: none; }
.admin-link svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.account-menu { position: relative; }
.account-menu-button { min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 5px 11px 5px 6px; border: 2px solid var(--foreground); border-radius: 13px; background: var(--card); color: var(--foreground); font-weight: 800; cursor: pointer; }
.account-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--primary); color: var(--primary-foreground); font-size: .78rem; }
.account-popover { position: absolute; z-index: 60; top: calc(100% + 10px); right: 0; min-width: 190px; padding: 7px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: var(--card-foreground); box-shadow: var(--shadow); }
.account-popover a { display: block; padding: 11px 12px; border-radius: 9px; font-weight: 700; text-decoration: none; }
.account-popover a:hover, .account-popover a:focus-visible { background: var(--muted); }
body[data-route="history"] .language-switch, body[data-route="history"] .admin-link { display: none; }

#customer-view { background-color: var(--hero-base); background-image: radial-gradient(ellipse 66% 72% at 80% 40%, var(--hero-glow) 0%, color-mix(in srgb, var(--hero-glow) 70%, transparent) 38%, transparent 72%); background-repeat: no-repeat; background-size: 100% 780px; }
.hero { min-height: 650px; display: grid; align-items: center; gap: 24px; padding-block: 50px 64px; overflow: hidden; }
.hero-copy { position: relative; z-index: 3; min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; color: var(--muted-foreground); font-size: .82rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow span:first-child { color: oklch(0.64 0.2 128); }
h1, h2, h3 { margin-top: 0; font-family: var(--font-display); line-height: 1.06; letter-spacing: -0.045em; }
h1 { max-width: 690px; margin-bottom: 20px; overflow-wrap: break-word; font-size: clamp(2.85rem, 12vw, 6.4rem); }
h1 span { position: relative; z-index: 0; }
h1 span::after { content: ""; position: absolute; z-index: -1; left: -2%; right: -3%; bottom: .07em; height: .25em; background: var(--primary); border-radius: 99px; transform: rotate(-2deg); }
.hero-intro { max-width: 570px; margin: 0 0 28px; color: var(--muted-foreground); font-size: clamp(1.1rem, 3vw, 1.35rem); }
.button { min-height: 56px; display: inline-flex; align-items: center; justify-content: center; gap: 14px; padding: 0 22px; border: 2px solid transparent; border-radius: 14px; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.button:hover { transform: translateY(-2px); }
.button svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.button-primary { background: var(--primary); color: var(--primary-foreground); border-color: color-mix(in oklch, var(--primary), black 17%); box-shadow: 0 8px 0 color-mix(in oklch, var(--primary), black 28%); }
.button-primary:active { transform: translateY(5px); box-shadow: 0 3px 0 color-mix(in oklch, var(--primary), black 28%); }
.button-dark { background: var(--foreground); color: var(--background); border-color: var(--foreground); }

.hero-visual { position: relative; min-height: 390px; display: grid; place-items: center; isolation: isolate; }
.hero-visual::before { content: ""; position: absolute; z-index: -2; width: 92%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--hero-glow) 88%, transparent), transparent 70%); filter: blur(10px); }
#globe-stage { position: relative; width: min(74vw, 390px); aspect-ratio: 1; display: grid; place-items: center; filter: drop-shadow(0 22px 32px hsl(220 35% 15% / .2)); }
.static-globe { position: absolute; width: 82%; aspect-ratio: 1; overflow: hidden; border: 4px solid var(--foreground); border-radius: 50%; background: var(--secondary); }
.static-globe::after { content: ""; position: absolute; inset: 10%; border: 2px solid hsl(0 0% 100% / .28); border-radius: 50%; }
.globe-line { position: absolute; border: 2px solid hsl(0 0% 100% / .35); border-radius: 50%; }
.globe-line-a { inset: 0 29%; }
.globe-line-b { inset: 28% -12%; }
.globe-line-c { inset: 7% -15%; transform: rotate(60deg); }
.land { position: absolute; background: var(--primary); border-radius: 47% 53% 56% 44%; transform: rotate(-18deg); }
.land-a { width: 38%; height: 30%; top: 20%; left: 13%; clip-path: polygon(7% 22%, 45% 0, 100% 27%, 78% 72%, 46% 66%, 23% 100%, 0 65%); }
.land-b { width: 42%; height: 38%; right: 5%; bottom: 13%; clip-path: polygon(8% 10%, 66% 0, 100% 34%, 77% 100%, 36% 79%, 0 54%); }
.globe-canvas { position: absolute; z-index: 2; inset: 0; width: 100% !important; height: 100% !important; }
#globe-stage.has-webgl .static-globe { opacity: 0; }
.visual-orbit { position: absolute; width: 92%; aspect-ratio: 1; border: 2px dashed color-mix(in oklch, var(--secondary) 35%, transparent); border-radius: 50%; }
.orbit-one { transform: rotate(20deg) scaleY(.56); }
.orbit-two { transform: rotate(-58deg) scaleY(.68); }
.vehicle { position: absolute; z-index: 4; display: grid; place-items: center; width: 70px; height: 70px; border: 3px solid var(--foreground); border-radius: 21px; background: var(--card); box-shadow: var(--shadow); }
.vehicle svg { width: 52px; fill: var(--primary); stroke: var(--foreground); stroke-width: 3; stroke-linejoin: round; }
.plane { top: 7%; right: 1%; transform: rotate(12deg); animation: float 4.2s ease-in-out infinite; }
.truck { left: 0; bottom: 19%; transform: rotate(-7deg); animation: float 4.8s .4s ease-in-out infinite; }
.ship { right: 2%; bottom: 8%; transform: rotate(5deg); animation: float 4.5s .8s ease-in-out infinite; }
.scene-caption { position: absolute; z-index: 5; bottom: -10px; display: flex; align-items: center; gap: 9px; margin: 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); font-size: .82rem; font-weight: 800; box-shadow: var(--shadow); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: oklch(0.54 0.18 145); box-shadow: 0 0 0 4px oklch(0.9 0.08 145); }
@keyframes float { 50% { translate: 0 -8px; } }

.tracking-section { padding: 18px 0 86px; background: linear-gradient(var(--background) 12%, var(--muted) 12%); }
.tracking-card { padding: 26px 20px; border: 1px solid var(--border); border-radius: 24px; background: var(--card); box-shadow: 0 20px 60px hsl(220 35% 15% / .09); }
.tracking-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 24px; }
.section-icon { flex: 0 0 50px; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; color: var(--primary-foreground); background: var(--primary); }
.section-icon svg { width: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.tracking-heading h2 { margin-bottom: 6px; font-size: clamp(1.55rem, 5vw, 2.1rem); }
.tracking-heading p, .section-heading > p:last-child { margin: 0; color: var(--muted-foreground); }
label { display: block; margin-bottom: 8px; font-weight: 800; }
.tracking-controls { display: grid; gap: 12px; }
.input-wrap { position: relative; }
.input-wrap svg { position: absolute; left: 18px; top: 50%; width: 23px; transform: translateY(-50%); fill: none; stroke: var(--muted-foreground); stroke-width: 2; }
input { width: 100%; min-height: 58px; padding: 0 18px; border: 2px solid color-mix(in oklch, var(--border), var(--foreground) 12%); border-radius: 14px; background: var(--card); color: var(--card-foreground); color-scheme: inherit; }
input::placeholder, input:focus::placeholder { color: var(--placeholder); opacity: 1; }
.input-wrap input { padding-left: 52px; font-size: 1.08rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
input[aria-invalid="true"] { border-color: var(--destructive); }
.form-help { margin: 12px 0 0; color: var(--muted-foreground); font-size: .92rem; }
.form-help button { padding: 4px; border: 0; background: transparent; color: var(--foreground); font-weight: 800; text-decoration: underline; cursor: pointer; }
.form-error { min-height: 1.5em; margin: 8px 0 0; color: var(--destructive); font-weight: 700; }
.tracking-result { margin-top: 26px; padding: 22px 18px; border: 2px solid color-mix(in oklch, var(--primary), black 12%); border-radius: 18px; background: var(--result-background); }
.result-summary { display: flex; align-items: flex-start; gap: 14px; }
.result-check { flex: 0 0 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--primary-foreground); background: var(--primary); }
.result-check svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 3; }
.result-kicker { margin: 0; color: var(--status-foreground); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.result-summary h3 { margin: 3px 0 4px; font-size: 1.45rem; letter-spacing: -.02em; }
.result-summary p:last-child { margin: 0; }
.delivery-steps { display: grid; grid-template-columns: repeat(4, 1fr); margin: 26px 0 0; padding: 0; list-style: none; }
.delivery-steps li { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; color: var(--muted-foreground); }
.delivery-steps li::before { content: ""; position: absolute; z-index: 0; top: 8px; left: 0; width: 100%; height: 4px; background: var(--border); }
.delivery-steps li:first-child::before { left: 50%; width: 50%; }
.delivery-steps li:last-child::before { width: 50%; }
.delivery-steps li.is-done::before, .delivery-steps li.is-current::before { background: oklch(0.58 0.18 135); }
.delivery-steps li > span { position: relative; z-index: 1; width: 20px; height: 20px; margin-inline: auto; border: 4px solid var(--card); border-radius: 50%; background: var(--border); box-shadow: 0 0 0 2px var(--border); }
.delivery-steps .is-done > span, .delivery-steps .is-current > span { background: oklch(0.58 0.18 135); box-shadow: 0 0 0 2px oklch(0.58 0.18 135); }
.delivery-steps .is-current > span { background: var(--card); border-color: var(--primary); }
.delivery-steps li div { display: grid; text-align: center; font-size: .78rem; }
.delivery-steps strong { color: var(--foreground); }
.delivery-steps small { overflow: hidden; text-overflow: ellipsis; }

.features { padding-block: 78px 105px; }
.section-heading { max-width: 620px; margin: 0 auto 38px; text-align: center; }
.section-heading .eyebrow { justify-content: center; }
.section-heading h2 { margin-bottom: 12px; font-size: clamp(2.2rem, 8vw, 4rem); }
.feature-grid { display: grid; gap: 16px; }
.feature-card { position: relative; min-height: 330px; padding: 22px; overflow: hidden; border: 1px solid color-mix(in oklch, var(--border), transparent 20%); border-radius: 24px; }
.feature-yellow { background: var(--feature-yellow); }
.feature-blue { background: var(--feature-blue); }
.feature-peach { background: var(--feature-peach); }
.feature-green { background: var(--feature-green); }
.step-number { position: absolute; top: 18px; left: 18px; width: 36px; height: 36px; display: grid; place-items: center; border: 2px solid var(--foreground); border-radius: 50%; background: var(--card); font-weight: 800; }
.feature-illustration { height: 185px; display: grid; place-items: center; }
.feature-illustration svg { width: min(100%, 210px); fill: none; stroke: var(--foreground); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.feature-illustration .fill-light { fill: var(--surface-alt); }
.feature-illustration .fill-dark { fill: var(--primary); }
.feature-illustration .light-stroke { stroke: var(--card); stroke-width: 5; }
.feature-card h3 { margin-bottom: 8px; font-size: 1.35rem; }
.feature-card p { margin: 0; color: var(--muted-foreground); }

.flow-view { min-height: calc(100vh - 76px); padding-block: 38px 100px; }
.back-link { display: inline-block; margin-bottom: 24px; font-weight: 800; }
.flow-card { padding: clamp(24px, 6vw, 48px); border: 1px solid var(--border); border-radius: 24px; background: var(--card); box-shadow: var(--shadow); }
.flow-step { display: flex; align-items: center; gap: 11px; }
.flow-step .eyebrow { margin: 0; }
.section-icon-small { flex-basis: 38px; width: 38px; height: 38px; border-radius: 11px; }
.section-icon-small svg { width: 24px; height: 24px; }
.flow-card h1 { margin: 22px 0 12px; font-size: clamp(2.3rem, 8vw, 4.2rem); }
.flow-card > p:not(.eyebrow, .form-error) { color: var(--muted-foreground); }
.sender-form { position: relative; }
.draft-banner { display: grid; gap: 14px; margin-bottom: 24px; padding: 18px; border: 2px solid var(--foreground); border-radius: 16px; background: var(--selected-background); }
.draft-banner p { margin: 4px 0 0; color: var(--muted-foreground); }
.draft-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.text-button { min-height: 48px; padding: 8px 14px; border: 2px solid var(--foreground); border-radius: 10px; background: var(--card); color: var(--foreground); font-weight: 800; cursor: pointer; }
.sticky-step-header { position: sticky; z-index: 30; top: 84px; margin: -10px -12px 26px; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); box-shadow: 0 8px 20px hsl(220 35% 15% / .12); }
.sender-progress { margin-bottom: 10px; }
.sender-progress .eyebrow { flex-wrap: wrap; color: var(--foreground); }
.progress-track { --progress: 25%; height: 14px; margin-top: 14px; overflow: hidden; border: 2px solid var(--foreground); border-radius: 999px; background: var(--muted); }
.progress-track span { display: block; width: var(--progress); height: 100%; border-right: 2px solid var(--foreground); background: var(--primary); transition: width .25s ease; }
.read-tools { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px 12px; margin: 0; padding-top: 10px; border-top: 1px solid var(--border); }
.read-button { min-height: 48px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 2px solid var(--foreground); border-radius: 12px; background: var(--card); color: var(--foreground); font-weight: 800; cursor: pointer; }
.read-button .ph-icon { width: 20px; height: 20px; stroke-width: 1.75; }
.read-fallback { max-width: 430px; }
.read-fallback summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 800; text-decoration: underline; }
.read-fallback p { margin: 4px 0 0; color: var(--muted-foreground); }
.error-summary { margin-bottom: 24px; padding: 16px 18px; border: 3px solid var(--destructive); border-radius: 14px; background: var(--card); color: var(--foreground); }
.error-summary ul { margin: 8px 0 0; padding-left: 24px; }
.form-stage > h1 { max-width: 760px; }
.form-stage > h1, .question, .field-group { scroll-margin-top: 250px; }
.shipment-confirmation { scroll-margin-top: 100px; }
.stage-intro { max-width: 650px; margin: 0 0 30px; color: var(--muted-foreground); font-size: 1.12rem; }
.question { margin: 0 0 34px; padding: 0; border: 0; }
.question + .question { padding-top: 28px; border-top: 1px solid var(--border); }
.question legend, .question h2 { margin: 0; padding: 0; font: 800 1.35rem/1.2 var(--font-display); letter-spacing: -.02em; }
.question-help, .field-instruction { margin: 7px 0 14px; color: var(--muted-foreground); }
.field-instruction { margin-bottom: 8px; font-size: .92rem; }
.choice-grid, .service-grid { display: grid; gap: 12px; }
.choice-grid-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.picture-choice, .service-choice { position: relative; min-height: 142px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 16px 12px; border: 2px solid var(--border); border-radius: 16px; background: var(--surface-alt); text-align: center; cursor: pointer; }
.picture-choice input, .service-choice input { position: absolute; width: 1px; min-height: 0; height: 1px; opacity: 0; }
.picture-choice:hover, .service-choice:hover { border-color: var(--foreground); }
.picture-choice:focus-within, .service-choice:focus-within { outline: 4px solid var(--ring); outline-offset: 3px; }
.picture-choice:has(input:checked), .service-choice:has(input:checked) { border-color: var(--foreground); background: var(--selected-background); box-shadow: inset 0 0 0 1px var(--foreground); }
.picture-choice:has(input:checked)::after, .service-choice:has(input:checked)::after { content: "✓"; position: absolute; top: 9px; right: 9px; width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid var(--foreground); border-radius: 50%; background: var(--primary); color: var(--primary-foreground); font-weight: 900; }
.form-stage[data-stage="3"] .picture-choice::after, .form-stage[data-stage="3"] .service-choice::after { display: none; }
.selection-indicator { position: absolute; top: 9px; right: 9px; width: 30px; height: 30px; display: none; place-items: center; border: 2px solid var(--foreground); border-radius: 50%; background: var(--primary); color: var(--primary-foreground); }
.selection-indicator .ph-icon { width: 20px; height: 20px; }
.picture-choice:has(input:checked) .selection-indicator, .service-choice:has(input:checked) .selection-indicator { display: grid; }
.choice-art { width: 48px; height: 48px; display: grid; place-items: center; color: var(--foreground); font-size: 2.45rem; line-height: 1; }
.choice-art .ph { display: block; font-size: inherit; font-weight: 400; line-height: 1; }
.picture-choice strong, .service-choice strong { font: 800 1.02rem/1.2 var(--font-display); }
.picture-choice small, .service-choice small { color: var(--muted-foreground); line-height: 1.3; }
.package-picture { display: grid; place-items: center; width: 62px; height: 54px; color: var(--primary); font-size: 3.5rem; line-height: 1; filter: drop-shadow(0 3px 0 var(--foreground)); }
.package-small { scale: .72; }
.package-large { scale: 1.14; }
.measurement-question { padding: 22px; border: 2px solid var(--border); border-radius: 18px; background: var(--surface-alt); }
.weight-fields { display: grid; gap: 18px; margin-top: 20px; }
.measurement-grid { display: grid; gap: 18px; margin-top: 20px; }
.field-group label { display: block; margin-bottom: 6px; font-weight: 800; }
.field-group > small { display: block; margin-top: 6px; color: var(--muted-foreground); }
.number-control { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; border-radius: 12px; }
.number-control:focus-within { outline: 4px solid var(--ring); outline-offset: 3px; }
.number-control button { min-width: 48px; min-height: 52px; display: grid; place-items: center; border: 2px solid var(--border); background: var(--card); color: var(--foreground); font-weight: 800; cursor: pointer; }
.number-control button .ph-icon { width: 20px; height: 20px; }
.number-control button:first-child { border-radius: 12px 0 0 12px; }
.number-control button:last-child { border-radius: 0 12px 12px 0; }
.number-control input { min-width: 0; min-height: 52px; border-inline: 0; border-radius: 0; text-align: center; }
.dimension-input::placeholder, .dimension-input:focus::placeholder { color: #71717a; opacity: 1; }
.dark .dimension-input::placeholder, .dark .dimension-input:focus::placeholder { color: var(--muted-foreground); }
@media (prefers-color-scheme: dark) { :root:not(.light) .dimension-input::placeholder, :root:not(.light) .dimension-input:focus::placeholder { color: var(--muted-foreground); } }
.number-control input:focus-visible { outline: 0; }
.number-control button:focus-visible { z-index: 1; outline: 0; box-shadow: inset 0 0 0 3px var(--ring); }
.field-error { min-height: 1.5em; display: flex; align-items: flex-start; gap: 8px; margin: 7px 0 0; color: var(--destructive); font-weight: 800; }
.field-error .ph-icon { margin-top: .15em; }
.unit-selector { display: flex; align-content: start; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.unit-selector legend { width: 100%; margin-bottom: 6px; font: 800 1rem/1.2 var(--font-sans); }
.unit-selector label { position: relative; min-width: 74px; min-height: 52px; margin: 0; }
.unit-selector input { position: absolute; width: 1px; min-height: 0; height: 1px; opacity: 0; }
.unit-selector span { min-height: 52px; display: grid; place-items: center; padding: 8px 18px; border: 2px solid var(--border); border-radius: 12px; background: var(--card); cursor: pointer; }
.unit-selector label:focus-within span { outline: 4px solid var(--ring); outline-offset: 3px; }
.unit-selector input:checked + span { border-color: var(--foreground); background: var(--selected-background); box-shadow: inset 0 0 0 1px var(--foreground); }
.dimensions-panel { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.dimensions-panel summary { min-height: 52px; display: flex; align-items: center; gap: 8px; font: 800 1.08rem/1.2 var(--font-display); cursor: pointer; }
.dimensions-panel summary::marker { color: var(--primary); }
.dimensions-panel .question-help { margin-bottom: 16px; }
.dimension-units { margin-bottom: 4px; }
.has-error input:not([type="radio"]), input[aria-invalid="true"] { border-color: var(--destructive); }
.has-error > legend { text-decoration: underline 3px var(--destructive); text-underline-offset: 5px; }
.people-grid { display: grid; gap: 18px; }
.person-card { padding: 20px; border: 2px solid var(--border); border-radius: 18px; background: var(--surface-alt); }
.person-card h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; font-size: 1.4rem; }
.person-card .field-group { margin-bottom: 20px; }
.input-with-icon { position: relative; }
.input-with-icon > .input-icon { position: absolute; z-index: 1; top: 50%; left: 15px; display: grid; place-items: center; color: #71717a; translate: 0 -50%; }
.input-with-icon input { padding-left: 48px; }
.service-choice { min-height: 175px; }
.card-icon { width: 24px; height: 24px; }
.service-choice b { color: var(--status-foreground); font-size: 1.18rem; }
.calendar-question { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 20px; border: 2px solid var(--border); border-radius: 18px; background: var(--surface-alt); }
.question-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: var(--primary); color: var(--primary-foreground); }
.date-input { background: var(--card); color: var(--card-foreground); }
.date-input::-webkit-datetime-edit, .date-input::-webkit-datetime-edit-fields-wrapper, .date-input::-webkit-datetime-edit-text, .date-input::-webkit-datetime-edit-month-field, .date-input::-webkit-datetime-edit-day-field, .date-input::-webkit-datetime-edit-year-field { color: inherit; }
.date-input.is-empty { color: #71717a; }
.dark .date-input.is-empty { color: var(--muted-foreground); }
@media (prefers-color-scheme: dark) { :root:not(.light) .date-input.is-empty { color: var(--muted-foreground); } }
.quick-dates { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quick-dates button { min-height: 48px; padding: 8px 16px; border: 2px solid var(--foreground); border-radius: 10px; background: var(--card); color: var(--foreground); font-weight: 800; cursor: pointer; }
.form-navigation { position: sticky; z-index: 10; bottom: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 34px -8px -8px; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: color-mix(in srgb, var(--card) 94%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.form-navigation .button { width: 100%; gap: 8px; }
.form-navigation #form-confirm { grid-column: 2; }
.button-secondary { border-color: var(--foreground); background: var(--card); color: var(--foreground); }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.review-summary { display: grid; gap: 12px; }
.summary-card { padding: 18px; border: 2px solid var(--border); border-radius: 16px; background: var(--surface-alt); }
.summary-card > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.summary-card h2 { margin: 0; font-size: 1.18rem; }
.summary-card button { min-height: 48px; padding: 6px 12px; border: 2px solid var(--foreground); border-radius: 10px; background: var(--card); color: var(--foreground); font-weight: 800; cursor: pointer; }
.summary-card dl { display: grid; grid-template-columns: minmax(90px, .35fr) 1fr; gap: 8px 12px; margin: 16px 0 0; }
.summary-card dt { color: var(--muted-foreground); font-weight: 700; }
.summary-card dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-weight: 700; }
.total-card { display: grid; grid-template-columns: 1fr auto; gap: 4px 18px; margin: 18px 0 34px; padding: 22px; border: 3px solid var(--foreground); border-radius: 18px; background: var(--selected-background); }
.total-card > span { font-weight: 800; }
.total-card strong { font: 800 1.8rem/1 var(--font-display); }
.total-card small { grid-column: 1 / -1; color: var(--muted-foreground); }
.submit-error { margin-top: 18px; padding: 16px; border: 3px solid var(--destructive); border-radius: 14px; }
.shipment-confirmation { text-align: center; }
.confirmation-mark { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto 18px; border: 3px solid var(--foreground); border-radius: 50%; background: var(--primary); color: var(--primary-foreground); font-size: 2.2rem; font-weight: 900; }
.shipment-confirmation .eyebrow { justify-content: center; }
.shipment-confirmation > p:not(.eyebrow) { max-width: 560px; margin-inline: auto; color: var(--muted-foreground); }
.shipment-confirmation > label { margin-top: 28px; }
.copy-row { display: grid; gap: 10px; max-width: 560px; margin-inline: auto; }
.copy-row input { text-align: center; font-size: 1.2rem; font-weight: 800; letter-spacing: .04em; }
.next-steps { max-width: 560px; margin: 28px auto; padding-left: 26px; text-align: left; }
.next-steps li { margin-bottom: 10px; padding-left: 5px; }
.login-card { max-width: 580px; margin-inline: auto; }
.login-card input { margin-bottom: 18px; text-transform: none; }
.login-card .button { width: 100%; margin-top: 8px; }

.admin-history-view { min-height: calc(100vh - 76px); padding-block: clamp(38px, 7vw, 72px) 100px; }
.history-heading { margin-bottom: 34px; }
.history-heading .eyebrow { margin-bottom: 12px; }
.history-heading h1 { margin-bottom: 12px; font-size: clamp(2.75rem, 7vw, 5rem); }
.history-heading h1:focus, .detail-heading h1:focus { outline: none; }
.history-heading > p:last-child { margin: 0; color: var(--muted-foreground); font-size: 1.08rem; }
.history-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.history-tabs { display: flex; gap: 4px; padding: 4px; overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--muted); }
.history-tabs button { min-height: 44px; flex: 0 0 auto; padding: 8px 14px; border: 0; border-radius: 10px; background: transparent; color: var(--foreground); font-weight: 800; cursor: pointer; }
.history-tabs button[aria-selected="true"] { background: var(--card); color: var(--card-foreground); box-shadow: 0 2px 8px hsl(220 35% 15% / .1); }
.history-search { position: relative; flex: 0 1 330px; margin: 0; }
.history-search .ph-icon { position: absolute; z-index: 1; left: 15px; top: 50%; transform: translateY(-50%); color: var(--placeholder); }
.history-search input { min-height: 48px; padding: 0 15px 0 46px; border-color: var(--border); border-radius: 12px; background: var(--card); color: var(--card-foreground); }
.history-state { min-height: 230px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 32px; border: 1px solid var(--border); border-radius: 20px; background: var(--card); color: var(--card-foreground); text-align: center; }
.history-state > div { display: grid; gap: 4px; }
.history-state span:not(.state-spinner) { color: var(--muted-foreground); }
.history-state-error { color: var(--destructive); }
.state-spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--ring); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.delivery-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.delivery-table { width: 100%; min-width: 860px; border-collapse: collapse; color: var(--card-foreground); }
.delivery-table th, .delivery-table td { padding: 17px 18px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.delivery-table thead th { background: var(--surface-alt); color: var(--muted-foreground); font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; }
.delivery-table thead button { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; margin: -8px; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-weight: 800; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.delivery-table thead [aria-sort]:not([aria-sort="none"]) button { color: var(--foreground); }
.delivery-table tbody tr:last-child > * { border-bottom: 0; }
.delivery-table tbody tr:hover { background: var(--surface-alt); }
.delivery-table tbody th { color: var(--foreground); font-weight: 800; white-space: nowrap; }
.sort-indicator { display: inline-grid; place-items: center; color: var(--foreground); }
.status-badge { width: max-content; display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; font-size: .82rem; font-weight: 800; white-space: nowrap; }
.status-delivered { background: var(--delivered-background); color: var(--delivered-foreground); }
.status-in-transit { background: var(--transit-background); color: var(--transit-foreground); }
.status-delayed { background: var(--delayed-background); color: var(--delayed-foreground); }
.detail-link { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; color: var(--foreground); font-weight: 800; white-space: nowrap; text-underline-offset: 3px; }
.delivery-cards { display: none; }
.history-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.history-footer p { margin: 0; color: var(--muted-foreground); font-weight: 700; }
.pagination { display: flex; align-items: center; gap: 8px; }
.pagination button { min-height: 44px; padding: 7px 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--card-foreground); font-weight: 800; cursor: pointer; }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }
.pagination span { min-width: 96px; text-align: center; font-weight: 700; }
.history-detail { padding: clamp(22px, 5vw, 46px); border: 1px solid var(--border); border-radius: 24px; background: var(--card); color: var(--card-foreground); box-shadow: var(--shadow); }
.history-detail > .back-link { margin-bottom: 30px; }
.detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 26px; border-bottom: 1px solid var(--border); }
.detail-heading .eyebrow { margin-bottom: 10px; }
.detail-heading h1 { margin: 0; font-size: clamp(2rem, 6vw, 4rem); letter-spacing: -.035em; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 26px 0 36px; }
.detail-grid > div { padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-alt); }
.detail-grid dt { margin-bottom: 4px; color: var(--muted-foreground); font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.detail-grid dd { margin: 0; overflow-wrap: anywhere; font-weight: 800; }
.tracking-history h2 { margin-bottom: 22px; font-size: clamp(1.55rem, 4vw, 2.2rem); }
.tracking-history ol { margin: 0; padding: 0; list-style: none; }
.tracking-history li { position: relative; display: grid; grid-template-columns: 42px 1fr; gap: 14px; min-height: 88px; }
.tracking-history li::before { content: ""; position: absolute; top: 39px; bottom: 0; left: 20px; width: 2px; background: var(--border); }
.tracking-history li:last-child::before { display: none; }
.tracking-history li > span { position: relative; z-index: 1; width: 42px; height: 42px; display: grid; place-items: center; border: 2px solid var(--border); border-radius: 50%; background: var(--card); color: var(--muted-foreground); }
.tracking-history li.is-current > span { border-color: color-mix(in oklch, var(--primary), black 22%); background: var(--primary); color: var(--primary-foreground); }
.tracking-history li > div { display: grid; align-content: start; padding-top: 1px; }
.tracking-history strong { font-size: 1.03rem; }
.tracking-history li span, .tracking-history time { color: var(--muted-foreground); }
body[data-route="history"] .footer { display: none; }

.footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 30px; border-top: 1px solid var(--border); }
.footer p { margin: 0; color: var(--muted-foreground); }

@media (min-width: 700px) {
  .hero { grid-template-columns: 1.08fr .92fr; padding-block: 70px 92px; }
  .tracking-card { padding: 34px; }
  .tracking-controls { grid-template-columns: 1fr auto; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .choice-grid-three, .service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .choice-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .measurement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weight-fields { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .draft-banner { grid-template-columns: 1fr auto; align-items: center; }
  .copy-row { grid-template-columns: 1fr auto; }
}

@media (min-width: 1050px) {
  .feature-grid { grid-template-columns: repeat(4, 1fr); }
  .feature-card:nth-child(even) { transform: translateY(22px); }
}

@media (min-width: 560px) {
  .choice-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .history-toolbar { align-items: stretch; flex-direction: column; }
  .history-tabs { width: 100%; }
  .history-tabs button { flex: 1 0 max-content; }
  .history-search { flex-basis: auto; width: 100%; }
  .delivery-table-wrap { display: none; }
  .delivery-cards { display: grid; gap: 12px; }
  .delivery-card { padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: var(--card); color: var(--card-foreground); box-shadow: var(--shadow); }
  .delivery-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .delivery-card-heading > strong { overflow-wrap: anywhere; }
  .delivery-card dl { display: grid; gap: 10px; margin: 18px 0 12px; }
  .delivery-card dl > div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; }
  .delivery-card dt { color: var(--muted-foreground); font-weight: 700; }
  .delivery-card dd { margin: 0; font-weight: 700; }
  .history-footer { align-items: stretch; flex-direction: column; }
  .pagination { justify-content: space-between; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .nav { gap: 8px; }
  .nav-actions { gap: 6px; }
  .theme-toggle { width: 44px; height: 44px; }
  .admin-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .admin-link { width: 48px; padding: 0; justify-content: center; }
  .account-menu-button > span:not(.account-avatar) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .account-menu-button { width: 64px; gap: 2px; padding: 5px 3px; justify-content: center; }
  .hero { padding-top: 38px; }
  .hero h1 { max-width: 100%; font-size: clamp(2.85rem, 13vw, 3.55rem); }
  .hero-visual { min-height: 335px; }
  .vehicle { width: 58px; height: 58px; border-radius: 17px; }
  .vehicle svg { width: 43px; }
  .tracking-heading { align-items: center; }
  .delivery-steps strong { font-size: .72rem; }
  .delivery-steps small { font-size: .66rem; }
  .sender-form { padding-inline: 18px; }
  .sticky-step-header { top: 80px; margin: -8px -8px 22px; padding: 10px; border-radius: 14px; }
  .sticky-step-header .flow-step { gap: 8px; }
  .sticky-step-header .eyebrow { font-size: .75rem; letter-spacing: .08em; }
  .sticky-step-header .progress-track { margin-top: 9px; }
  .sticky-step-header .read-tools { padding-top: 8px; }
  .sticky-step-header .read-button { padding-inline: 11px; }
  .form-stage > h1, .question, .field-group { scroll-margin-top: 290px; }
  .measurement-question { padding-inline: 16px; }
  .form-navigation { margin-inline: -5px; }
  .calendar-question { grid-template-columns: 1fr; }
  .question-icon { width: 44px; height: 44px; }
  .summary-card dl { grid-template-columns: 1fr; gap: 2px; }
  .summary-card dd { margin-bottom: 9px; }
  .admin-history-view { padding-top: 32px; }
  .history-heading { margin-bottom: 26px; }
  .history-heading h1 { font-size: clamp(2.55rem, 13vw, 3.45rem); }
  .history-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; overflow: visible; }
  .history-tabs button { min-width: 0; padding: 7px 5px; font-size: .8rem; line-height: 1.25; white-space: normal; }
  .delivery-card-heading { align-items: flex-start; flex-direction: column; }
  .detail-heading { flex-direction: column; }
  .detail-grid { grid-template-columns: 1fr; }
  .history-detail { padding-inline: 18px; }
  .footer { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (prefers-contrast: more) {
  :root { --border: oklch(0.48 0.03 257); --muted-foreground: var(--foreground); }
  .feature-card, .tracking-card, .flow-card { border-width: 2px; }
}
