:root {
  --bg: #0f1115;
  --bg-elevated: #171a21;
  --bg-card: #1c2029;
  --border: #2a2f3a;
  --text: #f2f3f5;
  --text-dim: #9aa1ad;
  --accent: #e8b339;
  --accent-dim: #4a3f22;
  --danger: #e2574c;
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
}

/* ---------- Lock screen ---------- */

.lock-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 0%, #1c2029, #0f1115 60%);
}

.lock-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.lock-banner {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.lock-card-body {
  padding: 24px 24px 32px;
}

.lock-card h1 {
  font-size: 19px;
  line-height: 1.3;
  margin: 0 0 6px;
}

.lock-sub {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 24px;
}

#lock-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#lock-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  color: var(--text);
  text-align: center;
  letter-spacing: 0.5px;
}

#lock-input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-primary,
#lock-form button {
  background: var(--accent);
  color: #201803;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:active,
#lock-form button:active {
  transform: scale(0.98);
}

.lock-error {
  color: var(--danger);
  font-size: 13px;
  margin: 16px 0 0;
}

/* ---------- App shell ---------- */

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  min-width: 0;
  flex: 1;
}

.brand-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-line-main {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-line-sub {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
}

.brand-line-show {
  font-size: 11px;
  color: var(--text-dim);
}

.topbar-actions {
  display: flex;
  flex: none;
  gap: 6px;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.icon-btn:active { background: var(--bg-card); }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 12px calc(16px + var(--safe-bottom));
  position: relative;
}

/* ---------- Loading / error states ---------- */

.state-msg {
  margin: auto;
  text-align: center;
  color: var(--text-dim);
  padding: 40px 20px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

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

.state-error-title {
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  margin: 0 0 6px;
}

.state-error-detail {
  font-size: 13px;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* ---------- Card view ---------- */

.card-view {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

.nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.job-card {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 20px;
  touch-action: pan-y;
  user-select: none;
  min-height: 60dvh;
}

.job-date-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  text-transform: capitalize;
}

.job-venue {
  margin: 10px 0 2px;
  font-size: 24px;
  line-height: 1.25;
}

.job-city {
  color: var(--text-dim);
  font-size: 14px;
}

.job-address {
  margin-bottom: 18px;
}

.job-address a {
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px dashed var(--border);
}

.job-address a:active {
  color: var(--accent);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.3;
}

.chip .chip-label {
  display: block;
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.info-box {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 14px;
}

.info-box h3 {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.info-box p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.info-box-access {
  background: var(--accent-dim);
  border: 1px solid #5c4e28;
  border-top: 1px solid #5c4e28;
  border-radius: 14px;
  padding: 14px;
  margin-top: 16px;
}

.kv-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-card);
  border-radius: 10px;
  padding: 10px 12px;
}

.info-box-access .kv-row {
  background: rgba(0,0,0,0.18);
}

.kv-row-text {
  min-width: 0;
}

.kv-row-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.info-box-access .kv-row-label {
  color: #d8c48d;
}

.kv-row-value {
  font-size: 15px;
  font-weight: 600;
  word-break: break-word;
}

.copy-btn {
  flex: none;
  background: rgba(232,179,57,0.15);
  border: 1px solid rgba(232,179,57,0.4);
  color: var(--accent);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.copy-btn:active { transform: scale(0.96); }

.job-position {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding-top: 14px;
}

/* ---------- List view ---------- */

.list-view {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
}

.list-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.list-view-header h2 {
  margin: 0;
  font-size: 17px;
}

.list-items {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  border-radius: 12px;
  cursor: pointer;
}

.list-item:active { background: var(--bg-card); }

.list-item.is-active {
  background: var(--accent-dim);
  border: 1px solid #5c4e28;
}

.list-item-date {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  min-width: 74px;
}

.list-item-main {
  min-width: 0;
}

.list-item-venue {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item-city {
  font-size: 12px;
  color: var(--text-dim);
}

.list-item.is-past {
  opacity: 0.45;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 30;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

@media (min-width: 640px) {
  .job-card { min-height: 420px; }
}
