:root {
  color-scheme: light;
  --nek-ink: #0b1b36;
  --nek-green: #087c67;
  --nek-green-deep: #055d50;
  --nek-mint: #dff7ef;
  --nek-canvas: #f1f7f5;
  --nek-muted: #536478;
}

[data-theme="nek"] {
  --color-primary: var(--nek-green);
  --color-primary-content: #ffffff;
  --color-secondary: #126d72;
  --color-secondary-content: #ffffff;
  --color-accent: #a7ead5;
  --color-accent-content: #07382f;
  --color-neutral: var(--nek-ink);
  --color-neutral-content: #ffffff;
  --color-base-100: #ffffff;
  --color-base-200: #edf5f2;
  --color-base-300: #dfeae6;
  --color-base-content: var(--nek-ink);
  --radius-box: 1.45rem;
  --radius-field: 1rem;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--nek-canvas); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--nek-canvas);
  color: var(--nek-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

button, input, select, textarea { font: inherit; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.mobile-shell {
  width: min(100%, 540px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(7rem + env(safe-area-inset-bottom));
}

.hero-panel {
  position: relative;
  height: clamp(19rem, 69vw, 23.3rem);
  overflow: hidden;
  padding: max(1.1rem, env(safe-area-inset-top)) 1.25rem 4.5rem;
  background: #dff7ef;
}

.hero-visual,
.hero-wash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-visual { object-fit: cover; object-position: center center; }
.hero-wash { background: linear-gradient(90deg, rgb(241 255 251 / 94%) 0%, rgb(235 253 248 / 78%) 33%, rgb(230 250 245 / 10%) 63%, transparent 100%); }

.brand-row,
.section-heading,
.next-trip-body,
.user-cluster {
  display: flex;
  align-items: center;
}

.brand-row,
.section-heading { justify-content: space-between; gap: .8rem; }
.brand-row { position: relative; z-index: 2; }
.brand-wordmark { display: grid; gap: .12rem; line-height: 1; }
.brand-wordmark strong { color: #1c2d3e; font-size: clamp(1.15rem, 4.7vw, 1.7rem); letter-spacing: -.035em; white-space: nowrap; }
.brand-wordmark strong span { color: var(--nek-green); font-size: 1.15em; }
.brand-wordmark small { color: #203b49; font-size: clamp(.5rem, 2vw, .75rem); letter-spacing: .01em; white-space: nowrap; }
.user-cluster { gap: .65rem; }
.user-summary { display: grid; gap: .1rem; text-align: right; font-size: .78rem; }
.user-summary strong { font-size: 1rem; }
.user-avatar { width: 3.25rem; height: 3.25rem; border: 3px solid rgb(255 255 255 / 92%); border-radius: 50%; object-fit: cover; box-shadow: 0 5px 18px rgb(0 55 45 / 18%); }

.welcome-copy { position: relative; z-index: 2; max-width: 14.5rem; margin-top: .25rem; }
.welcome-copy h1 { margin: 0 0 .55rem; color: var(--nek-green-deep); font-size: clamp(2rem, 8.6vw, 2.9rem); line-height: .98; letter-spacing: -.045em; }
.welcome-copy p { margin: 0; color: #0b5149; font-size: clamp(.92rem, 3.6vw, 1.15rem); line-height: 1.28; }

.eyebrow { margin: 0; color: var(--nek-green-deep); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.content-stack {
  position: relative;
  z-index: 3;
  display: grid;
  gap: .8rem;
  margin-top: -3.1rem;
  padding: 0 .9rem 1.4rem;
}

.content-stack > section[aria-labelledby="tripSummaryTitle"] { order: 1; }
#developmentAlert { position: absolute; top: -2.35rem; right: 1rem; order: 2; width: auto; min-height: auto; padding: .35rem .6rem; font-size: .65rem; box-shadow: 0 4px 12px rgb(0 74 61 / 12%); }
.workspace-section { order: 3; }
.content-stack > section[aria-labelledby="nextTripTitle"] { order: 4; }

.summary-body { gap: .2rem; padding: .65rem 1rem .5rem; }
.summary-body .section-heading h2 { font-size: 1.05rem; }
.summary-body .btn { min-height: 2rem; padding-inline: .35rem; color: var(--nek-green-deep); }
.summary-body .btn svg { width: 1rem; height: 1rem; }
.summary-stats { width: 100%; box-shadow: none; }
.summary-stats .stat { min-width: 0; padding: .2rem .55rem; grid-template-columns: auto 1fr; column-gap: .6rem; }
.summary-stats .stat { grid-template-areas: "figure value" "figure desc"; }
.summary-stats .stat-figure { grid-area: figure; display: grid; width: 2.75rem; height: 2.75rem; place-items: center; border-radius: 50%; background: var(--nek-mint); }
.summary-stats .stat-value { grid-area: value; }
.summary-stats .stat-desc { grid-area: desc; }
.summary-stats .stat:first-child .stat-figure { background: var(--nek-green); color: #fff; }
.summary-stats .stat-value { font-size: 1.55rem; line-height: 1; }
.summary-stats .stat-desc { margin-top: .2rem; color: var(--nek-ink); font-size: .82rem; }
.summary-stats svg { width: 1.4rem; height: 1.4rem; }
.section-heading h2 { margin: 0; font-size: 1rem; font-weight: 800; }

.workspace-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.workspace-button {
  position: relative;
  display: grid;
  grid-template-rows: 5rem 1fr;
  width: 100%;
  min-width: 0;
  height: 10.1rem;
  min-height: 0;
  overflow: hidden;
  padding: 0 .7rem .75rem;
  text-align: left;
  white-space: normal;
}

.workspace-art {
  width: calc(100% + 1.4rem);
  height: 5rem;
  margin-left: -.7rem;
  background-image: url('/assets/nek-workspaces-v1.png');
  background-repeat: no-repeat;
  background-size: 300% 200%;
}
.workspace-art-fcl { background-position: 50% 0%; }
.workspace-art-lcl { background-position: 0% 0%; }
.workspace-art-warehouse { background-position: 100% 0%; }
.workspace-art-management { background-position: 0% 100%; }
.workspace-art-sales { background-position: 50% 100%; }
.workspace-art-operations { background-position: 100% 100%; }
.workspace-copy { display: grid; align-content: start; gap: .2rem; min-width: 0; padding-right: 1rem; }
.workspace-copy strong { font-size: .95rem; line-height: 1.05; }
.workspace-copy > span:not(.badge) { display: -webkit-box; overflow: hidden; color: var(--nek-muted); font-size: .7rem; font-weight: 500; line-height: 1.18; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.workspace-status { position: absolute; top: .45rem; right: .45rem; }
.workspace-arrow { position: absolute; right: .55rem; bottom: .65rem; display: grid; width: 1.8rem; height: 1.8rem; place-items: center; border-radius: 50%; background: var(--nek-mint); color: var(--nek-green); }
.workspace-arrow svg { width: 1.05rem; height: 1.05rem; }

.next-trip-body { display: grid; grid-template-columns: auto 1fr 5.6rem auto; gap: .7rem; padding: .9rem; }
.next-trip-icon { display: grid; width: 3rem; height: 3rem; place-items: center; border-radius: 50%; background: var(--nek-mint); }
.next-trip-icon svg { width: 1.55rem; height: 1.55rem; }
.next-trip-copy { min-width: 0; }
.next-trip-copy strong { display: block; margin-top: .25rem; font-size: 1.45rem; line-height: 1; }
.next-trip-copy h2 { margin: .15rem 0 0; overflow: hidden; font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
.next-trip-copy p:last-child { margin: .22rem 0 0; overflow: hidden; color: var(--nek-muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.next-trip-photo { width: 5.6rem; height: 4.5rem; border-radius: .8rem; object-fit: cover; }
.next-trip-body .btn-circle { width: 2.5rem; height: 2.5rem; min-height: 2.5rem; }

.mobile-dock {
  left: 50%;
  width: min(100%, 540px);
  height: calc(5.7rem + env(safe-area-inset-bottom));
  z-index: 20;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: .55rem .75rem env(safe-area-inset-bottom);
  border-radius: 1.8rem 1.8rem 0 0;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 -8px 30px rgb(12 77 64 / 8%);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
}
.mobile-dock button { min-width: 0; min-height: 4rem; border-radius: 1.45rem; }
.mobile-dock button.dock-active { background: var(--nek-mint); color: var(--nek-green-deep); }
.mobile-dock svg { width: 1.35rem; height: 1.35rem; }
.mobile-dock .dock-label { font-size: .7rem; }
.dock-signature { align-self: center; color: var(--nek-green); font-family: cursive; font-size: .72rem; font-style: italic; font-weight: 700; line-height: 1.05; text-align: center; transform: rotate(-5deg); }

.install-fab { position: fixed; right: max(1rem, calc((100vw - 540px) / 2 + 1rem)); bottom: calc(6.2rem + env(safe-area-inset-bottom)); z-index: 18; min-height: 2.7rem; box-shadow: 0 12px 30px rgb(6 91 76 / 25%); }
.install-instructions { margin-top: 1rem; font-size: 1rem; line-height: 1.6; }

.trips-shell { background: var(--nek-canvas); }
.trips-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; min-height: 8rem; padding: max(1.25rem, env(safe-area-inset-top)) 1rem 1.1rem; background: linear-gradient(145deg, #f7fffc, #ccefe4); }
.trips-header h1 { margin: .15rem 0 0; font-size: 1.7rem; }
.trips-content { margin-top: 0; padding-top: 1rem; }
.trip-list { display: grid; gap: .8rem; }
.trip-card .card-body { gap: .8rem; padding: 1rem; }
.trip-card .card-title { font-size: 1rem; }
.trip-card .badge { text-transform: capitalize; }
.trip-route { display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: start; }
.trip-route > svg { width: 1.35rem; height: 1.35rem; color: var(--nek-green); }
.trip-route div { display: grid; gap: .2rem; min-width: 0; }
.trip-route span { color: var(--nek-muted); font-size: .82rem; overflow-wrap: anywhere; }
.trip-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.trip-details > span { display: grid; grid-template-columns: auto 1fr; gap: .4rem; align-items: start; min-width: 0; color: var(--nek-muted); font-size: .75rem; }
.trip-details svg { width: .95rem; height: .95rem; color: var(--nek-green); }
.trip-details span span { overflow-wrap: anywhere; }
.trip-instructions { align-items: start; font-size: .8rem; line-height: 1.4; }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: max(1.25rem, env(safe-area-inset-top)) 1rem max(1.25rem, env(safe-area-inset-bottom)); background: linear-gradient(150deg, rgb(226 248 240 / 92%), rgb(248 255 252 / 96%)), url('/assets/nek-mobile-hero-v1.png') center / cover; }
.login-shell { width: min(100%, 30rem); }
.login-card .card-body { gap: 1.35rem; padding: clamp(1.35rem, 5vw, 2rem); }
.login-logo { width: min(14rem, 68vw); height: auto; }
.login-title { margin: .25rem 0 .5rem; font-size: clamp(1.8rem, 7vw, 2.4rem); }
.login-copy { margin: 0; color: var(--nek-muted); line-height: 1.55; }
.login-status { min-height: 1.5rem; margin: 0; color: var(--nek-muted); text-align: center; }

@media (max-width: 390px) {
  .content-stack { padding-inline: .7rem; }
  .workspace-grid { gap: .42rem; }
  .workspace-button { height: 9.5rem; padding-inline: .55rem; }
  .workspace-art { width: calc(100% + 1.1rem); margin-left: -.55rem; }
  .workspace-copy strong { font-size: .85rem; }
  .workspace-copy > span:not(.badge) { font-size: .64rem; }
  .next-trip-body { grid-template-columns: auto 1fr 4.5rem auto; gap: .5rem; }
  .next-trip-photo { width: 4.5rem; height: 4rem; }
  .dock-signature { font-size: .63rem; }
}

@media (max-width: 340px) {
  .user-avatar { width: 2.8rem; height: 2.8rem; }
  .user-summary { font-size: .68rem; }
  .workspace-copy > span:not(.badge) { -webkit-line-clamp: 1; }
  .next-trip-photo { display: none; }
  .next-trip-body { grid-template-columns: auto 1fr auto; }
  .trip-details { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
