/* ══════════════════════════════════════════════════════════════════
   Paradise Tickets — design system
   ══════════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────────────── */
/*
   Palette follows Apple's system colours: near-black text rather than
   pure black, a single blue accent, and greys that carry the hierarchy
   so almost nothing needs a border.
*/
:root {
  --bg:            #161618;
  --bg-elevated:   #1e1e21;
  --surface:       #26262a;
  --surface-hover: #2e2e33;
  --surface-active:#37373d;
  --border:        rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .13);

  --text:          #f5f5f7;
  --text-muted:    #a1a1a6;
  /* Apple's systemGray — clears AA at small sizes, unlike a dimmer tertiary. */
  --text-faint:    #8e8e93;

  --accent:        #0a84ff;
  --accent-hover:  #3b9bff;
  --accent-soft:   rgba(10, 132, 255, .16);
  --accent-ring:   rgba(10, 132, 255, .35);

  --green:  #30d158;  --green-soft:  rgba(48, 209, 88, .16);
  --amber:  #ff9f0a;  --amber-soft:  rgba(255, 159, 10, .16);
  --red:    #ff453a;  --red-soft:    rgba(255, 69, 58, .16);
  --blue:   #0a84ff;  --blue-soft:   rgba(10, 132, 255, .16);
  --violet: #bf5af2;  --violet-soft: rgba(191, 90, 242, .16);
  --cyan:   #64d2ff;  --cyan-soft:   rgba(100, 210, 255, .16);

  /* Translucent chrome, the way macOS sidebars and toolbars behave. */
  --chrome:        rgba(30, 30, 33, .72);
  --chrome-blur:   saturate(180%) blur(20px);

  /* Segmented control: recessed track, raised selected pill. */
  --seg-track: rgba(120, 120, 128, .20);
  --seg-pill:  #48484a;

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .18);
  --shadow:    0 4px 24px rgba(0, 0, 0, .22);
  --shadow-lg: 0 32px 80px rgba(0, 0, 0, .46);

  /* -apple-system resolves to SF Pro on Apple platforms. */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  /* Apple tightens tracking as type gets larger. */
  --track-tight:  -.022em;
  --track-tighter:-.03em;

  --sidebar-w: 244px;
  --ease: cubic-bezier(.4, 0, .2, 1);

  /* iOS draws a home-screen web app underneath the status bar and the
     home indicator. These carry that inset to every surface that touches
     an edge. Named variables so they can be exercised in a test. */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

[data-theme="light"] {
  --bg:            #f5f5f7;
  --bg-elevated:   #ffffff;
  --surface:       #ffffff;
  --surface-hover: #f0f0f2;
  --surface-active:#e8e8ed;
  --border:        rgba(0, 0, 0, .08);
  --border-strong: rgba(0, 0, 0, .14);

  --text:          #1d1d1f;
  --text-muted:    #5d5d62;
  --text-faint:    #6e6e73;

  --accent:        #0071e3;
  --accent-hover:  #0077ed;
  --accent-soft:   rgba(0, 113, 227, .1);
  --accent-ring:   rgba(0, 113, 227, .25);

  --green:  #1d8c3e;  --green-soft:  rgba(29, 140, 62, .12);
  --amber:  #b25000;  --amber-soft:  rgba(178, 80, 0, .12);
  --red:    #d70015;  --red-soft:    rgba(215, 0, 21, .1);
  --blue:   #0071e3;  --blue-soft:   rgba(0, 113, 227, .1);
  --violet: #8944ab;  --violet-soft: rgba(137, 68, 171, .12);
  --cyan:   #0088a3;  --cyan-soft:   rgba(0, 136, 163, .12);

  --chrome:        rgba(255, 255, 255, .72);

  --seg-track: rgba(120, 120, 128, .12);
  --seg-pill:  #ffffff;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow:    0 4px 20px rgba(0, 0, 0, .07);
  --shadow-lg: 0 32px 80px rgba(0, 0, 0, .18);
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-ring);
  border-radius: 6px;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(140, 140, 150, .38);
  border-radius: 100px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(140, 140, 150, .62); background-clip: content-box; }

/* Inline icons default to a sensible size everywhere. Individual
   components may still override this. */
svg.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Utilities ──────────────────────────────────────────────────── */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.spacer { flex: 1; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }

/* ══════════════════════════════════════════════════════════════════
   Auth screen
   ══════════════════════════════════════════════════════════════════ */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(24px + var(--sat)) calc(24px + var(--sar))
           calc(24px + var(--sab)) calc(24px + var(--sal));
  background:
    radial-gradient(900px 560px at 15% -10%, rgba(10, 132, 255, .12), transparent 62%),
    radial-gradient(800px 480px at 85% 110%, rgba(100, 210, 255, .08), transparent 62%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-elevated);
  border: .5px solid var(--border);
  border-radius: 22px;
  padding: 40px 36px 32px;
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  display: flex; align-items: center; gap: 11px;
  margin-bottom: 26px;
}
.auth-brand .logo {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(160deg, #0a84ff, #0060df);
  display: grid; place-items: center;
  font-weight: 700; font-size: 17px; color: #fff;
  box-shadow: 0 4px 14px rgba(10, 132, 255, .35);
}
.auth-brand h1 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.auth-brand p  { font-size: 12.5px; color: var(--text-faint); }

.auth-title { font-size: 26px; font-weight: 600; letter-spacing: var(--track-tighter); }
.auth-sub   { color: var(--text-muted); font-size: 13.5px; margin: 5px 0 24px; }

.auth-tabs {
  display: flex; gap: 2px; padding: 2px;
  background: var(--seg-track); border: none;
  border-radius: 11px; margin-bottom: 22px;
}
.auth-tabs button {
  flex: 1; padding: 7px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text);
  transition: all .18s var(--ease);
}
.auth-tabs button[aria-selected="true"] {
  background: var(--seg-pill); color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .16), 0 0 0 .5px rgba(0, 0, 0, .04);
}

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text-faint); font-size: 12px;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

.btn-google {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 11px; font-size: 14px; font-weight: 500;
  background: transparent; border: 1px solid var(--border-strong);
  border-radius: 980px; transition: all .18s var(--ease);
}
.btn-google:hover { background: var(--surface-hover); border-color: var(--text-faint); }

.auth-foot { margin-top: 22px; text-align: center; font-size: 12.5px; color: var(--text-faint); }

/* ── Forms ──────────────────────────────────────────────────────── */
.field { margin-bottom: 15px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 500;
  color: var(--text); margin-bottom: 7px;
}
.field .hint { font-size: 11.5px; color: var(--text-faint); font-weight: 400; }

.input, .textarea, .select {
  width: 100%; padding: 10px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.select { appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23969db2' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 980px;
  font-size: 13.5px; font-weight: 500; letter-spacing: -.01em;
  border: 1px solid transparent;
  transition: background .18s var(--ease), transform .1s var(--ease),
              box-shadow .18s var(--ease), color .18s var(--ease);
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg.icon { width: 15px; height: 15px; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:active:not(:disabled) { transform: scale(.97); }

.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }

.btn-outline { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn-outline:hover:not(:disabled) { background: var(--surface-hover); }
.btn-outline:active:not(:disabled) { transform: scale(.97); }

.btn-danger { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn-danger:hover:not(:disabled) { background: var(--red); color: #fff; }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-icon { padding: 7px; border-radius: 50%; color: var(--text-muted); }
.btn-icon svg.icon { width: 17px; height: 17px; }
.btn-icon:hover { background: var(--surface-hover); color: var(--text); }

/* ── Notes ──────────────────────────────────────────────────────
   A calmer alternative to .alert for explanatory asides. */
.note {
  border-radius: var(--radius);
  padding: 15px 18px;
  margin: 18px 0;
  background: var(--surface);
  border-left: 3px solid var(--border-strong);
  font-size: 13.5px;
  line-height: 1.55;
}
.note .title { font-weight: 600; margin-bottom: 5px; letter-spacing: var(--tight); }
.note p { margin: 0; color: var(--text-muted); }
.note.tip  { border-left-color: var(--accent); }
.note.tip .title  { color: var(--accent); }
.note.warn { border-left-color: var(--amber); }
.note.warn .title { color: var(--amber); }

/* ── Alerts ─────────────────────────────────────────────────────── */
.alert {
  padding: 10px 13px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px;
  display: flex; gap: 9px; align-items: flex-start;
}
.alert-error   { background: var(--red-soft);   color: #fca5a5; }
.alert-success { background: var(--green-soft); color: #86efac; }
.alert-info    { background: var(--blue-soft);  color: #93c5fd; }
[data-theme="light"] .alert-error   { color: #b42318; }
[data-theme="light"] .alert-success { color: #067647; }
[data-theme="light"] .alert-info    { color: #1849a9; }

/* ══════════════════════════════════════════════════════════════════
   App shell
   ══════════════════════════════════════════════════════════════════ */
.app { display: flex; height: 100vh; overflow: hidden; }
@supports (height: 100dvh) { .app { height: 100dvh; } }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--chrome);
  backdrop-filter: var(--chrome-blur);
  -webkit-backdrop-filter: var(--chrome-blur);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform .22s var(--ease);
  z-index: 40;
}

.sidebar-head { padding: calc(18px + var(--sat)) 16px 14px; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; }
.sidebar-brand .logo {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(160deg, #0a84ff, #0060df);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff;
}
.sidebar-brand .name { font-weight: 600; font-size: 14.5px; letter-spacing: var(--track-tight); }
.sidebar-brand .sub  { font-size: 11px; color: var(--text-faint); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: .01em; color: var(--text-faint);
  padding: 14px 10px 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px;
  color: var(--text); font-size: 13.5px; font-weight: 450;
  transition: background .14s var(--ease); margin-bottom: 1px;
  width: 100%; text-align: left;
}
.nav-item:hover { background: var(--surface-hover); }
/* Selected rows read as a filled pill, the way macOS sidebars do. */
.nav-item.active { background: var(--accent); color: #fff; font-weight: 500; }
.nav-item.active .icon { opacity: 1; }
.nav-item .icon { width: 17px; height: 17px; flex-shrink: 0; opacity: .9; }
.nav-item .count {
  margin-left: auto; font-size: 11.5px; font-weight: 500;
  color: var(--text-faint);
  padding: 0 2px; min-width: 16px; text-align: right;
}
.nav-item.active .count { color: rgba(255, 255, 255, .8); }

/* Anything waiting on you turns into a red pill you cannot miss. */
.nav-item .count.alert {
  background: #ff3b30;
  color: #fff;
  font-weight: 600;
  font-size: 11px;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 980px;
  display: inline-flex; align-items: center; justify-content: center;
  text-align: center;
  box-shadow: 0 0 0 0 rgba(255, 59, 48, .55);
  /* A slow heartbeat so it stays noticeable without being frantic. */
  animation: countPulse 2.6s ease-out infinite;
}
/* Stays red even on the selected row — a white ring keeps it legible
   against the blue pill without dulling the alert. */
.nav-item.active .count.alert {
  background: #ff3b30;
  color: #fff;
  animation: countPulseOnBlue 2.6s ease-out infinite;
}

@keyframes countPulseOnBlue {
  0%   { box-shadow: 0 0 0 0   rgba(255, 255, 255, .85); }
  60%  { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0   rgba(255, 255, 255, 0); }
}

@keyframes countPulse {
  0%   { box-shadow: 0 0 0 0   rgba(255, 59, 48, .55); }
  60%  { box-shadow: 0 0 0 7px rgba(255, 59, 48, 0); }
  100% { box-shadow: 0 0 0 0   rgba(255, 59, 48, 0); }
}

/* A one-off kick the moment the number goes up. */
.nav-item .count.bump { animation: countBump .55s var(--ease-out), countPulse 2.6s ease-out .55s infinite; }
.nav-item.active .count.bump { animation: countBump .55s var(--ease-out), countPulseOnBlue 2.6s ease-out .55s infinite; }
@keyframes countBump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.45); }
  70%  { transform: scale(.92); }
  100% { transform: scale(1); }
}

/* Safari on iPhone zooms the page whenever a focused field is under 16px,
   and never zooms back out. Bumping touch devices to 16px avoids it. */
@media (hover: none) and (pointer: coarse) {
  .input, .textarea, .select,
  input[type="text"], input[type="email"], input[type="password"],
  input[type="search"], input[type="url"], input[type="date"], textarea, select {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-item .count.alert, .nav-item .count.bump,
  .nav-item.active .count.alert, .nav-item.active .count.bump { animation: none; }
}

.sidebar-foot { padding: 10px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--radius-sm); width: 100%;
  transition: background .14s var(--ease);
}
.user-chip:hover { background: var(--surface-hover); }
.user-chip .meta { min-width: 0; text-align: left; }
.user-chip .n { font-size: 13px; font-weight: 550; }
.user-chip .r { font-size: 11px; color: var(--text-faint); }

/* ── Avatars ────────────────────────────────────────────────────── */
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 640; color: #fff;
  background: var(--accent); overflow: hidden;
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar-lg { width: 38px; height: 38px; font-size: 14px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -7px; border: 2px solid var(--bg-elevated); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ── Main region ────────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: calc(56px + var(--sat));
  padding-top: var(--sat);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--chrome);
  backdrop-filter: var(--chrome-blur);
  -webkit-backdrop-filter: var(--chrome-blur);
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
}
.topbar h2 { font-size: 15.5px; font-weight: 600; letter-spacing: var(--track-tight); }
.topbar .sub { font-size: 12.5px; color: var(--text-faint); }

.content { flex: 1; overflow: auto; }
/* Board routes manage their own scrolling so the columns can be full height. */
.content.no-scroll { overflow: hidden; }
.content-pad { padding: 22px 24px 40px; }

.menu-toggle { display: none; }

/* A quiet, dismissible nudge under the toolbar. */
.notice-bar {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
  font-size: 13.5px; color: var(--text);
  flex-shrink: 0;
}
.notice-bar svg.icon { color: var(--accent); }
.notice-bar .btn-ghost { color: var(--text-muted); }

@media (max-width: 640px) {
  .notice-bar { padding: 10px 14px; font-size: 13px; }
}

/* ── Live indicator ─────────────────────────────────────────────── */
.live-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-faint); font-weight: 500;
}
.live-dot i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); display: block;
  box-shadow: 0 0 0 0 rgba(34,197,94,.55);
  animation: pulse 2.4s infinite;
}
.live-dot.stale i { background: var(--amber); animation: none; }
.live-dot.offline i { background: var(--red); animation: none; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ══════════════════════════════════════════════════════════════════
   Kanban board
   ══════════════════════════════════════════════════════════════════ */
/* A segmented control, like the ones in macOS toolbars. */
.board-tabs {
  display: flex; gap: 2px;
  margin: 14px 20px 2px;
  padding: 2px;
  background: var(--seg-track);
  border-radius: 11px;
  overflow-x: auto;
  align-self: flex-start;
  max-width: calc(100% - 40px);
}
.board-tab {
  padding: 6px 14px; border-radius: 9px;
  font-size: 13px; font-weight: 500; color: var(--text);
  transition: background .18s var(--ease), box-shadow .18s var(--ease);
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.board-tab svg.icon { width: 15px; height: 15px; opacity: .75; }
.board-tab:hover:not(.active) { background: rgba(120, 120, 128, .14); }
.board-tab.active {
  background: var(--seg-pill);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .16), 0 0 0 .5px rgba(0, 0, 0, .04);
}
.board-tab.active svg.icon { opacity: 1; }
.board-tab .count { font-size: 11.5px; font-weight: 500; color: var(--text-faint); }
.board-tab.active .count { color: var(--text-muted); }
/* Dragging a card over a board tab moves it to that board */
.board-tab.drop-target {
  background: var(--accent-soft); color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.board {
  display: flex; gap: 14px; padding: 18px 20px 24px;
  height: 100%; align-items: stretch; overflow-x: auto;
  /* It is itself a flex item, so claim the full width — otherwise it
     shrinks to its content and the columns have nothing to grow into. */
  flex: 1;
  min-width: 0;
}

.column {
  /* Share the width evenly, but never get cramped — scrolls if it must. */
  flex: 1 1 300px;
  min-width: 272px;
  max-width: 460px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  max-height: 100%;
  min-height: 0;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.board-single .column { max-width: 780px; }

/* Columns are borderless now, so the drop target reads as a tinted
   well with a ring rather than a border colour change. */
.column.drop-target { background: transparent; }
.column.drop-target .column-body {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
  border-radius: var(--radius);
}

.column-head {
  padding: 2px 6px 12px; display: flex; align-items: center; gap: 8px;
  position: sticky; top: 0; z-index: 2;
  background: var(--bg);
}
.column-head .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.column-head .title { font-size: 13px; font-weight: 590; letter-spacing: var(--track-tight); }
.column-head .count { font-size: 12px; font-weight: 450; color: var(--text-faint); }
.column-head .points {
  margin-left: auto; font-size: 11px; font-weight: 600;
  color: var(--text-faint);
}

.column-body {
  padding: 0 2px 8px; overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 90px;
}

.column-empty {
  padding: 22px 12px; text-align: center;
  color: var(--text-faint); font-size: 12.5px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
}

/* ── Ticket card ────────────────────────────────────────────────── */
.card {
  background: var(--bg-elevated);
  border: none;
  box-shadow: var(--shadow-sm), 0 0 0 .5px var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  cursor: grab;
  transition: box-shadow .18s var(--ease), transform .18s var(--ease),
              opacity .14s var(--ease);
  position: relative;
}
.card:hover { box-shadow: var(--shadow), 0 0 0 .5px var(--border-strong); transform: translateY(-1px); }
.card:active { cursor: grabbing; }
.card.dragging { opacity: .4; transform: rotate(1.5deg) scale(.98); }
.card.flash { animation: flash .9s var(--ease); }
@keyframes flash {
  0%   { box-shadow: 0 0 0 0 var(--accent-ring); border-color: var(--accent); }
  100% { box-shadow: 0 0 0 9px transparent; }
}

/* .card-top was removed with the badges — the reference now sits in the foot. */
.card-ref {
  font-family: var(--mono); font-size: 10.5px; color: var(--text-faint);
  font-weight: 500; white-space: nowrap;   /* never split PT-0012 across lines */
}
.card-title { font-size: 13.5px; font-weight: 480; line-height: 1.42;
  letter-spacing: -.008em; margin-bottom: 11px; }
.card-foot { display: flex; align-items: center; gap: 8px; }
.card-meta { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-faint); }
.card-meta svg { width: 13px; height: 13px; }

.card-thumb {
  width: 100%; height: 104px; object-fit: cover;
  border-radius: 6px; margin-bottom: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
}

/* ── Badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500; letter-spacing: 0;
  padding: 2.5px 9px; border-radius: 980px; white-space: nowrap;
  text-transform: capitalize;
}
.badge svg { width: 11px; height: 11px; }

/* One quiet status chip is the only coloured label left. */
.status-chip     { background: var(--surface-active); }
.badge-team      { background: var(--accent-soft); color: var(--accent); }
.badge-internal  { background: var(--amber-soft);  color: var(--amber); }
.badge-pending   { background: #ff3b30; color: #fff; min-width: 20px; justify-content: center; font-weight: 600; }

/* de / en toggle — a miniature segmented control */
.lang-switch {
  display: flex; gap: 2px; padding: 2px;
  background: var(--seg-track); border-radius: 9px;
}
.lang-switch button {
  flex: 1; padding: 5px 8px; border-radius: 7px;
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  transition: background .18s var(--ease), color .18s var(--ease);
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.on {
  background: var(--seg-pill); color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .16);
}
.auth-card .lang-switch { margin-top: 18px; }

/* ── Drop placeholder ───────────────────────────────────────────── */
.drop-line {
  height: 2px; background: var(--accent); border-radius: 2px;
  margin: -5px 0; position: relative;
}
.drop-line::before {
  content: ""; position: absolute; left: -3px; top: -2.5px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}

/* ══════════════════════════════════════════════════════════════════
   Ticket popup — scales out of the card you clicked, macOS style
   ══════════════════════════════════════════════════════════════════ */
.tkt-stage {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 26px;
}

.backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .42);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}

.tkt {
  position: relative;
  width: min(760px, 100%);
  max-height: min(860px, 100%);
  background: var(--bg-elevated);
  border: .5px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
  /* The open/close transform is driven by the Web Animations API. */
  transform-origin: center center;
  will-change: transform, opacity;
}

.tkt-head {
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 11px; flex-shrink: 0;
}
.tkt-body { flex: 1; overflow-y: auto; padding: 22px; }
.tkt-foot {
  padding: 14px 22px; border-top: 1px solid var(--border);
  flex-shrink: 0; background: var(--bg-elevated);
}
.tkt h3 { font-size: 21px; font-weight: 600; letter-spacing: var(--track-tighter); line-height: 1.28; }

/* Stop the page behind the popup from scrolling under it. */
body.no-body-scroll { overflow: hidden; }

/* ══════════════════════════════════════════════════════════════════
   Image viewer
   ══════════════════════════════════════════════════════════════════ */
.lightbox {
  position: fixed; inset: 0; z-index: 150;
  display: grid; place-items: center;
  padding: 56px 68px 74px;
  background: rgba(0, 0, 0, .84);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: zoom-out;
}

.lightbox-frame {
  max-width: 100%; max-height: 100%;
  display: grid; place-items: center;
  transform-origin: center center;
  will-change: transform, opacity;
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  width: auto; height: auto;
  border-radius: 10px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
  cursor: default;
}

.lightbox-caption {
  position: absolute; left: 0; right: 0; bottom: 20px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  color: rgba(255, 255, 255, .8); font-size: 12.5px;
  padding: 0 20px; pointer-events: none;
}
.lightbox-caption .btn {
  pointer-events: auto; background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .22); color: #fff;
}
.lightbox-caption .btn:hover { background: rgba(255, 255, 255, .2); }

.lightbox-close {
  position: absolute; top: 18px; right: 20px;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .1); color: #fff;
  transition: background .15s var(--ease);
}
.lightbox-close:hover { background: rgba(255, 255, 255, .22); }
.lightbox-close svg.icon { width: 18px; height: 18px; }

.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  font-size: 26px; line-height: 1; color: #fff;
  background: rgba(255, 255, 255, .1);
  transition: background .15s var(--ease);
}
.lightbox-nav:hover { background: rgba(255, 255, 255, .22); }
.lightbox-nav.prev { left: 16px; }
.lightbox-nav.next { right: 16px; }

/* Image tiles are buttons now, so reset the button chrome. */
button.attach {
  display: block; width: 100%; text-align: left; padding: 0;
  font: inherit; color: inherit; cursor: zoom-in;
}

.section { margin-bottom: 24px; }
.section-label {
  font-size: 12px; font-weight: 500;
  color: var(--text-faint); margin-bottom: 10px;
}

.prose { font-size: 14px; line-height: 1.68; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  background: var(--surface); border: none;
  border-radius: var(--radius); padding: 16px 18px;
}
.meta-item .k { font-size: 12px; color: var(--text-faint); font-weight: 450; margin-bottom: 5px; }
.meta-item .v { font-size: 13.5px; font-weight: 450; }

/* ── Attachments ────────────────────────────────────────────────── */
.attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 9px; }
.attach {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface);
  transition: border-color .14s var(--ease);
  position: relative;
}
.attach:hover { border-color: var(--accent); }
.attach img { width: 100%; height: 82px; object-fit: cover; background: var(--bg); }
.attach .file-ico {
  height: 82px; display: grid; place-items: center;
  color: var(--text-faint); background: var(--bg);
}
.attach .file-ico svg { width: 26px; height: 26px; }
.attach .nm {
  padding: 6px 8px; font-size: 11px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-top: 1px solid var(--border);
}

/* Whole-surface drop target: the popup or the new-ticket form lights up
   when a file is dragged over it, not just the little upload box. */
.drop-over { position: relative; }
.drop-over::after {
  content: "";
  position: absolute; inset: 0; z-index: 5;
  border: 2px dashed var(--accent);
  border-radius: inherit;
  background: var(--accent-soft);
  pointer-events: none;
}

/* ── Dropzone ───────────────────────────────────────────────────── */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 20px; text-align: center; color: var(--text-muted);
  font-size: 13px; cursor: pointer;
  transition: all .16s var(--ease);
}
.dropzone:hover, .dropzone.over {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent);
}
.dropzone svg { width: 22px; height: 22px; margin: 0 auto 7px; }

.upload-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12.5px; margin-top: 7px;
}
.progress { flex: 1; height: 4px; background: var(--surface-active); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .2s var(--ease); }

/* ── Links list ─────────────────────────────────────────────────── */
.link-row {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 6px; font-size: 13px;
}
.link-row a { color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row svg { width: 14px; height: 14px; color: var(--text-faint); flex-shrink: 0; }

/* ── Comments ───────────────────────────────────────────────────── */
.comment { display: flex; gap: 11px; margin-bottom: 17px; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.comment-head .who { font-size: 13px; font-weight: 600; }
.comment-head .when { font-size: 11.5px; color: var(--text-faint); }
.comment-text {
  font-size: 13.5px; line-height: 1.62; white-space: pre-wrap; word-break: break-word;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.comment.internal .comment-text {
  background: var(--amber-soft); border-color: rgba(245,158,11,.3);
}

/* Images that came with a comment: shown in the comment itself, sized
   like a chat message rather than the ticket's attachment grid. */
.comment-shots { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.comment-shot {
  padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface); cursor: zoom-in;
  transition: border-color .14s var(--ease), transform .14s var(--ease);
}
.comment-shot img { display: block; max-width: 210px; max-height: 150px; object-fit: cover; }
.comment-shot:hover { border-color: var(--accent); transform: translateY(-1px); }
.comment-file {
  display: inline-flex; align-items: center; gap: 7px; max-width: 220px;
  padding: 8px 11px; font-size: 12.5px; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.comment-file svg { width: 14px; height: 14px; flex-shrink: 0; }
.comment-file:hover { border-color: var(--accent); color: var(--accent); }

/* ── Pinned to the comment being written ────────────────────────── */
.shot-tray { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.shot-pending {
  position: relative; border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; background: var(--surface);
}
.shot-pending img { display: block; width: 74px; height: 74px; object-fit: cover; }
.shot-pending .shot-file {
  display: flex; align-items: center; gap: 6px; width: 132px; height: 74px;
  padding: 0 10px; font-size: 11.5px; color: var(--text-muted);
}
.shot-pending .shot-file svg { width: 15px; height: 15px; flex-shrink: 0; }
.shot-drop {
  position: absolute; top: 3px; right: 3px;
  width: 19px; height: 19px; padding: 0;
  display: grid; place-items: center;
  border: none; border-radius: 50%; cursor: pointer;
  color: #fff; background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(6px);
}
.shot-drop svg { width: 11px; height: 11px; }
.shot-drop:hover { background: var(--red); }

/* ── Activity ───────────────────────────────────────────────────── */
.activity-row {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 7px 0; font-size: 12.5px; color: var(--text-muted);
}
.activity-row .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong);
  margin-top: 7px; flex-shrink: 0;
}
.activity-row b { color: var(--text); font-weight: 580; }
.activity-row .when { color: var(--text-faint); font-size: 11.5px; }

/* ══════════════════════════════════════════════════════════════════
   Tables / list view
   ══════════════════════════════════════════════════════════════════ */
.panel {
  background: var(--bg-elevated);
  border: none;
  box-shadow: var(--shadow-sm), 0 0 0 .5px var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.panel-head {
  padding: 14px 17px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 11px;
}
.panel-head h3 { font-size: 14.5px; font-weight: 590; letter-spacing: var(--track-tight); }
.panel-head > svg.icon { width: 17px; height: 17px; color: var(--text-muted); }

/* Wide tables scroll inside their own container, so a long row can never
   push its buttons past the edge of the panel and out of reach. */
.tablewrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.panel .tablewrap { margin: 0; }

table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th {
  text-align: left; font-size: 12px; font-weight: 500;
  color: var(--text-faint);
  padding: 11px 18px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.tbl td {
  padding: 13px 18px; border-bottom: 1px solid var(--border); font-size: 13.5px;
  vertical-align: middle;
}
table.tbl tr:last-child td { border-bottom: none; }
/* Action buttons wrap onto a second line rather than widening the row
   past the panel — matters most on iPad-width screens. */
table.tbl td .row { flex-wrap: wrap; }

table.tbl tbody tr { cursor: pointer; transition: background .13s var(--ease); }
table.tbl tbody tr:hover { background: var(--surface-hover); }

/* ── Stats ──────────────────────────────────────────────────────── */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 13px; margin-bottom: 22px;
}
.stat {
  background: var(--bg-elevated);
  border: none;
  box-shadow: var(--shadow-sm), 0 0 0 .5px var(--border);
  border-radius: var(--radius); padding: 18px 19px;
}
.stat .k { font-size: 12px; color: var(--text-muted); font-weight: 450; margin-bottom: 8px; }
.stat .v { font-size: 30px; font-weight: 590; letter-spacing: var(--track-tighter); line-height: 1.05; }
.stat .d { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }

/* ── Empty state ────────────────────────────────────────────────── */
.empty { text-align: center; padding: 56px 20px; }
.empty svg { width: 42px; height: 42px; color: var(--text-faint); margin: 0 auto 14px; opacity: .55; }
.empty h3 { font-size: 15.5px; font-weight: 600; margin-bottom: 5px; }
.empty p { color: var(--text-muted); font-size: 13.5px; max-width: 380px; margin: 0 auto 18px; }

/* ── Modal ──────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 110;
  display: grid; place-items: center; padding: 22px;
  background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
}
.modal-card {
  width: 100%; max-width: 560px; max-height: 90vh;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: modalIn .22s var(--ease);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.modal-head {
  padding: 17px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 11px;
}
.modal-head h3 { font-size: 16px; font-weight: 630; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 9px; justify-content: flex-end;
}

/* ── Toasts ─────────────────────────────────────────────────────── */
.toasts {
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 11px 15px;
  box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 500;
  display: flex; align-items: center; gap: 9px;
  animation: toastIn .24s var(--ease); pointer-events: auto;
  max-width: 380px;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: none; }
}
.toast.out { animation: toastOut .2s var(--ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
.toast .bar { width: 3px; height: 20px; border-radius: 2px; background: var(--accent); }
.toast.success .bar { background: var(--green); }
.toast.success .bar { background: var(--green); }
.toast.error   .bar { background: var(--red); }

/* ── Skeleton ───────────────────────────────────────────────────── */
.skel {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s infinite linear;
  border-radius: 6px;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ── Filter bar ─────────────────────────────────────────────────── */
.filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 20px 4px;
  background: transparent;
}
.search-box { position: relative; flex: 1; max-width: 300px; min-width: 160px; }
.search-box svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--text-faint); pointer-events: none;
}
.search-box .input { padding-left: 32px; }
.chip {
  padding: 5px 13px; border-radius: 980px; font-size: 12.5px; font-weight: 450;
  border: 1px solid var(--border); color: var(--text-muted);
  background: var(--surface); transition: all .16s var(--ease);
}
.chip:hover { color: var(--text); background: var(--surface-hover); }
.chip.on { background: var(--accent); border-color: transparent; color: #fff; font-weight: 500; }

/* ══════════════════════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════════════════════ */
/* ══════════════════════════════════════════════════════════════════
   Phones
   ══════════════════════════════════════════════════════════════════ */
.tabbar { display: none; }

@media (max-width: 900px) {
  /* The sidebar becomes a sheet, opened from the bottom bar. */
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    width: min(300px, 84vw);
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    padding-bottom: var(--sab);
    z-index: 60;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed; inset: 0; z-index: 55;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  }

  /* ── Bottom navigation ── */
  .tabbar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: var(--chrome);
    backdrop-filter: var(--chrome-blur);
    -webkit-backdrop-filter: var(--chrome-blur);
    border-top: 1px solid var(--border);
    padding-bottom: var(--sab);
  }
  .tabbar-item {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 4px 7px;
    background: none; border: 0; cursor: pointer;
    color: var(--text-faint);
    font-size: 10.5px; font-weight: 500; letter-spacing: 0;
    text-decoration: none;
    transition: color .15s var(--ease);
  }
  .tabbar-item span {
    max-width: 100%; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
  }
  .tabbar-item svg.icon { width: 21px; height: 21px; }
  .tabbar-item.active { color: var(--accent); }
  .tabbar-item:active { opacity: .55; }

  /* Content clears the bar. */
  .app { padding-bottom: calc(54px + var(--sab)); }

  /* ── Slimmer chrome ── */
  .topbar {
    padding: var(--sat) 14px 0;
    height: calc(52px + var(--sat));
  }
  .topbar h2 { font-size: 17px; font-weight: 600; }
  .topbar .sub { display: none; }
  .topbar .cta-label { display: none; }
  .topbar .btn-primary { padding: 9px; border-radius: 50%; }
  #presence { display: none; }
  .live-dot span { display: none; }
  .menu-toggle { display: none; }          /* the bottom bar covers this */

  .board-tabs { display: none; }           /* replaced by the bottom bar */

  .filters { padding: 10px 14px 2px; gap: 8px; flex-wrap: nowrap; }
  .search-box { flex: 1 1 auto; max-width: none; min-width: 0; }
  .filters .chip { flex: 0 0 auto; }

  .notice-bar { padding: 9px 14px; font-size: 12.5px; gap: 8px; }
  .notice-bar .btn { padding: 6px 12px; font-size: 12.5px; }

  .board { padding: 12px 14px 18px; gap: 12px; }
  .column { flex: 0 0 82vw; min-width: 82vw; max-width: 82vw; scroll-snap-align: start; }
  .board { scroll-snap-type: x proximity; }
  .board-single .column { flex: 1 1 100%; min-width: 100%; max-width: 100%; }

  .content-pad { padding: 14px 14px 28px; }
  .card { padding: 14px 15px; }
  .card-title { font-size: 14.5px; }
}

/* ── Tables become stacked cards ─────────────────────────────────
   Hiding columns was worse than useless: it took the action buttons
   with it, so approving somebody was impossible on a phone. */
@media (max-width: 760px) {
  .panel-head { flex-wrap: wrap; row-gap: 5px; }
  .panel-head > span:last-of-type { flex-basis: 100%; }

  table.tbl thead { display: none; }
  table.tbl, table.tbl tbody, table.tbl tr, table.tbl td { display: block; width: 100%; }

  table.tbl tr { padding: 14px 17px; border-bottom: 1px solid var(--line-soft); }
  table.tbl tr:last-child { border-bottom: 0; }

  table.tbl td {
    padding: 4px 0 !important;
    border: none !important;
    width: auto !important;
    white-space: normal !important;
    text-align: left !important;
  }
  table.tbl td:empty { display: none; }

  table.tbl td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--text-faint);
    font-size: .88em;
  }
  table.tbl td[data-label] { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }

  table.tbl td .row { justify-content: flex-start !important; flex-wrap: wrap; gap: 7px; }
  table.tbl td:last-child:not(:only-child) { padding-top: 11px !important; }
  table.tbl td .btn { flex: 0 1 auto; }
}

/* Safari on iPhone zooms the page whenever a focused field is under 16px,
   and never zooms back out. */
@media (hover: none) and (pointer: coarse) {
  .input, .textarea, .select,
  input[type="text"], input[type="email"], input[type="password"],
  input[type="search"], input[type="url"], input[type="date"], textarea, select {
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  .tkt-stage { padding: 0; }
  .tkt {
    width: 100%; height: 100%; max-height: 100%;
    border-radius: 0; border: none;
  }
  .tkt-head { padding-top: calc(15px + var(--sat)); }
  .tkt-foot { padding-bottom: calc(14px + var(--sab)); }
  .lightbox { padding: calc(52px + var(--sat)) 12px calc(68px + var(--sab)); }
  .lightbox-nav { width: 38px; height: 38px; }
  .lightbox-close { top: calc(18px + var(--sat)); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .nav-item .count.alert, .nav-item .count.bump,
  .nav-item.active .count.alert, .nav-item.active .count.bump { animation: none; }
}
