/* Welcome route, the first-days guide, the phone bottom sheet, landscape and small phones.
 * index.html loads the stylesheets in src/styles/ in a fixed order; later files override earlier ones. */
/* Welcome steps: one route through the chain. Four stops on a dashed line, a parcel travelling along it. */
.welcome-steps {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 0;
  max-width: 540px;
  margin: 0 -8px 30px;
  padding: 0;
}
.welcome-steps::before {
  content: '';
  position: absolute;
  left: 12.5%;
  right: 12.5%;
  top: 21px;
  border-top: 2px dashed #eab26266;
}
.welcome-steps::after {
  content: '';
  position: absolute;
  top: 17px;
  left: 12.5%;
  width: 10px;
  height: 10px;
  background: #eab262;
  box-shadow: inset 0 -2px 0 #b98232;
  animation: parcel 6s steps(48) infinite;
}
@keyframes parcel {
  to {
    left: calc(87.5% - 10px);
  }
}
.welcome-steps li,
.welcome-steps li:last-child {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  width: 25%;
  padding: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: #eef2e2;
}
.welcome-steps li .icon {
  width: 20px;
  height: 20px;
  padding: 11px;
  box-sizing: content-box;
  border-radius: 50%;
  background: #1b3b2e;
  box-shadow: inset 0 0 0 2px #eab262;
  color: #eab262;
}
@media (prefers-reduced-motion: reduce) {
  .welcome-steps::after {
    animation: none;
    display: none;
  }
}
@media (max-width: 760px) {
  .welcome-steps,
  .welcome-steps li,
  .welcome-steps li:last-child {
    grid-template-columns: none;
  }
  .welcome-steps li,
  .welcome-steps li:first-child,
  .welcome-steps li:last-child {
    flex-direction: column;
    padding: 0;
    font-size: 11px;
  }
}

/* First-days guide */
#guide {
  position: fixed;
  inset: 0;
  z-index: 125;
  pointer-events: none;
}
#guide.in-modal {
  z-index: 130;
}
.guide-ring {
  position: fixed;
  border: 2px solid #eab262;
  border-radius: 12px;
  box-shadow:
    0 0 0 4px #eab26240,
    0 0 24px #eab26288;
  animation: guidePulse 1.4s ease-in-out infinite;
}
@keyframes guidePulse {
  50% {
    box-shadow:
      0 0 0 9px #eab26222,
      0 0 30px #eab26266;
  }
}
.guide-arrow {
  position: fixed;
  width: 18px;
  height: 18px;
  color: #eab262;
  filter: drop-shadow(0 2px 0 #7a5418);
  transform: rotate(var(--rot, 0deg));
  animation: guideBob 0.9s ease-in-out infinite;
}
@keyframes guideBob {
  50% {
    transform: rotate(var(--rot, 0deg)) translateX(-5px);
  }
}
.guide-bubble {
  position: fixed;
  max-width: 250px;
  padding: 11px 13px 9px;
  border-radius: 12px;
  background: #253f34;
  color: #f5f3e3;
  box-shadow: 0 10px 28px #10241a55;
  pointer-events: auto;
  animation: panelIn 0.25s ease;
}
.guide-bubble p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
}
.guide-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.guide-actions .guide-skip {
  margin: 0;
  padding: 0;
  font-size: 10px;
  color: #cfd6c3;
}
.guide-actions .guide-ok {
  min-height: 26px;
  padding: 0 12px;
  background: #eab262;
  color: #2b2410;
}
@media (prefers-reduced-motion: reduce) {
  .guide-ring,
  .guide-arrow {
    animation: none;
  }
}

/* ---------- Phones: the desk is a bottom sheet (header only, half, full) ---------- */
.sheet-handle,
.sheet-min {
  display: none;
}
@media (max-width: 760px) {
  .department-panel {
    top: auto;
    bottom: 71px;
    left: 58px;
    right: 8px;
    max-height: none;
    height: 46vh;
    border-radius: 16px;
    transition: height 0.22s ease;
  }
  .department-panel.sheet-peek {
    height: 68px;
  }
  .department-panel.sheet-full {
    height: calc(100vh - 196px);
    height: calc(100dvh - 196px);
  }
  .department-panel.sheet-peek .panel-content {
    display: none;
  }
  .department-panel .panel-header {
    position: relative;
    padding-top: 20px;
    touch-action: none;
  }
  .sheet-handle {
    display: block;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 72px;
    height: 24px;
    padding: 0;
    background: none;
    border: 0;
    cursor: grab;
  }
  .sheet-handle i {
    display: block;
    width: 36px;
    height: 4px;
    margin: 7px auto 0;
    border-radius: 2px;
    background: #cfd6c3;
  }
  .sheet-min {
    display: grid;
  }
  .department-panel .panel-header h2 {
    font-size: 18px;
  }
  .department-panel .panel-header .desk-mark {
    width: 28px;
    height: 28px;
  }
  .department-panel .panel-tools .icon-btn,
  .department-panel .panel-header .tips-toggle {
    width: 32px;
    height: 32px;
    min-height: 32px;
  }
  .department-panel .panel-tools {
    gap: 2px;
  }

  /* Stats: five equal columns, icon over number, nothing hidden off-screen. */
  .health-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 4px;
    overflow: visible;
    padding: 6px 8px;
  }
  .health-strip .season-chip,
  .health-strip .health-note {
    display: none;
  }
  .health-stat {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px;
    border-radius: 10px;
    min-width: 0;
  }
  .health-stat > div:last-child {
    min-width: 0;
    text-align: center;
  }
  .health-stat strong {
    font-size: 13px;
    letter-spacing: -0.3px;
  }
  .health-stat .trend {
    font-size: 8px;
  }
  .health-icon {
    width: 18px;
    height: 18px;
    background: none;
  }
  .health-icon .icon {
    width: 13px;
    height: 13px;
  }

  /* The view switch already says where you are. */
  .location-label {
    display: none;
  }

  /* Touch targets: at least 32px for anything tapped often. */
  .schedule-card select,
  .schedule-card .batch-quantity {
    min-height: 34px;
  }
  .schedule-card {
    gap: 4px;
    padding: 5px 6px 5px 8px;
  }
  .schedule-card .grip {
    display: none;
  }
  .schedule-card select {
    flex: 1;
    min-width: 0;
    max-width: none;
    font-size: 12px;
  }
  .schedule-card .batch-quantity {
    width: 50px;
    font-size: 13px;
  }
  .schedule-card .line-badge,
  .schedule-card .remove-batch {
    min-width: 30px;
    min-height: 32px;
    margin-left: 0;
    padding: 0;
    font-size: 11px;
  }
  input.range {
    height: 24px;
    margin: 2px 0;
  }
  .toggle {
    height: 24px;
  }
  .credit-toggle input,
  input[type='checkbox'] {
    width: 20px;
    height: 20px;
  }
  .welcome-privacy {
    padding: 6px 4px;
  }
  .keyboard-keys {
    display: none;
  }
  .book-tabs {
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
}

/* Help lives in the top bar on wide screens; phones reach it from Settings. */
.settings-help {
  display: none;
}
@media (max-width: 760px) {
  .settings-help {
    display: flex;
    margin-top: 12px;
  }
}

/* ---------- Landscape phones: one slim bar on top, one below, the world in between ---------- */
@media (max-height: 520px) and (min-width: 600px) {
  .topbar {
    height: 48px;
    padding: 0 10px;
    gap: 10px;
  }
  .topbar .brand > span:last-child,
  .career-heading {
    display: none;
  }
  .top-actions .icon-btn {
    width: 32px;
    height: 32px;
  }
  .health-strip {
    z-index: 11;
    top: 0;
    left: 54px;
    right: 250px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: hidden;
  }
  .health-strip .season-chip,
  .health-strip .health-note,
  .health-stat .eyebrow,
  .health-stat strong small {
    display: none;
  }
  .health-stat {
    flex: 0 1 auto;
    min-width: 0;
    gap: 4px;
    margin: 0;
    padding: 4px 8px 4px 4px;
    border: 0;
    border-radius: 999px;
    background: #eef2e6;
  }
  .health-stat strong {
    font-size: 12px;
    white-space: nowrap;
  }
  .health-icon {
    width: 20px;
    height: 20px;
  }
  .health-icon .icon {
    width: 12px;
    height: 12px;
  }
  .world-stage {
    top: 48px;
    bottom: 52px;
  }
  .shift-bar {
    height: 52px;
    padding: 0 12px;
  }
  .world-tools {
    top: 56px;
    left: 10px;
  }
  .department-dock {
    top: 102px;
    left: 10px;
    bottom: 60px;
    overflow-y: auto;
    scrollbar-width: none;
    padding: 4px;
    gap: 2px;
  }
  .dept-btn {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }
  .location-label,
  .mission-card {
    display: none;
  }
  .department-panel {
    top: 56px;
    bottom: 60px;
    right: 8px;
    width: 340px;
    max-height: none;
    height: auto;
  }
  .incident-banner,
  .panel-open .incident-banner {
    bottom: 60px;
    left: calc(50% - 170px);
  }
  .welcome-content {
    margin-top: 12px;
    margin-bottom: 12px;
  }
}

/* Small phones: the bottom bar keeps every control by tightening, not clipping. */
@media (max-width: 380px) {
  .shift-bar {
    gap: 8px;
    padding: 0 8px;
  }
  .time-controls {
    gap: 4px;
  }
  .time-track {
    width: 34px;
  }
  .speed-buttons button {
    width: 24px;
    padding: 0;
  }
  .end-shift {
    padding: 0 12px;
  }
  .end-shift .icon {
    display: none;
  }
}
/* Phone report: the three checks share one full-width row. */
@media (max-width: 760px) {
  .report-top {
    flex-direction: column;
    align-items: stretch;
    padding-right: 0;
  }
  .report-top > div:first-child {
    padding-right: 36px;
  }
  .report-top .day-check {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }
  .report-top .day-check .check {
    min-width: 0;
    padding: 8px;
  }
}

.department-panel.dragging {
  transition: none;
}

/* New company: the name comes first */
.company-name {
  margin: 4px 0 14px;
}
.company-name .name-row {
  display: flex;
  gap: 8px;
}
.company-name input {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
}
