/* Gallery chrome. FCF tokens supply color and type. Card radius and rail width follow the measured Envato reference. */

* { box-sizing: border-box; }

html[data-fcf-style="branded"] body {
  margin: 0;
  min-height: 100vh;
  background: #f4f7f6;
  color: var(--fcf-color-text);
  font-family: var(--fcf-font-body);
  font-size: 17px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 40;
  background: var(--fcf-color-surface);
  color: var(--fcf-color-brand);
  padding: 8px 12px;
}

.skip:focus { top: 8px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  display: grid;
  grid-template-columns: var(--rail-width, 249px) minmax(0, 1fr);
  min-height: 100vh;
}

body[data-rail="collapsed"] { --rail-width: 72px; }

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fcf-color-surface);
  border-right: 1px solid var(--fcf-color-border);
  padding: 24px 16px 16px;
}

.rail-top, .saved-head, .card-actions, .saved-actions, .weight-grid, .stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rail-top { justify-content: space-between; }

.weight-grid { flex-wrap: wrap; }

.mark {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  color: var(--fcf-color-brand);
  font-weight: var(--fcf-weight-navigation);
  letter-spacing: var(--fcf-spacing-navigation);
  text-decoration: none;
  text-transform: uppercase;
  font-size: var(--fcf-size-navigation);
}

.mark img { flex: 0 0 auto; }

body[data-rail="collapsed"] .mark-text,
body[data-rail="collapsed"] .rail-nav span,
body[data-rail="collapsed"] .rail-foot { display: none; }

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
}

.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--fcf-color-brand);
  text-decoration: none;
  font-size: var(--fcf-size-navigation);
  font-weight: var(--fcf-weight-navigation);
  letter-spacing: var(--fcf-spacing-navigation);
  text-transform: uppercase;
}

.rail-nav a[aria-current="page"] { background: var(--fcf-color-brand-soft); }

.rail-foot {
  margin-top: auto;
  color: var(--fcf-color-copy);
  font-size: 0.95rem;
}

.workspace { min-width: 0; display: flex; flex-direction: column; }

.menu-open { display: none; }

.top-mark {
  display: none;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  color: var(--fcf-color-brand);
  font-weight: 600;
  line-height: 1.15;
  text-decoration: none;
}

.topbar {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 24px 16px 0;
  background: var(--fcf-color-surface);
  border-top: var(--fcf-width-header-accent) solid var(--fcf-color-brand);
  box-shadow: var(--fcf-shadow-header);
}

.search { display: flex; flex: 1; gap: 8px; min-width: 0; }

.search input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 8px;
}

.search-submit, .text-button, .saved-open, .icon-button, .density-button {
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--fcf-radius-control);
  font: inherit;
  cursor: pointer;
}

.saved-open, .text-button, .density-button, .icon-button {
  border: 1px solid var(--fcf-color-brand);
  background: var(--fcf-color-surface);
  color: var(--fcf-color-brand);
  padding: 0 12px;
}

.search-submit { padding: 0 16px; }

.icon-button { width: 44px; padding: 0; }

.icon-button svg { width: 20px; height: 20px; }

main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 36px 32px 72px;
  min-width: 0;
}

.footer-bar { margin-top: auto; padding: 0; }

.footer-bar p { margin: 0; }

h1, h2, h3 { font-weight: var(--fcf-weight-heading); line-height: var(--fcf-line-heading); }

h1 { margin: 0 0 8px; }

.eyebrow, .meta, .result-count { color: var(--fcf-color-muted); }

.lede { max-width: var(--fcf-width-reading-max); font-size: var(--fcf-size-body); color: var(--fcf-color-copy); }

.page-intro { margin-bottom: 28px; }

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 36px;
}

.steps article { padding: 18px 18px 8px; }

.steps article h2 { margin-top: 0; font-size: 1.15rem; }

.steps article p:last-child { margin-bottom: 0; }

.overview-copy { padding: 8px 8px 8px 0; }

.overview-copy h3 { margin-top: 0; }

.page-intro.tight { margin-bottom: 8px; }

.toolbar, .chip-row, .card-actions, .compare-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.toolbar { margin: 8px 0; }

.toolbar label, .decision-form label, .choice-form label, .account-form label, .note-card label, .weight-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--fcf-color-heading);
  font-size: 0.95rem;
}

.toolbar select, .decision-form input, .decision-form select, .decision-form textarea, .choice-form input, .choice-form select, .choice-form textarea, .account-form input, .account-form select, .account-form textarea, .note-card textarea, .weight-grid input {
  min-height: 44px;
  padding: 8px;
  font: inherit;
}

.toolbar-end { margin-left: auto; }

.density { border: 0; margin: 0; padding: 0; display: flex; gap: 8px; }

.density-button[aria-pressed="true"], .text-button[aria-pressed="true"] {
  background: var(--fcf-color-brand);
  color: var(--fcf-color-inverse);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--fcf-color-surface);
  color: var(--fcf-color-brand);
  text-decoration: none;
  border: 1px solid var(--fcf-color-border);
}

.result-count { margin: 8px 0 16px; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid[data-density="compact"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (min-width: 1360px) {
  .grid[data-density="comfortable"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid[data-density="compact"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1760px) {
  .grid[data-density="comfortable"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid[data-density="compact"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.theme-card, .overview-card, .stat, .callout, .note-card, .unavailable-panel, .overview-list article {
  background: var(--fcf-color-surface);
  border: 1px solid var(--fcf-color-border);
  border-radius: 12px;
}

.theme-card { display: flex; flex-direction: column; min-width: 0; }

.card-media {
  display: block;
  aspect-ratio: 3 / 2;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  background: var(--fcf-color-brand-soft);
}

.card-media svg, .mark-svg svg { width: 100%; height: 100%; display: block; }

.mark-svg { width: 36px; height: 36px; display: block; }

.card-media { position: relative; }

.media-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: var(--fcf-color-surface);
  color: var(--fcf-color-heading);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.85rem;
}

.card-body, .callout, .note-card, .unavailable-panel, .stat { padding: 16px; }

.card-body h2 { margin: 0 0 8px; font-size: 1.35rem; }

.card-body h2 a { color: var(--fcf-color-heading); text-decoration: none; }

.card-body p, .fit { color: var(--fcf-color-copy); }

.fit { font-size: var(--fcf-size-body); }

.badges { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 12px 0; list-style: none; }

.badges li {
  border: 1px solid var(--fcf-color-border);
  border-radius: 8px;
  padding: 4px 8px;
  color: var(--fcf-color-brand);
  background: var(--fcf-color-brand-soft);
  font-size: 0.85rem;
}

.theme-card:hover, .theme-card:focus-within { border-color: var(--fcf-color-brand); }

.is-hidden { display: none; }

.empty, .callout.warning { padding: 16px; }

.empty {
  background: var(--fcf-color-surface);
  border-radius: 12px;
  padding: 24px;
}

.stat-row, .overview-list, .milestone-list, .note-list, .panes, .split {
  display: grid;
  gap: 16px;
}

.stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 24px; }

.stat-value { margin: 0; font-size: 2rem; color: var(--fcf-color-brand); }

.overview-list { grid-template-columns: 1fr; }

.overview-card { display: grid; grid-template-columns: minmax(220px, 380px) minmax(0, 1fr); gap: 20px; overflow: hidden; padding: 12px; }

.overview-card img { aspect-ratio: 3 / 2; }

.split { grid-template-columns: 1.2fr 1fr; }

.facts { margin: 0; }

.facts div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--fcf-color-border); }

.facts dt { color: var(--fcf-color-muted); }

.facts dd { margin: 0; overflow-wrap: anywhere; }

.hash { overflow-wrap: anywhere; font-family: Consolas, "Courier New", monospace; font-size: 0.85rem; }

.page-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.review-panel {
  background: var(--fcf-color-surface);
  border: 1px solid var(--fcf-color-border);
  border-radius: 12px;
  padding: 20px 22px;
}

.review-lead {
  margin: 0 0 18px;
  color: var(--fcf-color-copy);
}

.review-points {
  display: grid;
  gap: 16px;
}

.review-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.review-list li {
  color: var(--fcf-color-copy);
  padding-left: 0;
}

.section-status {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.section-status li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--fcf-color-border);
}

.section-status li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.status {
  color: var(--fcf-color-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.status.is-on {
  color: var(--fcf-color-brand);
}

.compare-table-wrap { position: relative; overflow-x: auto; max-width: 100%; min-width: 0; background: var(--fcf-color-surface); border-radius: 12px; }

.compare-table { width: 100%; border-collapse: collapse; min-width: 760px; }

.compare-table th, .compare-table td { text-align: left; vertical-align: top; padding: 12px; border-bottom: 1px solid var(--fcf-color-border); }

.compare-table th { color: var(--fcf-color-heading); }

.milestone-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.milestone-list article, .weight-editor, .decision-form, .account-form, .report {
  background: var(--fcf-color-surface);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.decision-form, .choice-form, .account-form { display: grid; gap: 12px; max-width: 40rem; }

.decision-form textarea, .choice-form textarea, .account-form textarea, .note-card textarea { min-height: 8rem; width: 100%; }

.choice-banner {
  background: var(--fcf-color-brand-soft);
  border: 1px solid #c5d5d2;
  border-left: 4px solid var(--fcf-color-brand);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 24px;
}

.choice-banner h2 { margin: 0 0 8px; font-size: 1.25rem; }

.choice-banner p:last-child { margin-bottom: 0; }

.choice-clear { margin-top: 16px; }

.choice-open {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--fcf-color-brand);
  background: #ffffff;
  color: var(--fcf-color-brand);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.choice-open.is-selected { background: var(--fcf-color-brand); color: #ffffff; }

.card-choice { display: inline-block; margin-top: 8px; color: var(--fcf-color-brand); font-weight: 600; text-decoration: none; }

.card-choice:hover { color: var(--fcf-color-brand-hover); text-decoration: none; }

.panes, .note-list { grid-template-columns: 1fr 1fr; }

.note-card h2 a, .page-list a { color: var(--fcf-color-brand); text-decoration: none; }

.note-card h2 a:hover, .page-list a:hover { color: var(--fcf-color-brand-hover); text-decoration: none; }

.saved-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100vh;
  height: 100dvh;
  background: #ffffff;
  color: var(--fcf-color-text);
  border-left: 1px solid var(--fcf-color-border);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.08);
  padding: 28px 22px 32px;
  z-index: 60;
  overflow: auto;
}

.saved-head {
  align-items: flex-start;
  justify-content: space-between;
  margin: 0 0 8px;
}

.saved-panel h2 {
  margin: 0;
  font-size: 1.45rem;
}

.saved-panel .eyebrow {
  margin: 0 0 4px;
}

.saved-panel .review-lead {
  margin: 0 0 18px;
}

.saved-group {
  background: #f6f8f0;
  border: 1px solid var(--fcf-color-border);
  border-radius: 16px;
  padding: 14px 14px 12px;
  margin: 0 0 12px;
}

.saved-group h3,
html[data-fcf-style="branded"] .saved-panel .saved-group h3 {
  margin: 0 0 10px;
  color: var(--fcf-color-brand);
  font-family: "Jost", "Segoe UI", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.saved-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.saved-empty {
  margin: 0;
  padding: 2px 2px 6px;
  color: var(--fcf-color-muted);
}

.save-status {
  margin: 14px 0 0;
  color: var(--fcf-color-muted);
  font-size: 0.85rem;
}

.scrim { position: fixed; inset: 0; background: rgba(36, 36, 36, 0.4); z-index: 15; }

.danger { border-color: var(--fcf-color-error); color: var(--fcf-color-error); }

.back { margin-top: 0; }

.check-list { padding-left: 1.2rem; }

@media (max-width: 899px) {
  .shell { grid-template-columns: 1fr; }
  .menu-open { display: inline-flex; align-items: center; justify-content: center; }
  .rail { position: fixed; z-index: 20; transform: translateX(-105%); width: min(280px, 88vw); transition: transform 160ms ease; }
  body[data-rail="open"] .rail { transform: none; }
  body[data-rail="collapsed"] .mark-text,
  body[data-rail="collapsed"] .rail-nav span,
  body[data-rail="collapsed"] .rail-foot { display: initial; }
  .topbar, .stat-row, .split, .panes, .note-list, .milestone-list, .overview-card, .steps { grid-template-columns: 1fr; display: grid; }
  .topbar { display: grid; }
  .toolbar-end { margin-left: 0; }
  .grid, .grid[data-density="comfortable"], .grid[data-density="compact"] { grid-template-columns: 1fr; }
}

@media (max-width: 899px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }
  .top-mark { display: inline-flex; }
  .search, .saved-open, .choice-open { grid-column: 1 / -1; }
}
@media (min-width: 900px) and (max-width: 1100px) {
  .steps { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 700px) and (max-width: 899px) {
  .grid, .grid[data-density="comfortable"], .grid[data-density="compact"] { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .rail { transition: none; }
}

html[data-fcf-style="branded"] [data-fcf-component="page-title"] {
  font-weight: 600;
  letter-spacing: -0.02em;
}

html[data-fcf-style="branded"] [data-fcf-component="header"] {
  background: #ffffff;
  border-top: 0;
  border-bottom: 1px solid #e3ebe9;
  box-shadow: none;
}

html[data-fcf-style="branded"] [data-fcf-component="navigation"],
html[data-fcf-style="branded"] [data-fcf-component="navigation"] a {
  color: var(--fcf-color-heading);
  text-transform: none;
  letter-spacing: 0;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

html[data-fcf-style="branded"] [data-fcf-component="navigation"] a[aria-current="page"] {
  background: var(--fcf-color-brand-soft);
  color: var(--fcf-color-brand);
  text-decoration: none;
}

html[data-fcf-style="branded"] [data-fcf-component="field"] {
  background: #ffffff;
  color: var(--fcf-color-text);
  border: 1px solid #c5d5d2;
  border-radius: 8px;
  font-size: 16px;
}

.rail {
  background: #ffffff;
  border-right-color: #e3ebe9;
}

.mark { color: var(--fcf-color-brand); text-transform: none; letter-spacing: 0; font-size: 16px; }

.lede, .result-count, .meta, .eyebrow { color: var(--fcf-color-muted); }

.eyebrow { font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.78rem; }

.topbar { background: #ffffff; padding: 16px 28px; }

.saved-panel a:not(.text-button) { color: var(--fcf-color-brand); }

.saved-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--fcf-color-border);
  background: #ffffff;
  color: var(--fcf-color-brand);
  font-weight: 600;
  text-decoration: none;
}

.saved-list a:hover {
  border-color: var(--fcf-color-brand);
  color: var(--fcf-color-brand-hover);
  text-decoration: none;
}

.saved-actions { flex-wrap: wrap; margin-top: 8px; }

.search input {
  background: #ffffff;
  color: var(--fcf-color-text);
  border: 1px solid #c5d5d2;
}

.saved-open, .text-button, .density-button, .icon-button {
  background: #ffffff;
  color: var(--fcf-color-brand);
  border-color: #c5d5d2;
}

.search-submit { background: var(--fcf-color-brand); color: #ffffff; border-color: var(--fcf-color-brand); }

.toolbar label, .decision-form label, .choice-form label, .account-form label, .note-card label, .weight-grid label,
h1, h2, h3, .card-body h2 a, .facts dt { color: var(--fcf-color-heading); }

.back, .back a { color: var(--fcf-color-brand); }

.card-body p, .facts dd, .fit, .steps p { color: var(--fcf-color-copy); }

.theme-card, .overview-card, .stat, .callout, .note-card, .unavailable-panel, .overview-list article,
.milestone-list article, .weight-editor, .decision-form, .account-form, .report, .empty, .compare-table-wrap, .steps article {
  background: #ffffff;
  border-color: #e3ebe9;
  color: var(--fcf-color-text);
  box-shadow: 0 1px 2px rgba(36, 68, 66, 0.04);
}

.theme-card {
  background: transparent;
  border: 0;
  border-radius: 12px;
  box-shadow: none;
}

.card-frame { border-radius: 16px; overflow: hidden; }

.card-media {
  border-radius: 16px;
  background: #111;
}

.media-label {
  position: static;
  display: inline-flex;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  margin: 0 0 8px;
  background: #f3f6ef;
  color: var(--fcf-color-heading);
  font-size: 0.75rem;
  font-weight: 600;
}

.card-quick {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.card-quick .text-button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 17, 17, 0.88);
  color: #ffffff;
  border-color: transparent;
  min-height: 40px;
  text-decoration: none;
}

.card-quick .text-button[aria-pressed="true"] {
  background: #3f6d69;
  color: #ffffff;
}

.card-body { padding: 12px 2px 0; }

.card-body h2 { font-size: 1.05rem; font-weight: 700; }

.card-body p { margin: 4px 0 0; font-size: 0.92rem; }

.chip { background: #ffffff; color: var(--fcf-color-heading); border-color: #c5d5d2; }

.compare-table th, .compare-table td { border-bottom-color: #e3ebe9; color: var(--fcf-color-text); }

.compare-table thead th { background: #f7faf9; }

.stat-value { color: var(--fcf-color-brand); }

.mark { align-items: center; }

.mark-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }

.mark-text small { display: block; color: var(--fcf-color-muted); font-size: 0.78rem; font-weight: 400; text-transform: none; letter-spacing: 0; }

.card-media img, .compare-thumb img, .detail-snapshot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.preferred-tag, .preferred-flag {
  display: inline-block;
  border-radius: 999px;
  background: #3f6d69;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  vertical-align: middle;
}

.preferred-flag { font-size: 0.9rem; padding: 4px 12px; margin: 4px 0 0; }

.detail-snapshot { margin: 0 0 16px; max-width: 960px; }

.detail-snapshot > a { display: block; aspect-ratio: 3 / 2; border-radius: 12px; overflow: hidden; background: #111; }

.detail-snapshot figcaption, .preview-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 12px;
  color: var(--fcf-color-muted);
}

.preview-nav { margin: 0 0 8px; }

.preview-nav .back { margin: 0; }

.preview-step { display: flex; align-items: center; gap: 8px; }

.preview-step .text-button, .card-actions .text-button, .saved-actions .text-button { display: inline-flex; align-items: center; text-decoration: none; gap: 6px; }

.preview-intro { margin-bottom: 8px; }

.viewer-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 10px 0;
  background: #f4f7f6;
  border-bottom: 1px solid #e3ebe9;
}

.page-tabs, .view-switch, .choose-actions { display: flex; flex-wrap: wrap; gap: 4px; }

.choose-actions { gap: 8px; margin-left: auto; }

.page-tabs a, .view-switch a, .view-switch span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #c5d5d2;
  background: #ffffff;
  color: var(--fcf-color-heading);
  text-decoration: none;
  font-size: 0.92rem;
}

.page-tabs a:hover, .view-switch a:hover { border-color: var(--fcf-color-brand); }

.page-tabs a[aria-current="page"], .view-switch a[aria-current="true"] {
  background: var(--fcf-color-brand);
  border-color: var(--fcf-color-brand);
  color: #ffffff;
  font-weight: 600;
}

.view-switch span[aria-disabled="true"] { color: #8a8a8a; }

.choose-actions .text-button { min-height: 40px; }

.choose-link { min-height: 40px; }

.snapshot-notice {
  margin: 12px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--fcf-color-brand);
  background: var(--fcf-color-brand-soft);
  color: var(--fcf-color-copy);
  font-size: 0.95rem;
}

.snapshot-notice a, .viewer figcaption a, .chosen-callout a { color: var(--fcf-color-brand); }

.viewer { margin: 0 0 24px; }

.viewer-screen {
  max-width: 1440px;
  margin: 0 auto;
  border: 1px solid #333333;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.viewer-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: #2a2a2a;
}

.viewer-chrome span { width: 10px; height: 10px; border-radius: 50%; background: #555555; flex: 0 0 auto; }

.viewer-chrome code {
  margin-left: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #c6c6c6;
  font-size: 0.8rem;
}

.viewer img { display: block; width: 100%; height: auto; }

.viewer[data-view="mobile"] .viewer-screen {
  width: 414px;
  max-width: 100%;
  border: 12px solid #2a2a2a;
  border-radius: 36px;
}

.viewer[data-view="mobile"] .viewer-chrome { justify-content: center; padding: 6px 12px 10px; }

.viewer[data-view="mobile"] .viewer-chrome span { display: none; }

.viewer[data-view="mobile"] .viewer-chrome code { margin-left: 0; }

.viewer figcaption { margin-top: 10px; text-align: center; color: var(--fcf-color-muted); font-size: 0.92rem; }

.preview-foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }

.preview-foot code { overflow-wrap: anywhere; }

.preview-foot h2, .chosen-callout h2 { margin-top: 0; font-size: 1.15rem; }

.chosen-callout { border-left: 3px solid #3f6d69; margin-bottom: 16px; max-width: 40rem; }

.report-logo svg { display: block; width: min(360px, 100%); height: auto; margin-bottom: 8px; }

.report p { overflow-wrap: anywhere; }

.rail-signout { margin: 4px 0 0; }

.rail-signout button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--fcf-color-brand);
  font: inherit;
  font-size: var(--fcf-size-navigation);
  font-weight: var(--fcf-weight-navigation);
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  cursor: pointer;
}

body[data-rail="collapsed"] .rail-signout span { display: none; }

.rail-foot { overflow-wrap: anywhere; }

.password-rules { margin: 0; padding-left: 1.2rem; }

.password-rules li { margin: 4px 0; }

.form-error { color: #8d3b32; font-weight: 600; }

.form-notice { color: var(--fcf-color-heading); }

.recovery-codes { list-style: none; padding: 0; display: grid; gap: 8px; max-width: 16rem; }

.recovery-codes code, .page-intro code {
  display: inline-block;
  padding: 8px 12px;
  background: #f4f7f6;
  border-radius: 8px;
  letter-spacing: 0.04em;
}

.table-wrap { overflow-x: auto; background: #ffffff; border-radius: 12px; padding: 12px; }

.records { width: 100%; border-collapse: collapse; min-width: 720px; }

.records th, .records td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #e3ebe9;
  vertical-align: top;
}

.row-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.row-actions a, .account-actions a, .account-actions button {
  color: var(--fcf-color-brand);
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.account-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 16px 0; }

.compare-thumb { display: block; color: var(--fcf-color-brand); text-decoration: none; font-weight: 600; }

.compare-thumb img { aspect-ratio: 3 / 2; height: auto; border-radius: 8px; margin-bottom: 6px; }

@media (max-width: 899px) {
  .preview-foot { grid-template-columns: minmax(0, 1fr); }
  .choose-actions { margin-left: 0; }
  .viewer-bar { position: static; }
}

@media print {
  .rail, .topbar, .saved-panel, .scrim, .footer-bar, .skip, .card-quick, .fcf-modal { display: none; }
  .shell { display: block; }
  body, html[data-fcf-style="branded"] body { background: white; color: black; }
  main, main * { color: black !important; background: none !important; border-color: #999999 !important; }
  .compare-table-wrap { overflow: visible; }
  .compare-table { min-width: 0; }
}

/* Studio chrome. Links stay plain; color, weight, and fill show they can be used. */

html[data-fcf-style="branded"] body {
  background: #eef2f1;
  color: #1c2423;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-size: 16.5px;
  letter-spacing: -0.011em;
}

html[data-fcf-style="branded"] :is(h1, h2, h3, [data-fcf-component="page-title"]) {
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.03em;
}

html[data-fcf-style="branded"] a,
html[data-fcf-style="branded"] a:hover,
html[data-fcf-style="branded"] a:focus,
html[data-fcf-style="branded"] a:active,
html[data-fcf-style="branded"] [data-fcf-component="navigation"] a,
html[data-fcf-style="branded"] [data-fcf-component="navigation"] a:hover,
html[data-fcf-style="branded"] [data-fcf-component="navigation"] a:focus,
html[data-fcf-style="branded"] [data-fcf-component="navigation"] a[aria-current="page"],
html[data-fcf-style="branded"] [data-fcf-component="link"],
html[data-fcf-style="branded"] [data-fcf-component="link"]:hover {
  text-decoration: none;
}

main :is(p, li, figcaption, dd, .lede, .snapshot-notice, .chosen-callout, .account-actions) a {
  color: #2f5c58;
  font-weight: 600;
}

main :is(p, li, figcaption, dd, .lede, .snapshot-notice, .chosen-callout, .account-actions) a:hover {
  color: #1d3d3b;
}

.rail {
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid rgba(63, 109, 105, 0.12);
  padding: 20px 14px 16px;
}

.rail-nav { gap: 2px; }

.rail-nav a {
  border-radius: 12px;
  padding: 4px 12px;
  color: #243331;
}

.rail-nav a:hover {
  background: #f3f7f6;
  color: #2f5c58;
}

html[data-fcf-style="branded"] [data-fcf-component="navigation"] a[aria-current="page"],
.rail-nav a[aria-current="page"] {
  background: #e7f1ef;
  color: #24514e;
}

.mark, .top-mark, .rail-signout button {
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.02em;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(63, 109, 105, 0.12);
  box-shadow: none;
  backdrop-filter: blur(16px);
}

main { padding: 40px 36px 80px; }

.footer-bar { background: transparent; border-top: 0; padding: 0; }

.eyebrow {
  color: #5d7572;
  letter-spacing: 0.08em;
}

html[data-fcf-style="branded"] :is(
  [data-fcf-component="button-primary"],
  [data-fcf-component="button-secondary"],
  .text-button,
  .search-submit,
  .choice-open,
  .saved-open,
  .density-button,
  .page-tabs a,
  .view-switch a,
  .view-switch span
) {
  border-radius: 999px;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.01em;
}

.icon-button { border-radius: 12px; border-color: transparent; background: #f3f7f6; }

.icon-button:hover { background: #e7f1ef; }

html[data-fcf-style="branded"] [data-fcf-component="button-primary"],
.search-submit {
  background: #2f5c58;
  border-color: #2f5c58;
  box-shadow: 0 1px 1px rgba(20, 40, 38, 0.08);
}

html[data-fcf-style="branded"] [data-fcf-component="button-primary"]:hover,
.search-submit:hover {
  background: #244845;
  border-color: #244845;
}

html[data-fcf-style="branded"] [data-fcf-component="field"],
.search input,
.toolbar select,
.decision-form input,
.decision-form select,
.decision-form textarea,
.choice-form input,
.choice-form select,
.choice-form textarea,
.account-form input,
.account-form select,
.account-form textarea,
.note-card textarea,
.weight-grid input {
  border-radius: 12px;
  border-color: #d5e2df;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.theme-card, .overview-card, .stat, .callout, .note-card, .unavailable-panel, .overview-list article,
.milestone-list article, .weight-editor, .decision-form, .account-form, .report, .empty,
.compare-table-wrap, .steps article, .table-wrap, .choice-banner {
  border-radius: 16px;
  border-color: rgba(63, 109, 105, 0.12);
  box-shadow: 0 1px 1px rgba(20, 40, 38, 0.04), 0 12px 32px rgba(20, 40, 38, 0.05);
}

.steps article, .overview-card, .account-form, .decision-form, .choice-form, .note-card, .stat, .callout {
  background: #ffffff;
}

.card-media, .detail-snapshot > a, .viewer-screen { border-radius: 16px; }

.viewer-bar {
  top: 73px;
  background: rgba(238, 242, 241, 0.92);
  backdrop-filter: blur(12px);
}

.compare-table thead th, .records th { background: #f7faf9; }

.records, .compare-table { border-collapse: separate; border-spacing: 0; }

.row-actions a:hover, .account-actions a:hover, .compare-thumb:hover, .card-body h2 a:hover, .back a:hover {
  color: #1d3d3b;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  .topbar, .viewer-bar { backdrop-filter: none; }
}

.theme-card {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.card-frame {
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(20, 40, 38, 0.1);
}

[data-icon] {
  --ico: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

[data-icon]::before {
  content: "";
  width: 1.05em;
  height: 1.05em;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
}

[data-icon="overview"] { --ico: url("/static/gallery/img/icons/overview.svg"); }
[data-icon="themes"] { --ico: url("/static/gallery/img/icons/themes.svg"); }
[data-icon="compare"] { --ico: url("/static/gallery/img/icons/compare.svg"); }
[data-icon="shortlist"] { --ico: url("/static/gallery/img/icons/shortlist.svg"); }
[data-icon="choice"] { --ico: url("/static/gallery/img/icons/choice.svg"); }
[data-icon="login"] { --ico: url("/static/gallery/img/icons/login.svg"); }
[data-icon="signup"] { --ico: url("/static/gallery/img/icons/signup.svg"); }
[data-icon="account"] { --ico: url("/static/gallery/img/icons/account.svg"); }
[data-icon="users"] { --ico: url("/static/gallery/img/icons/users.svg"); }
[data-icon="selections"] { --ico: url("/static/gallery/img/icons/selections.svg"); }
[data-icon="search"] { --ico: url("/static/gallery/img/icons/search.svg"); }
[data-icon="close"] { --ico: url("/static/gallery/img/icons/close.svg"); }
[data-icon="preview"] { --ico: url("/static/gallery/img/icons/preview.svg"); }
[data-icon="details"] { --ico: url("/static/gallery/img/icons/details.svg"); }
[data-icon="check"] { --ico: url("/static/gallery/img/icons/check.svg"); }
[data-icon="plus"] { --ico: url("/static/gallery/img/icons/plus.svg"); }
[data-icon="trash"] { --ico: url("/static/gallery/img/icons/trash.svg"); }
[data-icon="chevron-left"] { --ico: url("/static/gallery/img/icons/chevron-left.svg"); }
[data-icon="chevron-right"] { --ico: url("/static/gallery/img/icons/chevron-right.svg"); }
[data-icon="eye"] { --ico: url("/static/gallery/img/icons/eye.svg"); }
[data-icon="eye-off"] { --ico: url("/static/gallery/img/icons/eye-off.svg"); }
[data-icon="key"] { --ico: url("/static/gallery/img/icons/key.svg"); }
[data-icon="edit"] { --ico: url("/static/gallery/img/icons/edit.svg"); }
[data-icon="desktop"] { --ico: url("/static/gallery/img/icons/desktop.svg"); }
[data-icon="mobile"] { --ico: url("/static/gallery/img/icons/mobile.svg"); }
[data-icon="bookmark"] { --ico: url("/static/gallery/img/icons/shortlist.svg"); }

[data-action="shortlist"][aria-pressed="true"] { --ico: url("/static/gallery/img/icons/shortlist-on.svg"); }

[data-icon-end] { flex-direction: row-reverse; }

.rail-nav a[data-icon] { justify-content: flex-start; }

body[data-rail="collapsed"] .rail-nav a[data-icon] { justify-content: center; }

.card-quick [data-icon] { gap: 6px; }

[data-fcf-component="button-primary"][data-icon="trash"] {
  background: #8d3b32;
  border-color: #8d3b32;
}

[data-fcf-component="button-primary"][data-icon="trash"]:hover {
  background: #732f28;
  border-color: #732f28;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.shell { min-height: 100vh; min-height: 100dvh; }

.rail { height: 100vh; height: 100dvh; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 14px max(28px, env(safe-area-inset-right)) 14px max(28px, env(safe-area-inset-left));
}

.search {
  flex: 1 1 320px;
  min-width: min(100%, 240px);
}

.choice-open,
.saved-open {
  flex: 0 1 auto;
  max-width: 100%;
}

.table-wrap,
.compare-table-wrap,
.viewer,
.viewer-screen,
.overview-card,
.detail-snapshot {
  max-width: 100%;
  min-width: 0;
}

.card-quick { flex-wrap: wrap; }

.card-quick .text-button {
  flex: 1 1 5.5rem;
  min-width: 0;
  padding-inline: 8px;
}

@media (max-width: 899px) {
  .shell { grid-template-columns: 1fr; }
  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  }
  .menu-open { grid-column: 1; grid-row: 1; }
  .top-mark {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
  }
  .search,
  .choice-open,
  .saved-open {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }
  .search {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .search input {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }
  .search .text-button,
  .search .search-submit {
    width: 100%;
  }
  .choice-open,
  .saved-open {
    justify-content: center;
    white-space: normal;
    text-align: center;
  }
  main {
    padding: 24px max(16px, env(safe-area-inset-right)) 56px max(16px, env(safe-area-inset-left));
  }
  .footer-bar { padding: 0 0 env(safe-area-inset-bottom); }
  .card-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .card-actions > * { width: 100%; }
  .preview-step { flex-wrap: wrap; }
  .viewer-bar { top: 0; }
}

#search-clear[hidden] {
  display: none !important;
}

#search-clear[hidden] + .search-submit {
  grid-column: 1 / -1;
}

.compare-banner,
.compare-notice,
.compare-notes {
  margin: 0 0 20px;
}

.compare-banner,
.compare-notice {
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--fcf-color-border);
  border-radius: 12px;
}

.compare-banner a { font-weight: 600; }

.compare-banner[hidden],
.compare-notice[hidden],
.theme-card.is-hidden,
.empty.is-hidden,
.empty[hidden] { display: none; }

.compare-picker {
  width: 100%;
  min-inline-size: 0;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.compare-picker legend {
  flex: 1 1 100%;
  padding: 0;
  margin: 0 0 4px;
  font-weight: 600;
  color: var(--fcf-color-heading);
}

.compare-picker label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--fcf-color-border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.compare-picker input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
}

.compare-notes ul { margin: 8px 0 0; padding-left: 1.2rem; }

@media (max-width: 699px) {
  .page-tabs a,
  .view-switch a,
  .view-switch span {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* Confirm dialog and snapshot lightbox. */

@keyframes fcf-modal-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

dialog.fcf-modal {
  position: fixed;
  inset: 0;
  width: min(32rem, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  height: fit-content;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid #e3ebe9;
  border-radius: 16px;
  background: #fff;
  color: #1c2423;
  box-shadow: 0 24px 64px rgba(20, 36, 34, 0.22);
  overflow: hidden;
}

dialog.fcf-modal[open] {
  animation: fcf-modal-in 180ms ease-out;
}

dialog.fcf-modal::backdrop {
  background: rgba(18, 32, 30, 0.56);
}

.fcf-modal-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  max-height: min(40rem, calc(100dvh - 2rem));
  background: #fff;
}

.fcf-modal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: start;
  column-gap: 12px;
  flex: 0 0 auto;
  padding: 22px 22px 0;
}

.fcf-modal-head .eyebrow {
  grid-column: 1;
  grid-row: 1;
  margin: 0 0 4px;
}

.fcf-modal-head .eyebrow:empty {
  display: none;
  margin: 0;
}

.fcf-modal-head h2 {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  margin: 0;
  font-size: 1.45rem;
  font-family: inherit;
  color: var(--fcf-color-brand);
}

.fcf-modal-head .eyebrow:empty + h2 {
  grid-row: 1;
}

html[data-fcf-style="branded"] .fcf-modal-head h2 {
  color: var(--fcf-color-brand);
}

.fcf-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  justify-self: end;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
}

.fcf-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 22px 8px;
  color: var(--fcf-color-copy);
  overflow: auto;
}

.fcf-modal-body p {
  margin: 0;
}

.fcf-modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  padding: 16px 22px 22px;
}

.fcf-modal-actions[hidden],
.fcf-modal-actions:empty {
  display: none;
}

.fcf-modal-confirm {
  cursor: pointer;
}

html[data-fcf-style="branded"] .fcf-modal-confirm[data-tone="danger"] {
  background: var(--fcf-color-error);
  border-color: var(--fcf-color-error);
  color: #ffffff;
}

html[data-fcf-style="branded"] .fcf-modal-confirm[data-tone="danger"]:hover {
  background: #8d2626;
  border-color: #8d2626;
  color: #ffffff;
}

/* solstar.css loads after this file and paints primary buttons, including a ::after sweep. */
html[data-fcf-style="branded"] .fcf-modal .fcf-modal-confirm[data-tone="danger"] {
  background: var(--fcf-color-error);
  border-color: var(--fcf-color-error);
  color: #ffffff;
}

html[data-fcf-style="branded"] .fcf-modal .fcf-modal-confirm[data-tone="danger"]:hover {
  background: #8d2626;
  border-color: #8d2626;
  color: #ffffff;
}

html[data-fcf-style="branded"] .fcf-modal .fcf-modal-confirm[data-tone="danger"]::after {
  content: none;
  display: none;
}

dialog.fcf-modal.is-snapshot {
  width: min(72rem, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
  max-height: calc(100dvh - 1.5rem);
}

.fcf-modal.is-snapshot .fcf-modal-card {
  max-height: calc(100dvh - 1.5rem);
}

.fcf-modal-body img.fcf-modal-shot {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  background: #f4f7f6;
  border-radius: 12px;
}

.viewer-screen button.snapshot-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.viewer-screen button.snapshot-open:focus-visible,
html[data-fcf-style="branded"] .viewer-screen button.snapshot-open:focus-visible {
  outline: 2px solid var(--fcf-color-brand);
  outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
  dialog.fcf-modal[open] {
    animation: none;
  }
}

.role-options {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.role-options legend {
  padding: 0;
  font-weight: 600;
  color: var(--fcf-color-heading);
}

.role-options p {
  margin: 0;
}

.account-form .role-options label {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}

.account-form .role-options input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}
