/* Campus Core Review & Approval Portal — Static Interactive Preview Styles
   Offline-first, zero external CDN dependencies, touch targets >= 44px */

:root {
  --bg-base: #090e17;
  --bg-elevated: #111927;
  --bg-card: #141e30;
  --bg-card-soft: #18253a;
  --bg-input: #0d1522;
  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.30);
  --border-gold: rgba(235, 186, 78, 0.48);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --gold: #ebba4e;
  --gold-strong: #d99b26;
  --gold-soft: rgba(235, 186, 78, 0.14);

  --approve: #16a34a;
  --approve-hover: #15803d;
  --approve-text: #dcfce7;
  --approve-soft: rgba(34, 197, 94, 0.16);

  --cancel: #dc2626;
  --cancel-hover: #b91c1c;
  --cancel-text: #fee2e2;
  --cancel-soft: rgba(239, 68, 68, 0.16);

  --feedback: #0284c7;
  --feedback-hover: #0369a1;
  --feedback-text: #e0f2fe;
  --feedback-soft: rgba(56, 189, 248, 0.16);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 18px 40px rgba(0, 0, 0, 0.45);
  --font-sans: "Noto Sans Thai", "Sarabun", "Leelawadee UI", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 18% 0%, #152238 0%, var(--bg-base) 58%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

button, input, textarea {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Subtle dark scrollbars */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.26);
  border-radius: 999px;
}

@media (max-width: 480px) {
  html {
    scrollbar-width: none;
  }
  ::-webkit-scrollbar {
    display: none;
  }
}

/* Preview switcher bar (shown in interactive preview, hidden when ?mode=clean) */
.preview-strip {
  background: #0d1422;
  border-bottom: 1px solid var(--border-gold);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}

.clean-mode .preview-strip {
  display: none !important;
}

.preview-strip-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-weight: 600;
}

.preview-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.preview-nav-link {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.preview-nav-link:hover {
  border-color: var(--border-gold);
  color: var(--text-primary);
}

.preview-nav-link.active {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold);
}

/* Top App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(9, 14, 23, 0.90);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.app-header-inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-crest {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(145deg, #273754, #141d2e);
  border: 1.5px solid var(--gold);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(235, 186, 78, 0.18);
}

.brand-crest svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  min-width: 0;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text-primary);
  white-space: nowrap;
}

.role-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.role-pill.owner {
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid var(--border-gold);
}

.role-pill.tester {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.sample-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.42);
  white-space: nowrap;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pending-badge {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.pending-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(235, 186, 78, 0.22);
}

.pending-dot.done {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}

.header-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s;
}

.header-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-soft);
  color: var(--text-primary);
}

.hide-sm {
  display: none;
}

/* Main Workspace Container */
.portal-shell {
  max-width: 1340px;
  margin: 0 auto;
  padding: 12px 14px 104px;
}

/* Filter Strip (Mobile + Tablet top, Desktop inside left rail) */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 10px;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.chip {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.chip.active {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold);
}

.chip.active.tester-accent {
  background: rgba(56, 189, 248, 0.16);
  border-color: #38bdf8;
  color: #7dd3fc;
}

.chip-count {
  font-size: 12px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
}

/* Desktop 2-column layout grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.queue-rail {
  display: none;
}

/* Card Deck Stage */
.stage-col {
  min-width: 0;
}

.deck-controls-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.deck-counter {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.swipe-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.deck-nav-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.nav-circle-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.nav-circle-btn:hover:not(:disabled) {
  border-color: var(--border-gold);
  background: var(--bg-card-soft);
}

.nav-circle-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Active Review Card */
.card-stack-wrap {
  position: relative;
}

.review-card {
  position: relative;
  background: linear-gradient(180deg, #162134 0%, #111927 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.22s ease, opacity 0.22s ease, border-color 0.2s;
  user-select: none;
  touch-action: pan-y;
}

.review-card.dragging {
  transition: none;
}

.review-card.status-approved,
.review-card.status-passed {
  border-color: rgba(34, 197, 94, 0.65);
}

.review-card.status-cancelled,
.review-card.status-still_broken {
  border-color: rgba(239, 68, 68, 0.65);
}

/* Card Top Strip (keeps 100% of image unobstructed) */
.card-top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #0d1522;
  border-bottom: 1px solid var(--border-subtle);
}

.card-top-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.zoom-strip-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.zoom-strip-btn:hover {
  border-color: var(--border-gold);
  color: var(--text-primary);
}

/* Card Hero Media */
.card-media-wrap {
  position: relative;
  background: #0a101b;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  aspect-ratio: 960 / 432;
}

.card-media-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0a101b;
  cursor: zoom-in;
}

.media-badge-top-left {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.media-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.media-pill.cat-decision {
  background: rgba(217, 155, 38, 0.90);
  color: #0b1018;
}

.media-pill.cat-ui_gate {
  background: rgba(56, 189, 248, 0.90);
  color: #08121f;
}

.media-pill.cat-release {
  background: rgba(168, 85, 247, 0.90);
  color: #ffffff;
}

.media-pill.cat-uat {
  background: rgba(14, 165, 233, 0.92);
  color: #06131f;
}

.media-pill.build-tag {
  background: rgba(9, 14, 23, 0.84);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.media-pill.sample-corner {
  background: rgba(245, 158, 11, 0.92);
  color: #111827;
}

.zoom-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(9, 14, 23, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #f8fafc;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(6px);
}

.zoom-btn:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--gold);
}

/* Status ribbon when already decided in preview */
.decision-banner {
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.decision-banner.approved, .decision-banner.passed {
  background: var(--approve-soft);
  color: #86efac;
  border-bottom: 1px solid rgba(34, 197, 94, 0.35);
}

.decision-banner.cancelled, .decision-banner.still_broken {
  background: var(--cancel-soft);
  color: #fca5a5;
  border-bottom: 1px solid rgba(239, 68, 68, 0.35);
}

.undo-inline-btn {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid currentColor;
  font-size: 13px;
  font-weight: 700;
  color: inherit;
}

/* Card Body */
.card-body {
  padding: 14px 16px 16px;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.card-code {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.3px;
}

.card-code.tester-code {
  color: #7dd3fc;
}

.card-time {
  font-size: 12px;
  color: var(--text-muted);
}

.card-title {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
}

/* 3-Line Owner Summary */
.summary-3lines {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.summary-3lines li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 14.5px;
  line-height: 1.48;
  color: var(--text-secondary);
}

.line-num {
  width: 21px;
  height: 21px;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Spec Pills */
.spec-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.spec-pill {
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.spec-pill.highlight {
  background: rgba(235, 186, 78, 0.11);
  border-color: rgba(235, 186, 78, 0.32);
  color: #fde68a;
}

/* Expandable detail accordion (keeps card clean on mobile) */
.spec-accordion {
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

.accordion-toggle {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 2px;
}

.accordion-toggle:hover {
  color: var(--gold);
}

.accordion-body {
  display: none;
  padding: 8px 12px 10px;
  margin-top: 4px;
  border-radius: 10px;
  background: rgba(9, 14, 23, 0.55);
  border: 1px solid var(--border-subtle);
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.accordion-body.open {
  display: block;
}

/* Tester UAT Specific Sections */
.uat-pc-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.uat-pc-left {
  display: flex;
  flex-direction: column;
}

.uat-box {
  background: rgba(9, 14, 23, 0.50);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 11px 13px;
  margin-bottom: 10px;
}

.uat-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #7dd3fc;
  margin-bottom: 4px;
}

.uat-what {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-primary);
  line-height: 1.5;
}

.uat-steps {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.uat-step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.uat-step-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.uat-step-item.checked {
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.35);
}

.uat-step-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-strong);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  color: transparent;
}

.uat-step-item.checked .uat-step-check {
  background: #22c55e;
  border-color: #22c55e;
  color: #06210f;
}

.uat-step-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.uat-step-item.checked .uat-step-text {
  color: #dcfce7;
}

.uat-expected {
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.32);
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 13.8px;
  color: #dcfce7;
}

.uat-expected strong {
  color: #86efac;
}

/* Feedback count pill inside card */
.card-feedback-note {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--feedback-soft);
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-size: 13px;
  color: #bae6fd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Primary 3-Button Action Dock (Sticky bottom on mobile, inline on tablet/PC) */
.action-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: rgba(9, 14, 23, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-strong);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
}

.action-grid {
  max-width: 780px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.act-btn {
  min-height: 52px;
  padding: 8px 10px;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.act-btn:active {
  transform: scale(0.97);
}

.act-btn-approve {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #041d0d;
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.34);
}

.act-btn-approve:hover {
  filter: brightness(1.06);
}

.act-btn-cancel {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.32);
}

.act-btn-cancel:hover {
  filter: brightness(1.06);
}

.act-btn-feedback {
  background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.30);
}

.act-btn-feedback:hover {
  filter: brightness(1.07);
}

/* Tablet Queue Strip (Up Next) */
.tablet-queue-section {
  display: none;
  margin-top: 18px;
}

.section-heading {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.queue-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.queue-item-btn {
  width: 100%;
  min-height: 60px;
  text-align: left;
  padding: 11px 13px;
  border-radius: 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s, background 0.15s;
}

.queue-item-btn:hover {
  background: var(--bg-card-soft);
  border-color: var(--border-strong);
}

.queue-item-btn.active {
  background: rgba(235, 186, 78, 0.10);
  border-color: var(--gold);
}

.queue-item-btn.active.tester-accent {
  background: rgba(56, 189, 248, 0.11);
  border-color: #38bdf8;
}

.queue-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.queue-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.status-dot-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-dot-label.pending {
  background: rgba(235, 186, 78, 0.16);
  color: var(--gold);
}

.status-dot-label.approved, .status-dot-label.passed {
  background: var(--approve-soft);
  color: #86efac;
}

.status-dot-label.cancelled, .status-dot-label.still_broken {
  background: var(--cancel-soft);
  color: #fca5a5;
}

/* Modal & Bottom Sheet Backdrop */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 7, 13, 0.78);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.sheet-backdrop.open {
  display: flex;
}

.sheet-panel {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  background: #121b2b;
  border: 1px solid var(--border-strong);
  border-radius: 22px 22px 0 0;
  padding: 16px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.55);
}

.sheet-handle {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.38);
  margin: 0 auto 12px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.sheet-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.close-icon-btn {
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 18px;
  display: grid;
  place-items: center;
}

.sheet-target-pill {
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.quick-tag-btn {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
}

.quick-tag-btn:hover, .quick-tag-btn.selected {
  background: var(--feedback-soft);
  border-color: #38bdf8;
  color: #bae6fd;
}

.field-label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.fb-textarea {
  width: 100%;
  min-height: 104px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
}

.fb-textarea:focus {
  border-color: #38bdf8;
}

.attach-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.attach-btn {
  min-height: 46px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--bg-card-soft);
  border: 1px dashed var(--border-strong);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.attach-btn:hover {
  border-color: var(--gold);
  background: rgba(235, 186, 78, 0.08);
}

.sample-attach-btn {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
}

.attach-note {
  margin: 7px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.thumb-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.thumb-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #0a101b;
  aspect-ratio: 4 / 3;
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  background: rgba(9, 14, 23, 0.84);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.confirm-preview-box {
  background: rgba(9, 14, 23, 0.65);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}

.confirm-preview-box p {
  margin: 0 0 8px;
  font-size: 14.5px;
  color: var(--text-primary);
}

.confirm-warning {
  font-size: 12.5px;
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 10px;
  padding: 9px 11px;
  margin-bottom: 14px;
}

.sheet-footer {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  margin-top: 14px;
}

.btn-secondary {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 14.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ebba4e 0%, #d99b26 100%);
  color: #0b1018;
  font-size: 14.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary.approve-solid {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #041d0d;
}

.btn-primary.cancel-solid {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
}

.btn-primary.feedback-solid {
  background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
}

/* Lightbox */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 6, 12, 0.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.lightbox-backdrop.open {
  display: flex;
}

.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
}

.lightbox-close {
  margin-top: 14px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
}

/* Toast Notification */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%) translateY(20px);
  z-index: 120;
  background: #162235;
  border: 1px solid var(--gold);
  color: var(--text-primary);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: 92vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Empty State */
.empty-state {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.empty-state p {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 14.5px;
}

/* Login Screen Styles */
.login-shell {
  max-width: 520px;
  margin: 26px auto 48px;
  padding: 0 16px;
}

.login-card {
  background: linear-gradient(180deg, #162134 0%, #101827 100%);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(9, 14, 23, 0.65);
  padding: 5px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.login-tab-btn {
  min-height: 46px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

.login-tab-btn.active {
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid var(--border-gold);
}

.login-tab-btn.active.tester-tab {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.5);
}

.totp-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.totp-digit {
  height: 52px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
}

.invite-meta-box {
  background: rgba(9, 14, 23, 0.58);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  padding: 14px;
  margin: 14px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
}

.invite-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.invite-meta-row span:first-child {
  color: var(--text-muted);
}

.invite-meta-row span:last-child {
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
}

/* ===========================
   RESPONSIVE: iPad Portrait (768px - 1199px)
   =========================== */
@media (min-width: 768px) {
  .hide-sm {
    display: inline-flex;
  }

  .portal-shell {
    max-width: 820px;
    padding: 22px 24px 48px;
  }

  .card-title {
    font-size: 22px;
  }

  .card-body {
    padding: 20px 24px 22px;
  }

  .summary-3lines li {
    font-size: 15.5px;
  }

  /* Move action dock inline inside card stage on tablet/desktop */
  .action-dock {
    position: static;
    background: transparent;
    backdrop-filter: none;
    border-top: none;
    padding: 16px 0 0;
  }

  .action-grid {
    max-width: none;
    gap: 12px;
  }

  .act-btn {
    min-height: 56px;
    font-size: 16px;
    border-radius: 15px;
  }

  .tablet-queue-section {
    display: block;
  }

  .sheet-backdrop {
    align-items: center;
    padding: 20px;
  }

  .sheet-panel {
    border-radius: 22px;
    padding: 22px 24px;
  }

  .sheet-handle {
    display: none;
  }

  .toast {
    bottom: 28px;
  }
}

/* ===========================
   RESPONSIVE: PC Desktop (>= 1200px)
   =========================== */
@media (min-width: 1200px) {
  .portal-shell {
    max-width: 1340px;
    padding: 14px 28px 24px;
  }

  .mobile-tablet-filters {
    display: none;
  }

  .tablet-queue-section {
    display: none;
  }

  .workspace-grid {
    grid-template-columns: 348px 1fr;
    gap: 24px;
  }

  .queue-rail {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(17, 25, 39, 0.78);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    position: sticky;
    top: 74px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
  }

  .rail-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .rail-filters .chip {
    min-height: 44px;
    padding: 0 11px;
    font-size: 13px;
  }

  .rail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .card-top-strip {
    padding: 6px 14px;
  }

  .card-media-wrap {
    aspect-ratio: auto;
    height: 310px;
  }

  .card-title {
    font-size: 20px;
    margin-bottom: 8px;
  }

  .card-body {
    padding: 14px 22px 14px;
  }

  .summary-3lines {
    gap: 5px;
    margin-bottom: 10px;
  }

  .summary-3lines li {
    font-size: 14.5px;
  }

  .spec-pills {
    margin-bottom: 8px;
  }

  .uat-pc-grid {
    display: grid;
    grid-template-columns: 0.88fr 1.22fr;
    gap: 12px;
    align-items: start;
  }

  .uat-box {
    padding: 9px 12px;
    margin-bottom: 8px;
  }

  .uat-steps {
    gap: 4px;
  }

  .uat-step-item {
    min-height: 44px;
    padding: 5px 9px;
  }

  .uat-step-text {
    font-size: 13.2px;
    line-height: 1.38;
  }

  .uat-expected {
    padding: 9px 12px;
    font-size: 13.4px;
  }

  .tester-page .card-media-wrap {
    height: 270px;
  }

  .action-dock {
    padding: 12px 0 0;
  }

  .act-btn {
    min-height: 52px;
  }
}

/* Compact phone tuning (<= 480px) so header, media, summary & 3 buttons fit cleanly */
@media (max-width: 480px) {
  .app-header-inner {
    padding: 8px 12px;
    gap: 8px;
  }

  .brand-crest {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .brand-name {
    font-size: 14.5px;
  }

  .brand-sub {
    display: none;
  }

  .hide-xs {
    display: none;
  }

  .swipe-hint {
    display: none;
  }

  .pending-badge {
    padding: 0 9px;
    font-size: 12px;
    gap: 5px;
  }

  .header-btn {
    padding: 0 9px;
    font-size: 12px;
  }

  .portal-shell {
    padding: 10px 12px 88px;
  }

  .filter-bar {
    gap: 6px;
    margin-bottom: 8px;
  }

  .chip {
    padding: 0 11px;
    font-size: 13px;
  }

  .nav-circle-btn {
    padding: 0 10px;
    font-size: 13px;
  }

  .card-top-strip {
    padding: 6px 10px;
  }

  .media-pill {
    font-size: 11px;
    padding: 3px 8px;
  }

  .zoom-strip-btn {
    padding: 0 9px;
    font-size: 12px;
  }

  .card-body {
    padding: 11px 13px 12px;
  }

  .card-title {
    font-size: 16.5px;
    margin-bottom: 8px;
  }

  .summary-3lines {
    gap: 5px;
    margin-bottom: 9px;
  }

  .summary-3lines li {
    font-size: 13.5px;
    line-height: 1.42;
  }

  .spec-pill {
    font-size: 11.5px;
    padding: 4px 8px;
  }

  .uat-pc-grid {
    gap: 8px;
  }

  .uat-box {
    padding: 9px 11px;
    margin-bottom: 8px;
  }

  .uat-what {
    font-size: 13.5px;
  }

  .uat-step-item {
    padding: 6px 8px;
    gap: 8px;
  }

  .uat-step-text {
    font-size: 13px;
  }

  .act-btn {
    min-height: 50px;
    font-size: 13.5px;
    padding: 6px 6px;
    gap: 4px;
  }
}
