
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-soft: #efeee9;
  --surface-blue: #eaf1f3;
  --ink: #182127;
  --muted: #77838a;
  --line: #e2e4e2;
  --accent: #2d6170;
  --accent-2: #3c7b88;
  --accent-soft: #dfecef;
  --success: #2d7d61;
  --success-soft: #e4f2ec;
  --warning: #a9772a;
  --warning-soft: #f6eddd;
  --danger: #ad5353;
  --danger-soft: #f7e7e7;
  --shadow: 0 20px 50px rgba(20, 35, 42, .08);
  --shadow-soft: 0 8px 28px rgba(20, 35, 42, .06);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: var(--bg);
  color-scheme: light;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 8% 0%, rgba(45, 97, 112, .06), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body.rtl {
  direction: rtl;
  font-family: Tahoma, Arial, sans-serif;
}

button, input, textarea {
  font: inherit;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(45, 97, 112, .24);
  outline-offset: 2px;
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
}

svg {
  display: block;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: 100%;
  max-width: 760px;
  min-height: 100vh;
  margin: 0 auto;
  padding:
    max(16px, env(safe-area-inset-top))
    18px
    max(28px, env(safe-area-inset-bottom));
  position: relative;
}

.app-header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 20;
}

.brand,
.header-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.brand-mark,
.splash-mark {
  position: relative;
  display: grid;
  place-items: center;
  background: var(--accent);
  overflow: hidden;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
}

.splash-mark {
  width: 78px;
  height: 78px;
  border-radius: 25px;
  box-shadow: 0 20px 40px rgba(45, 97, 112, .2);
}

.mark-road {
  width: 10px;
  height: 62%;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  position: relative;
  transform: rotate(17deg);
}

.mark-road::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 10%;
  bottom: 10%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--accent);
  box-shadow: 0 7px 0 var(--accent), 0 14px 0 var(--accent), 0 21px 0 var(--accent);
}

.mark-pin {
  position: absolute;
  width: 7px;
  height: 7px;
  border: 2px solid white;
  border-radius: 50%;
  right: 8px;
  top: 7px;
}

.header-actions {
  gap: 8px;
}

.ghost-button,
.icon-button,
.secondary-button {
  background: rgba(255,255,255,.72);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 3px 12px rgba(20,35,42,.03);
}

.ghost-button.compact {
  min-height: 38px;
  border-radius: 13px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.main {
  padding-top: 14px;
}

.view {
  display: none;
  opacity: 0;
  transform: translateY(12px) scale(.995);
}

.view.active {
  display: block;
  animation: viewIn .46s var(--ease) forwards;
}

@keyframes viewIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Splash */
.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity .45s var(--ease), visibility .45s;
}

.splash.out {
  opacity: 0;
  visibility: hidden;
}

.splash-mark {
  animation: splashMark .8s var(--ease) both;
}

@keyframes splashMark {
  0% { opacity: 0; transform: scale(.7) rotate(-8deg); }
  70% { transform: scale(1.04) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

.splash-name {
  margin-top: 18px;
  font-weight: 750;
  letter-spacing: -.03em;
  animation: fadeUp .5s .22s both;
}

.splash-loader {
  display: flex;
  gap: 5px;
  margin-top: 16px;
}

.splash-loader span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: loadingDots 1s infinite ease-in-out;
}

.splash-loader span:nth-child(2) { animation-delay: .12s; }
.splash-loader span:nth-child(3) { animation-delay: .24s; }

@keyframes loadingDots {
  0%, 100% { opacity: .22; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

/* Login */
.login-visual {
  height: 190px;
  margin: 18px 0 10px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(45,97,112,.12), rgba(255,255,255,.68)),
    var(--surface);
  border: 1px solid rgba(45,97,112,.09);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.orbit {
  position: absolute;
  border: 1px solid rgba(45,97,112,.13);
  border-radius: 50%;
}

.orbit-one {
  width: 220px;
  height: 220px;
  right: -60px;
  top: -72px;
  animation: orbitFloat 6s ease-in-out infinite;
}

.orbit-two {
  width: 150px;
  height: 150px;
  left: -40px;
  bottom: -72px;
  animation: orbitFloat 7s ease-in-out infinite reverse;
}

@keyframes orbitFloat {
  50% { transform: translate(8px, 10px) scale(1.04); }
}

.login-car {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -45%);
  width: 132px;
  animation: carIdle 3.4s ease-in-out infinite;
}

.login-car svg {
  width: 100%;
  fill: var(--accent);
}

.login-car .car-window {
  fill: rgba(255,255,255,.82);
}

@keyframes carIdle {
  0%,100% { transform: translate(-50%, -45%); }
  50% { transform: translate(-50%, -49%); }
}

.intro-copy {
  padding: 8px 4px 0;
}

.eyebrow,
.card-label {
  color: var(--accent);
  letter-spacing: .13em;
  font-size: 10px;
  font-weight: 800;
}

.intro-copy h1,
.welcome-block h1,
.break-hero h1,
.summary-hero h1 {
  margin: 7px 0 7px;
  font-size: clamp(30px, 8vw, 44px);
  line-height: 1.02;
  letter-spacing: -.045em;
  font-weight: 760;
}

.intro-copy p,
.welcome-block p,
.break-hero p,
.summary-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.pin-panel {
  padding-top: 18px;
}

.pin-dots {
  height: 58px;
  background: rgba(255,255,255,.66);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.pin-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c8cecf;
  transition: transform .22s var(--ease), background .22s;
}

.pin-dot.filled {
  background: var(--accent);
  transform: scale(1.18);
}

.pin-dots.shake {
  animation: shake .38s ease;
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(7px); }
  75% { transform: translateX(-4px); }
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.keypad button {
  height: 58px;
  border-radius: 17px;
  background: rgba(255,255,255,.7);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 20px;
  font-weight: 650;
  cursor: pointer;
  transition: transform .14s var(--ease), background .14s;
}

.keypad button:active {
  transform: scale(.94);
  background: var(--accent-soft);
}

.keypad .key-icon {
  display: grid;
  place-items: center;
}

.keypad .key-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inline-feedback {
  min-height: 26px;
  padding-top: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--danger);
}

/* Ready */
.welcome-block {
  padding-top: clamp(38px, 9vh, 90px);
  text-align: center;
}

.avatar-ring {
  width: 84px;
  height: 84px;
  margin: 0 auto 22px;
  padding: 5px;
  border: 1px solid rgba(45,97,112,.15);
  border-radius: 50%;
  position: relative;
  animation: avatarIn .7s var(--ease) both;
}

.avatar {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 760;
  font-size: 28px;
}

.presence-dot {
  position: absolute;
  right: 5px;
  bottom: 6px;
  width: 17px;
  height: 17px;
  border: 4px solid var(--bg);
  border-radius: 50%;
  background: var(--success);
}

@keyframes avatarIn {
  from { opacity: 0; transform: scale(.7); }
  to { opacity: 1; transform: scale(1); }
}

.start-day-visual {
  margin: 52px auto 44px;
  max-width: 360px;
  padding: 0 12px;
}

.road-line {
  position: relative;
  height: 2px;
  background: #d6dadd;
}

.road-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 36%;
  background: var(--accent);
  animation: roadGrow 2.5s var(--ease) infinite alternate;
}

@keyframes roadGrow {
  from { width: 18%; }
  to { width: 76%; }
}

.road-dot {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #c9ced0;
}

.dot-start { left: 0%; background: var(--accent); }
.dot-mid { left: 50%; }
.dot-end { left: 100%; }

/* Buttons */
.primary-button,
.secondary-button {
  width: 100%;
  min-height: 58px;
  border-radius: 19px;
  font-size: 15px;
  font-weight: 760;
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s, background .18s;
}

.primary-button {
  background: var(--accent);
  color: white;
  box-shadow: 0 12px 28px rgba(45,97,112,.16);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.primary-button.large {
  min-height: 64px;
}

.primary-button:active,
.secondary-button:active,
.quick-button:active,
.trip-action-card:active {
  transform: scale(.985);
}

.button-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255,255,255,.14);
}

.button-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success-button {
  background: var(--success);
}

.danger-primary {
  background: var(--danger);
  box-shadow: 0 12px 28px rgba(173,83,83,.14);
}

/* Home */
.home-top {
  padding: 26px 2px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.current-time {
  font-size: clamp(30px, 7vw, 40px);
  font-weight: 760;
  letter-spacing: -.05em;
}

.current-date,
.subtle-time {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.status-pill.available {
  background: var(--success-soft);
  color: var(--success);
}

.status-pill.driving {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse 1.9s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.shift-card {
  min-height: 200px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.shift-orbit {
  position: absolute;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(45,97,112,.11);
  border-radius: 50%;
  right: -95px;
  top: -85px;
}

.shift-orbit::before,
.shift-orbit::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(45,97,112,.08);
  border-radius: 50%;
  inset: 24px;
}

.shift-orbit::after {
  inset: 49px;
}

.hero-timer {
  font-size: clamp(48px, 13vw, 72px);
  font-weight: 720;
  letter-spacing: -.055em;
  margin-top: 14px;
  font-variant-numeric: tabular-nums;
  position: relative;
}

.shift-meta {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 6px;
  position: relative;
}

.shift-meta strong {
  color: var(--ink);
}

.trip-action-card {
  margin-top: 14px;
  width: 100%;
  min-height: 116px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: white;
  display: grid;
  grid-template-columns: 52px 1fr 34px;
  align-items: center;
  gap: 14px;
  text-align: start;
  box-shadow: 0 18px 34px rgba(45,97,112,.16);
  cursor: pointer;
  transition: transform .18s var(--ease);
  overflow: hidden;
  position: relative;
}

.trip-action-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 50%;
  right: -55px;
  top: -60px;
}

.action-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: rgba(255,255,255,.13);
  display: grid;
  place-items: center;
}

.action-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.action-copy .card-label {
  color: rgba(255,255,255,.62);
}

.action-copy strong {
  font-size: 20px;
  margin-top: 4px;
}

.action-copy small {
  color: rgba(255,255,255,.7);
  margin-top: 5px;
  font-size: 11px;
}

.action-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: grid;
  place-items: center;
}

.action-arrow svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.quick-button {
  min-height: 76px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  color: var(--ink);
  font-size: 12px;
  font-weight: 740;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  transition: transform .18s var(--ease);
}

.break-button {
  background: var(--warning-soft);
  color: #8d6827;
  border-color: #ebddc4;
}

.end-button {
  background: rgba(255,255,255,.76);
}

.quick-icon {
  font-size: 19px;
}

.today-section {
  padding-top: 28px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 16px;
}

.section-head span {
  color: var(--success);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.stat-card {
  min-height: 106px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.72);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-icon {
  color: var(--accent);
  font-size: 16px;
}

.stat-card strong {
  font-size: 22px;
  letter-spacing: -.04em;
}

.stat-card small {
  color: var(--muted);
  font-size: 10px;
}

/* Trip active */
.trip-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 2px 18px;
}

.trip-route-card {
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  padding: 26px 22px;
  position: relative;
}

.route-stop {
  position: relative;
  min-height: 82px;
  display: flex;
  gap: 17px;
  align-items: flex-start;
  z-index: 2;
}

.route-stop:last-child {
  min-height: 36px;
}

.route-stop small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  margin-bottom: 7px;
}

.route-stop strong {
  font-size: 16px;
}

.route-node {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  margin-top: 3px;
}

.destination-node {
  background: var(--success);
  box-shadow: 0 0 0 1px var(--success);
}

.route-progress {
  position: absolute;
  left: 28px;
  top: 38px;
  height: 81px;
  width: 2px;
  z-index: 1;
}

body.rtl .route-progress {
  left: auto;
  right: 28px;
}

.route-track {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, #d6dbdc 0 5px, transparent 5px 10px);
}

.route-moving-dot {
  position: absolute;
  left: 50%;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(45,97,112,.1);
  animation: routeMove 2.3s var(--ease) infinite;
}

@keyframes routeMove {
  0% { top: 8%; opacity: .3; }
  45% { opacity: 1; }
  100% { top: 92%; opacity: .3; }
}

.trip-purpose-card {
  margin-top: 10px;
  min-height: 88px;
  border-radius: var(--radius-md);
  background: var(--surface-blue);
  padding: 17px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.trip-purpose-card strong {
  margin-top: 6px;
  font-size: 16px;
}

.trip-timer-wrap {
  padding: 44px 0 36px;
  text-align: center;
}

.trip-timer {
  font-size: clamp(42px, 12vw, 64px);
  letter-spacing: -.05em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 8px;
}

.moving-road {
  width: 164px;
  height: 10px;
  overflow: hidden;
  margin: 22px auto 0;
  display: flex;
  gap: 14px;
}

.moving-road span {
  width: 24px;
  height: 2px;
  flex: 0 0 24px;
  margin-top: 4px;
  border-radius: 99px;
  background: #c9cecf;
  animation: roadDash 1.2s linear infinite;
}

@keyframes roadDash {
  to { transform: translateX(38px); }
}

/* Break */
.break-hero,
.summary-hero {
  text-align: center;
  padding-top: clamp(42px, 9vh, 88px);
}

.cup-scene {
  height: 114px;
  position: relative;
  display: grid;
  place-items: end center;
  margin-bottom: 20px;
}

.cup {
  font-size: 62px;
  animation: cupFloat 3s ease-in-out infinite;
}

@keyframes cupFloat {
  50% { transform: translateY(-5px); }
}

.steam {
  position: absolute;
  width: 2px;
  height: 34px;
  bottom: 62px;
  border-radius: 99px;
  background: linear-gradient(to top, rgba(45,97,112,.42), transparent);
  filter: blur(.2px);
  animation: steam 2.2s ease-in-out infinite;
}

.steam-one { left: calc(50% - 15px); }
.steam-two { left: 50%; animation-delay: .5s; }
.steam-three { left: calc(50% + 14px); animation-delay: 1s; }

@keyframes steam {
  0% { transform: translateY(8px) scaleY(.7); opacity: 0; }
  35% { opacity: .8; }
  100% { transform: translateY(-20px) translateX(5px) scaleY(1.15); opacity: 0; }
}

.break-timer {
  font-size: clamp(50px, 14vw, 74px);
  font-weight: 700;
  letter-spacing: -.055em;
  text-align: center;
  margin: 36px 0 50px;
  font-variant-numeric: tabular-nums;
}

/* Summary */
.success-burst {
  width: 100px;
  height: 100px;
  margin: 0 auto 20px;
  position: relative;
}

.success-check {
  position: absolute;
  inset: 17px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  display: grid;
  place-items: center;
  animation: checkPop .55s var(--ease) both;
}

.success-check svg {
  width: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes checkPop {
  0% { transform: scale(.5); opacity: 0; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.burst-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: burst 1.4s ease-in-out infinite alternate;
}

.b1 { left: 5px; top: 50%; }
.b2 { right: 7px; top: 25%; animation-delay: .2s; }
.b3 { left: 25%; top: 2px; animation-delay: .35s; }
.b4 { right: 25%; bottom: 0; animation-delay: .5s; }

@keyframes burst {
  to { transform: scale(1.5); opacity: .35; }
}

.summary-total {
  margin-top: 34px;
  text-align: center;
  padding: 26px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.summary-total span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.summary-total strong {
  display: block;
  font-size: 42px;
  letter-spacing: -.05em;
  margin-top: 8px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 10px 0 22px;
}

.summary-grid > div {
  min-height: 92px;
  padding: 14px 8px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.7);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.summary-grid strong {
  font-size: 20px;
}

.summary-grid span {
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
}

/* Sheets */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(19,27,31,.3);
  backdrop-filter: blur(4px);
  opacity: 0;
  animation: backdropIn .26s forwards;
}

@keyframes backdropIn {
  to { opacity: 1; }
}

.bottom-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 100;
  width: min(100%, 760px);
  max-height: min(88vh, 760px);
  transform: translateX(-50%);
  background: var(--bg);
  border-radius: 30px 30px 0 0;
  border: 1px solid rgba(255,255,255,.78);
  box-shadow: 0 -20px 60px rgba(20,35,42,.14);
  padding: 10px 18px max(18px, env(safe-area-inset-bottom));
  animation: sheetUp .44s var(--ease) both;
}

@keyframes sheetUp {
  from { transform: translate(-50%, 105%); }
  to { transform: translate(-50%, 0); }
}

.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  margin: 0 auto 16px;
  background: #d0d4d5;
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.sheet-head h2,
.confirm-sheet h2 {
  margin: 6px 0 0;
  font-size: 25px;
  letter-spacing: -.04em;
}

.sheet-scroll {
  max-height: calc(88vh - 220px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 12px;
  scrollbar-width: none;
}

.sheet-scroll::-webkit-scrollbar {
  display: none;
}

.form-section + .form-section {
  margin-top: 24px;
}

.form-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
}

.choice-button {
  min-height: 54px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.7);
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: start;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s var(--ease), background .18s, border .18s;
}

.choice-button:active {
  transform: scale(.97);
}

.choice-button.selected {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(45,97,112,.24);
  box-shadow: inset 0 0 0 1px rgba(45,97,112,.08);
}

.conditional-field {
  margin-top: 10px;
  animation: fadeUp .25s var(--ease) both;
}

.conditional-field label {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin: 0 0 7px;
}

.conditional-field input,
.conditional-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.76);
  color: var(--ink);
  padding: 13px 14px;
  font-size: 14px;
  resize: none;
}

.confirm-sheet {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 101;
  width: min(calc(100% - 28px), 470px);
  transform: translateX(-50%);
  background: var(--surface);
  border-radius: 26px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(20,35,42,.2);
  padding: 24px;
  text-align: center;
  animation: confirmUp .36s var(--ease) both;
}

@keyframes confirmUp {
  from { transform: translate(-50%, 30px) scale(.97); opacity: 0; }
  to { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

.confirm-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 22px;
  font-weight: 900;
}

.confirm-sheet p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 10px 0 20px;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

/* Overlays */
.loading-overlay,
.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background: rgba(246,245,241,.82);
  backdrop-filter: blur(6px);
  padding: 20px;
}

.loading-card,
.success-pop {
  width: min(100%, 300px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
  animation: popIn .3s var(--ease) both;
}

@keyframes popIn {
  from { transform: scale(.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.location-loader {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  position: relative;
  display: grid;
  place-items: center;
}

.loader-ring {
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

.loader-pin {
  width: 12px;
  height: 12px;
  border-radius: 50% 50% 50% 0;
  background: var(--accent);
  transform: rotate(-45deg);
}

.loading-card strong,
.success-pop strong {
  display: block;
  font-size: 15px;
}

.loading-card span:last-child,
.success-pop > span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.success-pop-icon {
  width: 58px;
  height: 58px;
  border-radius: 19px;
  margin: 0 auto 14px;
  background: var(--success);
  color: white;
  display: grid;
  place-items: center;
}

.success-pop-icon svg {
  width: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 500;
  transform: translate(-50%, 130%);
  width: min(calc(100% - 32px), 460px);
  background: #202a30;
  color: white;
  border-radius: 16px;
  padding: 13px 15px;
  font-size: 12px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(20,35,42,.2);
  transition: transform .34s var(--ease);
}

.toast.show {
  transform: translate(-50%, 0);
}

.offline-banner {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  z-index: 600;
  transform: translateX(-50%);
  width: min(calc(100% - 28px), 560px);
  min-height: 44px;
  padding: 9px 13px;
  border-radius: 15px;
  background: #263035;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 10px;
  box-shadow: 0 12px 30px rgba(20,35,42,.18);
}

.offline-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f1b95d;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* RTL adjustments */
body.rtl .trip-action-card,
body.rtl .choice-button {
  text-align: right;
}

body.rtl .action-arrow svg,
body.rtl .button-icon svg {
  transform: scaleX(-1);
}

body.rtl .road-progress {
  left: auto;
  right: 0;
}

/* Responsive */
@media (min-width: 680px) {
  .app-shell {
    padding-left: 28px;
    padding-right: 28px;
  }

  .login-visual {
    height: 230px;
  }

  .keypad {
    max-width: 430px;
    margin-left: auto;
    margin-right: auto;
  }

  .pin-dots {
    max-width: 430px;
    margin-left: auto;
    margin-right: auto;
  }

  .inline-feedback {
    max-width: 430px;
    margin-left: auto;
    margin-right: auto;
  }

  .quick-actions {
    gap: 12px;
  }

  .choice-grid {
    grid-template-columns: repeat(3, minmax(0,1fr));
  }
}

@media (max-width: 360px) {
  .app-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand-title {
    font-size: 13px;
  }

  .keypad button {
    height: 54px;
  }

  .trip-action-card {
    grid-template-columns: 46px 1fr 30px;
    gap: 11px;
  }

  .action-icon {
    width: 46px;
    height: 46px;
  }

  .stats-grid,
  .summary-grid {
    gap: 6px;
  }

  .stat-card {
    padding: 11px 9px;
  }
}

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


/* =========================================================
   V1.1 — Login redesign + mobile browser safe spacing
   ========================================================= */

#loginView {
  min-height: calc(100dvh - 92px);
}

.login-premium {
  width: min(100%, 430px);
  margin: 0 auto;
  padding: clamp(34px, 8vh, 74px) 0 24px;
}

.login-motion {
  width: min(100%, 330px);
  height: 72px;
  margin: 0 auto 30px;
  display: grid;
  grid-template-columns: 26px 1fr 26px;
  align-items: center;
  gap: 10px;
}

.motion-pin {
  width: 18px;
  height: 18px;
  border-radius: 50% 50% 50% 0;
  background: var(--accent);
  transform: rotate(-45deg);
  position: relative;
  box-shadow: 0 0 0 6px rgba(45, 97, 112, .07);
}

.motion-pin::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bg);
  left: 6px;
  top: 6px;
}

.motion-track {
  position: relative;
  height: 3px;
  border-radius: 99px;
  background: #dfe3e3;
  overflow: visible;
}

.motion-track::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(45, 97, 112, .22) 0 10px,
    transparent 10px 18px
  );
}

.motion-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 38%;
  border-radius: 99px;
  background: var(--accent);
  opacity: .2;
  animation: loginTrack 2.8s var(--ease) infinite alternate;
}

.motion-car {
  position: absolute;
  top: 50%;
  left: 8%;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  border-radius: 11px;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  box-shadow: 0 7px 18px rgba(45,97,112,.18);
  animation: loginCarDrive 2.8s var(--ease) infinite alternate;
}

.motion-car svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes loginCarDrive {
  from { left: 8%; transform: translateX(0); }
  to { left: calc(92% - 32px); transform: translateX(0); }
}

@keyframes loginTrack {
  from { width: 16%; }
  to { width: 88%; }
}

.login-copy {
  text-align: center;
  padding: 0 18px;
}

.login-copy h1 {
  font-size: clamp(34px, 9vw, 48px);
}

.login-copy p {
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.pin-card {
  margin-top: 26px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.70);
  border-radius: 28px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.pin-card .pin-dots {
  background: var(--surface-soft);
  border: 0;
  height: 54px;
}

.premium-keypad {
  gap: 9px;
  margin-top: 14px;
}

.premium-keypad button {
  height: 60px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #e7e8e5;
  box-shadow: 0 4px 12px rgba(20,35,42,.035);
}

.premium-keypad button:active {
  background: var(--accent-soft);
  border-color: rgba(45,97,112,.18);
  transform: scale(.95);
}

/* Keep all transient notices above mobile browser UI */
.toast {
  bottom: max(78px, calc(env(safe-area-inset-bottom) + 62px));
  width: min(calc(100% - 28px), 430px);
}

.offline-banner {
  top: max(70px, calc(env(safe-area-inset-top) + 56px));
}

/* Avoid hidden fixed sheets/buttons behind iOS/Android browser chrome */
.bottom-sheet {
  padding-bottom: max(28px, calc(env(safe-area-inset-bottom) + 22px));
}

.confirm-sheet {
  bottom: max(22px, calc(env(safe-area-inset-bottom) + 18px));
}

@media (max-height: 700px) {
  .login-premium {
    padding-top: 18px;
  }

  .login-motion {
    margin-bottom: 18px;
    height: 56px;
  }

  .pin-card {
    margin-top: 18px;
  }

  .premium-keypad button {
    height: 54px;
  }
}

@media (max-width: 360px) {
  .login-premium {
    width: 100%;
  }

  .pin-card {
    border-radius: 24px;
    padding: 14px;
  }

  .premium-keypad button {
    height: 54px;
  }
}


/* =========================================================
   V1.2 — True mobile viewport layout / no useless page scroll
   ========================================================= */

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overscroll-behavior: none;
}

body {
  overflow: hidden;
}

.app-shell {
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding-top: max(10px, env(safe-area-inset-top));
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  overflow: hidden;
}

.app-header {
  min-height: 44px;
  height: 44px;
  flex: 0 0 44px;
  margin: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.brand-title {
  font-size: 14px;
}

.ghost-button.compact {
  min-height: 34px;
  height: 34px;
  padding: 0 11px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.main {
  min-height: 0;
  height: 100%;
  padding-top: 6px;
  overflow: hidden;
}

.view,
.view.active {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* LOGIN: everything fits in one phone screen */
#loginView {
  min-height: 0;
  height: 100%;
}

.login-premium {
  height: 100%;
  width: min(100%, 430px);
  margin: 0 auto;
  padding: clamp(8px, 1.8vh, 18px) 0 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-motion {
  width: min(88%, 300px);
  height: clamp(44px, 7vh, 60px);
  margin: 0 auto clamp(10px, 1.8vh, 18px);
  flex: 0 0 auto;
}

.login-copy {
  padding: 0 12px;
  flex: 0 0 auto;
}

.login-copy h1 {
  margin-top: 4px;
  margin-bottom: 4px;
  font-size: clamp(29px, 7.4vw, 40px);
}

.login-copy p {
  font-size: 12px;
  line-height: 1.45;
}

.login-copy .eyebrow {
  font-size: 9px;
}

.pin-card {
  width: 100%;
  margin-top: clamp(10px, 1.8vh, 18px);
  padding: clamp(10px, 1.5vh, 15px);
  border-radius: 24px;
  flex: 0 0 auto;
}

.pin-card .pin-dots {
  height: clamp(42px, 6.2vh, 50px);
}

.pin-dots {
  gap: 16px;
}

.pin-dot {
  width: 9px;
  height: 9px;
}

.premium-keypad {
  gap: clamp(6px, 1vh, 9px);
  margin-top: clamp(8px, 1.2vh, 12px);
}

.premium-keypad button {
  height: clamp(44px, 6.7vh, 56px);
  border-radius: 16px;
  font-size: clamp(17px, 4.7vw, 20px);
}

.inline-feedback {
  min-height: 18px;
  height: 18px;
  padding-top: 4px;
  font-size: 10px;
}

/* READY screen */
#readyView {
  display: none;
}

#readyView.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 6px;
}

.welcome-block {
  padding-top: 0;
}

.avatar-ring {
  width: clamp(68px, 10vh, 80px);
  height: clamp(68px, 10vh, 80px);
  margin-bottom: clamp(12px, 2vh, 20px);
}

.welcome-block h1 {
  font-size: clamp(30px, 7vw, 40px);
  margin: 6px 0;
}

.start-day-visual {
  width: 100%;
  margin: clamp(24px, 5vh, 42px) auto clamp(24px, 4vh, 36px);
}

/* HOME: compact, one-screen dashboard */

.home-top {
  padding: clamp(10px, 1.5vh, 15px) 2px clamp(8px, 1.4vh, 13px);
  flex: 0 0 auto;
}

.current-time {
  font-size: clamp(26px, 6vw, 34px);
}

.shift-card {
  min-height: 0;
  height: clamp(132px, 20vh, 170px);
  padding: clamp(16px, 2.4vh, 21px);
  flex: 0 0 auto;
}

.hero-timer {
  font-size: clamp(40px, 10vw, 58px);
  margin-top: 8px;
}

.trip-action-card {
  min-height: clamp(82px, 12vh, 104px);
  margin-top: clamp(8px, 1.2vh, 12px);
  padding: 14px 16px;
  flex: 0 0 auto;
}

.action-icon {
  width: 46px;
  height: 46px;
  border-radius: 15px;
}

.action-copy strong {
  font-size: 18px;
}

.action-copy small {
  margin-top: 3px;
  line-height: 1.25;
}

.quick-actions {
  margin-top: 8px;
  flex: 0 0 auto;
}

.quick-button {
  min-height: clamp(56px, 8.3vh, 68px);
}

.today-section {
  padding-top: clamp(12px, 2vh, 18px);
  min-height: 0;
  flex: 1 1 auto;
}

.section-head {
  padding-bottom: 7px;
}

.stats-grid {
  height: calc(100% - 29px);
  min-height: 82px;
}

.stat-card {
  min-height: 0;
  height: 100%;
  padding: 10px;
}

.stat-card strong {
  font-size: clamp(18px, 4.8vw, 22px);
}

/* ACTIVE TRIP: all essential actions visible without page scrolling */
#tripView.active {
  display: flex;
  flex-direction: column;
}

.trip-status-head {
  padding: clamp(10px, 1.8vh, 16px) 2px clamp(9px, 1.5vh, 14px);
  flex: 0 0 auto;
}

.trip-route-card {
  padding: clamp(18px, 2.5vh, 23px) 20px;
  flex: 0 0 auto;
}

.route-stop {
  min-height: clamp(62px, 9vh, 76px);
}

.trip-purpose-card {
  min-height: clamp(65px, 9vh, 80px);
  margin-top: 8px;
  padding: 13px 16px;
  flex: 0 0 auto;
}

.trip-timer-wrap {
  padding: clamp(18px, 3vh, 28px) 0 clamp(15px, 2.5vh, 24px);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.trip-timer {
  font-size: clamp(38px, 10vw, 54px);
}

.moving-road {
  margin-top: 15px;
}

#arrivedButton {
  flex: 0 0 auto;
}

/* BREAK: one-screen centered */
#breakView.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.break-hero {
  padding-top: 0;
}

.cup-scene {
  height: clamp(82px, 12vh, 104px);
  margin-bottom: 12px;
}

.cup {
  font-size: clamp(48px, 8vh, 60px);
}

.break-hero h1 {
  font-size: clamp(30px, 7vw, 40px);
}

.break-timer {
  font-size: clamp(42px, 11vw, 62px);
  margin: clamp(20px, 3.6vh, 34px) 0 clamp(24px, 4vh, 38px);
}

/* SUMMARY: compact single-screen */
#summaryView.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.summary-hero {
  padding-top: 0;
}

.success-burst {
  width: clamp(72px, 10vh, 92px);
  height: clamp(72px, 10vh, 92px);
  margin-bottom: 10px;
}

.summary-hero h1 {
  font-size: clamp(29px, 7vw, 38px);
  margin: 5px 0;
}

.summary-total {
  margin-top: clamp(14px, 2vh, 22px);
  padding: clamp(16px, 2.3vh, 22px);
}

.summary-total strong {
  font-size: clamp(32px, 8vw, 40px);
  margin-top: 5px;
}

.summary-grid {
  margin: 8px 0 12px;
}

.summary-grid > div {
  min-height: clamp(70px, 10vh, 86px);
}

/* Only the trip option sheet may scroll internally if its content exceeds viewport */
.sheet-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Mobile browser UI / toast remains safely visible */
.toast {
  bottom: max(66px, calc(env(safe-area-inset-bottom) + 54px));
}

/* Very short phones: remove non-essential decorative space first */
@media (max-height: 760px) {
  .login-motion {
    height: 40px;
    margin-bottom: 7px;
  }

  .login-copy p {
    display: none;
  }

  .pin-card {
    margin-top: 9px;
  }

  .premium-keypad button {
    height: 43px;
  }

  .welcome-block p,
  .action-copy small {
    display: none;
  }

  .start-day-visual {
    margin: 20px auto;
  }

  .today-section {
    padding-top: 9px;
  }

  .shift-card {
    height: 124px;
  }

  .trip-action-card {
    min-height: 76px;
  }

  .quick-button {
    min-height: 52px;
  }

  .cup-scene {
    height: 72px;
  }

  .break-timer {
    margin: 16px 0 22px;
  }
}

@media (max-height: 650px) {
  .login-motion {
    display: none;
  }

  .login-premium {
    padding-top: 2px;
  }

  .login-copy h1 {
    font-size: 27px;
  }

  .pin-card .pin-dots {
    height: 38px;
  }

  .premium-keypad button {
    height: 39px;
  }

  .inline-feedback {
    height: 14px;
    min-height: 14px;
  }

  .home-top {
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .current-date,
  .shift-meta,
  .section-head {
    display: none;
  }

  .shift-card {
    height: 108px;
    padding: 13px 16px;
  }

  .hero-timer {
    font-size: 38px;
  }

  .today-section {
    padding-top: 7px;
  }

  .stats-grid {
    height: 72px;
  }

  .trip-status-head {
    padding-top: 4px;
  }

  .trip-timer-wrap {
    padding: 10px 0;
  }
}

/* Desktop/tablet still behaves cleanly without growing into a long page */
@media (min-width: 680px) {
  .app-shell {
    max-width: 720px;
  }

  .login-premium {
    max-width: 440px;
  }

  .home-top,
  .shift-card,
  .trip-action-card,
  .quick-actions,
  .today-section,
  .trip-status-head,
  .trip-route-card,
  .trip-purpose-card,
  .trip-timer-wrap,
  #arrivedButton {
    width: 100%;
  }
}


/* =========================================================
   V1.3 — Better home dashboard + toast fix
   ========================================================= */

#homeView.active {
  display: block;
  height: 100%;
}

.home-redesign {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 10px;
}

.home-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}

.hero-copy {
  min-width: 0;
}

.current-time {
  font-size: clamp(30px, 6.8vw, 38px);
  line-height: 1;
  font-weight: 760;
  letter-spacing: -.05em;
}

.current-date {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.compact-status {
  margin-top: 3px;
}

.dashboard-shift-card {
  min-height: 0;
  border-radius: 28px;
  padding: 18px 18px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.dashboard-shift-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}

.dashboard-shift-timer {
  font-size: clamp(46px, 11vw, 60px);
  line-height: 1;
  letter-spacing: -.06em;
  font-weight: 760;
  margin: 12px 0 10px;
  font-variant-numeric: tabular-nums;
}

.dashboard-shift-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.shift-meta-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.shift-meta-inline strong {
  color: var(--ink);
  font-size: 13px;
}

.shift-divider {
  width: 1px;
  height: 14px;
  background: #d7dbdb;
}

.shift-small-hint {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trip-primary-card {
  width: 100%;
  min-height: 92px;
  border-radius: 28px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #2f6776, #2d6170);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 18px 34px rgba(45,97,112,.18);
  text-align: start;
  position: relative;
  overflow: hidden;
}

.trip-primary-card::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 50%;
  right: -36px;
  bottom: -44px;
}

.trip-primary-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.trip-primary-icon {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.15);
}

.trip-primary-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trip-primary-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.trip-primary-copy .card-label {
  color: rgba(255,255,255,.68);
}

.trip-primary-copy strong {
  margin-top: 4px;
  font-size: 22px;
}

.trip-primary-copy small {
  margin-top: 4px;
  color: rgba(255,255,255,.76);
  font-size: 12px;
  line-height: 1.28;
}

.trip-primary-arrow {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.12);
}

.trip-primary-arrow svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.secondary-action-card {
  min-height: 62px;
  border-radius: 22px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 760;
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(20,35,42,.04);
  background: rgba(255,255,255,.82);
}

.break-card {
  background: linear-gradient(180deg, #f6efdf, #f5ead4);
  color: #8f6b2d;
  border-color: #eadbbf;
}

.end-card {
  color: var(--ink);
}

.secondary-action-icon {
  font-size: 22px;
  line-height: 1;
}

.today-compact-card {
  border-radius: 26px;
  background: rgba(255,255,255,.78);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.today-compact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.today-compact-head h2 {
  margin: 0;
  font-size: 16px;
}

.today-compact-head span {
  color: var(--success);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.compact-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  min-height: 0;
  height: 100%;
}

.compact-stat {
  min-height: 82px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.compact-stat-icon {
  color: var(--accent);
  font-size: 16px;
  line-height: 1;
}

.compact-stat strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -.05em;
}

.compact-stat small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

/* Fix empty dark bar at bottom */
.toast {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (max-height: 760px) {
  .home-redesign {
    gap: 8px;
  }

  .current-time {
    font-size: 28px;
  }

  .current-date {
    margin-top: 4px;
    font-size: 12px;
  }

  .dashboard-shift-card {
    padding: 15px 16px 13px;
  }

  .dashboard-shift-timer {
    font-size: 42px;
    margin: 8px 0 8px;
  }

  .trip-primary-card {
    min-height: 84px;
    padding: 14px 16px;
  }

  .trip-primary-copy strong {
    font-size: 20px;
  }

  .trip-primary-copy small {
    display: none;
  }

  .secondary-action-card {
    min-height: 56px;
    font-size: 15px;
  }

  .today-compact-card {
    padding: 12px;
  }

  .compact-stat {
    min-height: 72px;
    padding: 10px;
  }

  .compact-stat strong {
    font-size: 24px;
  }
}

@media (max-width: 380px) {
  .trip-primary-icon {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .trip-primary-copy strong {
    font-size: 19px;
  }

  .secondary-action-card {
    padding: 0 10px;
    gap: 6px;
    font-size: 14px;
  }

  .compact-stat {
    padding: 10px 9px;
  }

  .compact-stat strong {
    font-size: 23px;
  }
}

body.rtl .trip-primary-arrow svg {
  transform: scaleX(-1);
}


/* =========================================================
   V1.5 — Driver Trip History page
   ========================================================= */

#historyView.active {
  display: block;
  height: 100%;
  overflow: hidden;
}

.history-page {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 10px;
  padding-top: 4px;
}

.history-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}

.history-back-button,
.date-arrow-button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.8);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(20,35,42,.04);
}

.history-back-button {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 14px;
}

.history-back-button svg,
.date-arrow-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-title-wrap {
  min-width: 0;
}

.history-title-wrap h1 {
  margin: 3px 0 0;
  font-size: 27px;
  line-height: 1;
  letter-spacing: -.04em;
}

.history-date-panel {
  min-height: 64px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: stretch;
  gap: 8px;
}

.date-arrow-button {
  width: 42px;
  height: 100%;
  min-height: 58px;
  border-radius: 17px;
}

.history-date-control {
  min-width: 0;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.84);
  padding: 8px 13px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  box-shadow: 0 4px 14px rgba(20,35,42,.035);
}

.history-date-control > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.history-date-control input {
  display: block;
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-size: 14px;
  font-weight: 720;
  outline: none;
}

.history-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.history-summary-card {
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 19px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
}

.history-summary-card span {
  color: var(--muted);
  font-size: 10px;
}

.history-summary-card strong {
  margin-top: 4px;
  font-size: 25px;
  letter-spacing: -.04em;
}

.history-list-head {
  min-height: 34px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 3px;
}

.history-list-head h2 {
  margin: 0;
  font-size: 15px;
}

.history-list-head span {
  color: var(--muted);
  font-size: 10px;
}

.history-scroll {
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 0 1px max(10px, env(safe-area-inset-bottom));
}

.history-scroll::-webkit-scrollbar {
  display: none;
}

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

.history-trip-card {
  border: 1px solid var(--line);
  border-radius: 21px;
  background: rgba(255,255,255,.82);
  padding: 14px;
  box-shadow: 0 4px 16px rgba(20,35,42,.035);
  animation: historyCardIn .32s var(--ease) both;
}

@keyframes historyCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.history-trip-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-purpose {
  min-width: 0;
}

.history-purpose small {
  color: var(--muted);
  display: block;
  font-size: 9px;
  letter-spacing: .08em;
  font-weight: 760;
  text-transform: uppercase;
}

.history-purpose strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.3;
}

.history-duration-badge {
  flex: 0 0 auto;
  padding: 7px 9px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.history-route {
  margin-top: 13px;
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr);
  gap: 9px;
}

.history-route-line {
  position: relative;
  width: 13px;
  min-height: 54px;
}

.history-route-line::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 6px;
  border-left: 1px dashed #cbd2d3;
}

body.rtl .history-route-line::before {
  left: auto;
  right: 6px;
}

.history-route-line span {
  position: absolute;
  left: 2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--accent);
  background: var(--accent);
}

body.rtl .history-route-line span {
  left: auto;
  right: 2px;
}

.history-route-line .route-end-dot {
  bottom: 1px;
  top: auto;
  background: var(--success);
  box-shadow: 0 0 0 1px var(--success);
}

.history-route-copy {
  display: grid;
  gap: 9px;
}

.history-route-row {
  min-width: 0;
}

.history-route-row span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.history-route-row strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.history-trip-footer {
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid #eceeec;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.history-empty {
  min-height: 210px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 24px;
}

.history-empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 22px;
  margin-bottom: 12px;
}

.history-empty strong {
  font-size: 14px;
}

.history-empty span {
  max-width: 250px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.history-loading {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

@media (max-height: 700px) {
  .history-page {
    gap: 7px;
  }

  .history-topbar {
    min-height: 48px;
  }

  .history-title-wrap h1 {
    font-size: 23px;
  }

  .history-date-panel {
    min-height: 55px;
  }

  .date-arrow-button {
    min-height: 52px;
  }

  .history-summary-card {
    min-height: 62px;
    padding: 9px 12px;
  }

  .history-summary-card strong {
    font-size: 22px;
  }
}

body.rtl .history-back-button svg,
body.rtl .date-arrow-button svg {
  transform: scaleX(-1);
}


/* =========================================================
   V1.6 — Premium organized Home
   ========================================================= */

#homeView.active {
  display: block;
  height: 100%;
  overflow: hidden;
}

.home-v16 {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 10px;
  padding-top: 4px;
}

.home-greeting-row {
  padding: 3px 2px 0;
}

.home-greeting-copy {
  min-width: 0;
}

.home-greeting {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  margin-bottom: 5px;
}

.home-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-time-row .current-time {
  font-size: clamp(32px, 8vw, 42px);
  line-height: 1;
  letter-spacing: -.055em;
  font-weight: 760;
}

.home-status {
  flex: 0 0 auto;
}

.home-greeting-copy .current-date {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.shift-summary-v16 {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

.shift-summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.shift-summary-timer {
  font-size: clamp(44px, 11vw, 58px);
  line-height: 1;
  margin-top: 8px;
  letter-spacing: -.06em;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.shift-start-mini {
  padding-top: 3px;
  text-align: end;
}

.shift-start-mini span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.shift-start-mini strong {
  display: block;
  margin-top: 3px;
  font-size: 12px;
}

.shift-stats-row-v16 {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid #eceeec;
}

.shift-stat-v16 {
  min-width: 0;
  text-align: center;
}

.shift-stat-v16 strong {
  display: block;
  font-size: 19px;
  line-height: 1;
  letter-spacing: -.03em;
}

.shift-stat-v16 span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.shift-stat-divider {
  width: 1px;
  height: 26px;
  background: #e2e5e4;
}

.start-trip-v16 {
  width: 100%;
  min-height: 88px;
  padding: 14px 16px;
  border-radius: 24px;
  background: linear-gradient(135deg, #326c7a, #2d6170);
  color: white;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  text-align: start;
  box-shadow: 0 16px 32px rgba(45,97,112,.16);
  position: relative;
  overflow: hidden;
}

.start-trip-v16::after {
  content: "";
  position: absolute;
  width: 122px;
  height: 122px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 50%;
  right: -42px;
  bottom: -48px;
}

.start-trip-icon-v16 {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(255,255,255,.14);
  display: grid;
  place-items: center;
}

.start-trip-icon-v16 svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.start-trip-copy-v16 {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.start-trip-copy-v16 > span {
  font-size: 20px;
  font-weight: 760;
}

.start-trip-copy-v16 small {
  margin-top: 4px;
  color: rgba(255,255,255,.72);
  font-size: 11px;
  line-height: 1.3;
}

.start-trip-arrow-v16 {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.12);
}

.start-trip-arrow-v16 svg,
.secondary-icon-v16 svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.secondary-actions-v16 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.secondary-action-v16 {
  min-height: 58px;
  border-radius: 19px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 730;
}

.break-v16 {
  background: var(--warning-soft);
  color: #8c6728;
  border: 1px solid #e9dbc2;
}

.end-v16 {
  background: rgba(255,255,255,.74);
  color: var(--danger);
  border: 1px solid #edd7d7;
}

.secondary-icon-v16 {
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.recent-card-v16 {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: rgba(255,255,255,.74);
  padding: 13px;
  display: flex;
  flex-direction: column;
}

.recent-head-v16 {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.recent-head-v16 h2 {
  margin: 3px 0 0;
  font-size: 15px;
}

.history-link-v16 {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
}

.recent-empty-v16,
.recent-item-v16 {
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 17px;
  background: var(--surface);
  border: 1px solid #eaedeb;
}

.recent-empty-v16 {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
}

.recent-empty-icon-v16 {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 17px;
}

.recent-empty-v16 strong {
  display: block;
  font-size: 12px;
}

.recent-empty-v16 span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.recent-item-v16 {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
}

.recent-item-icon-v16 {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--success-soft);
  color: var(--success);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.recent-item-copy-v16 {
  min-width: 0;
}

.recent-purpose-v16 {
  display: block;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
}

.recent-destination-v16 {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.recent-meta-v16 {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.recent-duration-v16 {
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

body.rtl .start-trip-arrow-v16 svg,
body.rtl .secondary-icon-v16 svg {
  transform: scaleX(-1);
}

@media (max-height: 760px) {
  .home-v16 {
    gap: 8px;
  }

  .home-greeting {
    margin-bottom: 3px;
    font-size: 11px;
  }

  .home-time-row .current-time {
    font-size: 29px;
  }

  .home-greeting-copy .current-date {
    margin-top: 3px;
    font-size: 11px;
  }

  .shift-summary-v16 {
    padding: 13px 14px;
  }

  .shift-summary-timer {
    font-size: 40px;
    margin-top: 5px;
  }

  .shift-stats-row-v16 {
    margin-top: 10px;
    padding-top: 10px;
  }

  .start-trip-v16 {
    min-height: 78px;
    padding: 12px 14px;
  }

  .start-trip-copy-v16 > span {
    font-size: 18px;
  }

  .start-trip-copy-v16 small {
    display: none;
  }

  .secondary-action-v16 {
    min-height: 51px;
  }

  .recent-card-v16 {
    padding: 10px;
  }

  .recent-head-v16 {
    margin-bottom: 6px;
  }
}

@media (max-height: 650px) {
  .home-greeting {
    display: none;
  }

  .home-greeting-copy .current-date {
    display: none;
  }

  .shift-stats-row-v16 {
    margin-top: 7px;
    padding-top: 7px;
  }

  .recent-head-v16 .card-label {
    display: none;
  }

  .recent-head-v16 h2 {
    margin-top: 0;
  }
}


/* =========================================================
   V1.8 — Departure -> Purpose -> Arrival -> Notes workflow
   ========================================================= */

.compact-flow-sheet {
  max-height: min(82vh, 650px);
}

.flow-text-input,
.flow-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,255,255,.82);
  color: var(--ink);
  padding: 14px 15px;
  font-size: 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.flow-text-input {
  min-height: 54px;
}

.flow-textarea {
  min-height: 96px;
  resize: none;
}

.flow-text-input:focus,
.flow-textarea:focus {
  border-color: rgba(45,97,112,.36);
  box-shadow: 0 0 0 3px rgba(45,97,112,.09);
}

.active-departure-card {
  min-height: 116px;
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.active-departure-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.active-departure-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.active-departure-copy {
  min-width: 0;
}

.active-departure-copy strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.active-departure-copy small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

#tripView.active {
  display: flex;
  flex-direction: column;
}

#tripView .trip-purpose-card {
  margin-top: 9px;
}

#tripView .trip-timer-wrap {
  flex: 1 1 auto;
}

@media (max-height: 700px) {
  .active-departure-card {
    min-height: 94px;
    padding: 14px;
  }

  .active-departure-icon {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .active-departure-copy strong {
    font-size: 17px;
  }

  .compact-flow-sheet {
    max-height: 88vh;
  }
}


.history-trip-note {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 13px;
  background: var(--surface-soft);
}

.history-trip-note span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.history-trip-note strong {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 600;
}


/* =========================================================
   V1.10 — Resume accidentally ended shift on the same day
   ========================================================= */

.resume-shift-card {
  width: min(100%, 420px);
  margin: 28px auto 20px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid #dce6e4;
  background: linear-gradient(145deg, #ffffff, #edf5f2);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: start;
}

.resume-icon {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: var(--success-soft);
  color: var(--success);
}

.resume-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.resume-copy {
  min-width: 0;
}

.resume-copy strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
}

.resume-copy small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.resume-button {
  background: var(--success);
  box-shadow: 0 12px 28px rgba(45,125,97,.15);
}

@media (max-height: 700px) {
  .resume-shift-card {
    margin: 16px auto 14px;
    padding: 13px;
  }

  .resume-icon {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .resume-copy strong {
    font-size: 14px;
  }
}


/* =========================================================
   V1.12 — End Shift PDF + native share / WhatsApp
   ========================================================= */

.summary-actions {
  display: grid;
  gap: 9px;
}

.share-report-button {
  background: var(--success);
  box-shadow: 0 12px 28px rgba(45,125,97,.16);
}

.share-report-button:disabled {
  background: #aab8b3;
  color: rgba(255,255,255,.9);
  opacity: 1;
  cursor: wait;
  box-shadow: none;
}

.summary-done-button {
  min-height: 54px;
  background: rgba(255,255,255,.76);
}

@media (max-height: 700px) {
  .summary-actions {
    gap: 7px;
  }

  .share-report-button {
    min-height: 56px !important;
  }

  .summary-done-button {
    min-height: 48px;
  }
}
