:root {
  --brand: #1d4ed8;
  --brand-dark: #1e3a8a;
  --bg: #0f172a;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Segoe UI", "Heebo", -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(180deg, var(--brand-dark) 0%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.header {
  text-align: center;
  color: #fff;
  margin-bottom: 24px;
}

.header h1 {
  font-size: 26px;
  margin: 0 0 6px;
  font-weight: 700;
}

.subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}

.grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-title {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 600;
  margin: 22px 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title:first-child {
  margin-top: 0;
}

.section-badge {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.tile {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border-radius: 18px;
  padding: 18px 20px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  border: none;
  font: inherit;
  width: 100%;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}

.tile:active {
  transform: scale(0.97);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.tile-icon {
  font-size: 30px;
  line-height: 1;
  flex: none;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  border-radius: 14px;
}

.tile-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

.tile-title {
  font-size: 17px;
  font-weight: 600;
}

.tile-hint {
  font-size: 13px;
  color: var(--muted);
}

/* modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  padding: 0;
}

/* the display:flex above outranks the UA [hidden] rule, so restate it explicitly */
.modal-backdrop[hidden] {
  display: none;
}

@media (min-width: 480px) {
  .modal-backdrop {
    align-items: center;
  }
}

.modal {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 420px;
  border-radius: 22px 22px 0 0;
  padding: 28px 24px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
}

@media (min-width: 480px) {
  .modal {
    border-radius: 22px;
    padding: 28px 24px;
  }
}

.modal h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.modal-hint {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
  border: none;
  background: #f1f5f9;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  color: var(--muted);
  cursor: pointer;
}

.worker-input {
  width: 100%;
  font-size: 32px;
  letter-spacing: 12px;
  text-align: center;
  padding: 14px 10px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  outline: none;
  font-variant-numeric: tabular-nums;
}

.worker-input:focus {
  border-color: var(--brand);
}

.modal-error {
  color: #dc2626;
  font-size: 13px;
  margin: 10px 0 0;
}

.modal-submit {
  margin-top: 18px;
  width: 100%;
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.modal-submit:active {
  transform: scale(0.98);
}
