/* ===========================================================================
   Studio look (3.4.0)

   A restyle that sits on top of style.css. Nothing here adds features; it
   only changes how things look. To go back to the old look, remove the one
   <link> to this file in views/partials/head.ejs.

   The ideas:
   - A dark glass rail down the left edge instead of a floating glass box,
     with live "waiting" counts on Applications and Tickets.
   - Big, tightly set page titles in Bricolage Grotesque; Instrument Sans for
     everything you read and click.
   - Flat sheets with thin dividing lines instead of a pile of separate
     rounded, shadowed cards. The noisy yellow background shows around them.
   - Black and white only. Green and red appear only where they mean
     approved/open and rejected/danger.
   =========================================================================== */

:root,
[data-theme="light"],
[data-theme="dark"] {
  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Bricolage Grotesque", "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius-card: 14px;
  --shadow: none;
  --sidebar-w: 248px;
  --gutter: 48px;
}
html.sb-collapsed { --sidebar-w: 76px; }

body { font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: var(--font); }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; }

/* ---------------------------------------------------------------- Rail */

.sidebar {
  --text: #f5f5f5;
  --muted: rgba(255, 255, 255, 0.64);
  --faint: rgba(255, 255, 255, 0.4);
  --border: rgba(255, 255, 255, 0.14);
  --panel-solid: #151515;
  --panel-2: rgba(255, 255, 255, 0.09);
  --ink: #ffffff;
  --ink-fg: #000000;
  left: 0; top: 0; bottom: 0;
  padding: 26px 14px 14px;
  /* Dark glass. Blur alone can't show on a smooth gradient, so the glass look
     comes from three things together: a see-through dark tint (the yellow
     glow behind it shows through, strongest at the bottom), a soft sheen that
     fades down from the top, and bright hairline edges. */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 38%, rgba(255, 255, 255, 0) 100%),
    rgba(6, 6, 6, 0.66);
  color: var(--text);
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05), 12px 0 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(34px) saturate(1.9);
  -webkit-backdrop-filter: blur(34px) saturate(1.9);
}
.sb-head { padding: 0 6px 26px; }
.sidebar .sb-logo { width: auto; height: auto; border-radius: 0; background: transparent; }
.sidebar .sb-logo img { filter: none; }
.sb-brand { gap: 10px; }
.sb-brand-text strong { font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.sb-brand-text small { font-size: 12.5px; }
.sb-collapse { background: transparent; border-color: rgba(255, 255, 255, 0.18); color: var(--muted); border-radius: 8px; }
.sb-collapse:hover { color: #fff; border-color: #fff; }

.sb-group { margin-bottom: 0; }
.sb-group + .sb-group { margin-top: 20px; }
.sb-group-label { display: none; }
.sidebar .sb-item {
  padding: 9px 12px;
  margin-bottom: 4px; /* even spacing between menu items (3.8.0) */
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
}
.sidebar .sb-item:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
.sidebar .sb-item.active,
.sidebar .sb-item.active:hover { background: rgba(255, 255, 255, 0.13); color: #fff; font-weight: 650; }
.sidebar .sb-item.active::before {
  left: -14px; top: 18%; bottom: 18%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: #fff;
}
.sb-item-text { flex: 1; min-width: 0; }
.sb-count {
  margin-left: auto;
  min-width: 22px; height: 20px; padding: 0 7px;
  border-radius: 10px;
  background: #fff; color: #000;
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.sb-foot { border-top-color: rgba(255, 255, 255, 0.12); }
.acct-chip { border-radius: 10px; }
.acct-menu { border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); }
.acct-menu-item { border-radius: 8px; }

@media (min-width: 901px) {
  body:has(.sidebar) { padding-left: var(--sidebar-w); }
  html.sb-collapsed .sidebar { padding-left: 10px; padding-right: 10px; }
  html.sb-collapsed .sidebar .sb-item.active::before { left: -10px; }
  html.sb-collapsed .sb-count {
    position: absolute; top: 2px; right: 8px;
    min-width: 16px; height: 16px; padding: 0 4px;
    font-size: 10px; line-height: 16px;
  }
  html.sb-collapsed .sb-group + .sb-group { margin-top: 10px; }
}

/* ----------------------------------------------------------- Page head */

.page-head-new { padding: 52px var(--gutter) 8px; align-items: flex-end; }
.page-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 3.8vw, 3.3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}
.page-subtitle { color: var(--text); margin-top: 12px; max-width: 60ch; font-size: 15.5px; line-height: 1.45; }
.back-pill { border-radius: 8px; padding: 5px 12px 5px 8px; font-weight: 600; }
.title-actions a:not(.btn):not(.btn-primary) { border-radius: 8px; padding: 0.6rem 1rem; }

@media (min-width: 901px) {
  .app-list, .logs-page-wrap, .detail-wrap, .settings-wrap, .mb-layout, .automation-card,
  .overview-grid, .events-page-wrap {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }
}

/* ------------------------------------------------------ Sheets & rows */

.login-card, .app-row, .leaderboard-card, .archive-batch-card, .type-card, .overview-card,
.settings-section, .events-sidebar-card, .public-feature, .lb-row {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* Collapsible sections that sit next to each other read as one sheet, cut by thin lines. */
.settings-section { border-radius: var(--radius-card); }
details.settings-section { border-radius: 0; margin-bottom: 0; border-bottom-width: 0; }
details.settings-section:not(details.settings-section + details.settings-section) { border-top-left-radius: var(--radius-card); border-top-right-radius: var(--radius-card); }
details.settings-section:not(:has(+ details.settings-section)) { border-bottom-width: 1px; border-bottom-left-radius: var(--radius-card); border-bottom-right-radius: var(--radius-card); margin-bottom: 1.1rem; }
details.settings-section > summary { border-radius: 0; }
.backup-title { margin: 0 0 0.3rem; font-size: 1.05rem; }
.settings-wrap { padding-top: 0.5rem; }
.settings-intro { color: var(--text); opacity: 0.86; margin-bottom: 1.25rem; }

/* Lists of applications, tickets, log entries: one sheet cut by thin lines. */
.app-list { gap: 0; max-width: none; } /* lists end on the same edge as the page title's buttons (3.8.0) */
.app-row {
  border-radius: 0;
  border-width: 1px 1px 0 1px;
  padding: 1rem 1.35rem;
  transform: none;
}
.app-row:first-child { border-radius: var(--radius-card) var(--radius-card) 0 0; }
.app-row:last-child { border-bottom-width: 1px; border-radius: 0 0 var(--radius-card) var(--radius-card); }
.app-row:only-child { border-radius: var(--radius-card); }
.app-row:hover { transform: none; border-color: var(--border); background: var(--panel-2); }
.app-row-static:hover { background: var(--panel); }
.app-row-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; letter-spacing: -0.015em; }

.tabs { justify-content: flex-start; padding-left: var(--gutter); padding-right: var(--gutter); gap: 6px; }
.tab { border-radius: 8px; padding: 0.5rem 0.95rem; }

.settings-section-expand-controls button { background: var(--panel); color: var(--text); border-color: var(--border); }
.btn, .btn-primary, .btn-ghost, .btn-approve, .btn-reject, .btn-danger { border-radius: 8px; font-weight: 650; }
input[type="password"], input[type="text"], input[type="datetime-local"], input[type="number"], input[type="url"],
textarea, select { border-radius: 8px; }
.type-badge { border-radius: 6px; }
.status-pill { text-transform: none; letter-spacing: 0; font-size: 0.74rem; font-weight: 650; border-radius: 6px; }
.status-Pending { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--text); }
.status-Approved, .status-Open { background: var(--panel-2); color: var(--text); }
.status-Rejected, .status-Closed { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--border); }
.app-row-live-indicator { color: var(--muted); }
.app-row-arrow { color: var(--muted); }
.type-badge-plain { background: var(--panel-2); color: var(--text); }
.flash-msg { border-radius: 10px; }

.overview-card:hover, a.overview-card:hover { transform: none; }
.overview-card-icon { border-radius: 8px; }

/* ------------------------------------------------------------ Controls */

/* One look for everything you can click or type into. The old controls were
   a faint grey with a nearly invisible border, which read as "disabled" on
   top of the yellow background. They are now solid dark fields with a clear
   light edge, and they all light up the same way on hover and focus. */
:root,
[data-theme] {
  --muted: #c6c6c6;
  --faint: #9d9d9d;
  --control: #1b1b1b;
  --control-hover: #272727;
  --control-line: rgba(255, 255, 255, 0.26);
  --control-line-hover: rgba(255, 255, 255, 0.62);
  --focus-ring: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

input[type="text"], input[type="password"], input[type="search"], input[type="url"],
input[type="email"], input[type="datetime-local"], input[type="number"], textarea, select,
.cs-trigger, .num-stepper {
  background: var(--control);
  border-color: var(--control-line);
  color: var(--text);
}
input::placeholder, textarea::placeholder { color: rgba(255, 255, 255, 0.5); }
.cs-trigger-label.cs-placeholder { color: rgba(255, 255, 255, 0.5); }
input[type="text"]:hover, input[type="password"]:hover, input[type="search"]:hover, input[type="url"]:hover,
input[type="number"]:hover, textarea:hover, select:hover, .cs-trigger:hover, .num-stepper:hover {
  border-color: var(--control-line-hover);
}
input[type="text"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="url"]:focus,
input[type="datetime-local"]:focus, textarea:focus, select:focus,
.cs-trigger:focus-visible, .cs-wrapper.cs-open .cs-trigger, .num-stepper:focus-within {
  border-color: #fff;
  box-shadow: var(--focus-ring);
}
.cs-trigger .icon { color: var(--text); }
.num-stepper-btn { color: var(--text); }
.num-stepper-btn.minus, .num-stepper-btn.plus { border-color: var(--control-line); }
.num-stepper-btn:hover:not(:disabled) { background: var(--control-hover); }

/* Dropdown list */
.cs-panel {
  background: #151515;
  border-color: var(--control-line);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
}
.cs-option { border-radius: 6px; }
.cs-option.active, .cs-option:hover { background: rgba(255, 255, 255, 0.11); }
.cs-option.selected::after { background: #fff; }
.cs-group-label { text-transform: none; letter-spacing: 0; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.cs-empty { color: var(--muted); }

/* Checkboxes, radios and switches */
input[type="checkbox"], input[type="radio"] { background: var(--control); border-color: var(--control-line); }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--control-line-hover); }
input[type="checkbox"]:checked, input[type="radio"]:checked { background: #f5f5f5; border-color: #f5f5f5; }
input[type="checkbox"]:checked::after { border-color: #0f0f0f; }
input[type="radio"]:checked::after { background: #0f0f0f; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
input[type="checkbox"].mb-switch { background: var(--control); border-color: var(--control-line); }
input[type="checkbox"].mb-switch::after { background: var(--muted); }
input[type="checkbox"].mb-switch:checked { background: #f5f5f5; border-color: #f5f5f5; }
input[type="checkbox"].mb-switch:checked::after { background: #0f0f0f; }
input[type="checkbox"].mb-switch:hover { border-color: var(--control-line-hover); }
input[type="checkbox"].mb-switch:checked:hover { border-color: #fff; }

/* Secondary buttons (the "ghost" family) */
.btn-ghost, .icon-btn, .tab, .back-pill, .mb-add-section-btn, .mb-add-row-btn, .mb-mention-btn,
.title-actions a:not(.btn):not(.btn-primary) {
  background: var(--control);
  color: var(--text);
  border: 1px solid var(--control-line);
}
.btn-ghost:hover, .icon-btn:hover, .tab:hover, .back-pill:hover, .mb-add-section-btn:hover, .mb-add-row-btn:hover,
.mb-mention-btn:hover, .title-actions a:not(.btn):not(.btn-primary):hover {
  background: var(--control-hover);
  color: var(--text);
  border-color: var(--control-line-hover);
}
.tab.active, .tab.active:hover { background: #f5f5f5; color: #0f0f0f; border-color: #f5f5f5; }
.btn-primary { background: #f5f5f5; color: #0f0f0f; }
.icon-btn-danger:hover { color: #ff9b9d; border-color: var(--red); }
.page-subtitle { opacity: 0.86; }

/* Labels read as normal sentence-case text everywhere, not small caps. */
.field-group > label, .attachment-block label, .review-form-large label, .ticket-meta-item label,
.mb-channel-label, .mb-content-box-heading, .dm-preview-row-label, .leaderboard-card-head,
.field-group-heading, .role-group-heading, .mb-cv2-header, .mb-preview-tab, .calendar-weekday,
.mention-popup-section-label {
  text-transform: none;
  letter-spacing: 0;
}
.field-group > label, .attachment-block label, .review-form-large label, .ticket-meta-item label,
.mb-channel-label, .dm-preview-row-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}
.field-group-heading, .role-group-heading, .mb-content-box-heading, .leaderboard-card-head { font-size: 0.92rem; font-weight: 700; color: var(--text); }

/* Warnings and notices: plain light-on-dark with a clear edge, no amber. */
.settings-warning {
  background: var(--control);
  color: var(--text);
  border: 1px solid var(--control-line);
  border-left: 3px solid #f5f5f5;
  border-radius: 8px;
}
.flash-msg { background: var(--control); color: var(--text); border: 1px solid var(--control-line); border-radius: 8px; }

/* Number steppers and colour pickers are the same height as the text fields next to them. */
.num-stepper { min-height: 2.6rem; }
.num-stepper-input.num-stepper-input { padding: 0.55rem 0.5rem; }
.num-stepper-btn { width: 2.6rem; }
.mb-color-row input[type="color"] { background: var(--control); border-color: var(--control-line); min-height: 2.6rem; }
.mb-color-row input[type="color"]:hover { border-color: var(--control-line-hover); }

/* ------------------------------------------------------------ Overview */

body:has(.ov) .page-head-new {
  /* The big sentence below is the headline; the h1 stays for screen readers. */
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.ov-flash { margin: 20px var(--gutter) 0; max-width: 1100px; }
.ov { max-width: 1180px; padding: 56px var(--gutter) 64px; }

.ov-lede { margin-bottom: 40px; }
.ov-sentence {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.6vw, 3.9rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.04em;
  max-width: 15em;
  text-wrap: balance;
}
.ov-sentence a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.12em;
}
.ov-sentence a:hover { text-decoration-thickness: 0.14em; }
.ov-aside { margin: 18px 0 0; max-width: 52ch; color: var(--muted); font-size: 15.5px; }

.ov-sheet {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.ov-sec { padding: 26px 28px 28px; min-width: 0; }
.ov-sec:nth-child(n + 3) { border-top: 1px solid var(--border); }
.ov-sec:nth-child(even) { border-left: 1px solid var(--border); }
.ov-sec h2 { margin: 0 0 14px; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.025em; }
.ov-sec h2 a { color: inherit; text-decoration: none; }
.ov-sec h2 a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.ov-figure { margin: 0; color: var(--muted); }
.ov-figure strong { color: var(--text); font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; letter-spacing: -0.04em; margin-right: 0.15em; }
.ov-empty, .ov-note { margin: 0; color: var(--muted); font-size: 14px; max-width: 42ch; }
.ov-note { margin-top: 14px; font-size: 13px; }

/* Bars and legends are plain shades of the page colour: the darkest one is the thing waiting on you. */
.stat-bar { height: 8px; border-radius: 4px; margin-top: 16px; background: var(--panel-2); }
.seg-pending, .seg-open { background: var(--text); }
.seg-approved { background: var(--muted); }
.seg-rejected, .seg-closed { background: var(--faint); }
.legend-dot { border-radius: 2px; }
.seg-c0 { fill: var(--text); background: var(--text); }
.seg-c1 { fill: var(--muted); background: var(--muted); }
.seg-c2 { fill: var(--faint); background: var(--faint); }
.donut-chart path { stroke: var(--panel-solid); stroke-width: 1.5; }

.ov-donuts { display: flex; flex-wrap: wrap; gap: 22px 32px; }
.donut-mini .donut-wrap { width: 5rem; height: 5rem; }
.donut-mini .donut-center-value { font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; }
.donut-mini .donut-center-label { font-size: 0.66rem; }
.chart-legend-compact { font-size: 0.8rem; }

/* The server numbers read like a ledger: name on the left, figure on the right. */
.ov-ledger { margin: 0; }
.ov-ledger > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}
.ov-ledger > div:first-child { border-top: 0; padding-top: 0; }
.ov-ledger dt { color: var(--muted); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
.ov-ledger dt small { font-size: 13px; color: var(--faint); }
.ov-ledger dt a { color: inherit; text-decoration: none; }
.ov-ledger dt a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 0.2em; }
.ov-ledger dd {
  margin: 0; text-align: right;
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.ov-list { list-style: none; margin: 0; padding: 0; }
.ov-list li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}
.ov-list li:first-child { border-top: 0; padding-top: 0; }
.ov-list-main { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1; }
.ov-list-main strong { font-weight: 650; }
.ov-list-main small { color: var(--muted); font-size: 13px; }
.ov-list-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.ov-list-text strong { color: var(--text); margin-right: 6px; }
.ov-list-time { flex-shrink: 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ov-list .type-badge { flex-shrink: 0; }

/* The one entrance: the headline sentence settles in once on load. */
@media (prefers-reduced-motion: no-preference) {
  .ov-sentence { animation: ov-settle 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  @keyframes ov-settle { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

/* -------------------------------------------------------------- Phones */

@media (max-width: 900px) {
  :root, [data-theme="light"], [data-theme="dark"] { --gutter: 16px; }
  .sidebar { background: rgba(6, 6, 6, 0.9); box-shadow: 0 0 60px rgba(0, 0, 0, 0.45); }
  .page-head-new { padding: 22px var(--gutter) 6px; }
  .page-title { font-size: clamp(2rem, 9vw, 2.6rem); }
  .m-top { background: rgba(0, 0, 0, 0.88); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); color: #fff; border-bottom-color: rgba(255, 255, 255, 0.12); }
  .m-top .m-icon-btn { color: #fff; }
  .m-title { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; font-size: 17px; }
  .m-tabs { background: rgba(0, 0, 0, 0.88); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top-color: rgba(255, 255, 255, 0.12); }
  .m-tab { color: rgba(255, 255, 255, 0.62); border-radius: 8px; }
  .m-tab.active { color: #fff; }
  .m-tab.active .m-tab-ico, .m-tab-ico { border-radius: 8px; }
  .m-tab.active .m-tab-ico { background: rgba(255, 255, 255, 0.16); color: #fff; }
  .ov { padding: 30px var(--gutter) 40px; }
  .ov-lede { margin-bottom: 28px; }
  .ov-sheet { grid-template-columns: 1fr; }
  .ov-sec { padding: 22px 20px 24px; }
  .ov-sec:nth-child(n + 2) { border-top: 1px solid var(--border); }
  .ov-sec:nth-child(even) { border-left: 0; }
  .app-row { padding: 0.9rem 1rem; }
}

/* Account menu: label text always visible, never wraps or inherits a faded colour. */
.acct-menu-item { color: var(--text); font-weight: 500; white-space: nowrap; opacity: 1; }
.acct-menu-item.danger { color: #ff6b6b; }
.acct-menu-item svg { flex: none; }

/* ------------------------------------------------------ Settings pop-up */
/* One pop-up for every settings page (partials/shell-open.ejs, js/settings-modal.js).
   The panel is the same dark glass as the side menu, so it reads as part of it. */

html.set-open { overflow: hidden; }
.set-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.set-modal[hidden] { display: none; }
.set-modal-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.set-modal-panel {
  --text: #f5f5f5;
  --muted: rgba(255, 255, 255, 0.64);
  --border: rgba(255, 255, 255, 0.14);
  position: relative;
  width: min(1180px, 100%); height: min(860px, 100%);
  display: grid; grid-template-columns: 216px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  border-radius: 18px; overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.015) 30%, rgba(255, 255, 255, 0) 100%),
    rgba(8, 8, 8, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 30px 80px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(34px) saturate(1.9); -webkit-backdrop-filter: blur(34px) saturate(1.9);
  color: var(--text);
}
.set-modal-head {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 16px 14px 24px;
  border-bottom: 1px solid var(--border);
}
.set-modal-head h2 { margin: 0; font-size: 1.55rem; font-weight: 800; line-height: 1.1; color: #fff; }
.set-modal-close {
  width: 38px; height: 38px; padding: 0; border-radius: 10px;
  background: var(--control); color: #fff; border: 1px solid var(--control-line);
}
.set-modal-close:hover { background: var(--control-hover); border-color: var(--control-line-hover); }
.set-modal-tabs {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 10px; border-right: 1px solid var(--border); overflow-y: auto;
}
.set-modal-tab {
  width: 100%; justify-content: flex-start; gap: 12px;
  padding: 10px 12px; border-radius: 8px;
  background: transparent; color: rgba(255, 255, 255, 0.72);
  font-size: 14px; font-weight: 500; text-align: left;
}
.set-modal-tab:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.set-modal-tab[aria-selected="true"] { background: rgba(255, 255, 255, 0.13); color: #fff; font-weight: 650; }
.set-modal-tab svg { flex: none; }
.set-modal-close:focus-visible, .set-modal-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.set-modal-body { position: relative; min-width: 0; min-height: 0; }
.set-modal-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; color-scheme: dark; }
.set-modal-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; pointer-events: none; }
.set-modal-loading[hidden] { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .set-modal:not([hidden]) .set-modal-scrim { animation: set-fade 0.18s ease both; }
  .set-modal:not([hidden]) .set-modal-panel { animation: set-rise 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  @keyframes set-fade { from { opacity: 0; } }
  @keyframes set-rise { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
}

@media (max-width: 900px) {
  .set-modal { padding: 0; }
  .set-modal-panel { width: 100%; height: 100%; border: 0; border-radius: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
  .set-modal-head { padding: calc(12px + env(safe-area-inset-top)) 12px 12px 16px; }
  .set-modal-tabs { flex-direction: row; overflow-x: auto; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--border); scrollbar-width: none; }
  .set-modal-tabs::-webkit-scrollbar { display: none; }
  .set-modal-tab { width: auto; flex: none; white-space: nowrap; padding: 8px 12px; }
}

/* A settings page shown inside the pop-up (html.in-modal, set by sb-init.js):
   no menus, no yellow background (the pop-up's glass is behind it), and on a
   tab's own page no title or back link, since the tab already names it. */
html.in-modal .sidebar, html.in-modal .sb-scrim, html.in-modal .m-top, html.in-modal .m-tabs, html.in-modal .set-modal { display: none; }
html.in-modal body { padding: 0; background: transparent; }
html.in-modal body::before, html.in-modal body::after { display: none; }
html.in-modal .page-head-new { padding: 22px 28px 0; }
html.in-modal .page-title { font-size: 1.6rem; }
html.in-modal .page-subtitle { display: none; }
html.in-modal-root .page-head-new, html.in-modal-root .settings-wrap > h1 { display: none; }
html.in-modal .settings-wrap { max-width: none; padding: 24px 28px 96px; }

/* --------------------------------------------- Msg Builder tabs (3.8.0) */
/* The tab row and the field boxes on the compose page. */

.msg-tabs { padding-top: 18px; }
.mb-title-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.mb-title-field input { font-size: 16px; font-weight: 600; }
.mb-title-field .field-note { margin: 0; }

.mb-editor-col { min-width: 0; }

.mb-type-pick { display: flex; align-items: center; gap: 8px; }
.mb-type-pick > select, .mb-type-pick > .cs-wrapper { flex: 1; min-width: 0; }

/* Msg Builder footer (3.9.1): Save as Template, Save Draft, Schedule and Send
   on one row. Only wraps on phone-sized screens. */
.mb-actions-footer, .mb-actions-footer-left, .mb-actions-footer-right { flex-wrap: nowrap; }
.mb-actions-footer { gap: 0.5rem; }
.mb-actions-footer-left, .mb-actions-footer-right { gap: 0.5rem; min-width: 0; }
.mb-actions-footer .btn, .mb-actions-footer .btn-ghost, .mb-send-btn { padding: 0.65rem 1rem; white-space: nowrap; }
@media (max-width: 700px) {
  .mb-actions-footer, .mb-actions-footer-left, .mb-actions-footer-right { flex-wrap: wrap; }
}

/* Msg Builder "restore from this browser" bar (3.9.3). */
.mb-restore-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 14px; padding: 12px 14px;
  background: var(--control); border: 1px solid var(--control-line-hover); border-radius: 10px;
}
.mb-restore-bar p { margin: 0; color: var(--text); font-size: 14px; line-height: 1.5; }
.mb-restore-actions { display: flex; gap: 8px; flex: none; }
@media (max-width: 700px) {
  .mb-restore-bar { flex-direction: column; align-items: flex-start; }
}

/* ------------------------------------------------ Tooltips (3.10.0) */
/* tooltips.js: details live in a tooltip shown after 3 s of hover. Labels
   carry no marker (no underline or icon since 3.12.0, Jeff's call). */
.ui-tip {
  position: fixed; z-index: 300; max-width: 320px; padding: 10px 12px;
  background: rgba(18, 18, 18, 0.96); color: #f5f5f5;
  border: 1px solid var(--control-line); border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  font-size: 13px; font-weight: 500; line-height: 1.5; text-align: left;
  pointer-events: none; opacity: 0; transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.ui-tip.is-below { transform: translateY(-4px); }
.ui-tip.is-on { opacity: 1; transform: none; }

/* ------------------------------------- Msg Builder list tabs (3.10.0) */
/* Icons on the tab names, and New Message on the same row, right side. */
.msg-tabs { align-items: center; }
.msg-tabs .tab { display: inline-flex; align-items: center; gap: 7px; }
.msg-tabs-new { margin-left: auto; }

/* --------------------------------------- Msg Builder compose (3.10.0) */
/* Add Message, Save as Template and Notification settings on one row. */
.mb-tool-row { display: flex; gap: 0.6rem; }
.mb-tool-btn {
  flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.65rem 0.9rem; border-radius: 10px; font-size: 0.88rem; font-weight: 600; white-space: nowrap;
  background: var(--control); color: var(--text); border: 1px solid var(--control-line);
}
.mb-tool-btn:hover, .mb-tool-btn.is-open { background: var(--control-hover); border-color: var(--control-line-hover); }
.mb-tool-btn .mb-counter { margin-left: 2px; }
.mb-notify-settings[hidden] { display: none; }
.mb-notify-settings .mb-notify-body { padding-top: 1.1rem; }
@media (max-width: 700px) {
  .mb-tool-row { flex-wrap: wrap; }
}

/* Add-a-component tiles: one row, icon only (the name is the tooltip). */
.mb-cv2-add-grid { display: flex; gap: 0.5rem; }
.mb-cv2-tile { flex: 1; min-width: 0; height: 44px; padding: 0; flex-direction: row; }

/* Save / send status: a small toast at the bottom of the screen, so it's
   always in view (replaces the text next to the page title). */
.mb-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 250;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px 10px 14px; max-width: calc(100vw - 32px);
  background: rgba(18, 18, 18, 0.94); color: #f5f5f5;
  border: 1px solid var(--control-line); border-radius: 999px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  font-size: 14px; font-weight: 600;
  opacity: 0; transform: translate(-50%, 18px) scale(0.96); pointer-events: none;
  transition: opacity 0.2s ease, transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
.mb-toast.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.mb-toast-icon { display: inline-flex; flex: none; }
.mb-toast.is-ok .mb-toast-icon { color: var(--green); }
.mb-toast.is-error .mb-toast-icon { color: #ff9b9d; }
.mb-toast-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22); border-top-color: #fff;
  animation: mb-toast-spin 0.7s linear infinite;
}
@keyframes mb-toast-spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) {
  .mb-toast { bottom: 88px; } /* above the phone tab bar */
}
@media (prefers-reduced-motion: reduce) {
  .mb-toast, .ui-tip { transition: opacity 0.15s ease; transform: translate(-50%, 0); }
  .ui-tip { transform: none; }
}

/* ------------------------------ Collapsed sidebar: square items (3.10.0) */
@media (min-width: 901px) {
  html.sb-collapsed { --sidebar-w: 68px; }
  html.sb-collapsed .sidebar { padding-left: 12px; padding-right: 12px; }
  html.sb-collapsed .sidebar .sb-item { width: 44px; height: 44px; padding: 0; justify-content: center; }
  html.sb-collapsed .sidebar .sb-item.active::before { left: -12px; }
  html.sb-collapsed .sb-count { right: 2px; }
}

/* ---------------------------- Application modal editor (3.11.0) */
/* settings-type.ejs: laid out like a Message Builder message. It's usually
   opened in the Message Builder's pop-up (about 980px wide), so the preview
   stays beside the editor down to 760px instead of the builder's 1100px. */
.type-layout { grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); }
@media (max-width: 1100px) {
  .type-layout { grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); }
  .type-layout .mb-preview-pane { position: sticky !important; max-height: calc(100vh - 2rem) !important; }
}
@media (max-width: 760px) {
  .type-layout { grid-template-columns: 1fr; }
  .type-layout .mb-preview-pane { position: static !important; max-height: none !important; }
}
html.in-modal .type-layout { padding: 20px 24px 96px; }
.type-questions-head { margin-bottom: 0; }
.type-question-card .mb-embed-card-title { min-width: 0; }
.type-question-card .mb-embed-card-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-question-card .icon-btn[disabled] { visibility: hidden; } /* no faded controls: an unavailable move isn't shown */

/* The preview: Discord's own modal look (greys like the message preview;
   buttons use the site accent, same as .mb-prev-btn-primary). */
.type-prev-modal { background: #313338; border: 1px solid #1e1f22; border-radius: 10px; overflow: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.type-prev-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 8px; color: #f2f3f5; }
.type-prev-head svg { color: #b5bac1; flex: none; }
.type-prev-title { font-size: 1.05rem; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.type-prev-field { padding: 8px 16px; }
.type-prev-label { font-size: 0.82rem; font-weight: 700; color: #dbdee1; margin-bottom: 6px; overflow-wrap: anywhere; }
.type-prev-req { color: #f23f42; }
.type-prev-input {
  background: #1e1f22; border-radius: 6px; padding: 9px 10px; min-height: 38px;
  color: #6d6f78; font-size: 0.88rem; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.type-prev-input.is-paragraph { min-height: 76px; white-space: normal; }
.type-prev-empty { padding: 8px 16px; color: #949ba4; font-size: 0.88rem; }
.type-prev-foot { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 8px; padding: 14px 16px; background: #2b2d31; }
.type-prev-cancel { color: #f2f3f5; font-size: 0.85rem; font-weight: 500; }
.type-prev-btn { display: inline-block; padding: 7px 16px; border-radius: 4px; background: var(--accent); color: var(--accent-fg); font-size: 0.85rem; font-weight: 600; }
.type-prev-continue { display: flex; justify-content: center; }
.type-prev-dm { background: #2b2d31; border-radius: 10px; padding: 12px 14px; font-size: 0.9rem; color: #dbdee1; }
.type-prev-dm-head { font-size: 0.75rem; font-weight: 700; color: #949ba4; margin-bottom: 6px; }

/* New Modal menu on the Modals tab's row (3.11.2). */
.msg-new-menu { position: relative; }
.msg-new-menu > summary { list-style: none; cursor: pointer; }
.msg-new-menu > summary::-webkit-details-marker { display: none; }
.msg-new-menu-list {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30;
  display: flex; flex-direction: column; min-width: 190px; padding: 6px;
  background: #151515; border: 1px solid var(--control-line); border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
.msg-new-menu-list a { padding: 8px 10px; border-radius: 7px; color: var(--text); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.msg-new-menu-list a:hover { background: var(--control-hover); }
.msg-empty-card .btn + .btn { margin-left: 8px; }

/* Ticket modal preview extras (3.11.2). */
.type-prev-desc { margin: -2px 0 6px; color: #b5bac1; font-size: 0.78rem; }

/* ------------------------------- Modal editor fields (3.12.0) */
/* settings-type.js / ticket-type.js: every field is a name row (name on the
   left, a subtle used/max counter on the right) above its control, with
   even spacing inside a card. */
.type-field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.type-field-head > label { margin: 0; font-size: 0.86rem; font-weight: 600; color: var(--text); text-transform: none; letter-spacing: 0; }
.type-field-head > .mb-channel-label { margin: 0; }
.type-field-count { color: var(--faint); font-size: 0.72rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.type-layout .mb-cv2-card-body { display: flex; flex-direction: column; gap: 14px; }
.type-layout .mb-cv2-card-body > [hidden] { display: none; }
.type-layout .mb-cv2-card-body .field-group,
.type-layout .mb-cv2-card-body .field-row .field-group { margin: 0; }
.type-layout .mb-cv2-card-body .field-row { gap: 12px; }
.type-layout .mb-cv2-card-body input, .type-layout .mb-cv2-card-body textarea, .type-layout .mb-cv2-card-body select { margin-bottom: 0; }
.type-type-row { align-items: end; }
.type-required { justify-self: start; align-self: center; margin-top: 22px; gap: 10px; font-size: 0.88rem; font-weight: 600; }
.type-required[hidden] { display: none; }
.type-card-icon { display: inline-flex; color: var(--muted); }
.type-question-card .mb-embed-card-title { min-width: 0; }
.type-question-card .mb-embed-card-title > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-options { display: flex; flex-direction: column; gap: 8px; }
.type-options:empty { display: none; }
.type-option-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.type-add-option { margin-top: 8px; padding: 0.5rem 0.85rem; }
.type-add-option[hidden] { display: none; }
.type-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.type-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--control); border: 1px solid var(--control-line); font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.type-chip:hover { border-color: var(--control-line-hover); }
@media (max-width: 700px) {
  .type-option-row { grid-template-columns: 1fr auto; }
  .type-option-row > input:nth-child(2) { grid-column: 1; }
}

/* Preview of the new answer types, in Discord's own modal look. */
.type-prev-desc { margin: -2px 0 8px; color: #b5bac1; font-size: 0.78rem; line-height: 1.35; }
.type-prev-select { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.type-prev-select svg { color: #b5bac1; flex: none; }
.type-prev-choices { display: flex; flex-direction: column; gap: 4px; }
.type-prev-choice { display: flex; align-items: flex-start; gap: 10px; padding: 6px 2px; color: #dbdee1; font-size: 0.88rem; }
.type-prev-radio, .type-prev-box { flex: none; width: 18px; height: 18px; margin-top: 1px; border: 2px solid #80848e; }
.type-prev-radio { border-radius: 50%; }
.type-prev-box { border-radius: 5px; }
.type-prev-choice-label { display: block; }
.type-prev-choice-desc { display: block; color: #949ba4; font-size: 0.78rem; }
.type-prev-upload {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 12px;
  background: #1e1f22; border: 1px solid #3f4147; border-radius: 8px; color: #949ba4; text-align: center;
}
.type-prev-upload svg { color: #f2f3f5; }
.type-prev-upload-main { color: #b5bac1; font-size: 0.92rem; }
.type-prev-link { color: #f2f3f5; text-decoration: underline; }
.type-prev-upload-sub { font-size: 0.75rem; }
.type-prev-info { padding: 8px 16px; color: #dbdee1; font-size: 0.88rem; line-height: 1.45; overflow-wrap: anywhere; }
.type-prev-info code { background: #2b2d31; border-radius: 4px; padding: 0 4px; font-size: 0.82rem; }
.type-prev-info .md-heading { font-size: 1rem; }

/* Files on the application page (3.12.0). */
.qa-files { display: flex; flex-wrap: wrap; gap: 8px; white-space: normal; }

/* Per-type question setup (3.12.1): options start with the control the
   applicant sees (round for Single choice, square for Multiple choice and
   the Checkbox, a dot for Dropdown); clicking it makes it picked when the
   form opens. */
.type-option-row { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto; }
.type-opt-mark {
  position: relative; flex: none; width: 22px; height: 22px; padding: 0;
  background: var(--control); border: 2px solid var(--control-line-hover); border-radius: 6px; cursor: pointer;
}
.type-opt-mark:hover { border-color: #fff; }
.type-options.is-radio .type-opt-mark { border-radius: 50%; }
.type-options.is-select .type-opt-mark { border-radius: 50%; width: 14px; height: 14px; margin: 0 4px; }
.type-opt-mark.is-on { background: #f5f5f5; border-color: #f5f5f5; }
.type-opt-mark.is-on::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 50%;
  background: #0f0f0f; transform: translate(-50%, -50%);
}
.type-opt-mark.is-box.is-on::after, .type-options.is-checkboxes .type-opt-mark.is-on::after {
  width: 10px; height: 6px; border-radius: 0; background: none;
  border-left: 2px solid #0f0f0f; border-bottom: 2px solid #0f0f0f; transform: translate(-50%, -65%) rotate(-45deg);
}
.type-options.is-select .type-opt-mark.is-on::after { display: none; }
.type-check-row {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  background: var(--control); border: 1px solid var(--control-line); border-radius: 10px;
}
.type-check-text { display: block; font-weight: 600; overflow-wrap: anywhere; }
.type-check-note { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
@media (max-width: 700px) {
  .type-option-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .type-option-row > input:nth-child(3) { grid-column: 2; }
}

/* Preview: what starts picked, ticked or filled in. */
.type-prev-input.is-filled { color: #dbdee1; }
.type-prev-radio.is-on { border-color: #f5f5f5; box-shadow: inset 0 0 0 3px #313338; background: #f5f5f5; }
.type-prev-box.is-on { border-color: #f5f5f5; background: #f5f5f5; }

/* ----------------------------------------------- Theater page (3.13.0) */
.theater-wrap { display: flex; flex-direction: column; gap: 18px; }
.theater-card { background: var(--panel); border: 1px solid var(--control-line); border-radius: var(--radius-card); padding: 18px 20px; }
.theater-card h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1.1rem; }
.theater-card .settings-intro { margin: 0 0 12px; }
.theater-discord summary { list-style: none; cursor: pointer; }
.theater-discord summary::-webkit-details-marker { display: none; }
.theater-discord summary h2 { margin: 0; }
.theater-discord[open] summary h2 { margin-bottom: 12px; }
.theater-steps { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 8px; line-height: 1.55; }
.theater-code { margin: 8px 0 0; padding: 10px 12px; background: var(--control); border: 1px solid var(--control-line); border-radius: 8px; font-size: 12.5px; white-space: pre-wrap; word-break: break-all; }
.theater-table { margin-top: 8px; border-collapse: collapse; }
.theater-table th, .theater-table td { padding: 6px 14px 6px 0; text-align: left; }
.theater-table th { color: var(--muted); font-weight: 600; font-size: 0.82rem; }
.theater-upload { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.theater-upload .field-group { margin: 0; }
.theater-upload-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.theater-progress { flex: 1; min-width: 160px; height: 8px; background: var(--control); border: 1px solid var(--control-line); border-radius: 999px; overflow: hidden; }
.theater-progress-bar { width: 0; height: 100%; background: #f5f5f5; transition: width 0.2s ease; }
.theater-progress-text { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.theater-films { padding: 0; }
.theater-film { align-items: center; }
.theater-poster { flex: none; width: 40px; height: 56px; margin-right: 14px; border-radius: 6px; background: var(--control) center / cover no-repeat; border: 1px solid var(--control-line); }
.theater-upload input[type="file"] {
  width: 100%; padding: 7px; background: var(--control); border: 1px solid var(--control-line); border-radius: 10px;
  color: var(--muted); font: inherit; font-size: 0.88rem; cursor: pointer;
}
.theater-upload input[type="file"]:hover { border-color: var(--control-line-hover); }
.theater-upload input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 6px 12px; border-radius: 7px; border: 1px solid var(--control-line);
  background: var(--control-hover); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.theater-card > .field-note-keep { margin: 12px 0 0; }

/* Modal preview: the Continue message between pages and the page-end notice (3.14.0). */
.type-prev-continue-msg { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.type-prev-h1 { font-size: 1.35rem; font-weight: 800; color: #f2f3f5; line-height: 1.25; }
.type-prev-btn.is-grey { background: #4e5058; color: #fff; margin-top: 4px; }
.type-prev-note .md-subtext { color: #949ba4; font-size: 0.8rem; }

/* Task list (3.17.0): views/tasks.ejs and tasks-settings.ejs. */
.tl-wrap { max-width: none; }
.tl-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
.tl-projects { display: flex; flex-direction: column; gap: 6px; }
.tl-project { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--control-line); border-radius: 10px; background: var(--control); color: #fff; text-decoration: none; }
.tl-project:hover { border-color: var(--control-line-hover); background: var(--control-hover); }
.tl-project.active { border-color: #fff; }
.tl-project-name { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.tl-project-meta { color: var(--muted); font-size: 0.8rem; }
.tl-mini-bar, .tl-bar { display: block; height: 6px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; }
.tl-mini-bar span, .tl-bar span { display: block; height: 100%; background: #fff; border-radius: 99px; }
.tl-bar { height: 10px; margin-top: 12px; }
.tl-bar-text { color: var(--muted); margin: 8px 0 0; }
.tl-tag { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--control-line); color: var(--muted); }
.tl-new { margin-top: 8px; }
.tl-new > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tl-new > summary::-webkit-details-marker { display: none; }
.tl-form { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.tl-title { font-family: var(--font-display); font-size: 1.6rem; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
.tl-head { margin-bottom: 18px; }
.tl-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--control-line); background: var(--control); color: #fff; text-decoration: none; font-size: 0.85rem; }
.tl-chip:hover { border-color: var(--control-line-hover); }
.tl-chip.active { background: #fff; color: #000; border-color: #fff; }
.tl-chip-count { font-weight: 700; }
.tl-group { margin-bottom: 18px; }
.tl-group-title { font-size: 0.95rem; color: var(--muted); margin: 0 0 6px; }
.tl-task { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.1); }
.tl-task form { margin: 0; }
.tl-check { width: 22px; height: 22px; margin-top: 1px; border-radius: 6px; border: 1.5px solid var(--control-line-hover); background: var(--control); color: #000; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.tl-check:hover:not(:disabled) { border-color: #fff; }
.tl-check:disabled { cursor: not-allowed; opacity: .55; }
.tl-task.is-done .tl-check { background: #fff; border-color: #fff; }
.tl-task-body { flex: 1; min-width: 0; }
.tl-task-title { font-weight: 600; }
.tl-task.is-done .tl-task-title { text-decoration: line-through; color: var(--muted); }
.tl-task-details { color: var(--muted); font-size: 0.88rem; margin-top: 2px; white-space: pre-wrap; }
.tl-task-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--faint); font-size: 0.8rem; margin-top: 4px; }
.tl-task-meta span, .tl-task-meta a { display: inline-flex; align-items: center; gap: 4px; }
.tl-task-meta a { color: var(--muted); }
.tl-card { border: 1px solid var(--control-line); border-radius: var(--radius-card); background: rgba(0,0,0,.35); padding: 16px 18px; margin-top: 18px; }
.tl-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 1rem; }
.tl-card > summary { list-style: none; cursor: pointer; }
.tl-card > summary::-webkit-details-marker { display: none; }
.tl-card > summary h3 { margin: 0; }
.tl-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tl-inline select { min-width: 220px; }
.tl-credits { display: flex; flex-direction: column; margin: 14px 0; }
.tl-credit { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.1); }
.tl-credit-body { flex: 1; min-width: 0; }
.tl-credit-actions { display: flex; gap: 6px; }
.tl-credit-actions form { margin: 0; }
.tl-credit-rejected .tl-credit-body { opacity: .6; }
.tl-danger { margin-top: 14px; }
.tl-danger-btn { color: #ff6b6b; }
.tl-preview { border: 1px solid var(--control-line); border-radius: var(--radius-card); background: #2b2d31; padding: 14px 16px; margin: 12px 0 20px; }
.tl-preview-h { font-size: 1.5rem; font-weight: 800; color: #f2f3f5; }
.tl-preview-bar { font-size: 1.2rem; font-weight: 700; color: #f2f3f5; margin-top: 6px; letter-spacing: 1px; }
.tl-preview-sub { color: #949ba4; font-size: 0.8rem; margin-top: 4px; }
@media (max-width: 860px) { .tl-layout { grid-template-columns: 1fr; } }

/* GitHub settings (3.18.0) and task codes on the Task list. */
.gh-users { display: flex; flex-direction: column; }
.gh-actions { margin-top: 14px; }
.gh-secret { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gh-secret input { min-width: 260px; font-family: ui-monospace, monospace; }
.tl-code { font-family: ui-monospace, monospace; color: var(--muted); }

/* GitHub settings: the build workflow to copy (3.21.0). */
.gh-workflow { font-family: ui-monospace, monospace; font-size: 0.8rem; white-space: pre; }

/* Public legal pages (Taskify privacy policy, 3.24.0): readable line length. */
.legal-page { max-width: 760px; margin: 0 auto; line-height: 1.65; }
.legal-page h2 { margin-top: 1.8rem; font-size: 1.2rem; }
.legal-page a { color: inherit; text-decoration: underline; }
