:root {
  --navy: #173f47;
  --teal: #4b818b;
  --mint: #64b6a2;
  --mint-soft: #e7f4f0;
  --orange: #e98232;
  --orange-soft: #fff0e4;
  --ink: #183038;
  --muted: #687a80;
  --line: #d9e4e3;
  --surface: #ffffff;
  --background: #edf3f2;
  --danger: #b94040;
  --shadow: 0 18px 48px rgba(23, 63, 71, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "SF Pro Display", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100dvh;
}

.gate-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
  text-align: center;
  background:
    radial-gradient(circle at 20% 15%, rgba(100, 182, 162, 0.28), transparent 34%),
    radial-gradient(circle at 82% 82%, rgba(75, 129, 139, 0.25), transparent 36%),
    linear-gradient(145deg, #f7fbfa, #e3efed);
}

.gate-card {
  width: min(520px, 100%);
  padding: 36px;
  border: 1px solid rgba(75, 129, 139, 0.18);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 86px;
  height: 86px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background: linear-gradient(145deg, var(--mint), var(--teal));
  color: white;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -1px;
  box-shadow: 0 12px 28px rgba(75, 129, 139, 0.3);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

.gate-card h1,
.gate-screen > h1 {
  margin-bottom: 12px;
  color: var(--navy);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
}

.gate-copy {
  max-width: 420px;
  margin: 0 auto 26px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.gate-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  text-align: left;
}

label {
  display: grid;
  gap: 8px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: white;
  color: var(--ink);
  font-size: 17px;
}

input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 4px rgba(100, 182, 162, 0.16);
}

.primary-button,
.secondary-button,
.text-button,
.action-button {
  min-height: 54px;
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  padding: 0 22px;
  background: linear-gradient(135deg, var(--mint), var(--teal));
  color: white;
  box-shadow: 0 10px 24px rgba(75, 129, 139, 0.24);
}

.primary-button:disabled,
.action-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.secondary-button {
  padding: 0 18px;
  border: 2px solid var(--line);
  background: white;
  color: var(--teal);
}

.text-button {
  min-height: 42px;
  background: transparent;
  color: var(--muted);
}

.full-width {
  width: 100%;
}

.authorise-success {
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--mint-soft);
  color: #246b59;
  font-weight: 900;
  text-align: center;
}

.form-message {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--danger);
  font-weight: 750;
}

.spinner {
  width: 46px;
  height: 46px;
  margin: 22px auto;
  border: 5px solid rgba(75, 129, 139, 0.18);
  border-top-color: var(--mint);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.kiosk-screen {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(340px, 35%) 1fr;
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  background: var(--background);
}

.team-panel {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 26px 24px 20px;
  border-right: 1px solid var(--line);
  background: #f9fcfb;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-header h1 {
  margin: 0;
  color: var(--navy);
  font-size: 29px;
  letter-spacing: -0.03em;
}

.device-pill {
  max-width: 155px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--mint-soft);
  color: #2e6659;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #32a76f;
  box-shadow: 0 0 0 3px rgba(50, 167, 111, 0.16);
}

.panel-date {
  margin: 18px 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 750;
}

.section-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  border-radius: 16px;
  background: #e6efed;
}

.tab-button {
  min-height: 48px;
  padding: 0 9px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.tab-button.active {
  background: white;
  color: var(--navy);
  box-shadow: 0 4px 14px rgba(23, 63, 71, 0.1);
}

.count-badge {
  min-width: 22px;
  height: 22px;
  margin-left: 4px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(75, 129, 139, 0.12);
  color: var(--teal);
  font-size: 11px;
}

.list-panel {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 15px;
}

.unscheduled-selector-header {
  flex: 0 0 auto;
  display: grid;
  gap: 12px;
  padding-bottom: 2px;
  background: #f9fcfb;
  position: relative;
  z-index: 2;
}

.left-panel-back {
  min-height: 46px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 16px;
  font-weight: 900;
  text-align: left;
}

.left-panel-search {
  display: grid;
  gap: 7px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.left-panel-search input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--ink);
  font-size: 16px;
}

.card-list {
  min-height: 0;
  flex: 1;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--mint) transparent;
}

.team-card,
.shift-card {
  width: 100%;
  display: grid;
  gap: 7px;
  padding: 15px;
  border: 2px solid transparent;
  border-radius: 17px;
  background: white;
  box-shadow: 0 6px 18px rgba(23, 63, 71, 0.07);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.staff-select-card {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 17px;
  border: 2px solid transparent;
  border-radius: 17px;
  background: white;
  box-shadow: 0 6px 18px rgba(23, 63, 71, 0.07);
  color: var(--navy);
  font-size: 17px;
  font-weight: 900;
  text-align: left;
}

.staff-select-card:active {
  transform: scale(0.985);
  border-color: var(--mint);
}

.team-card:active,
.shift-card:active {
  transform: scale(0.985);
}

.team-card.selected,
.shift-card.selected {
  border-color: var(--mint);
}

.card-topline,
.shift-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.person-name {
  color: var(--navy);
  font-size: 17px;
  font-weight: 900;
}

.status-chip,
.shift-type {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef3f2;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-chip.clocked_in {
  background: var(--mint-soft);
  color: #28705d;
}

.status-chip.on_break {
  background: #fff4ce;
  color: #8a6500;
}

.status-chip.finished {
  background: #e7ecf4;
  color: #526782;
}

.shift-type {
  background: var(--orange-soft);
  color: #b65c17;
}

.card-meta,
.shift-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.unscheduled-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.unscheduled-indicator {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: #a95314;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.shift-time {
  color: var(--navy);
  font-size: 20px;
  font-weight: 950;
}

.empty-state {
  padding: 28px 18px;
  border: 2px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

.action-panel {
  position: relative;
  min-height: 100dvh;
  overflow-y: auto;
  padding: 28px clamp(30px, 5vw, 72px) max(32px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 90% 10%, rgba(100, 182, 162, 0.18), transparent 30%),
    white;
}

.action-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  color: var(--navy);
}

.live-date {
  color: var(--teal);
  font-size: 16px;
  font-weight: 850;
}

.live-time {
  font-size: clamp(32px, 4vw, 50px);
  font-weight: 950;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.action-view {
  width: min(760px, 100%);
  margin: 30px auto 0;
}

.default-view {
  min-height: 58vh;
  display: grid;
  place-content: center;
  text-align: center;
}

.default-view h2,
.action-view h2 {
  margin-bottom: 9px;
  color: var(--navy);
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -0.035em;
}

.default-view p,
.action-subtitle {
  color: var(--muted);
  font-size: 18px;
}

.water-icon {
  width: 92px;
  height: 92px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 30px;
  background: var(--mint-soft);
  color: var(--mint);
  font-size: 70px;
  font-weight: 300;
  line-height: 1;
}

.back-button {
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-weight: 900;
}

.detail-card {
  margin: 20px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f9fcfb;
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
}

.detail-row + .detail-row {
  border-top: 1px solid var(--line);
}

.detail-label {
  color: var(--muted);
  font-weight: 700;
}

.detail-value {
  color: var(--navy);
  font-weight: 900;
  text-align: right;
}

.pin-section {
  margin-top: 22px;
  text-align: center;
}

.pin-title {
  margin-bottom: 12px;
  color: var(--navy);
  font-size: 16px;
  font-weight: 900;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 14px 0 20px;
}

.pin-dot {
  width: 17px;
  height: 17px;
  border: 2px solid var(--teal);
  border-radius: 50%;
}

.pin-dot.filled {
  background: var(--teal);
}

.pin-pad {
  width: min(420px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}

.pin-key {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
  color: var(--navy);
  box-shadow: 0 5px 14px rgba(23, 63, 71, 0.07);
  font-size: 24px;
  font-weight: 900;
}

.pin-key:active {
  background: var(--mint-soft);
  transform: scale(0.97);
}

.pin-key.utility {
  color: var(--teal);
  font-size: 15px;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.action-button {
  min-height: 66px;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--mint), var(--teal));
  color: white;
  font-size: 17px;
}

.action-button.break {
  background: #d8a22b;
}

.action-button.clock-out {
  background: var(--navy);
}

.action-button.claim {
  background: linear-gradient(135deg, #f29a51, var(--orange));
}

.search-box {
  margin: 20px 0 14px;
}

.search-results {
  display: grid;
  gap: 10px;
}

.search-result {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--navy);
  font-weight: 900;
  text-align: left;
}

.search-result span {
  color: var(--muted);
  font-size: 12px;
}

.confirmation-view {
  min-height: 58vh;
  place-content: center;
  text-align: center;
}

.confirmation-view:not(.hidden) {
  display: grid;
}

.success-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--mint-soft);
  color: #28926f;
  font-size: 55px;
  font-weight: 950;
}

.confirmation-view p {
  color: var(--muted);
  font-size: 19px;
}

.kiosk-auto-clock-alert {
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid #efbf83;
  border-radius: 14px;
  background: #fff8ef;
  color: #754217;
  font-weight: 700;
  line-height: 1.45;
}

.kiosk-confirm-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.kiosk-confirm-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

.kiosk-confirm-form input {
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  border: 2px solid #d4e3df;
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.kiosk-confirm-form input:focus {
  border-color: var(--mint);
  outline: 3px solid rgba(100, 182, 162, 0.2);
}

.kiosk-confirm-note,
.kiosk-confirm-actions {
  grid-column: 1 / -1;
}

.kiosk-confirm-note {
  color: var(--muted);
  font-size: 14px;
}

.action-button.secondary {
  border: 2px solid #c9dad6;
  background: #fff;
  color: var(--teal);
}

@media (max-width: 850px) {
  .kiosk-confirm-form {
    grid-template-columns: 1fr;
  }
}

.reset-note {
  margin-top: 22px;
  font-size: 14px !important;
}

.action-error {
  position: sticky;
  bottom: 20px;
  width: min(680px, 100%);
  margin: 20px auto 0;
  padding: 15px 18px;
  border-radius: 15px;
  background: #fff0f0;
  color: var(--danger);
  font-weight: 850;
  box-shadow: 0 8px 24px rgba(185, 64, 64, 0.12);
}

.portrait-notice {
  display: none;
}

@media (orientation: portrait) {
  .app-shell {
    display: none;
  }

  .portrait-notice {
    min-height: 100dvh;
    display: grid;
    place-content: center;
    gap: 12px;
    padding: 30px;
    background: var(--navy);
    color: white;
    text-align: center;
  }

  .portrait-notice strong {
    font-size: 30px;
  }

  .portrait-notice span {
    color: #c6ddda;
  }

  .rotate-icon {
    font-size: 72px;
  }
}

@media (max-height: 700px) and (orientation: landscape) {
  .team-panel {
    padding-top: 18px;
  }

  .panel-date {
    margin: 10px 0;
  }

  .team-card,
  .shift-card {
    padding: 11px 13px;
  }

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

  .pin-key {
    min-height: 50px;
  }

  .action-view {
    margin-top: 15px;
  }
}

.shift-question{display:grid;gap:10px;text-align:left;padding:14px 0;border-bottom:1px solid rgba(75,129,139,.18);font-weight:700}
.shift-question:last-child{border-bottom:0}.shift-question input[type="text"],.shift-question input[type="number"],.shift-question textarea{width:100%;box-sizing:border-box;border:1px solid #cbdad7;border-radius:12px;padding:12px;font:inherit;background:#fff}
.shift-question.checkbox{grid-template-columns:auto minmax(0,1fr);align-items:center}.shift-question.checkbox input{width:24px;height:24px;min-height:0;padding:0;margin:0}
/* Safari fieldset/legend sizing must not use a grid formatting context. */
fieldset.shift-question {
  display: block;
  width: 100%;
  min-width: 0;
  min-inline-size: 0;
  margin: 0;
  border: 0;
  border-bottom: 1px solid rgba(75,129,139,.18);
}
fieldset.shift-question legend {
  float: none;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0 0 10px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
fieldset.shift-question:last-child { border-bottom: 0; }
.shift-question { min-width: 0; min-inline-size: 0; }
.question-choice{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;min-width:0;width:100%}
.question-choice label{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;min-height:48px;border:1px solid #cbdad7;border-radius:12px;padding:10px 12px;text-align:center;background:#fff}
.question-choice input{flex:0 0 20px;width:20px;height:20px;min-height:0;padding:0;margin:0}

.shift-questions-panel {
  margin: 18px 0 4px;
  padding: 20px;
  border: 2px solid var(--mint);
  border-radius: 20px;
  background: linear-gradient(145deg, #f1fbf8, #ffffff);
  box-shadow: 0 10px 28px rgba(75, 129, 139, 0.12);
  text-align: left;
}

.shift-questions-panel.loading {
  padding: 16px 20px;
  border-style: dashed;
}

.shift-questions-panel h3 {
  margin: 2px 0 6px;
  color: var(--navy);
  font-size: 24px;
  letter-spacing: -0.02em;
}

.shift-questions-panel > p:not(.eyebrow) {
  margin: 0 0 8px;
  color: var(--muted);
}

.shift-questions-heading {
  color: var(--teal);
  font-weight: 900;
}

.shift-questions-fields {
  display: grid;
  gap: 2px;
}

.inline-question-error {
  min-height: 0;
  margin-top: 8px;
  color: var(--danger);
  font-weight: 850;
}

.inline-question-error:empty {
  display: none;
}

@media (max-height: 700px) and (orientation: landscape) {
  .shift-questions-panel {
    padding: 14px 16px;
  }

  .shift-questions-panel h3 {
    font-size: 20px;
  }
}

.pin-complete-summary {
  min-height: 48px;
  margin: 16px 0 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f7fbfa;
  color: var(--navy);
  font-size: 14px;
  font-weight: 850;
}

.pin-complete-dots {
  display: inline-flex;
  gap: 5px;
}

.pin-complete-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
}

.pin-complete-summary button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--teal);
  font: inherit;
}

@media (orientation: landscape) and (max-height: 850px) {
  .kiosk-screen {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .action-panel {
    height: 100dvh;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px clamp(22px, 4vw, 48px) max(16px, env(safe-area-inset-bottom));
  }

  .action-header {
    gap: 14px;
  }

  .live-date {
    font-size: 14px;
    line-height: 1.15;
  }

  .live-time {
    font-size: clamp(32px, 4vw, 42px);
    line-height: 1;
  }

  .weather-kiosk {
    max-width: 320px;
    padding: 4px 8px;
    font-size: 10px;
    line-height: 1.1;
  }

  .weather-kiosk strong {
    margin-bottom: 1px;
    font-size: 10px;
  }

  .action-view {
    width: min(720px, 100%);
    margin-top: 4px;
  }

  .back-button {
    min-height: 28px;
  }

  .action-view > .eyebrow {
    margin: 2px 0;
  }

  .action-view h2 {
    margin: 2px 0 4px;
    font-size: clamp(29px, 3.5vw, 38px);
    line-height: 1.05;
  }

  .action-subtitle {
    margin: 0 0 6px;
    font-size: 15px;
    line-height: 1.2;
  }

  .detail-card {
    margin: 8px 0;
    padding: 9px 14px;
    border-radius: 14px;
  }

  .detail-row {
    padding: 4px 0;
  }

  .pin-section {
    margin-top: 6px;
  }

  .pin-title {
    margin-bottom: 2px;
    font-size: 14px;
  }

  .pin-dots {
    gap: 10px;
    margin: 6px 0 8px;
  }

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

  .pin-pad {
    width: min(370px, 100%);
    gap: 6px;
  }

  .pin-key {
    min-height: 42px;
    border-radius: 12px;
    font-size: 20px;
  }

  .pin-key.utility {
    font-size: 13px;
  }

  .action-buttons {
    gap: 8px;
    margin-top: 8px;
  }

  .action-button {
    min-height: 50px;
  }

  .pin-complete-summary {
    min-height: 40px;
    margin: 8px 0 6px;
    padding: 6px 10px;
  }

  .shift-questions-panel {
    margin: 8px 0 3px;
    padding: 12px 14px;
  }

  .shift-question {
    gap: 6px;
    padding: 8px 0;
  }

  .shift-question input[type="text"],
  .shift-question input[type="number"],
  .shift-question textarea {
    padding: 9px 10px;
  }
}

