/* ============================================================
   Zebra People — flat UI, light & dark themes
   ============================================================ */

:root {
  --brand: #ef8c11;
  --brand-2: #fbbf24;
  --brand-soft: rgba(239, 140, 17, .14);
  --green: #1a9b62;
  --green-soft: rgba(26, 155, 98, .14);
  --amber: #c2810b;
  --amber-soft: rgba(194, 129, 11, .16);
  --red: #e04848;
  --red-soft: rgba(224, 72, 72, .12);
  --on-brand: #2a1a02;
  --link-dark: #fbbf24;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;

  --nav-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

html[data-theme='dark'] {
  --bg: #14100a;
  --surface: #1e1810;
  --surface-2: #272016;
  --elevated: #221b12;
  --stroke: #33291d;
  --stroke-strong: #423626;
  --text: #f6f0e5;
  --text-2: #cdc1ad;
  --muted: #998d79;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

html[data-theme='light'] {
  --bg: #faf6f0;
  --surface: #ffffff;
  --surface-2: #f5efe5;
  --elevated: #ffffff;
  --stroke: #ece3d5;
  --stroke-strong: #ded2be;
  --text: #1d1710;
  --text-2: #4d4436;
  --muted: #857a68;
  --shadow: 0 1px 2px rgba(40, 28, 10, .06);
  --shadow-lg: 0 20px 44px rgba(40, 28, 10, .16);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: 'cv02', 'cv03', 'cv04';
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  transition: background .2s ease, color .2s ease;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
p { margin: 0; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

#app { height: 100%; }

.screen {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* icons ---------------------------------------------------- */
.icon {
  width: 20px; height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; }

/* ============ AUTH ============ */
.screen-auth { overflow: auto; }
.auth-wrap {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  padding: 24px;
}
.auth-hero { display: none; }

.brand-mark {
  width: 46px; height: 46px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--on-brand);
}
.brand-mark .icon { width: 24px; height: 24px; }
.brand-mark-sm { width: 34px; height: 34px; border-radius: var(--r-sm); }
.brand-mark-sm .icon { width: 18px; height: 18px; }

.auth-panel {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow);
}
.auth-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.auth-title { font-size: 22px; }
.auth-sub { font-size: 14px; margin-bottom: 22px; }
.auth-foot { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.hint { font-size: 12px; text-align: center; }
.powered { font-size: 12px; }
.powered a { color: var(--brand); font-weight: 600; text-decoration: none; }
.powered a:hover { text-decoration: underline; }

/* ============ FORM ELEMENTS ============ */
.field { display: block; }
.field > span { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.field + .field, .field + .form-error { margin-top: 14px; }
form .btn-block { margin-top: 18px; }

input[type=text], input[type=email], input[type=password], input[type=date], select, .select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--stroke-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--muted); }
input:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
option { background: var(--surface); color: var(--text); }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input { padding-left: 42px; }
.input-icon { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.input-action {
  position: absolute; right: 6px;
  background: none; border: 0; color: var(--muted);
  padding: 8px; cursor: pointer; display: grid; place-items: center;
  border-radius: var(--r-sm);
}
.input-action:hover { color: var(--text); background: var(--surface-2); }

.form-error {
  display: flex; align-items: center; gap: 8px;
  color: var(--red);
  font-size: 13px;
  background: var(--red-soft);
  padding: 10px 12px;
  border-radius: var(--r-md);
  margin-top: 14px;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 12px 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 550;
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
  transition: background .15s, opacity .15s, transform .1s;
}
.btn:active { transform: scale(.985); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 13px; font-size: 13.5px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--stroke-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger-ghost { background: transparent; border-color: var(--stroke-strong); color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-soft); }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: color .15s, background .15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 4px;
  color: var(--brand);
  font: inherit; font-size: 13.5px; font-weight: 550;
  cursor: pointer;
}
html[data-theme='dark'] .link-btn { color: var(--link-dark); }
.link-btn .icon { width: 16px; height: 16px; }

/* segmented control */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
}
.segmented-wide { display: flex; width: 100%; }
.seg {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px;
  border: 0; border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit; font-size: 13.5px; font-weight: 550;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg .icon { width: 16px; height: 16px; }
.seg.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ============ APP SHELL ============ */
.pane { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.app-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: calc(14px + var(--safe-t)) 18px 12px;
  border-bottom: 1px solid var(--stroke);
  background: var(--bg);
}
.app-bar-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-bar-text { min-width: 0; }
.app-bar-hello { font-size: 12px; color: var(--muted); }
.app-bar-name { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-bar-tools { display: flex; align-items: center; gap: 10px; }
.clock { font-variant-numeric: tabular-nums; font-size: 13.5px; color: var(--muted); font-weight: 500; }

.avatar {
  width: 40px; height: 40px; flex: none;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  font-weight: 600; font-size: 14px;
  background: var(--brand);
  color: #fff;
}
.avatar-lg { width: 64px; height: 64px; border-radius: var(--r-lg); font-size: 21px; }

.views {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px calc(var(--nav-h) + var(--safe-b) + 24px);
}
.view { display: none; }
.view.is-active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 2px 10px;
}
.view > .section-head:first-child, .col-side > .section-head:first-child { margin-top: 0; }
.section-head h3 { font-size: 15px; }

.grid { display: grid; gap: 16px; }
.col-main > * + *, .col-side > * + * { margin-top: 14px; }
.col-main > .section-head + .list, .col-side > .section-head + .list { margin-top: 10px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ============ CARDS ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  padding: 18px;
}
.card + .btn { margin-top: 14px; }
.card-title {
  font-size: 12px; font-weight: 600;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 14px;
}
.card-title.mt { margin-top: 22px; }

.stat { padding: 16px; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 22px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-accent { border-color: var(--green); background: var(--green-soft); }
.stat-accent .stat-value { color: var(--green); }
html[data-theme='dark'] .stat-accent .stat-value { color: #4ade9f; }

/* ============ PUNCH CARD ============ */
.punch-card { text-align: center; padding: 26px 20px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px 5px 9px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 550;
  background: var(--surface-2);
  color: var(--muted);
}
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill.status-working { background: var(--green-soft); color: var(--green); }
html[data-theme='dark'] .status-pill.status-working { color: #4ade9f; }
.status-pill.status-working i { animation: pulse 1.8s infinite; }
.status-pill.status-break { background: var(--amber-soft); color: var(--amber); }
html[data-theme='dark'] .status-pill.status-break { color: #f0be5a; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.timer {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  margin: 14px 0 2px;
}
.timer-sub { font-size: 13px; }
.punch-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.btn-punch { padding: 15px; font-size: 16px; }
.btn-in { background: var(--green); color: #fff; }
.btn-out { background: var(--red); color: #fff; }

.profile-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.profile-card h3 { font-size: 17px; margin-top: 6px; }
.profile-card p { font-size: 13.5px; }

/* ============ LISTS ============ */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-lg);
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.list-item:hover { border-color: var(--stroke-strong); }
.list-item-static { cursor: default; }
.list-item.is-dim { opacity: .55; }

.li-thumb { position: relative; width: 42px; height: 42px; flex: none; }
.li-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-md); display: block; }
.li-thumb-fallback {
  width: 100%; height: 100%; border-radius: var(--r-md);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600; color: #fff;
}
.dot {
  position: absolute; right: -2px; bottom: -2px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2.5px solid var(--surface);
  background: var(--muted);
}
.dot-working { background: var(--green); }
.dot-break { background: var(--amber); }
.dot-off { display: none; }

.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 550; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.li-amount { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.li-amount.is-live { color: var(--green); }
html[data-theme='dark'] .li-amount.is-live { color: #4ade9f; }
.chev { color: var(--muted); display: grid; }

.tag {
  font-style: normal; font-size: 10.5px; font-weight: 550;
  color: var(--red); background: var(--red-soft);
  padding: 1px 6px; border-radius: 6px; margin-left: 6px;
}
.badge {
  font-size: 11px; font-weight: 550;
  padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
}
.badge-working { background: var(--green-soft); color: var(--green); }
.badge-break { background: var(--amber-soft); color: var(--amber); }
html[data-theme='dark'] .badge-working { color: #4ade9f; }
html[data-theme='dark'] .badge-break { color: #f0be5a; }

.empty {
  text-align: center; color: var(--muted); font-size: 13.5px;
  padding: 30px 10px;
  border: 1px dashed var(--stroke-strong);
  border-radius: var(--r-lg);
}
.empty-sm { padding: 10px; border: 0; }

/* per-day grouping in timesheets */
.day-group { margin-bottom: 18px; }
.day-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px;
  padding: 0 4px 8px;
}
.day-head h4 { font-size: 14px; }
.day-head .day-meta { font-size: 12.5px; color: var(--muted); }
.day-head b { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--brand); }
.worker-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  background: var(--surface);
  margin-bottom: 16px;
}
.worker-head .avatar { width: 44px; height: 44px; }
.worker-head .wh-main { flex: 1; min-width: 0; }
.worker-head .wh-name { font-weight: 600; font-size: 15px; }
.worker-head .wh-sub { font-size: 12.5px; color: var(--muted); }
.worker-head .wh-total { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============ SETTINGS BITS ============ */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; font-size: 14px; }
.switch-row + .switch-row { border-top: 1px solid var(--stroke); }
.switch {
  appearance: none; width: 44px; height: 26px; flex: none;
  border-radius: 999px; background: var(--stroke-strong);
  position: relative; cursor: pointer; transition: background .18s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow);
  transition: transform .18s ease;
}
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(18px); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 6px 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  font-size: 13px;
}
.chip button {
  border: 0; background: none; color: var(--muted);
  cursor: pointer; padding: 2px; display: grid; place-items: center; border-radius: 50%;
}
.chip button:hover { color: var(--red); }
.chip .icon { width: 14px; height: 14px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; }

.filters { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 8px; margin-bottom: 14px; }
.filters .select { padding: 10px 12px; font-size: 13.5px; }

/* ============ NAVIGATION ============ */
.navbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--stroke);
  z-index: 20;
}
.nav-brand { display: none; }
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  border: 0; background: none;
  color: var(--muted);
  font: inherit; font-size: 11px; font-weight: 500;
  cursor: pointer;
  transition: color .15s;
}
.tab .icon { width: 21px; height: 21px; }
.tab.is-active { color: var(--brand); }
html[data-theme='dark'] .tab.is-active { color: var(--link-dark); }

/* ============ SHEET ============ */
.sheet-root { position: fixed; inset: 0; z-index: 60; }
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 12, 20, .45);
  opacity: 0; transition: opacity .2s;
}
.sheet-root.is-open .sheet-backdrop { opacity: 1; }
.sheet {
  position: absolute; left: 50%; bottom: 0;
  width: 100%; max-width: 520px;
  transform: translate(-50%, 100%);
  transition: transform .26s cubic-bezier(.22, 1, .36, 1);
  background: var(--elevated);
  border: 1px solid var(--stroke);
  border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 10px 22px calc(22px + var(--safe-b));
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.sheet-root.is-open .sheet { transform: translate(-50%, 0); }
.sheet-grip { width: 38px; height: 4px; border-radius: 99px; background: var(--stroke-strong); margin: 2px auto 18px; }
.sheet-title { font-size: 18px; }
.sheet-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.sheet-title + .field, .sheet-title + form, .sheet-title + .detail-grid, .sheet-title + .temp-pw { margin-top: 16px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 22px; }
.sheet-actions .btn { flex: 1; }
.sheet-person { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }

.action-list { display: flex; flex-direction: column; gap: 8px; }
.action {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--text);
  font: inherit; font-weight: 500; font-size: 14.5px;
  cursor: pointer;
}
.action:hover { background: var(--surface-2); }
.action-danger { color: var(--red); border-color: var(--stroke); }
.action-danger:hover { background: var(--red-soft); }

.temp-pw { display: flex; align-items: center; gap: 10px; }
.temp-pw code {
  flex: 1; padding: 14px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px dashed var(--stroke-strong);
  font-size: 16px; letter-spacing: .05em; text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* dropdown --------------------------------------------------- */
.dd { position: relative; }
.dd-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--stroke-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit; font-size: 15px;
  cursor: pointer;
  text-align: left;
}
.dd-toggle:hover { border-color: var(--brand); }
.dd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-label.is-placeholder { color: var(--muted); }
.dd-caret { color: var(--muted); transform: rotate(90deg); width: 18px; height: 18px; }
.dd-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  z-index: 30;
  padding: 6px;
  border-radius: var(--r-md);
  border: 1px solid var(--stroke);
  background: var(--elevated);
  box-shadow: var(--shadow-lg);
  max-height: 240px; overflow-y: auto;
}
.dd-opt {
  display: block; width: 100%; text-align: left;
  padding: 10px 12px;
  border: 0; border-radius: 10px;
  background: none; color: var(--text);
  font: inherit; font-size: 14.5px;
  cursor: pointer;
}
.dd-opt:hover { background: var(--surface-2); }
.dd-opt.is-selected { background: var(--brand-soft); color: var(--brand); font-weight: 550; }
html[data-theme='dark'] .dd-opt.is-selected { color: var(--link-dark); }

/* camera ----------------------------------------------------- */
.camera {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #0b0d13;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
}
.camera video, .camera img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-status {
  position: absolute; inset: auto 12px 12px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: rgba(8, 10, 16, .72);
  color: #fff;
  font-size: 12.5px;
  text-align: center;
}
.cam-actions { display: flex; gap: 8px; margin-top: 10px; }
.cam-actions .btn { flex: 1; }
.cam-actions label.btn { cursor: pointer; }

.meta-line {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--muted);
}
.meta-line.is-ok { color: var(--green); }
.meta-line.is-address { color: var(--text-2); align-items: flex-start; }
.meta-line.is-address .icon { margin-top: 2px; }
html[data-theme='dark'] .meta-line.is-ok { color: #4ade9f; }
.meta-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--brand); text-decoration: none; font-weight: 550;
}
html[data-theme='dark'] .meta-link { color: var(--link-dark); }
.small { font-size: 12.5px; margin-top: -8px; margin-bottom: 14px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-grid > div {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 11px 13px;
}
.detail-grid span { display: block; font-size: 11.5px; color: var(--muted); }
.detail-grid b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.detail-note { margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.photo-row { display: grid; gap: 12px; margin-top: 16px; }
.photo-card { margin: 0; border: 1px solid var(--stroke); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.photo-card img { width: 100%; height: 190px; object-fit: cover; display: block; }
.photo-card figcaption { padding: 12px 14px; display: grid; gap: 6px; }
.photo-card figcaption strong { font-size: 13.5px; font-weight: 600; }
.filters { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 8px; margin-bottom: 14px; }

/* ============ TOAST ============ */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  transform: translate(-50%, 10px);
  z-index: 80;
  max-width: 92vw;
  padding: 11px 16px;
  border-radius: var(--r-md);
  background: var(--elevated);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px; font-weight: 500;
  opacity: 0;
  transition: opacity .2s, transform .2s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* scrollbars */
.views::-webkit-scrollbar, .sheet::-webkit-scrollbar { width: 8px; }
.views::-webkit-scrollbar-thumb, .sheet::-webkit-scrollbar-thumb { background: var(--stroke-strong); border-radius: 99px; }

/* ============================================================
   TABLET  ≥ 700px
   ============================================================ */
@media (min-width: 700px) {
  .views { padding: 24px 26px calc(var(--nav-h) + var(--safe-b) + 28px); }
  .app-bar { padding: calc(18px + var(--safe-t)) 26px 14px; }
  .grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .list-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .timer { font-size: 52px; }
  .auth-panel { padding: 30px; }
  .sheet { border-radius: var(--r-xl); bottom: 26px; }
  .photo-row { grid-template-columns: 1fr 1fr; }
  .photo-card img { height: 150px; }
}

/* ============================================================
   DESKTOP  ≥ 1000px — side navigation
   ============================================================ */
@media (min-width: 1000px) {
  .screen { flex-direction: row; }
  .pane { min-width: 0; }

  .navbar {
    position: static;
    order: -1;
    width: 246px;
    height: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 20px 14px;
    border-top: 0;
    border-right: 1px solid var(--stroke);
  }
  .nav-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 8px 20px;
    font-weight: 600; font-size: 15px;
  }
  .tab {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 11px 12px;
    border-radius: var(--r-md);
    font-size: 14.5px;
    font-weight: 500;
  }
  .tab:hover { background: var(--surface-2); color: var(--text); }
  .tab.is-active { background: var(--brand-soft); }
  .tab .icon { width: 19px; height: 19px; }

  .views { padding: 26px 32px 40px; }
  .views > .view { max-width: 1160px; margin: 0 auto; }
  .app-bar { padding: 20px 32px 16px; }

  .grid { grid-template-columns: 1.15fr .85fr; gap: 20px; }
  .list-cols { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .row-3, .row-2 { gap: 16px; }

  .toast { bottom: 26px; left: auto; right: 26px; transform: translate(0, 10px); }
  .toast.is-visible { transform: translate(0, 0); }

  .sheet { max-width: 560px; bottom: 50%; transform: translate(-50%, 50%) scale(.97); opacity: 0; }
  .sheet-root.is-open .sheet { transform: translate(-50%, 50%) scale(1); opacity: 1; }
  .sheet-grip { display: none; }

  /* split auth screen */
  .auth-wrap {
    grid-template-columns: 1fr 460px;
    max-width: 1120px;
    margin: 0 auto;
    gap: 60px;
    padding: 40px;
  }
  .auth-hero { display: block; }
  .auth-hero h1 { font-size: 40px; margin-top: 22px; letter-spacing: -.03em; }
  .auth-hero h1 span { color: var(--brand); }
  .auth-hero .lead { font-size: 17px; color: var(--muted); margin-top: 10px; }
  .hero-points { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 14px; }
  .hero-points li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--text-2); }
  .hero-points .icon { color: var(--brand); }
  .auth-panel .brand-mark-sm { display: none; }
  .auth-top { justify-content: flex-end; }
}

@media (min-width: 1400px) {
  .list-cols { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
