:root {
  --blue: #0076d6;
  --blue-deep: #0057ac;
  --blue-soft: #e7f2ff;
  --ink: #132238;
  --muted: #64748b;
  --line: #dbe5ee;
  --line-strong: #c6d5e2;
  --panel: #ffffff;
  --panel-soft: #f7fafc;
  --surface: #eef5f9;
  --accent: #f47c20;
  --accent-soft: #fff3e8;
  --good: #0f8b63;
  --warn: #b45309;
  --danger: #c24130;
  --shadow: 0 18px 44px rgba(22, 44, 70, 0.18);
  --panel-shadow: 0 10px 26px rgba(26, 47, 73, 0.08);
  color-scheme: light;
  font-family: Inter, Roboto, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 14%, rgba(0, 118, 214, 0.18), transparent 30%),
    radial-gradient(circle at 86% 12%, rgba(244, 124, 32, 0.13), transparent 24%),
    linear-gradient(145deg, #eef5f9 0%, #f8fbfd 48%, #e6edf2 100%);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.phone-frame {
  width: min(100%, 430px);
  min-height: min(860px, calc(100vh - 36px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f6fbff 0%, var(--surface) 100%);
  border: 1px solid rgba(19, 34, 56, 0.08);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(18px + env(safe-area-inset-top)) 18px 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
}

.eyebrow {
  margin: 0 0 3px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 0.78;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.85rem, 9vw, 2.45rem);
  font-weight: 650;
  line-height: 1.05;
}

h2 {
  font-size: 1rem;
  line-height: 1.2;
}

.header-actions,
.tab-bar,
.area-grid,
.quick-actions,
.summary-grid,
.inline-form,
.tasking-actions,
.tasking-stats {
  display: flex;
}

.header-actions {
  gap: 9px;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.23);
  transform: translateY(-1px);
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab svg {
  width: 21px;
  height: 21px;
}

.tab-bar {
  position: relative;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
}

.tab {
  position: relative;
  flex: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 76px;
  padding: 8px 4px 12px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(0.78rem, 3.7vw, 1rem);
  transition:
    color 160ms ease,
    background 160ms ease;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.08);
}

.tab.is-active {
  color: #fff;
}

.tab.is-active::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 5px;
  border-radius: 5px 5px 0 0;
  background: var(--accent);
}

.content {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
  opacity: 0;
  transform: translateX(26px);
  pointer-events: none;
  transition:
    opacity 210ms ease,
    transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.view.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.hero-panel,
.control-panel,
.summary-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--panel-shadow);
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 3px solid var(--blue);
  pointer-events: none;
}

.hero-panel > * {
  position: relative;
}

.hero-panel.compact {
  margin-bottom: 16px;
}

.label,
.field-label,
.section-head span,
.summary-grid span,
dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-panel strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(2rem, 11vw, 3rem);
  font-weight: 520;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hero-panel .street-status {
  max-width: 220px;
  font-size: clamp(1.35rem, 7vw, 2rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.primary-action,
.secondary-action,
.small-action {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--good);
  font-weight: 750;
  box-shadow: 0 8px 18px rgba(15, 139, 99, 0.2);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.primary-action:hover,
.secondary-action:hover,
.small-action:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 139, 99, 0.24);
}

.primary-action {
  flex: 0 0 auto;
  padding: 0 14px;
}

.primary-action.is-live {
  background: var(--danger);
  box-shadow: 0 8px 18px rgba(194, 65, 48, 0.2);
}

.primary-action.is-paused {
  background: var(--warn);
  box-shadow: 0 8px 18px rgba(180, 83, 9, 0.2);
}

.info-strip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.info-strip strong {
  color: var(--ink);
  text-align: right;
}

.control-panel {
  padding: 16px;
  margin-bottom: 16px;
}

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

.section-head span {
  max-width: 52%;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.area-grid {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tasking-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.tasking-card {
  position: relative;
  display: grid;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  box-shadow: 0 4px 14px rgba(26, 47, 73, 0.05);
}

.tasking-card.is-active {
  border-color: rgba(15, 139, 99, 0.46);
  background:
    linear-gradient(180deg, rgba(240, 253, 248, 0.92), rgba(247, 250, 252, 0.96)),
    var(--panel-soft);
}

.tasking-card.is-active::before {
  content: "";
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--good);
}

.tasking-main {
  min-width: 0;
}

.tasking-main strong {
  display: block;
  margin-bottom: 3px;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.tasking-main span {
  color: var(--muted);
  font-size: 0.84rem;
}

.tasking-stats {
  gap: 8px;
  flex-wrap: wrap;
}

.tasking-stats span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.tasking-actions {
  gap: 7px;
  flex-wrap: wrap;
}

.tasking-actions button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue-deep);
  font-weight: 750;
}

.tasking-actions button:hover {
  border-color: var(--line-strong);
  background: var(--blue-soft);
}

.area-chip,
.quick-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-weight: 700;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.area-chip {
  min-height: 42px;
  padding: 0 13px;
}

.area-chip.is-active {
  border-color: var(--blue);
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  box-shadow: 0 8px 18px rgba(0, 118, 214, 0.2);
}

.area-chip:hover,
.quick-actions button:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.inline-form {
  gap: 8px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  outline: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

input {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 104px;
  padding: 12px;
}

input:focus,
textarea:focus {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 118, 214, 0.14);
}

.field-label {
  display: block;
  margin: 10px 0 7px;
}

.small-action {
  flex: 0 0 74px;
}

.quick-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.quick-actions button {
  min-height: 40px;
  padding: 0 12px;
}

.quick-actions button.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #8a3a08;
  box-shadow: 0 7px 16px rgba(244, 124, 32, 0.14);
}

.secondary-action {
  width: 100%;
  margin-top: 12px;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(0, 118, 214, 0.2);
}

.text-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--blue-deep);
  font-weight: 750;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.text-button:hover {
  border-color: var(--line);
  background: var(--blue-soft);
}

.summary-grid {
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.summary-grid article {
  flex: 1 1 calc(50% - 8px);
  min-width: 120px;
  padding: 14px 10px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 250, 252, 0.92)),
    var(--panel);
}

.summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 1.8rem;
}

.detail-list {
  margin: 0;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.detail-list div:first-child {
  border-top: 0;
}

dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  position: relative;
  padding: 13px 12px 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  box-shadow: 0 4px 14px rgba(26, 47, 73, 0.05);
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--blue);
}

.timeline-item strong {
  display: block;
  margin-bottom: 4px;
  line-height: 1.25;
}

.timeline-item p {
  margin: 4px 0 0;
  color: #334155;
  line-height: 1.38;
}

.timeline-meta {
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  padding: 24px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.54);
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 10;
  max-width: min(92vw, 390px);
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: rgba(19, 34, 56, 0.94);
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 520px) {
  .app-shell {
    display: block;
    padding: 0;
  }

  .phone-frame {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .view {
    padding: 16px;
  }
}

@media (max-width: 360px) {
  .hero-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-action {
    width: 100%;
  }

  .tab {
    min-height: 70px;
    font-size: 0.74rem;
  }

  .tab svg {
    width: 19px;
    height: 19px;
  }
}

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

@media print {
  body {
    background: #fff;
  }

  .phone-frame {
    width: 100%;
    min-height: auto;
    border: 0;
    box-shadow: none;
  }

  .top-bar,
  .tab-bar,
  #shiftView,
  #taskingView,
  #breaksView,
  .toast {
    display: none;
  }

  .view {
    position: static;
    display: block;
    opacity: 1;
    transform: none;
    overflow: visible;
  }
}
