/* Shared Haunted Tech UI contract. Keep component layouts and meaningful states intact. */
:root { --ht-frame-shadow:0 0 0 4px var(--void),0 0 0 5px var(--gold),0 40px 80px rgba(229,9,20,.3); --ht-corner-glow:0 0 16px rgba(255,212,0,.4); }
.about-frame,.lightbox-frame,.book-modal-frame,.commission-frame { border:1px solid var(--gold); border-radius:0; box-shadow:var(--ht-frame-shadow); }
.simple-lightbox-img { border:1px solid var(--gold); border-radius:0; box-shadow:var(--ht-frame-shadow); }
.about-frame::before,.about-frame::after,.lightbox-frame::before,.lightbox-frame::after,.book-modal-frame::before,.book-modal-frame::after,.commission-frame::before,.commission-frame::after,.simple-lightbox-frame::before,.simple-lightbox-frame::after { content:''; position:absolute; width:50px; height:50px; border:2px solid var(--gold); box-shadow:var(--ht-corner-glow); z-index:10; pointer-events:none; }
.about-frame::before,.lightbox-frame::before,.book-modal-frame::before,.commission-frame::before,.simple-lightbox-frame::before { top:8px; left:8px; border-right:0; border-bottom:0; }
.about-frame::after,.lightbox-frame::after,.book-modal-frame::after,.commission-frame::after,.simple-lightbox-frame::after { bottom:8px; right:8px; border-left:0; border-top:0; }
.about-close,.lightbox-close,.book-modal-close,.commission-close,.simple-lightbox-close { width:48px; height:48px; min-width:48px; flex-shrink:0; border:1px solid var(--gold); border-radius:0; background:var(--void); color:var(--gold); font-family:'Forum',serif; font-size:1.4rem; z-index:20; }
.about-close:hover,.lightbox-close:hover,.book-modal-close:hover,.commission-close:hover,.simple-lightbox-close:hover { border-color:var(--red); background:var(--red); color:var(--bone); }
/* Text actions share geometry; filled primaries and selected tabs keep their hierarchy. */
.service-btn,.buy-btn,.find-btn,.newsletter-submit,.htf-submit,.gallery-inquire,.gallery-chip,.gallery-tab,.wp-block-button .wp-block-button__link,.wp-block-search .wp-block-search__button { border-radius:0; border-style:solid; border-width:1px; border-color:var(--gold); min-height:44px; }
.wp-block-search .wp-block-search__button { background:var(--void); color:var(--gold); font-family:'Forum',serif; }
.wp-block-search .wp-block-search__button:hover { background:var(--gold); color:var(--void); }
/* Match native form controls to the site's dark, square fields. */
.htf-field input,.htf-field textarea,.htf-field select,.newsletter-input,.wp-block-search .wp-block-search__input { border-radius:0; border:1px solid var(--border); background:var(--void); color:var(--bone); }
.transmission-channel,.lab-icon { border-radius:0; }
.transmission-channel { border-color:var(--border); }
:where(a,button,input,textarea,select,summary,[tabindex]):focus-visible { outline:2px solid var(--gold-bright); outline-offset:3px; }
:where(.about-close,.lightbox-close,.book-modal-close,.commission-close,.simple-lightbox-close):focus-visible { outline-offset:-5px; }
:where(.about-body,.lightbox-desc,.book-modal-body,.commission-body) { scrollbar-width:thin; scrollbar-color:var(--gold) var(--void); }
:where(button:disabled,[aria-disabled='true']) { cursor:not-allowed; }
@media(prefers-reduced-motion:reduce) { .about-modal.active,.lightbox.active,.book-modal.active,.commission-modal.active,.simple-lightbox.active,.buy-btn:hover,.wp-block-button .wp-block-button__link:hover { animation:none; } }
/* Mobile layout repairs: fit real content rather than concealing horizontal overflow. */
@media(max-width:1280px) {
  .logo-text-wrap { display:none; }
  .logo img { height:56px; }
  .header-inner { grid-template-columns:minmax(0,1fr) auto; gap:8px; }
  .header-right { gap:6px; min-width:0; }
  .header-cta { padding:10px; font-size:11px; letter-spacing:.08em; }
  .nav-toggle,.header-search-toggle { flex-shrink:0; }
  .section-title { display:block; max-width:100%; font-size:clamp(1.5rem,6vw,2.4rem); letter-spacing:.12em; overflow-wrap:anywhere; }
  .section-title::before,.section-title::after { display:none; }
  .gallery-footer { flex-wrap:wrap; gap:12px; }
  .gallery-arrow { flex:0 0 48px; }
  .gallery-inquire { max-width:100%; white-space:normal; text-align:center; }
  .service-btn,.buy-btn,.find-btn,.wp-block-button__link,.flagship-button { max-width:100%; white-space:normal; overflow-wrap:anywhere; text-align:center; justify-content:center; }
  .lab-grid { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:900px), (max-height:550px) {
  .about-modal,.commission-modal,.book-modal,.lightbox,.simple-lightbox { padding:12px; }
  .about-frame,.commission-frame { display:block; height:auto; max-height:calc(100dvh - 32px); overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:var(--gold) var(--void); }
  .about-frame .about-close,.commission-frame .commission-close { position:sticky; top:0; float:right; margin-bottom:-48px; }
  .about-portrait,.commission-poster { height:clamp(120px,24dvh,200px); min-height:0; }
  .commission-poster { padding:20px 60px 20px 20px; }
  .about-meta,.commission-meta { height:auto; overflow:visible; padding:24px 20px; }
  .about-bio-wrap,.commission-body-wrap { display:block; }
  .about-bio,.commission-body { overflow:visible; min-height:0; max-height:none; padding-right:0; margin-right:0; }
  .about-bio-wrap::after { display:none; }
  .about-name,.commission-title { overflow-wrap:anywhere; font-size:clamp(1.7rem,6vw,2.4rem); }
  .about-title { letter-spacing:.08em; }
  .about-handle { letter-spacing:.12em; overflow-wrap:anywhere; }
  .book-modal-frame { max-height:calc(100dvh - 32px); }
  .book-modal-topbar { padding:8px 8px 8px 20px; gap:12px; }
  .book-modal-close { margin-right:0; }
  .book-modal-breadcrumb { min-width:0; overflow-wrap:anywhere; letter-spacing:.1em; }
  .lightbox-frame { max-height:calc(100dvh - 32px); }
  .simple-lightbox-img { max-width:calc(100vw - 32px); max-height:calc(100dvh - 32px); object-fit:contain; }
  .htf-field,.htf-field input,.htf-field textarea,.htf-field select { min-width:0; max-width:100%; }
  .htf-field input,.htf-field textarea,.htf-field select,.newsletter-input { font-size:16px; }
}
@media(max-width:360px) { .site-header { padding-inline:10px; } .header-right { gap:4px; } .logo img { height:44px; } .header-cta { padding:10px 7px; font-size:10px; } }
@media(max-width:900px), (max-height:550px) {
  .lightbox-frame { display:block; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:var(--gold) var(--void); }
  .lightbox-close { position:sticky; top:0; float:right; margin-bottom:-48px; }
  .lightbox-image { min-height:160px; max-height:55dvh; }
  .lightbox-meta { padding:24px 20px; }
}
/* Loaded book/web-novel recommendations need to fit the dialog, not the page width. */
@media(max-width:900px) {
  .book-modal .crt-monitor { padding:16px 14px 56px; }
  .book-modal .crt-screen { padding:20px 16px; min-height:0; overflow-wrap:anywhere; }
  .book-modal .crt-row { grid-template-columns:20px minmax(0,1fr); gap:8px; }
  .book-modal .crt-title { min-width:0; }
  .book-modal .crt-title-name,.book-modal .crt-title-slug,.book-modal .crt-prompt,.book-modal .crt-screen .path,.book-modal .crt-screen .user { white-space:normal; overflow-wrap:anywhere; }
  .book-modal .crt-tag,.book-modal .crt-state,.book-modal .crt-meta { grid-column:2; text-align:left; }
  .book-modal .crt-tip { min-width:0; max-width:100%; width:100%; }
  .book-modal .crt-brand { letter-spacing:.15em; }
}

/* Optional Lab support uses the same square button treatment. */
.lab-support-actions { justify-content: center; margin-top: 1rem; }
.lab-support-actions .service-btn { max-width: 100%; white-space: normal; text-align: center; }
