/* The theme is applied before the first stylesheet paints. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #101714;
  --paper: #101714;
  --surface: #18221d;
  --soft: #223229;
  --soft-surface: #223229;
  --warm-surface: #382e24;
  --ink: #f2f4ea;
  --muted: #b6c2b7;
  --secondary-ink: #bbcab9;
  --link: #d9e9cb;
  --edge: #47594c;
  --line: #38483d;
  --red: #ffad9a;
  --warning-ink: #ffcc9b;
  background: var(--page);
  color: var(--ink);
}
.theme-toggle {
  background: transparent; color: inherit; font-family: inherit; font-size: 13px;
  font-weight: 600; border: 1px solid var(--line); border-radius: 100px;
  min-height: 44px; padding: 8px 13px; cursor: pointer; flex-shrink: 0;
}
.theme-toggle > span { align-items: center; justify-content: center; gap: 7px; }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.theme-to-dark, [data-theme="light"] .theme-to-light { display: none; }
.theme-to-light, [data-theme="light"] .theme-to-dark { display: inline-flex; }
.theme-toggle:hover { border-color: currentColor; }
.site-footer { align-items: flex-start; gap: 28px; }
.site-footer > .footer-identity { display: grid; justify-items: start; gap: 12px; flex-shrink: 0; }
.footer-socials { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.footer-socials a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface,#fff); color: var(--link,var(--green)); text-decoration: none; }
.footer-socials a:hover { border-color: currentColor; background: var(--soft-surface,#edf1df); }
.footer-socials svg { display: block; flex-shrink: 0; }
:focus-visible { outline: 3px solid #728932; outline-offset: 3px; }
[data-theme="dark"] :focus-visible { outline-color: #e0ee91; }
[data-theme="dark"] input::placeholder, [data-theme="dark"] textarea::placeholder { color: #abb9ac; opacity: 1; }
[data-theme="dark"] input, [data-theme="dark"] select { accent-color: #bfdf95; }
[data-theme="dark"] dialog { background: var(--surface); color: var(--ink); }
.landing-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 25px; margin-top: 24px; }
.landing-actions > a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; gap: 12px; }
.landing-actions .button { margin: 0; }
.home-guide, .home-faq, .home-quick-start { border-top: 1px solid var(--line); padding: clamp(32px,5vw,64px) 0; scroll-margin-top: 24px; }
.home-guide h2, .home-faq h2, .home-quick-start h2 { font-size: clamp(26px,3.3vw,42px); letter-spacing: -.035em; font-weight: 550; line-height: 1.1; margin: 0; }
.quick-start-intro { color: var(--muted); font-size: 1rem; line-height: 1.65; max-width: 62ch; margin: 16px 0 28px; }
.quick-start-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.quick-start-card { min-width: 0; padding: clamp(16px,2vw,24px); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.quick-start-card h3 { font-size: 1.375rem; margin: 0 0 8px; }
.quick-start-card p { color: var(--muted); font-size: 1rem; line-height: 1.6; margin: 0 0 20px; }
.quick-start-card video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #103e2c; border-radius: 10px; }
.quick-start-transcript { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; font-size: 1rem; }
@media (max-width: 700px) { .quick-start-grid { grid-template-columns: 1fr; } }
.guide-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(20px,4vw,56px); list-style: none; counter-reset: steps; padding: 0; margin: 32px 0 0; }
.guide-steps li { counter-increment: steps; }
.guide-steps li::before { content: "0" counter(steps); display: block; color: var(--muted); font: 500 13px/1.5 ui-monospace,monospace; margin-bottom: 13px; }
.guide-steps h3 { font-size: 21px; letter-spacing: -.025em; margin: 0 0 6px; }
.guide-steps p, .home-faq p { color: var(--muted); line-height: 1.65; margin: 0; max-width: 62ch; }
.home-faq { display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.45fr); gap: clamp(24px,6vw,100px); }
.home-faq h2 { max-width: 13ch; }
.home-faq details { border-bottom: 1px solid var(--line); }
.home-faq summary { padding: 16px 0; min-height: 48px; font-weight: 600; line-height: 1.45; list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.iphone-install { display: grid; grid-template-columns: 48px minmax(0,1fr); column-gap: 16px; align-items: start; }
.iphone-install img { border-radius: 11px; }
.iphone-install ol { margin: 0 0 12px; padding-inline-start: 1.4rem; }
.iphone-install li { margin: 0 0 8px; line-height: 1.55; }
.home-faq details:first-of-type summary { padding-top: 4px; }
.home-faq summary::-webkit-details-marker { display:none; }
.home-faq summary::after { content: '+'; font-size: 21px; font-weight: 400; }
.home-faq details[open] > summary::after { content: '−'; }
.home-faq details p { padding: 0 24px 18px 0; }
@media (max-width: 700px) {
  .home-faq, .guide-steps { grid-template-columns: 1fr; }
  .home-faq h2 { max-width: none; }
  .guide-steps li { padding-left: 42px; position: relative; }
  .guide-steps li::before { position: absolute; left: 0; top: 2px; }
  .theme-toggle { font-size: 12px; padding: 8px 10px; }
}

.site-header nav { margin-left: auto; }
.site-header .theme-toggle { order: 1; }
.simple-hero .landing-actions .button { margin: 0; }
.directory-hero.simple-hero { border: 1px solid var(--line); }
.simple-hero > div:first-child { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.directory-hero.simple-hero h1 { margin: 0 0 18px; }
.simple-hero p { margin: 0; }
.directory-section { scroll-margin-top: 24px; }
.workspace-welcome p:empty { display: none; }
[data-theme="dark"] .directory-hero { background: #193a2d; }
[data-theme="dark"] .brand-name { color: var(--ink); }
[data-theme="dark"] .initial, [data-theme="dark"] .confirmation-icon,
[data-theme="dark"] .slot-grid button:hover { color: #173f36; }
[data-theme="dark"] button:not(.secondary):not(.text-button):not(.theme-toggle):not(.filter-chip),
[data-theme="dark"] .button:not(.secondary) { border-color: #627a63; }
[data-theme="dark"] .directory-hero .lime { color:#173f36; }
@media (max-width:1100px) {
  .site-header .theme-toggle { order: 0; margin-left: auto; margin-right: 8px; }
  .site-header nav { margin-left: 0; }
}
@media (max-width:380px) {
  .site-header { padding-inline: 9px; }
  .site-header .brand-symbol { width: 31px; }
  .site-header .theme-toggle { margin-right: 4px; }
}

@media (max-width: 520px) {
  .theme-toggle { width: 44px; height: 44px; padding: 0; display: inline-grid; place-items: center; }
  .theme-toggle .theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .theme-toggle svg { width: 18px; height: 18px; }
}

.expert-rating { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:.875rem; margin:.4rem 0 .75rem; }
.rating-empty { color:var(--muted); }
.rating-stars { color:#82620c; letter-spacing:.08em; white-space:nowrap; }
[data-theme="dark"] .rating-stars, .expert-profile-hero .rating-stars { color:#edcf75; }
#member-rating fieldset { border:0; padding:0; margin:0; }
#member-rating legend { font-weight:600; padding:0; }
.star-picker { display:flex; gap:3px; margin:12px 0; }
.star-picker label { position:relative; display:grid; width:44px; height:44px; place-items:center; cursor:pointer; margin:0; }
.star-picker input { position:absolute; inset:0; width:100%; height:100%; opacity:0; margin:0; cursor:pointer; }
.star-picker label > span:first-of-type { font-size:32px; line-height:1; color:transparent; -webkit-text-stroke:1.3px currentColor; -webkit-text-stroke-color:var(--muted); }
.star-picker label:has(input:checked) > span:first-of-type,
.star-picker label:has(~ label input:checked) > span:first-of-type { color:#846608; -webkit-text-stroke-color:currentColor; }
[data-theme="dark"] .star-picker label:has(input:checked) > span:first-of-type,
[data-theme="dark"] .star-picker label:has(~ label input:checked) > span:first-of-type { color:#edcf75; }
.star-picker label:focus-within { outline:2px solid currentColor; border-radius:6px; }
.half-star { position:relative; display:inline-block; }
.half-star::before { content:'★'; position:absolute; inset:0 auto 0 0; width:50%; overflow:hidden; }

.privacy-choice { width:min(640px,calc(100% - 32px)); margin:24px auto 0; padding:20px; background:var(--surface,#fff); color:var(--ink,#19372f); border:2px solid var(--edge,#47594c); border-radius:14px; }
.privacy-choice h2 { font-size:1.25rem; margin-top:0; }
.privacy-choice p { font-size:.9375rem; line-height:1.5; }
.privacy-choice .actions { display:flex; flex-wrap:wrap; gap:12px; }
.privacy-choice button { min-height:44px; flex:1 1 200px; }
