:root {
  color-scheme: light;
  --paper: #f7f7f2;
  --surface: #fffefa;
  --surface-soft: #f0f3ed;
  --ink: #1d2b28;
  --ink-soft: #495a56;
  --muted: #6c7a75;
  --line: #d8dfd9;
  --teal: #236b5c;
  --teal-dark: #174b41;
  --teal-light: #e1eee8;
  --on-filled: #fff;
  --focus-ring: #236b5c;
  --serif: Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow: 0 18px 55px rgba(24, 47, 38, .11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; z-index: 100; top: -100px; left: 12px; background: var(--ink); color: var(--paper); padding: 10px 15px; }
.skip-link:focus { top: 12px; }
.app-shell { width: min(100%, 1600px); margin: auto; }

.site-header { min-height: 64px; padding: 12px clamp(22px, 5vw, 78px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 24px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 29px; height: 29px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; transform: rotate(-8deg); }
.brand-mark span { background: var(--teal); border-radius: 1px; }
.brand-mark span:nth-child(2) { opacity: .72; }
.brand-mark span:nth-child(3) { opacity: .48; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.14; }
.brand-copy strong { font-size: 16px; letter-spacing: .04em; }
.brand-copy small { font-size: 16px; margin-top: 4px; color: var(--muted); }
.header-note { color: var(--muted); font-size: 16px; letter-spacing: .02em; }

.hero { padding: 38px clamp(22px, 5vw, 78px) 39px; display: grid; grid-template-columns: minmax(0, 1fr) 242px; gap: 8%; border-bottom: 1px solid var(--line); }
.eyebrow { display: flex; align-items: center; gap: 13px; margin: 0 0 12px; font-size: 16px; font-weight: 700; letter-spacing: .16em; color: var(--teal); text-transform: uppercase; }
.eyebrow-line { width: 24px; height: 1px; background: var(--teal); }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-family: var(--serif); font-size: clamp(44px, 4.1vw, 55px); line-height: 1.06; letter-spacing: -.054em; font-weight: 400; }
h1 em { color: var(--teal); font-weight: 400; }
.hero-intro { max-width: 540px; margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.55; }
.hero-aside { align-self: end; padding: 0 0 6px; }
.aside-index { font-family: var(--serif); color: var(--teal); font-size: 16px; letter-spacing: -.02em; }
.aside-rule { height: 1px; width: 100%; background: var(--line); margin: 9px 0 11px; }
.hero-aside p { font-family: var(--serif); font-size: 16px; line-height: 1.28; margin-bottom: 10px; }
.hero-aside small { display: block; color: var(--muted); font-size: 16px; line-height: 1.6; }

.browse-section { padding: 35px clamp(22px, 5vw, 78px) 120px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 21px; }
.section-heading .eyebrow { margin-bottom: 9px; }
.section-heading h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 3vw, 49px); letter-spacing: -.04em; line-height: 1.1; }
.count-badge { display: inline-flex; vertical-align: top; margin: 5px 0 0 12px; font-family: var(--sans); font-size: 16px; font-weight: 650; color: var(--teal); letter-spacing: 0; }
.section-note { margin: 0 0 5px; color: var(--muted); font-size: 16px; }
.filter-bar { display: flex; align-items: stretch; gap: 12px; }
.search-field { flex: 1; min-width: 0; height: 54px; display: flex; align-items: center; gap: 12px; padding: 0 17px; border: 1px solid var(--line); background: var(--surface); }
.search-field svg { flex: 0 0 auto; stroke: var(--teal); stroke-width: 1.6; fill: none; }
.search-field:focus-within { border-color: var(--teal); box-shadow: 0 0 0 2px #72baa33d; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; }
.search-field input::placeholder { color: #8a9790; opacity: 1; }
.search-field input:focus-visible { outline: 0; }
.search-key { white-space: nowrap; color: var(--muted); font-size: 16px; border: 1px solid var(--line); padding: 3px 6px; border-radius: 3px; }
.category-field { height: 54px; min-width: 182px; border: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding: 0 13px; background: var(--surface); }
.category-field span { color: var(--muted); font-size: 16px; }
.category-field select { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; }
.category-field:focus-within { border-color: var(--teal); box-shadow: 0 0 0 2px #72baa33d; }
.text-button { border: 0; padding: 8px 9px; background: none; color: var(--teal); font-size: 16px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: var(--teal-dark); }
.tag-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 44px; margin-top: 20px; }
.tag-filter-label { margin-right: 8px; color: var(--muted); font-size: 16px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.filter-chip { border: 1px solid var(--line); background: transparent; padding: 7px 13px; border-radius: 100px; color: var(--ink-soft); font-size: 16px; line-height: 1.2; transition: background .18s, border-color .18s, color .18s; }
.filter-chip:hover, .filter-chip.is-active { border-color: var(--teal); color: var(--teal-dark); background: var(--teal-light); }
.result-status { margin: 20px 0 16px; color: var(--muted); font-size: 16px; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.template-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 2px 2px rgba(20, 45, 35, .015); transition: transform .22s, box-shadow .22s, border-color .22s; }
.template-card:hover { transform: translateY(-4px); border-color: #b3cbc0; box-shadow: var(--shadow); }
.card-preview { position: relative; height: clamp(220px, 24vw, 345px); overflow: hidden; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.card-preview > .preview-image-frame { height: 100%; }
.card-preview .preview-image { width: 100%; height: auto; display: block; object-fit: initial; object-position: top; }
.card-preview-topline { position: absolute; z-index: 1; inset: 15px 15px auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; }
.card-number, .availability { padding: 6px 9px; background: var(--surface); border: 1px solid var(--line); font-size: 16px; font-weight: 700; letter-spacing: .04em; line-height: 1.1; }
.card-number { color: var(--ink-soft); }
.availability.ready { color: var(--teal-dark); background: #edf7f0; border-color: #c4decf; }
.availability.unavailable { color: #895a3e; background: #fff5e8; border-color: #eed9c3; }
.card-preview-open { position: absolute; right: 15px; bottom: 15px; background: var(--ink); color: var(--paper); border: 0; padding: 10px 13px; font-size: 16px; font-weight: 650; box-shadow: 0 5px 16px #0002; }
.card-preview-open:hover { background: var(--teal-dark); color: var(--on-filled); }
.card-body { padding: 23px 24px 19px; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 24px; }
.card-category { color: var(--teal); font-size: 16px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.compare-toggle { flex: 0 0 auto; border: 0; background: none; color: var(--teal); font-size: 16px; font-weight: 650; }
.compare-toggle.is-active { color: var(--teal-dark); }
.card-title-button { display: block; width: 100%; text-align: left; margin: 20px 0 8px; padding: 0; border: 0; background: transparent; color: var(--ink); font-family: var(--serif); font-size: clamp(27px, 2.4vw, 35px); letter-spacing: -.04em; line-height: 1.1; }
.card-title-button:hover { color: var(--teal); }
.card-summary { min-height: 66px; margin: 0 0 19px; color: var(--ink-soft); font-size: 16px; line-height: 1.65; }
.card-tags, .detail-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-block; padding: 5px 9px; border: 1px solid var(--line); color: var(--muted); font-size: 16px; line-height: 1.2; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 50px; margin-top: 23px; padding-top: 15px; border-top: 1px solid var(--line); }
.best-for-short { color: var(--muted); font-size: 16px; line-height: 1.3; }
.card-arrow { flex: 0 0 auto; width: 30px; height: 30px; border: 1px solid var(--line); background: transparent; color: var(--teal); font-size: 16px; }
.card-arrow:hover { background: var(--teal-light); }
.empty-state { text-align: center; margin: 55px auto; padding: 50px 20px; border: 1px dashed var(--line); }
.empty-glyph { color: var(--teal); font-family: var(--serif); font-size: 52px; }
.empty-state h3 { margin: 6px 0 9px; font-family: var(--serif); font-size: 29px; font-weight: 400; }
.empty-state p { color: var(--muted); }

.button { display: inline-flex; justify-content: center; align-items: center; gap: 13px; min-height: 44px; border: 1px solid transparent; padding: 11px 17px; font-size: 16px; font-weight: 700; line-height: 1.3; text-decoration: none; transition: background .18s, transform .18s; }
.button:not(:disabled):hover { transform: translateY(-1px); }
.button-primary { background: var(--teal); color: var(--on-filled); }
.button-primary:hover { background: var(--teal-dark); }
.button-dark { background: var(--ink); color: var(--paper); }
.button-dark:hover { background: var(--teal-dark); color: var(--on-filled); }
.button-outline { border-color: var(--teal); color: var(--teal); background: transparent; }
.button-outline:hover { background: var(--teal-light); }
.compare-bar { position: fixed; z-index: 5; bottom: 18px; left: max(18px, calc((100vw - 1350px)/2)); right: max(18px, calc((100vw - 1350px)/2)); min-height: 74px; padding: 12px 17px 12px 23px; background: var(--ink); color: var(--paper); box-shadow: 0 12px 48px #10221d4d; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.compare-bar-copy { min-width: 0; display: flex; flex-direction: column; }
.compare-bar-kicker { color: var(--paper); font-size: 16px; font-weight: 750; letter-spacing: .14em; }
.compare-bar-copy strong { font-size: 16px; }
.compare-bar-copy > span:last-child { color: var(--paper); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compare-bar-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 13px; }
.compare-bar .text-button { color: var(--paper); }
.compare-bar .button-dark { border-color: #668379; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 23px clamp(22px, 5vw, 78px) 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 16px; }

.surface-dialog { width: min(1000px, calc(100vw - 34px)); max-height: min(92vh, 1150px); padding: 0; border: 1px solid var(--line); color: var(--ink); background: var(--surface); box-shadow: 0 30px 90px #0b201a55; }
.surface-dialog::backdrop { background: #12241fd1; backdrop-filter: blur(5px); }
.dialog-frame { padding: clamp(20px, 3vw, 37px); }
.dialog-topline { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 29px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.dialog-kicker { color: var(--teal); font-size: 16px; font-weight: 750; letter-spacing: .15em; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 25px; line-height: 1; }
.icon-button:hover { background: var(--surface-soft); }
.detail-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 29px; }
.detail-heading .eyebrow { margin: 0 0 9px; }
.detail-title, .compare-heading h2, .handoff-heading h2 { margin: 0 0 11px; font-family: var(--serif); font-size: clamp(38px, 4.5vw, 62px); font-weight: 400; letter-spacing: -.045em; line-height: 1.05; }
.detail-summary { max-width: 570px; margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.6; }
.detail-status { flex: 0 0 auto; margin-top: 4px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(230px, .75fr); gap: 33px; }
.viewport-tabs { display: flex; gap: 5px; margin-bottom: 11px; }
.viewport-tab { min-width: 100px; padding: 9px 13px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 16px; font-weight: 700; }
.viewport-tab.is-active { border-color: var(--teal); background: var(--teal-light); color: var(--teal-dark); }
.detail-preview { height: min(63vh, 580px); overflow: auto; background: var(--surface-soft); border: 1px solid var(--line); scrollbar-color: #9fada6 var(--surface-soft); }
.detail-preview .preview-image-frame { min-height: 100%; }
.detail-preview .preview-image { width: 100%; height: auto; display: block; }
.detail-preview.mobile { display: flex; justify-content: center; padding: 19px; }
.detail-preview.mobile .preview-image-frame { width: min(100%, 300px); min-height: 0; background: var(--surface); box-shadow: 0 3px 20px #102b2333; }
.preview-image-frame { overflow: hidden; background: var(--surface-soft); }
.preview-unavailable { height: 100%; min-height: 180px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; color: var(--muted); font-size: 16px; }
.preview-unavailable-mark { font-family: var(--serif); font-size: 45px; color: var(--teal); }
.preview-caption { margin: 9px 0 0; color: var(--muted); font-size: 16px; }
.detail-info { padding-top: 4px; }
.text-list { padding: 0 0 18px; margin: 0 0 20px; border-bottom: 1px solid var(--line); }
.text-list-title { margin: 0 0 9px; color: var(--teal); font-size: 16px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.text-list ul { padding-left: 19px; margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.65; }
.text-list li + li { margin-top: 5px; }
.text-list li::marker { color: var(--teal); }
.text-list.positive li::marker { content: "✓  "; }
.muted { color: var(--muted); }
.small { font-size: 16px; }
.detail-actions { margin-top: 27px; }
.detail-actions .button { width: 100%; }
.detail-actions p { margin: 9px 0 0; }

.compare-dialog { width: min(1200px, calc(100vw - 34px)); }
.compare-heading { margin-bottom: 28px; }
.compare-heading p, .handoff-heading p:last-child { color: var(--ink-soft); font-size: 16px; }
.comparison-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.comparison-grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.comparison-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.comparison-column { min-width: 0; display: flex; flex-direction: column; padding: 14px; border: 1px solid var(--line); background: var(--surface); }
.comparison-column > .preview-image-frame { height: 155px; margin-bottom: 17px; border: 1px solid var(--line); }
.comparison-column > .preview-image-frame img { width: 100%; height: auto; display: block; }
.comparison-column h3 { margin: 7px 0 8px; font-family: var(--serif); font-size: 28px; font-weight: 400; letter-spacing: -.035em; }
.comparison-summary { min-height: 60px; margin-bottom: 19px; color: var(--ink-soft); font-size: 16px; line-height: 1.55; }
.comparison-column .text-list { margin-bottom: 16px; padding-bottom: 13px; }
.comparison-action { margin-top: auto; padding-top: 12px; }
.comparison-action .button { width: 100%; }

.handoff-dialog { width: min(650px, calc(100vw - 34px)); }
.handoff-heading { margin-bottom: 22px; }
.handoff-heading .eyebrow { margin-bottom: 12px; }
.handoff-choice { display: flex; gap: 17px; align-items: center; padding: 12px; margin-bottom: 24px; border: 1px solid var(--line); background: var(--surface-soft); }
.handoff-choice > .preview-image-frame { flex: 0 0 115px; height: 75px; border: 1px solid var(--line); }
.handoff-choice img { display: block; width: 100%; height: auto; }
.handoff-choice strong { display: block; margin: 2px 0 2px; font-family: var(--serif); font-size: 22px; font-weight: 400; }
.handoff-choice p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.4; }
.brief-label, .output-label { display: block; margin-bottom: 8px; font-size: 16px; font-weight: 750; }
.brief-textarea, .handoff-output { display: block; width: 100%; resize: vertical; padding: 12px 14px; border: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--ink); font-size: 16px; line-height: 1.5; }
.brief-textarea::placeholder { color: #89958f; }
.brief-help { margin: 7px 0 19px; color: var(--muted); font-size: 16px; }
.handoff-submit { width: 100%; }
.handoff-status { padding: 14px 15px; margin: 18px 0; background: var(--teal-light); border-left: 3px solid var(--teal); }
.handoff-status.copy { background: #f9f2e8; border-color: #ab7843; }
.handoff-status strong { font-size: 16px; }
.handoff-status p { margin: 3px 0 0; color: var(--ink-soft); font-size: 16px; line-height: 1.55; }
.output-label { margin-top: 19px; }
.handoff-output { min-height: 120px; background: var(--surface-soft); }
.copy-row { display: flex; align-items: center; gap: 11px; margin: 12px 0; }
.copy-status { color: var(--muted); font-size: 16px; }
.handoff-disclaimer { margin: 19px 0 0; color: var(--muted); font-size: 16px; }

@media (max-width: 1000px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-preview { height: 310px; }
  .hero { grid-template-columns: minmax(0, 1fr) 195px; gap: 6%; }
}
@media (max-width: 680px) {
  .site-header { min-height: 68px; }
  .header-note, .hero-aside, .section-note, .search-key { display: none; }
  .hero { display: block; padding-top: 32px; padding-bottom: 34px; }
  h1 { font-size: clamp(48px, 12vw, 72px); }
  .browse-section { padding-top: 32px; padding-bottom: 100px; }
  .filter-bar { flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .category-field { min-width: 0; flex: 1; }
  .card-grid { grid-template-columns: 1fr; }
  .card-preview { height: min(79vw, 380px); }
  .card-summary { min-height: 0; }
  .site-footer { flex-direction: column; gap: 5px; }
  .detail-heading { flex-direction: column; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-preview { height: 53vh; }
  .comparison-grid, .comparison-grid[data-count] { grid-template-columns: 1fr; }
  .comparison-column > .preview-image-frame { height: 180px; }
  .comparison-summary { min-height: 0; }
  .compare-bar { left: 8px; right: 8px; bottom: 8px; padding: 10px 12px; }
  .compare-bar-copy > span:last-child { display: none; }
  .compare-bar-actions { gap: 5px; }
  .compare-bar .button { padding: 9px; }
  .compare-bar .text-button { font-size: 16px; }
  .surface-dialog { max-height: 94vh; }
}
@media (max-width: 380px) {
  .section-heading h2 { font-size: 34px; }
  .tag-filter-label { flex-basis: 100%; }
  .handoff-choice > .preview-image-frame { flex-basis: 83px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; --paper: #17211e; --surface: #202c27; --surface-soft: #1b2923; --ink: #f0f5ef; --ink-soft: #c6d4ca; --muted: #a4b7aa; --line: #3b5045; --teal: #93d2b4; --teal-dark: #b2dfc6; --teal-light: #294a3b; --on-filled: #17211e; --focus-ring: #93d2b4; --shadow: 0 18px 55px rgba(0, 0, 0, .3); }
}
:root[data-theme="dark"] { color-scheme: dark; --paper: #17211e; --surface: #202c27; --surface-soft: #1b2923; --ink: #f0f5ef; --ink-soft: #c6d4ca; --muted: #a4b7aa; --line: #3b5045; --teal: #93d2b4; --teal-dark: #b2dfc6; --teal-light: #294a3b; --on-filled: #17211e; --focus-ring: #93d2b4; --shadow: 0 18px 55px rgba(0, 0, 0, .3); }
:root[data-theme="dark"] .availability.ready { color: var(--teal-dark); background: var(--teal-light); border-color: var(--line); }
:root[data-theme="dark"] .handoff-status { background: var(--teal-light); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .availability.ready { color: var(--teal-dark); background: var(--teal-light); border-color: var(--line); }
  :root:not([data-theme="light"]) .handoff-status { background: var(--teal-light); }
}

/* Hosted gallery: all formats, CLARE links, contained Office previews. */
.header-links { display: flex; align-items: center; gap: 16px; font-size: 16px; }
.header-links a { color: var(--teal); text-underline-offset: 3px; }
.site-footer a { color: inherit; text-underline-offset: 3px; }
.filter-chip .chip-count { margin-left: 6px; color: var(--muted); font-size: 16px; }
.availability.format { color: var(--teal-dark); background: var(--surface); }
.card-preview .preview-image.contain { width: 100%; height: 100%; object-fit: contain; }
.card-preview .preview-image.cover { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card-preview { height: clamp(200px, 17vw, 260px); }
.card-preview > .preview-image-frame { padding: 52px 14px 14px; }
.card-preview > .preview-image-frame.site { padding: 0; }
.card-title-button { font-size: clamp(24px, 2vw, 30px); }
.card-summary { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.detail-preview.page { display: flex; justify-content: center; align-items: center; padding: 16px; }
.detail-preview.page .preview-image-frame { min-height: 0; height: 100%; display: flex; justify-content: center; align-items: center; background: transparent; }
.detail-preview.page .preview-image { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 3px 20px #102b2333; }
.comparison-column > .preview-image-frame img, .handoff-choice img { height: 100%; object-fit: contain; }
.detail-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); font-size: 16px; }
.detail-meta dt { color: var(--muted); }
.detail-meta dd { margin: 0; color: var(--ink-soft); }
.detail-meta code, .skill-name { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; overflow-wrap: anywhere; }
.sample-note { margin: 0 0 18px; padding: 10px 12px; background: #f9f2e8; border-left: 3px solid #ab7843; color: var(--ink-soft); font-size: 16px; }
.detail-actions .button + .button { margin-top: 8px; }
.link-row { display: flex; gap: 8px; margin-top: 8px; }
.link-row input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--ink); font-size: 16px; }
.full-size-link { color: var(--teal); font-size: 16px; text-underline-offset: 3px; }
.about-note { max-width: 760px; margin: 0 clamp(22px, 5vw, 78px) 60px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 16px; }
@media (max-width: 680px) {
  .site-header { flex-wrap: wrap; gap: 10px 20px; }
  .header-links .header-note { display: inline; }
  .card-preview { height: min(62vw, 300px); }
  .compare-bar .button-dark { white-space: nowrap; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sample-note { background: var(--surface-soft); }
}

/* Tags, active filters, downloads and live site demos. */
.card-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.topic-field { min-width: 182px; }
.active-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.active-filter { border: 1px solid var(--teal); background: var(--teal-light); color: var(--teal-dark); padding: 6px 11px; border-radius: 100px; font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; text-align: left; }
.active-filter:hover { background: var(--surface); }
.tag-button { background: transparent; cursor: pointer; color: var(--teal-dark); border-color: #b3cbc0; }
.tag-button:hover { background: var(--teal-light); border-color: var(--teal); }
.detail-tag-list .detail-tags { margin-top: 2px; }
.mode-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 11px; }
.mode-button { min-height: 40px; padding: 9px 14px; border: 1px solid var(--line); background: transparent; color: var(--ink-soft); font-size: 16px; font-weight: 700; }
.mode-button.is-active { border-color: var(--teal); background: var(--teal-light); color: var(--teal-dark); }
.mode-button.is-live:not(.is-active) { border-color: var(--teal); background: var(--teal); color: var(--on-filled); }
.mode-button.is-live:not(.is-active):hover { background: var(--teal-dark); }
/* Keep the preview controls on matched semantic color pairs in the family shell.
   The legacy --on-filled alias belongs to the yellow CTA, not this mode switch. */
body[data-fc-library] .mode-button { background: var(--fc-surface); color: var(--fc-text); border-color: var(--fc-border-control); }
body[data-fc-library] .mode-button:hover { background: var(--fc-surface-soft); }
body[data-fc-library] .mode-button.is-active { background: var(--fc-selected-bg); color: var(--fc-selected-text); border-color: var(--fc-border-control); }
body[data-fc-library] .mode-button.is-live:not(.is-active) { background: var(--fc-cta-secondary); color: var(--fc-cta-secondary-text); border-color: var(--fc-cta-secondary); }
body[data-fc-library] .mode-button.is-live:not(.is-active):hover { background: var(--fc-cta-secondary-hover); }
body[data-fc-library] .mode-button.is-live:not(.is-active):active { background: var(--fc-cta-secondary-pressed); }
.detail-layout.is-live { grid-template-columns: minmax(0, 1fr); }
.live-demo { min-width: 0; }
.live-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-bottom: 11px; }
.live-toolbar .viewport-tabs { margin: 0; }
.live-stage { height: min(68vh, 640px); overflow: hidden; display: flex; justify-content: center; align-items: flex-start; background: var(--surface-soft); border: 1px solid var(--line); }
.live-stage.mobile { padding: 12px; }
.live-canvas { position: relative; flex: 0 0 auto; max-width: 100%; overflow: hidden; background: #fff; box-shadow: 0 3px 20px #102b2333; }
.live-frame { display: block; border: 0; background: #fff; transform-origin: 0 0; }
.resource-panel { display: grid; gap: 8px; margin: 0 0 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.resource-panel .button { width: 100%; text-align: center; }
.resource-pdf { justify-self: start; font-size: 16px; font-weight: 650; }
.resource-help { margin: 4px 0 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
@media (max-width: 1000px) {
  .filter-bar { flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
}
@media (max-width: 680px) {
  .topic-field { min-width: 0; flex: 1; }
  .live-stage { height: 62vh; }
  .mode-button { flex: 1; }
}

/* Use choices remain inside the existing prompt dialog. */
.usage-mode{display:block;width:100%;padding:12px 14px;border:1px solid var(--line,#d0dcd5);background:var(--paper,#fffefb);color:inherit;font:inherit;border-radius:0;margin:8px 0;}
.usage-files{border-top:1px solid var(--line,#d0dcd5);margin-top:24px;padding-top:16px;}
.usage-files summary{cursor:pointer;color:var(--accent,#216d60);font-weight:600;}
.usage-file-links{display:flex;flex-direction:column;align-items:flex-start;gap:12px;margin:16px 0;}
.usage-file-links a{color:var(--accent,#216d60);text-underline-offset:3px;}
.agent-guide-link{font-size:16px;margin-left:12px;}
.compatibility-note{flex-basis:100%;margin:6px 0;color:var(--muted,#586d65);font-size:16px;line-height:1.55;}
.native-download-status { font-size: 16px; line-height: 1.5; color: var(--muted); }


.writing-guidance { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; font-size: 16px; line-height: 1.55; }
.writing-guidance summary { color: var(--teal-dark); cursor: pointer; font-weight: 650; padding: 8px 0; }
.writing-guidance summary:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.writing-guidance p { margin: 9px 0; }
.writing-tag { color: var(--teal-dark); background: var(--teal-light); }

/* A second ring keeps focus visible over both pale previews and dark surfaces. */
:is(.card-preview-open, .button-primary, .button-dark, .mode-button.is-live):focus-visible { box-shadow: 0 0 0 3px var(--paper); }

/* Shared library control typography; card layout and preview behavior are unchanged. */
.search-field input, .category-field select, .text-button, .compare-bar .text-button, .button { font-size: 16px; }
.search-field input::placeholder { color: var(--ink-soft); }
.category-field { min-height: 54px; }

/* Ordinary interface text uses a 16px minimum, including browser-default small/code text. */
small, code, pre, sub, sup { font-size: 16px; }

/* Match the shared Writing card roles without changing template preview fitting. */
.card-preview-open { min-height: 44px; }
.compare-toggle { min-height: 44px; padding: 0; }
.card-arrow, .icon-button { width: 44px; height: 44px; flex-shrink: 0; }
.card-title-button { font-size: clamp(28px, 2.4vw, 32px); }
.card-summary { min-height: 79px; }
.card-category { letter-spacing: .08em; }
.card-top { flex-wrap: wrap; }
.tag { min-height: 32px; }
.filter-chip, .active-filter, .tag-button, .viewport-tab, .mode-button, .text-button { min-height: 44px; }
@media (max-width: 680px) {
  .card-title-button { font-size: 32px; }
  .compare-bar { flex-wrap: wrap; }
  .compare-bar-actions { width: 100%; justify-content: space-between; }
}

/* Template details prioritize purpose, getting the file and inspecting its pages. */
.template-use-case { max-width: 70ch; margin: 12px 0 0; color: var(--ink-soft); }
.template-use-case strong { color: var(--ink); }
.template-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 28px; }
.template-actions .button { width: auto; }
.template-detail-layout { align-items: start; }
.template-detail-info { min-width: 0; padding: 0; }
.template-adapt { margin-bottom: 24px; }
.template-adapt h3 { font-size: 20px; margin: 0 0 8px; font-weight: 650; }
.template-adapt p { margin: 0; color: var(--ink-soft); }
.template-detail-info .text-list-title { text-transform: none; letter-spacing: normal; font-size: 20px; color: var(--ink); }
.template-extras { display: grid; gap: 16px; }
.preview-gallery { min-width: 0; }
.template-detail-layout .detail-media > .detail-tag-list { margin-top: 24px; }
.preview-gallery-open { width: 100%; display: block; padding: 0; border: 1px solid var(--line); background: var(--surface-soft); color: var(--ink); cursor: zoom-in; }
.gallery-image-frame { position: relative; min-height: 100px; display: flex; align-items: center; justify-content: center; }
.gallery-image[hidden], .gallery-image-status[hidden] { display: none; }
.preview-retry { display: none; }
.preview-gallery:has([data-failed="true"]) > .preview-retry, .preview-reader-scroll:has([data-failed="true"]) > .preview-retry { display: inline-flex; }
.preview-gallery-open .gallery-image { display: block; width: auto; height: auto; max-width: 100%; max-height: min(56vh, 500px); }
.gallery-image-status { margin: 16px; color: var(--ink-soft); }
.gallery-image:not([hidden]) + .gallery-image-status:not([hidden]) { position: absolute; inset: 0; display: grid; place-items: center; background: var(--surface-soft); }
.preview-gallery-expand { padding-left: 0; }
.preview-lightbox { width: min(1440px, calc(100vw - 32px)); height: calc(100dvh - 32px); max-height: none; padding: 0; border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.preview-lightbox[open] { display: flex; flex-direction: column; }
.preview-lightbox::backdrop { background: #12241fe6; }
.preview-reader-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.preview-reader-header h2 { margin: 0; font-size: clamp(20px, 2.3vw, 28px); line-height: 1.2; }
.preview-reader-header .button { flex-shrink: 0; }
.preview-reader-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 20px; background: var(--surface-soft); scroll-padding: 20px; }
.preview-reader-page { position: relative; margin: 0 auto 28px; max-width: 1280px; }
.preview-reader-page .gallery-image { width: 100%; height: auto; display: block; }
.preview-reader-page .gallery-image-frame { background: var(--surface); }
@media (max-width: 560px) {
  .template-actions { gap: 8px; }
  .template-actions .button { flex: 1 1 auto; }
  .preview-reader-scroll { padding: 12px; }
  .preview-lightbox { width: calc(100vw - 12px); height: calc(100dvh - 12px); }
}

.preview-carousel { position: relative; padding: 0 24px; }
.preview-arrow { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 44px; padding: 0 0 3px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font-family: Arial, sans-serif; font-size: 32px; line-height: 1; cursor: pointer; }
.preview-arrow:hover { background: var(--teal-light); border-color: var(--teal); }
.preview-arrow-left { left: 0; }
.preview-arrow-right { right: 0; }
.preview-lightbox > .preview-arrow-left { left: 8px; }
.preview-lightbox > .preview-arrow-right { right: 8px; }
.preview-reader-header h2 { margin-right: auto; }
@media (max-width: 560px) {
  .preview-reader-header { flex-wrap: wrap; gap: 10px; }
  .preview-reader-header h2 { flex-basis: 100%; }
}

.template-file-downloads { display: grid; gap: 10px; margin-top: 16px; }
.template-file-downloads .button { display: flex; justify-content: center; width: 100%; }

.template-note { border-top: 1px solid var(--line); padding-top: 16px; }
.template-note h3 { margin: 0 0 8px; font-size: 20px; }
.template-note p { margin: 8px 0 0; color: var(--ink-soft); }
.template-note .full-size-link { font-size: 16px; }
