/* Shared interface roles. Reader prose, cover artwork and native Google UI retain their own styles. */
.catalog-site{--ui-action:#7950b5;--ui-action-hover:#674099;--ui-focus:#bda0eb;--ui-radius:10px;--ui-title:28px;--ui-section:20px;--ui-body:16px;--ui-help:14px;--ui-meta:13px;--ui-control:44px;font-size:var(--ui-body);line-height:1.7}
.catalog-site.light{--ui-focus:#7950b5}
.catalog-site :is(button,input,select,textarea){font-family:'Noto Sans Thai',Tahoma,sans-serif;letter-spacing:normal}
.catalog-site :is(button,.primary,.secondary){font-size:16px;font-weight:600;line-height:1.5;letter-spacing:normal;border-radius:var(--ui-radius);white-space:normal;overflow-wrap:break-word;transition:background-color .15s,border-color .15s,color .15s}
.catalog-site button{min-height:var(--ui-control)}
.catalog-site :is(.primary,.writer-shell .primary,.simple-auth button[type=submit],.wallet-shell .topup-next){display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:11px 18px;background:var(--ui-action);background-image:none;color:#fff;border:1px solid transparent;border-radius:var(--ui-radius);font-size:16px;font-weight:600;box-shadow:none;text-align:center}
.catalog-site :is(.primary,.writer-shell .primary,.simple-auth button[type=submit]):hover:not(:disabled){background:var(--ui-action-hover)}
.catalog-site :is(.secondary,.writer-shell .secondary){display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 16px;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:var(--ui-radius);box-shadow:none}
.catalog-site :is(button,a,input,select,textarea):focus-visible{outline:2px solid var(--ui-focus);outline-offset:3px}
.catalog-site :is(button,.primary,.secondary):disabled{opacity:.55;cursor:not-allowed}
.catalog-site #main :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]):not([type=file]){font-size:16px;line-height:1.6;min-height:46px;border-radius:var(--ui-radius);border-color:var(--line)}
.catalog-site #main :is(input,textarea)::placeholder{color:var(--muted);opacity:1}
.catalog-site #main label{font-size:14px;font-weight:600;line-height:1.7}
.catalog-site :is(.page-heading h1,.simple-auth h1,.writer-content>.page-heading h1,.payment-heading h1){font-size:var(--ui-title);font-weight:700;line-height:1.4;letter-spacing:normal;text-wrap:balance}
.catalog-site :is(.account-group h2,.topup-card h2,.writer-content h2,.payment-side h2){font-size:var(--ui-section);font-weight:600;line-height:1.5;letter-spacing:normal}
.catalog-site :is(.page-heading>p,.simple-auth-intro,.account-link small,.topup-card-title p,.payment-description,.payment-footnote,.payment-support,.payment-confirm,.simple-remember small,.google-auth-status,.simple-auth-switch,.writer-stat small){font-size:var(--ui-help);line-height:1.75;letter-spacing:normal}
.catalog-site :is(.account-link strong,.writer-nav-group a,.account-wallet,.wallet-tabs button){font-size:16px;line-height:1.6}
.catalog-site :is(.wallet-history-row small,.payment-order-id,.role-pill,.payment-state,.exchange-rate){font-size:var(--ui-meta);line-height:1.6}
.catalog-site :is(.account-link,.writer-nav-group a){min-height:48px}
.catalog-site .icon{width:20px;height:20px;flex:0 0 20px;stroke-width:1.5;vertical-align:middle}
.catalog-site :is(.bottomnav,.site-header,.writer-navigation) .icon{width:22px;height:22px;flex-basis:22px}
.catalog-site .account-link>.icon{width:16px;height:16px;flex-basis:16px;color:var(--muted)}
.catalog-site :is(.action-icon,.writer-summary-icon,.writer-avatar-mark,.payment-upload-symbol){background:transparent!important;border:0;box-shadow:none;color:var(--muted);border-radius:0}
.catalog-site :is(.account-link .action-icon,.wallet-history-row .action-icon){width:28px;height:28px;flex:0 0 28px}
.catalog-site .writer-summary-icon{width:28px;height:28px;flex:0 0 28px}
.catalog-site .writer-library-summary>button[aria-pressed=true] .writer-summary-icon{color:var(--purple)}
.catalog-site :is(.wallet-tabs button,.writer-view-switch button,.writer-menu-toggle){border-radius:8px}
.catalog-site .bottomnav a{min-width:0;min-height:48px;gap:4px}
.catalog-site .bottomnav small{font-size:12px;line-height:1.4;font-weight:500}
.catalog-site .icon-button{width:44px;height:44px;padding:10px;align-items:center;justify-content:center}
.catalog-site .simple-auth{max-width:460px}
.catalog-site .simple-password input{padding-right:74px!important}
.catalog-site .simple-password button{top:2px;right:3px;min-height:42px;min-width:64px;padding:8px;font-size:14px;font-weight:500;background:transparent;border:0;color:var(--ink)}
.catalog-site .simple-auth .simple-remember{font-size:14px;line-height:1.6}
.catalog-site .simple-auth .simple-auth-switch{font-size:14px}
.catalog-site .simple-auth-switch button{font-size:14px;min-height:44px;color:var(--purple)}
.catalog-site .auth-forgot{font-size:14px;margin:8px 0}
.catalog-site .auth-forgot a{display:inline-flex;align-items:center;min-height:40px;color:var(--purple)}
.catalog-site :is(.wallet-balance-card strong,.writer-stat strong,.account-wallet strong){font-variant-numeric:tabular-nums;letter-spacing:normal;font-weight:600}
.catalog-site .wallet-balance-card{background:var(--paper);border:1px solid var(--line);color:var(--ink);box-shadow:none}
.catalog-site .wallet-balance-card :is(p,small){color:var(--muted)}
.catalog-site :is(.wallet-mark,.profile-avatar){background:var(--soft);color:var(--purple);box-shadow:none}
.catalog-site .writer-shell{--accent:var(--ui-action)}
.catalog-site .writer-shell :is(button,.primary,.secondary){font-size:16px}
.catalog-site .writer-nav-group a{padding-block:10px;border-radius:8px}
.catalog-site .writer-nav-group>p{font-size:13px;font-weight:600;color:var(--muted)}
.catalog-site :is(.payment-card,.account-group,.profile-card,.topup-card,.form-panel.simple-auth){border-radius:16px}
.catalog-site :is(.payment-pay .topup-qr p,.payment-recipient small,.payment-upload small,#slip-file-name){font-size:14px;line-height:1.7}
.catalog-site .payment-submit{font-size:16px;min-height:46px;border-radius:10px!important}
@media(max-width:600px){.catalog-site{--ui-title:24px;--ui-section:19px}.catalog-site :is(.account-link small,.topup-card-title p,.payment-description,.payment-support,.simple-remember small){font-size:14px}.catalog-site .account-link strong{font-size:16px}.catalog-site .simple-auth{padding:24px 20px}.catalog-site .account-link{gap:10px}.catalog-site .writer-shell :is(button,.primary,.secondary){max-width:100%;min-width:0}.catalog-site .bottomnav{gap:0;padding-inline:6px}.catalog-site .bottomnav a{padding-inline:4px}}
@media(prefers-reduced-motion:reduce){.catalog-site :is(button,.primary,.secondary){transition:none}}

.catalog-site .profile-avatar .icon{width:34px;height:34px;flex-basis:34px}
.catalog-site :is(.writer-profile-media,.public-author-heading)>.icon{width:60px;height:60px;flex-basis:60px}
.catalog-site .studio-empty>.icon{width:48px;height:48px;flex-basis:48px}
@media(max-width:600px){.catalog-site .profile-avatar .icon{width:28px;height:28px;flex-basis:28px}.catalog-site .writer-profile-media>label{flex-basis:100%;min-width:0}.catalog-site .writer-profile-media input[type=file]{max-width:100%}}
@media(max-width:380px){.catalog-site .header-publish{font-size:0;width:44px;height:44px;min-width:44px;justify-content:center;padding:10px;gap:0}.catalog-site .header-publish .icon{display:block;width:20px;height:20px}}

/* Keep carousel markers circular; the surrounding hit area remains clickable. */
.catalog-site .slider-dots button{width:8px;height:8px;min-width:8px;min-height:0;padding:0;border:0;border-radius:50%;flex:0 0 8px}
.catalog-site .slider-dots button.selected{width:9px;height:9px;flex-basis:9px}

/* Cover save controls: compact neutral surface with a full touch target. */
.catalog-site .card-save.icon-button{display:grid;place-items:center;top:8px;right:8px;bottom:auto;width:34px;height:34px;min-height:34px;padding:7px!important;border-radius:50%;background:#15201eee!important;border:1px solid #ffffff30!important;color:#fff!important;box-shadow:0 2px 6px #0003;transform:none}
.catalog-site .card-save.icon-button::after{content:'';position:absolute;inset:-5px;border-radius:50%}
.catalog-site .card-save.icon-button .icon{width:18px;height:18px;fill:none;stroke-width:1.6}
.catalog-site .card-save.icon-button:hover{background:#293631!important;border-color:#ffffff80!important;transform:none;box-shadow:0 2px 6px #0003}
.catalog-site .card-save.icon-button.is-saved{background:#7950b5!important;border-color:#bda0eb!important;color:#fff!important;box-shadow:0 2px 6px #0003}
.catalog-site .card-save.icon-button.is-saved .icon{fill:currentColor}
.catalog-site .card-save.icon-button:focus-visible{outline:2px solid #fff;outline-offset:3px;transform:none}

/* Equal dimensions keep carousel arrows round and optically centered. */
.catalog-site .slider-arrow,.catalog-site .catalog-hero .slider-arrow,.catalog-site .spot-carousel .slider-arrow{display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0!important;line-height:0;box-sizing:border-box}
.catalog-site .slider-arrow .icon{display:block;width:20px;height:20px;margin:0;flex:none}

/* Align header controls without changing responsive visibility. */
.catalog-site .site-header #search-form{height:44px;align-items:center;border-radius:24px}
.catalog-site #search-form input{height:42px;min-height:0;line-height:1.5}
.catalog-site #search-form button{height:42px;min-height:42px;min-width:42px;align-items:center;justify-content:center;padding:0;border-radius:50%;flex-shrink:0}
.catalog-site #search-form>[data-icon]{display:flex;align-items:center;flex-shrink:0}
.catalog-site .site-header .theme-toggle{border-radius:50%;display:grid;place-items:center;flex-shrink:0}
.catalog-site .site-header :is(.coin,.account){height:44px;min-height:44px;border-radius:24px;align-content:center;line-height:1.5}
.catalog-site .site-header .coin{background:#f3d480;box-shadow:none}

/* Featured shelf: consistent cover proportions and a quieter backdrop. */
.catalog-site .spotlight:before{background:linear-gradient(90deg,#080f0ef2,#080f0ed9),url('assets/interesting-fantasy.webp') center/cover!important}
.catalog-site .spotlight-body{grid-template-columns:minmax(0,1fr) minmax(0,1.35fr);gap:32px;padding:24px 0}
.catalog-site .spotlight #spotlight-copy{padding:0 12px 0 0;min-width:0}
.catalog-site .spotlight #spotlight-copy h3{font-size:clamp(24px,2vw,32px);line-height:1.5}
.catalog-site .spot-track{align-items:flex-start;gap:20px;padding:12px 52px 20px;scroll-padding-inline:52px}
.catalog-site .spot-book,.catalog-site .spot-book.selected{flex:0 0 clamp(160px,15vw,250px);min-width:0;transform:none;opacity:1;border-radius:8px}
.catalog-site .spot-book .cover{width:100%;height:auto;aspect-ratio:3/4;background-size:contain;background-position:center;background-repeat:no-repeat;background-color:transparent;border:0!important;border-radius:8px;box-shadow:none}
.catalog-site .spot-book>span{font-size:13px;line-height:1.6;max-width:100%;margin-top:12px;color:#bdc8c9;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;height:42px;text-align:left}
.catalog-site .spot-book.selected>span{color:#fff}
.catalog-site .spot-book.selected .cover{outline:2px solid #bda0eb;outline-offset:4px}
.catalog-site .spot-carousel{padding-bottom:32px}
.catalog-site .spot-carousel .slider-arrow{top:calc((clamp(160px,15vw,250px) * 4 / 3) / 2 + 12px)}
@media(max-width:760px){.catalog-site .spotlight-body{grid-template-columns:1fr;gap:24px;padding:12px 0}.catalog-site .spotlight #spotlight-copy{padding:0}.catalog-site .spot-track{gap:16px;padding:10px 44px 18px}.catalog-site .spot-book,.catalog-site .spot-book.selected{flex-basis:clamp(150px,45vw,230px)}.catalog-site .spot-carousel .slider-arrow{top:calc((clamp(150px,45vw,230px) * 4 / 3) / 2 + 10px)}}

/* Hero atmosphere comes from the current cover, never unrelated artwork. */
.catalog-site #catalog-hero{background:#0c1513;overflow:hidden;isolation:isolate}
.catalog-site #catalog-hero .hero-ambience{display:block;inset:-60px!important;background-image:var(--hero-cover-art,none)!important;background-size:cover!important;background-position:center 40%!important;filter:blur(64px) saturate(.65);opacity:.22;pointer-events:none;mask-image:none!important}
.catalog-site #catalog-hero:after{background:linear-gradient(90deg,#0c1513b3,#0c151380),linear-gradient(0deg,#0c1513,transparent 65%)!important;pointer-events:none}
.catalog-site #catalog-hero .hero-inner{max-width:none;margin-inline:0;width:100%}
.catalog-site #catalog-hero .hero-cover{border:0;box-shadow:none;border-radius:8px;overflow:hidden}
.catalog-site #catalog-hero .hero-cover>img{aspect-ratio:3/4;object-fit:contain}
@media(max-width:760px){.catalog-site #catalog-hero .hero-ambience{display:none}.catalog-site #catalog-hero:after{background:none!important}}

@media(max-width:760px){.catalog-site #catalog-hero .hero-inner{padding:24px 22px 45px;min-width:0}.catalog-site #catalog-hero .hero-cover{max-width:100%}.catalog-site #catalog-hero .hero-copy{min-width:0;width:100%}}

@media(max-width:760px){.catalog-site .categories{display:flex;flex-wrap:nowrap;align-items:center;overflow-x:auto;gap:8px}.catalog-site .categories button{flex:0 0 128px;width:128px;min-width:128px;height:48px;min-height:48px;padding:10px 12px;display:flex;align-items:center;justify-content:center;white-space:nowrap;overflow-wrap:normal;word-break:normal;font-size:14px;line-height:1.5;border-radius:10px}}

.catalog-site .site-header .header-publish{width:44px;height:44px;min-width:44px;flex:0 0 44px;padding:0;border-radius:50%;gap:0;align-items:center;justify-content:center;line-height:0}
.catalog-site .site-header .header-publish .icon{display:block;width:22px;height:22px;flex:none}
.catalog-site .site-header .header-publish>[data-icon]{display:flex;align-items:center;justify-content:center}

.catalog-site .site-header .header-publish{background:transparent;border-color:var(--line);color:var(--muted)!important;box-shadow:none}
.catalog-site .site-header .header-publish:hover{background:var(--paper);border-color:var(--muted);color:var(--ink)!important}
