:root {
  --bg: #eef3f8;
  --surface: #ffffff;
  --text: #10263d;
  --muted: #5a6f86;
  --primary: #0f3a63;
  --accent: #0fb7a8;
  --pink: #e84d8a;
  --line: #d3e0ec;
  --radius: 18px;
  --shadow: 0 10px 28px rgba(16, 38, 61, 0.08);
  --dock: 76px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}
a { color: var(--primary); text-decoration: none; }
img, svg { max-width: 100%; }
button, .btn, a.job-card { -webkit-tap-highlight-color: transparent; }

.top {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
}
.top a, .top button { color: #fff; }
.brand { font-weight: 800; letter-spacing: .06em; font-size: 1.05rem; }
.desk-nav { display: none; }
.who {
  margin-left: auto;
  font-size: .8rem;
  font-weight: 600;
  opacity: .9;
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lang-switch { display: flex; gap: 4px; }
.lang-switch button {
  width: auto;
  min-width: 0;
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.75rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  border-radius: 999px;
}
.lang-switch button.on { background: var(--accent); color: #10263d; border-color: var(--accent); }
.lang-switch-login { margin-bottom: 18px; }
.lang-switch-login button { border-color: rgba(255,255,255,.5); }

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--dock) + var(--safe-bottom) + 20px);
}
.guest .wrap { padding: 0; max-width: none; }

.hero-lite {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 18px;
}
h1 { margin: 0 0 6px; font-size: 1.75rem; letter-spacing: -0.03em; line-height: 1.15; }
h2 { margin: 20px 0 10px; font-size: 1.05rem; }
.eyebrow {
  margin: 0 0 4px;
  color: #0a8f84;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .7rem;
}
.muted { color: var(--muted); }

.card, .job-card, .stats article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { padding: 16px; margin: 12px 0; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
input, select, textarea {
  font: inherit;
  font-size: 16px;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  width: 100%;
  min-height: 48px;
}
textarea { min-height: 96px; }
input[type="file"] { min-height: 0; padding: 10px; }

button, .btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
}
button:active, .btn:active { transform: scale(0.99); }
.ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: none;
}
.ghost.dark {
  color: var(--primary);
  border: 1.5px solid var(--line);
  background: #fff;
}
.actions, .field-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.actions form, .field-actions form { margin: 0; }
.row, .row-inline {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.stats article { padding: 14px; }
.stats strong { display: block; font-size: 1.55rem; letter-spacing: -0.03em; }
.stats span { color: var(--muted); font-size: .82rem; }

.list, .more-list { display: grid; gap: 10px; }
.job-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  color: inherit;
  min-height: 72px;
}
.job-card p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.job-card .actions { margin: 0; grid-template-columns: 1fr 1fr; }
.pill {
  align-self: flex-start;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: capitalize;
  background: #d9ecff;
  color: var(--primary);
}
.pill.in_progress, .pill.en_route { background: #d7f6f2; }
.pill.completed { background: #d8f5d8; }
.pill.canceled { background: #f7d7e4; }

.flash { padding: 12px 14px; border-radius: 12px; margin: 0 0 12px; }
.flash.ok { background: #d8f5d8; }
.flash.err { background: #f7d7e4; }

.auth {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0f3a63 0%, #164a78 42%, var(--bg) 42%);
  padding: calc(28px + var(--safe-top)) 18px 32px;
}
.auth-brand { color: #fff; margin-bottom: 28px; }
.auth-brand h1 { font-size: 2.2rem; color: #fff; }
.auth-brand p { margin: 8px 0 0; color: rgba(255,255,255,.82); }
.auth-brand .eyebrow { color: var(--accent); }
.auth-card { margin: 0; padding: 22px 18px 24px; }
.auth-card h2 { margin: 0 0 6px; }
.btn-block { width: 100%; }

.photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.photos img { width: 100%; height: 140px; object-fit: cover; border-radius: 12px; }
.note { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.card.danger { border-color: var(--pink); }
.card.danger h2 { color: var(--pink); }

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 6px 6px calc(8px + var(--safe-bottom));
  background: rgba(15, 58, 99, 0.96);
  backdrop-filter: blur(12px);
  z-index: 40;
  border-top: 1px solid rgba(255,255,255,.08);
}
.dock a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: rgba(255,255,255,.72);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 6px 2px;
  border-radius: 12px;
  min-height: 52px;
}
.dock svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.dock a.on {
  color: #10263d;
  background: var(--accent);
}

.week-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.week-col {
  flex: 0 0 78%;
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  min-height: 180px;
}
.week-col h3 { font-size: 0.95rem; margin: 0 0 10px; }

@media (min-width: 900px) {
  .desk-nav {
    display: flex;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
  }
  .desk-nav a.on { color: var(--accent); }
  .desk-only { display: block; }
  .dock { display: none; }
  .wrap { padding: 24px 20px 40px; }
  .hero-lite {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
  button, .btn { width: auto; min-width: 120px; }
  .actions { display: flex; flex-wrap: wrap; }
  .job-card {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    overflow: visible;
  }
  .week-col { flex: none; min-width: 0; }
  .auth {
    display: grid;
    place-items: center;
    background: var(--bg);
  }
  .auth-brand { display: none; }
  .auth-card { width: min(420px, 100%); }
}
