/* =========================================================
   app-shell.css — Razor-app supplement for bootstrap-utterdeck.css
   ---------------------------------------------------------
   bootstrap-utterdeck.css is the pristine design-system drop-in
   (matches the Claude Design handoff bundle exactly). This file
   layers four things ON TOP that the design spec leaves unspecified
   because they're app-integration concerns, not design primitives:

     1. Bootstrap 5.3 `--bs-*` theme variables so components the
        spec doesn't override (accordion, offcanvas, toast, carousel,
        dropdown, popover) inherit the clay palette automatically.
     2. Paper-grain body::before overlay — the signature printed-feel
        texture described in the design README but not in utterdeck.css.
     3. Body sticky-footer flex layout so <footer> always sits at the
        bottom of the page instead of floating inside content.
     4. The two-column "app-shell" used by /Dashboard (sidebar +
        main grid): .app-sidebar, .app-main, .segments, .session-card,
        .template-tiles, .refresh-pills, .quota-chip, .user-menu-btn, etc.

   Load order: colors_and_type.css → bootstrap-utterdeck.css → this.
   ========================================================= */


/* =========================================================
   1. BOOTSTRAP 5.3 --bs-* THEME MAPPING
   ========================================================= */
:root,
[data-bs-theme="light"] {
  --bs-blue:    #4a6fa5;
  --bs-indigo:  #3d4f7a;
  --bs-purple:  #6a4c93;
  --bs-pink:    #d48aa0;
  --bs-red:     var(--clay);
  --bs-orange:  #e8823c;
  --bs-yellow:  var(--yolk);
  --bs-green:   var(--forest);
  --bs-teal:    #3a8a7a;
  --bs-cyan:    #4a8ca5;

  --bs-primary:    var(--clay);
  --bs-secondary:  var(--ink-soft);
  --bs-success:    var(--forest);
  --bs-info:       #4a8ca5;
  --bs-warning:    var(--yolk);
  --bs-danger:     var(--clay-deep);
  --bs-light:      var(--cream-2);
  --bs-dark:       var(--ink);

  --bs-primary-rgb:   232, 93, 60;
  --bs-secondary-rgb: 45, 54, 87;
  --bs-success-rgb:   45, 95, 78;
  --bs-info-rgb:      74, 140, 165;
  --bs-warning-rgb:   244, 196, 48;
  --bs-danger-rgb:    201, 74, 45;
  --bs-light-rgb:     247, 230, 210;
  --bs-dark-rgb:      30, 42, 74;

  --bs-body-bg:          var(--cream);
  --bs-body-color:       var(--ink);
  --bs-body-font-family: var(--fs-ui);
  --bs-body-font-size:   1.0625rem;
  --bs-body-font-weight: 400;
  --bs-body-line-height: 1.5;

  --bs-emphasis-color:   var(--ink);
  --bs-secondary-color:  var(--ink-mute);
  --bs-secondary-bg:     var(--cream-2);
  --bs-tertiary-color:   rgba(30, 42, 74, 0.55);
  --bs-tertiary-bg:      var(--cream-3);
  --bs-heading-color:    var(--ink);

  --bs-link-color:       var(--clay);
  --bs-link-hover-color: var(--clay-deep);
  --bs-code-color:       var(--clay-deep);
  --bs-highlight-bg:     var(--yolk);

  --bs-border-width:     1.5px;
  --bs-border-style:     solid;
  --bs-border-color:     var(--ink);
  --bs-border-color-translucent: var(--paper-line-strong);
  --bs-border-radius:     var(--r-tight);
  --bs-border-radius-sm:  var(--r-sm);
  --bs-border-radius-lg:  var(--r-card);
  --bs-border-radius-xl:  var(--r-panel);
  --bs-border-radius-xxl: 24px;
  --bs-border-radius-pill: var(--r-pill);

  --bs-box-shadow:    var(--sh-2);
  --bs-box-shadow-sm: var(--sh-1);
  --bs-box-shadow-lg: var(--sh-4);

  --bs-focus-ring-width:   3px;
  --bs-focus-ring-color:   rgba(244, 196, 48, 0.55);
  --bs-focus-ring-opacity: 1;

  --bs-font-sans-serif: var(--fs-ui);
  --bs-font-monospace:  var(--fs-mono);
}


/* =========================================================
   2. PAPER GRAIN + STICKY-FOOTER BODY LAYOUT
   ========================================================= */
html { height: 100%; }
body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(30, 42, 74, 0.04) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: multiply;
}
[data-bs-theme="dark"] body::before {
  background-image: radial-gradient(rgba(245, 234, 216, 0.04) 1px, transparent 1px);
  mix-blend-mode: screen;
}
body > header, body > footer, body > .footer { flex-shrink: 0; }
body > .container, body > .container-fluid, body > main, body > div.container { flex: 1 0 auto; }
body > footer, body > .footer { margin-top: auto; }
main, header, footer, .container, .container-fluid, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
  position: relative;
  z-index: 1;
}

/* Footer default styling (dashed rule, mono) */
footer, .footer {
  border-top: 1px dashed var(--paper-line-strong) !important;
  margin-top: 3rem;
  padding: 2rem 0 1.5rem;
  font-family: var(--fs-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
}
footer a, .footer a { color: var(--ink-soft); }
footer a:hover, .footer a:hover { color: var(--clay); }


/* =========================================================
   3. ASP.NET Core VALIDATION GLUE
   ========================================================= */
.field-validation-error, .text-danger {
  color: var(--clay-deep) !important;
  font-family: var(--fs-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.validation-summary-errors {
  background: color-mix(in oklab, var(--clay-deep) 22%, var(--cream));
  color: var(--ink);
  border: 1.5px solid var(--clay-deep);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 1rem;
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 0.92rem;
}
.validation-summary-errors ul { margin: 0.25rem 0 0 0; padding-left: 1.2rem; text-transform: none; }
.validation-summary-valid { display: none; }


/* =========================================================
   4. APP SHELL — two-column post-login layout (/Dashboard)
   ========================================================= */

body.app-shell {
  flex-direction: row;
  align-items: stretch;
  padding-top: 0;
}
/* Legacy rule targeting plain <main> (pre-app-main migration). Scoped with
   :not(.app-main) so it doesn't clobber the 48px top padding the app-main
   pages actually want. */
body.app-shell > main:not(.app-main),
body.app-shell > .container > main:not(.app-main),
body.app-shell > .container-fluid > main:not(.app-main) { padding-top: 0; }

.app-sidebar {
  width: 320px;
  flex: 0 0 320px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream-2);
  border-right: 1.5px solid var(--ink);
  padding: 0;
  overflow: hidden;
  z-index: 2;
}
.app-sidebar__brand {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--fs-display);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--paper-line);
  background: var(--cream-2);
}
.app-sidebar__brand:hover { color: var(--clay); text-decoration: none; }
.app-sidebar__brand .brand-mark {
  width: 32px; height: 32px;
  background: var(--clay);
  color: var(--cream);
  font-family: var(--fs-display);
  font-size: 1.25rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  transform: rotate(-4deg);
  box-shadow: 2px 2px 0 var(--ink);
  flex-shrink: 0;
}
.app-sidebar__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 16px 12px;
  scrollbar-gutter: stable;
}
.app-sidebar__footer {
  flex: 0 0 auto;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--paper-line);
  background: var(--cream-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* /Identity/Account/Manage sidebar navigation — same shell as the dashboard
   left column, but with a simple vertical link list specific to account
   settings. Mirrors the .segments style used elsewhere in the app. */
.manage-nav { display: flex; flex-direction: column; gap: 4px; }
.manage-nav__heading {
  font-family: var(--fs-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 4px 10px 6px;
}
.manage-nav__link {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.manage-nav__link:hover {
  background: var(--cream);
  color: var(--ink);
  border-color: var(--paper-line-strong);
  text-decoration: none;
}
.manage-nav__link.is-active {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.manage-nav__back {
  font-size: 0.88rem;
  color: var(--ink-mute);
  text-decoration: none;
}
.manage-nav__back:hover { color: var(--clay); text-decoration: none; }

.manage-title {
  font-family: var(--fs-display);
  font-size: 1.9rem;
  color: var(--ink);
  margin: 0;
  line-height: 1.15;
}

/* /Identity/Account/Manage/PersonalData — Identity UI nests the Download
   link inside a <p> (block) and the Delete submit inside a <form> (block),
   so by default the two buttons stack. Target by ID and force inline-block
   on the stacking ancestors so they sit side-by-side. */
#download-data,
#delete-user button,
#delete-user .btn {
  display: inline-block;
}
/* The <p> that wraps the Download link */
.app-main p:has(> #download-data) {
  display: inline-block;
  margin: 0 10px 0 0;
  vertical-align: top;
}
/* The Delete form itself */
form#delete-user {
  display: inline-block;
  vertical-align: top;
  margin: 0;
}

/* Creation form card */
.create-card {
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.create-card .field-help {
  font-size: 0.78rem;
  color: var(--ink-mute);
  margin-top: 3px;
  line-height: 1.4;
}
.create-card .form-label { margin-bottom: 4px; }
.create-card .form-control, .create-card .form-select { padding: 8px 12px; font-size: 0.92rem; }

/* Template picker tiles */
.template-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.template-tiles input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.template-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 1 / 1;
  border: 1.5px solid var(--paper-line-strong);
  border-radius: 6px;
  padding: 5px;
  background: var(--cream-2);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.template-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--tile-accent, var(--rose));
  opacity: 0.55;
  z-index: 0;
}
.template-tile__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.template-tile:has(> .template-tile__img)::before {
  display: none;
}
.template-tile > span {
  position: relative; z-index: 1;
  font-family: var(--fs-mono);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: var(--cream);
  border-radius: 4px;
  padding: 2px 6px;
  align-self: flex-start;
  font-weight: 500;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
input[type="radio"]:checked + .template-tile {
  border-color: var(--clay);
  box-shadow: 0 0 0 2px var(--clay-deep);
  transform: translateY(-1px);
}
input[type="radio"]:focus-visible + .template-tile {
  box-shadow: 0 0 0 3px var(--yolk);
}

/* Refresh-rate radio pills */
.refresh-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.refresh-pills input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.refresh-pill {
  display: block;
  text-align: center;
  padding: 6px 0;
  border: 1.5px solid var(--paper-line-strong);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--cream-2);
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  font-variant-numeric: tabular-nums;
  font-family: var(--fs-ui);
}
.refresh-pills input[type="radio"]:checked + .refresh-pill {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

/* Free-slide quota chip */
.quota-chip {
  padding: 12px 14px;
  background: var(--cream);
  border: 1px solid var(--paper-line-strong);
  border-radius: 10px;
}
.quota-chip .label {
  font-family: var(--fs-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}
.quota-bar {
  height: 6px;
  background: var(--cream-3);
  border: 1px solid var(--paper-line);
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0 8px;
}
.quota-bar__fill { height: 100%; background: var(--clay); transition: width 0.4s ease; }
.quota-chip .quota-meta { font-size: 0.82rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.quota-chip .quota-meta strong { color: var(--ink); font-weight: 600; }
.quota-chip .balance {
  font-size: 0.82rem; color: var(--ink-soft);
  margin-top: 7px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.quota-chip .balance strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.quota-chip .balance a { color: var(--clay); text-decoration: none; font-weight: 500; }
.quota-chip .balance a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Account dropup — Bootstrap button trigger + branded menu */
.user-menu-wrap { position: relative; }

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: var(--cream);
  border: 1.5px solid var(--paper-line-strong);
  border-radius: 12px;
  color: var(--ink);
  font-family: var(--fs-ui);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.user-menu-btn:hover,
.user-menu-btn[aria-expanded="true"] {
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(-1px, -1px);
}
.user-menu-btn:focus-visible {
  outline: 0;
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(212, 117, 78, 0.22);
}

.user-menu-btn__avatar {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--clay);
  color: var(--cream);
  border-radius: 50%;
  font-family: var(--fs-display);
  font-size: 1rem;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0;
}

.user-menu-btn__info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}
.user-menu-btn__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-btn__email {
  font-size: 0.72rem;
  color: var(--ink-mute);
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-btn__caret {
  flex: 0 0 auto;
  color: var(--ink-mute);
  font-size: 0.85rem;
  line-height: 1;
  transition: transform .2s ease, color .15s ease;
}
.user-menu-btn[aria-expanded="true"] .user-menu-btn__caret {
  transform: rotate(180deg);
  color: var(--ink);
}

/* Branded dropdown menu used by the account dropup */
.user-menu.dropdown-menu {
  --bs-dropdown-min-width: 100%;
  min-width: 100%;
  margin-bottom: 8px;
  padding: 6px;
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--fs-ui);
}
.user-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.user-menu .dropdown-item:hover,
.user-menu .dropdown-item:focus {
  background: var(--cream-3);
  color: var(--ink);
}
.user-menu .dropdown-item:active {
  background: var(--clay);
  color: var(--cream);
}
.user-menu .dropdown-item:active .user-menu__ico { color: var(--cream); }

.user-menu__ico {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-mute);
  font-size: 0.95rem;
  line-height: 1;
}
.user-menu .dropdown-item:hover .user-menu__ico { color: var(--clay); }

.user-menu .dropdown-divider {
  margin: 6px 4px;
  border-top: 1px solid var(--paper-line);
  opacity: 1;
}

.user-menu__logout-form { margin: 0; padding: 0; }

/* Main (right) pane */
.app-main {
  flex: 1 1 auto;
  /* 48px top matches Bootstrap pt-5 for consistent breathing room across all
     app-shell pages (Dashboard tabs, Summary, Explore, Manage). */
  padding: 48px clamp(40px, 4.5vw, 72px) 40px;
  overflow-y: auto;
  min-width: 0;
}
.app-main__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  padding: 0;
}

/* Segment tabs — outline-pill active */
.segments {
  display: inline-flex;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
}
.segments .segment {
  appearance: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
  font-family: var(--fs-ui);
}
.segments .segment:hover { color: var(--ink); }
.segments .segment.is-active {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

/* Search input with magnifier glyph */
.app-main__search {
  position: relative;
  width: clamp(200px, 24vw, 320px);
}
.app-main__search input {
  width: 100%;
  padding: 8px 14px 8px 34px;
  border: 1.5px solid var(--paper-line-strong);
  border-radius: 999px;
  background: var(--cream-2);
  font-size: 0.88rem;
  color: var(--ink);
  font-family: var(--fs-ui);
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.app-main__search input:focus {
  outline: 0;
  border-color: var(--clay);
  background: var(--cream);
  box-shadow: 3px 3px 0 var(--clay);
}
.app-main__search::before {
  content: "";
  position: absolute;
  top: 50%; left: 13px;
  width: 11px; height: 11px;
  border: 1.5px solid var(--ink-mute);
  border-radius: 50%;
  transform: translateY(-70%);
  pointer-events: none;
}
.app-main__search::after {
  content: "";
  position: absolute;
  top: 50%; left: 21px;
  width: 6px; height: 1.5px;
  background: var(--ink-mute);
  transform: translateY(120%) rotate(45deg);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* Card grid + session card */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.session-card {
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border: 1.5px solid var(--paper-line-strong);
  border-radius: 14px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}
.session-card:hover {
  transform: translateY(-2px);
  box-shadow: 2px 2px 0 var(--ink);
  border-color: var(--ink);
  color: inherit;
  text-decoration: none;
}
.session-card__thumb {
  aspect-ratio: 4 / 3;
  background: var(--card-accent, linear-gradient(135deg, rgba(232,168,124,0.35) 0%, var(--cream-2) 100%));
  position: relative;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--paper-line-strong);
}
.session-card__thumb::after {
  content: "";
  width: 26%;
  height: 40%;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: var(--cream);
  opacity: 0.78;
  box-shadow: 3px 3px 0 rgba(30, 42, 74, 0.12), inset 0 4px 0 var(--clay);
}
/* Suppress the placeholder card-icon when the thumb actually shows a cover image. */
.session-card__thumb:has(img)::after { display: none; }
.session-card__thumb .initial { display: none; }
.session-card__body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.session-card__title {
  font-family: var(--fs-display);
  font-size: 1.15rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.session-card__meta {
  font-size: 0.78rem;
  color: var(--ink-mute);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.session-card__meta code {
  font-family: var(--fs-mono);
  font-size: 0.72rem;
  background: var(--cream-2);
  border: 1px solid var(--paper-line);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}
.session-card__status {
  display: inline-block;
  font-family: var(--fs-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--cream-3);
  color: var(--ink-soft);
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid var(--ink);
  line-height: 1.4;
}
.session-card__status.is-live  { background: var(--clay); color: var(--cream); }
.session-card__status.is-ended { background: var(--ink); color: var(--cream); }
.session-card__status.is-demo  { background: var(--forest); color: var(--cream); }

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  padding: 48px 20px;
  text-align: center;
  background: var(--cream-2);
  border: 1.5px dashed var(--paper-line-strong);
  border-radius: 18px;
  color: var(--ink-soft);
}
.empty-state h3 { font-family: var(--fs-display); font-size: 1.35rem; color: var(--ink); margin-bottom: 6px; }
.empty-state p { margin: 0; font-size: 0.9rem; }

@media (max-width: 991.98px) {
  body.app-shell { flex-direction: column; }
  .app-sidebar {
    width: 100%;
    flex: 0 0 auto;
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1.5px solid var(--ink);
    padding: 0;
    overflow: visible;
  }
  .app-sidebar__body { overflow-y: visible; min-height: 0; padding: 14px 16px 12px; }
  .app-sidebar__brand { padding: 16px 16px 12px; }
  .app-sidebar__footer { padding: 12px 16px 16px; }
  .app-main { padding: 20px 16px 24px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}


/* =========================================================
   5. SMALL EXTRAS (reduced motion, scrollbar, mobile)
   ========================================================= */

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--paper-line-strong);
  border: 2px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
  transition: background-color 0.15s ease;
}
*::-webkit-scrollbar-thumb:hover { background-color: var(--ink-mute); background-clip: content-box; }
* { scrollbar-width: thin; scrollbar-color: var(--paper-line-strong) transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover, .card:hover, .session-card:hover, .form-control:focus { transform: none !important; }
}

@media (max-width: 575.98px) {
  .navbar { padding: 10px 14px; }
  .card-body { padding: 16px; }
  .modal-body { padding: 16px; }
  .modal-header, .modal-footer { padding: 12px 16px; }
}

/* =========================================================
   Prep page
   ========================================================= */

/* Small uppercase label used above headings on the prep shell.
   Defined here because no other stylesheet provides `.eyebrow`. */
.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

.prep-shell {
  padding: 24px clamp(20px, 4vw, 48px);
  max-width: 1100px;
  margin: 0 auto;
}

.prep-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}

.prep-status-card {
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 20px;
}

.prep-title {
  font-family: var(--fs-display);
  font-size: 1.6rem;
  margin: 4px 0 14px;
  line-height: 1.1;
}

.prep-checklist { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 12px; }
.prep-checklist li { display: flex; align-items: center; gap: 10px; }
.prep-checklist .check-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--paper-line-strong); display: inline-block; }
.prep-checklist .is-pending .check-dot { background: var(--clay); }
.prep-checklist .is-ready .check-dot { background: var(--forest); position: relative; }
.prep-checklist .is-ready .check-dot::after { content: "✓"; color: #fff; position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.85rem; font-weight: 700; }

.audio-gauge { margin-bottom: 18px; }
.audio-gauge .gauge-label { display: block; font-size: 0.72rem; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; }
.audio-gauge .gauge-bars { display: flex; gap: 2px; height: 22px; }
.audio-gauge .gauge-bar { flex: 1; background: var(--cream-3); border-radius: 2px; transition: background 0.08s linear; }
.audio-gauge .gauge-bar.is-hot { background: var(--clay); }
.audio-gauge .gauge-bar.is-warm { background: var(--clay-soft, #e8a87c); }

.btn-start { padding: 14px 20px; border-radius: 999px; font-weight: 600; }
.btn-start:disabled { background: var(--paper-line-strong); color: var(--ink-soft); cursor: not-allowed; }
.prep-hint { font-size: 0.78rem; color: var(--ink-mute); text-align: center; margin-top: 10px; }

.prep-permission-denied { margin-top: 16px; padding: 12px; background: var(--cream-2); border: 1px solid var(--paper-line-strong); border-radius: 10px; font-size: 0.85rem; }
.browser-instructions { margin-top: 10px; font-size: 0.85rem; }
.browser-instructions ol { padding-left: 18px; margin: 6px 0; }

.prep-main { display: flex; flex-direction: column; gap: 20px; }

.cover-preview { aspect-ratio: 16/9; background: var(--cream-2); border: 1.5px solid var(--ink); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink); position: relative; overflow: hidden; }
.cover-preview__placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.cover-title-echo { font-family: var(--fs-display); font-size: 2.2rem; color: var(--ink); }
.cover-state { font-size: 0.78rem; color: var(--ink-mute); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 8px; }
.cover-preview__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.share-panel { background: var(--cream); border: 1.5px solid var(--paper-line-strong); border-radius: 14px; padding: 16px 18px; }
.share-panel__row { display: flex; gap: 18px; align-items: center; margin-top: 10px; }
.qr-inline { flex: 0 0 auto; background: #fff; border: 1.5px solid var(--ink); border-radius: 8px; padding: 4px; line-height: 0; }
.qr-inline svg { display: block; }
.share-panel__text { flex: 1; min-width: 0; }
.share-panel__label { font-weight: 600; margin-bottom: 6px; }
.share-panel__url-row { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.share-panel__url { flex: 1; background: var(--cream-2); padding: 8px 10px; border-radius: 8px; border: 1px solid var(--paper-line-strong); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-panel__help { font-size: 0.78rem; color: var(--ink-mute); margin: 0; line-height: 1.4; }

/* Mobile */
@media (max-width: 720px) {
  .prep-grid { grid-template-columns: 1fr; }
  .btn-start { position: sticky; bottom: 10px; z-index: 10; }
  .share-panel__row { flex-direction: column; align-items: stretch; }
  .qr-inline { align-self: center; }
}

/* =========================================================
   Summary page
   ========================================================= */

.summary-page {
  padding: 0;
  max-width: 1100px;
  margin: 0 auto;
}

.summary-caption { margin: 14px 0 18px; }
.summary-title { font-family: var(--fs-display); font-size: 1.9rem; color: var(--ink); margin: 4px 0 8px; line-height: 1.15; }
.summary-meta { font-size: 0.85rem; color: var(--ink-mute); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.summary-meta code { background: var(--cream); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--paper-line-strong); font-family: var(--fs-mono); font-size: 0.78rem; color: var(--ink); }
.summary-meta__pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 999px;
  font-size: 0.72rem;
  font-family: var(--fs-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-main__back {
  color: var(--ink-mute);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.15s ease;
}
.app-main__back:hover { color: var(--ink); text-decoration: none; }

.segments a.segment { text-decoration: none; }

.summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 420px) 1fr;
  gap: 28px;
  align-items: start;
}

.summary-cover {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  aspect-ratio: 16/9;
  background: var(--cream-2);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.summary-cover:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); color: inherit; text-decoration: none; }
.summary-cover__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.summary-cover__placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; }
.summary-cover__title { font-family: var(--fs-display); font-size: 1.8rem; color: var(--ink); line-height: 1.1; }
.summary-cover__sub { font-size: 0.72rem; color: var(--ink-mute); letter-spacing: .12em; text-transform: uppercase; margin-top: 8px; font-family: var(--fs-mono); }
.summary-cover__overlay {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(30, 42, 74, 0.88);
  color: var(--cream);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  letter-spacing: 0.02em;
}

.summary-stats { display: flex; gap: 10px; margin-top: 14px; }
.summary-stat {
  flex: 1;
  background: var(--cream);
  border: 1px solid var(--paper-line-strong);
  border-radius: 10px;
  padding: 12px 14px;
}
.summary-stat__label {
  font-size: 0.68rem;
  color: var(--ink-mute);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-family: var(--fs-mono);
  margin-bottom: 2px;
}
.summary-stat__value {
  font-family: var(--fs-display);
  font-size: 1.4rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.summary-right { min-width: 0; }

/* Share panel */
.share-panel {
  background: var(--cream);
  border: 1.5px solid var(--paper-line-strong);
  border-radius: 14px;
  padding: 18px 20px;
}
.share-panel .eyebrow { margin-bottom: 6px; }
.share-panel__body { font-size: 0.9rem; color: var(--ink); line-height: 1.5; margin: 6px 0 14px; }

.share-panel__audio-opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
  cursor: pointer;
  padding: 10px 12px;
  background: var(--cream-2);
  border: 1px solid var(--paper-line);
  border-radius: 10px;
  transition: border-color 0.15s ease;
}
.share-panel__audio-opt:hover { border-color: var(--paper-line-strong); }
.share-panel__audio-opt input { margin-top: 3px; flex: 0 0 auto; }
.share-panel__audio-opt input[disabled] ~ div { color: var(--ink-mute); cursor: not-allowed; }
.share-panel__audio-title { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.share-panel__audio-hint { font-size: 0.78rem; color: var(--ink-mute); line-height: 1.4; margin-top: 2px; }

.btn-generate-share {
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 600;
  width: 100%;
}

/* Audience link card — contains QR + URL + Copy as one visual unit inside the summary left column. */
.share-panel__link {
  background: var(--cream);
  border: 1.5px solid var(--paper-line-strong);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 14px;
}
.share-panel__row { display: flex; gap: 14px; align-items: center; }
.share-panel__qr {
  flex: 0 0 auto;
  width: 84px; height: 84px;
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  padding: 4px;
  display: grid;
  place-items: center;
  line-height: 0;
}
.share-panel__qr svg { display: block; width: 100%; height: 100%; }
.share-panel__text { flex: 1; min-width: 0; }
.share-panel__label {
  font-family: var(--fs-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.share-panel__url-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 0; }
.share-panel__url {
  flex: 1;
  background: var(--cream-2);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--paper-line-strong);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--fs-mono);
  color: var(--ink);
  display: flex;
  align-items: center;
}
.share-panel__url-row .btn {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.82rem;
}
.share-panel__audio-toggle {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--ink);
  margin-right: 12px;
}
.btn-revoke {
  color: var(--clay-deep) !important;
  padding: 4px 10px;
}
.btn-revoke:hover { color: var(--cream) !important; background: var(--clay-deep); }

/* Download wrapper — sits below the audience link card, left-aligned pill. */
.summary-download {
  margin-top: 14px;
  display: flex;
  justify-content: flex-start;
}
.summary-download .btn-download-zip { white-space: nowrap; }

/* Legacy summary footer (kept in case any other view still uses it) */
.summary-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px dashed var(--paper-line-strong);
}
.summary-back {
  text-decoration: none;
  color: var(--ink-mute);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.15s ease;
}
.summary-back:hover { color: var(--ink); text-decoration: none; }
.btn-download-zip {
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.88rem;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.btn-download-zip.disabled {
  opacity: 0.75;
  cursor: pointer;
  pointer-events: auto;
}
.paid-chip {
  font-size: 0.62rem;
  padding: 2px 8px;
  background: var(--yolk);
  color: var(--ink);
  border-radius: 999px;
  margin-left: 6px;
  font-family: var(--fs-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

@media (max-width: 820px) {
  .summary-grid { grid-template-columns: 1fr; }
  .summary-foot { flex-direction: column-reverse; align-items: stretch; }
  .summary-back { text-align: center; padding-top: 6px; }
  .btn-download-zip { justify-content: center; }
}

/* Visibility picker (share panel) */
.vis-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 14px;
}
.vis-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--cream-2);
  border: 1.5px solid var(--paper-line-strong);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.vis-option:hover { border-color: var(--ink-mute); }
.vis-option.is-disabled { opacity: 0.55; cursor: not-allowed; }
.vis-option input[type="radio"] { margin-top: 3px; flex: 0 0 auto; accent-color: var(--clay); }
.vis-option:has(input[type="radio"]:checked) {
  border-color: var(--clay);
  background: color-mix(in oklab, var(--clay) 8%, var(--cream));
  box-shadow: 0 0 0 2px rgba(232, 93, 60, 0.15);
}
.vis-option__body { flex: 1; min-width: 0; }
.vis-option__title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.vis-option__hint {
  font-size: 0.78rem;
  color: var(--ink-mute);
  line-height: 1.45;
  margin-top: 2px;
}

.share-panel__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.share-panel__actions .btn {
  min-width: 110px;
}

.share-panel__status {
  min-height: 1.2em;
  font-size: 0.8rem;
  color: var(--ink-mute);
  font-family: var(--fs-mono);
  margin-top: 8px;
  text-align: right;
}
.share-panel__status.is-ok { color: var(--forest); }
.share-panel__status.is-err { color: var(--clay-deep); }

/* =========================================================
   Replay private page
   ========================================================= */

.replay-private { max-width: 560px; margin: 80px auto; padding: 0 20px; }
.replay-private__card {
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 32px 36px;
  text-align: center;
}
.replay-private__title { font-family: var(--fs-display); font-size: 1.8rem; color: var(--ink); margin: 8px 0 12px; }
.replay-private__body { color: var(--ink); line-height: 1.55; margin-bottom: 24px; }

/* End of app-shell.css */
