/* Themes, readable type and penalty highlights. Loaded after styles.css/motion.css and overrides them.
   Light is the default (theme-init.js sets html[data-theme]); dark keeps the original look. */

/* ---------- Larger small text (generated from styles.css sizes: 6-12px -> 11-13.5px) ---------- */
.brand small,.art-caption,.panel-kicker,.page-footer,.category-number,.city-art-caption,.community-panel .panel-kicker,.footer-brand small,.preview-kicker,.preview-socials span,.eyebrow,.footer-brand,.hero-text .eyebrow,.reader-position-label{font-size:11px}
.nav-label,.sidebar-footer small,.eyebrow,.small-label,.category-number,.activity-mini small,.page-footer>span:last-child,.badge,.modal-kicker,.category-card p,.keyboard,.history-meta,.reader-meta,.search-hints,.search-hints button,.admin-privacy-label,.footer-brand,.footer-socials .social-contact.compact,.preview-content>p,.preview-search,.preview-card-grid>div,.home-social-bar>span,.home-settings-link,.mobile-bottom-nav>a,.mobile-bottom-nav>button,.settings-help,.settings-preview-label,.settings-savebar>span,.reader-position-label,#read-percent,.pager-link small{font-size:11.5px}
.category-label span,.nav-count,.sidebar-note,.sidebar-note a,.mini-logo,.keyboard,.search-hints,.search-hints button,.section-heading p,.category-card p,.start-item span:first-child,.rail-title a,.row-body p,.row-end,.search-hit,.reader-meta,.fine-tag,.note-tag,.tag-blacklist,.article-toc a,.article-toc .button,.history-meta,.history-actions .button,.user-chip .avatar,.user-actions button,.editor-bar small,.form-field small,.form-note,.diff-entry label,.version-tabs .chip,.revision-controls p,.catalog-summary,.breadcrumb,.reader-tools .button,.list-section .row-body p,.editor-bar .button,.hero-subtitle,.searchbar input,.reader-content .rule-num,.version-diff-label,.search-submit,.social-contact.compact,.home-social-bar>span,.home-settings-link,.contact-edit-row .form-field,.settings-preview-label,.settings-help,.settings-savebar>span,.settings-image-status,.home-social-bar .social-contact.compact,.settings-fields .form-field small,.reader-position,.pager-link small,#reader-current-heading{font-size:12px}
.category-label,.sidebar-note p,.sidebar-footer,.breadcrumb,.reading-panel>p,.start-item,.activity-mini b,.empty-mini,.chip,.list-section .row-body p,.result-count,.search-snippet,.back-link,.rule-num,.stat-label,.article-toc h3,.history-avatar,.notice,.user-chip,.user-menu-pop a,.user-menu-pop button,.panel>p,.permission-options label,.editor-bar,.edit-tip,.form-field,.form-error,.revision-meta,.connection-warning,.searchbar input,.hero-subtitle,.history-summary,.row-body h3,.login-button,.mobile-toc a,.table-scroll .rule-table,.social-contact,.community-panel>p,.settings-panel-heading p,.settings-fields .panel>p,.contact-edit-row input,.contact-edit-row select,.upload-field input,.range-field output,.search-submit,.settings-savebar .button,.pager-link strong{font-size:13px}
.button,.page-intro,.hero-subtitle,.searchbar input,.rail-title,.row-body h3,.empty-state p,.rule-table,.field-select,.field-input,.history-summary,.editor-bar strong,.loading,.modal-subtitle,.diff-old,.diff-new,#toast,.catalog-summary b,.reader-content .search-empty,.brand,.nav-link,.category-card h3,.history-title,.list-section .row-body h3,.mobile-toc,.brand-name,.checkbox-field,.reader-content .rule-table,.login-divider,.user-card .user-email,.user-card .user-ops,.pager-link strong,.mobile-toc summary,.mobile-toc a{font-size:13.5px}
/* ---------- Readable type (both themes) ---------- */
:root{--font:'Noto Sans Thai','IBM Plex Sans Thai',sans-serif}
body{font-size:15px;line-height:1.75;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
.reader-content{font-size:16px;line-height:1.95}
.reader-content .subsection-title{font-size:19px;font-weight:600}
.reader-content .rule-card{padding:18px 20px}
.reader-content .rule-table,.table-scroll .rule-table{font-size:14.5px;line-height:1.8}
.rule-table th{font-weight:600}
.rule-table td:first-child,.rule-table th:first-child{white-space:nowrap}
.reader-content .info-box,.reader-content .warn-box{font-size:15px}
.reader-content strong{font-weight:600}
.nav-link{font-size:14px}
.category-card h3,.row-body h3,.list-section .row-body h3{font-size:15px}
.reader-heading h1{font-weight:600}

/* ---------- Penalty highlights (both themes) ---------- */
.fine-tag,.tag-blacklist,.badge-red,.badge-gold,.note-tag,.badge-gray,.reader-content .hi-red,.penalty-mark{font-weight:600}
.fine-tag,.badge-red{color:var(--pen-red);background:var(--pen-red-bg);border-color:var(--pen-red-line)!important}
.tag-blacklist{color:var(--pen-black);background:var(--pen-black-bg);border-color:var(--pen-black-line)!important}
.badge-gold,.note-tag{color:var(--pen-gold);background:var(--pen-gold-bg);border-color:var(--pen-gold-line)!important}
.badge-gray{color:var(--muted);background:var(--surface);border-color:var(--line)!important}
.fine-tag,.note-tag,.tag-blacklist,.reader-content .badge{font-size:12.5px;padding:2px 9px;border-radius:6px;white-space:normal;line-height:1.7;display:inline-block}
.reader-content .hi-red{color:var(--pen-red);font-weight:600}
.reader-content .hi-gold{color:var(--pen-gold);font-weight:600}
.reader-content .hi-blue{color:var(--hi-blue);font-weight:600}
.reader-content .hi-green{color:var(--hi-green);font-weight:600}
.reader-content .rule-card.highlight-red{border-left:3px solid var(--pen-red);background:var(--pen-red-bg)}
.reader-content .rule-card.highlight-gold{border-left:3px solid var(--pen-gold);background:var(--pen-gold-bg)}
.reader-content .rule-card.highlight-blue{border-left:3px solid var(--hi-blue)}
.reader-content .rule-card.highlight-green{border-left:3px solid var(--hi-green)}
/* Table column whose header is "โทษ"/"ค่าปรับ"… (marked by app.js) and penalty phrases in running text. */
.reader-content td.penalty-cell{color:var(--pen-red);font-weight:600;background:var(--pen-cell-bg)}
.reader-content th.penalty-cell{color:var(--pen-red)}
.penalty-mark{color:var(--pen-red);background:var(--pen-red-bg);padding:0 4px;border-radius:4px;box-decoration-break:clone;-webkit-box-decoration-break:clone}

:root{--pen-red:#f0a3b4;--pen-red-bg:#e4a4b512;--pen-red-line:#e4a4b540;--pen-cell-bg:#e4a4b508;--pen-gold:#e2c98f;--pen-gold-bg:#d5c09212;--pen-gold-line:#d5c09240;--pen-black:#ffd0d8;--pen-black-bg:#c2384f40;--pen-black-line:#e4627a66;--hi-blue:#a9c4ec;--hi-green:#a5d3b8}


.theme-switching *,.theme-switching *:before,.theme-switching *:after{transition:none!important}

/* ---------- Light theme ---------- */
:root[data-theme="light"]{color-scheme:light;--bg:#f5f5f8;--text:#1d1b26;--muted:#585568;--subtle:#7a7789;--line:rgba(30,26,60,.12);--surface:#f6f5fa;--surface-hover:#eeecf5;--accent:#5b3fb8;
  --pen-red:#c0182f;--pen-red-bg:#fdecee;--pen-red-line:#f3b8c1;--pen-cell-bg:#fff6f7;--pen-gold:#8a5a00;--pen-gold-bg:#fff4dc;--pen-gold-line:#efd394;--pen-black:#ffffff;--pen-black-bg:#b0142b;--pen-black-line:#b0142b;--hi-blue:#1f5fbf;--hi-green:#17784a}
:root[data-theme="light"] body{background:#eff0f4;background-image:none;color:var(--text)}
:root[data-theme="light"] .ambient{display:none}
:root[data-theme="light"] .app-shell{background:#fff;border-color:#e3e2ea;box-shadow:0 10px 40px #1d1b2614;backdrop-filter:none}
:root[data-theme="light"] .sidebar{background:#fafafc}
:root[data-theme="light"] .brand-symbol i,:root[data-theme="light"] .live-dot{background:var(--accent);box-shadow:none}
:root[data-theme="light"] .sidebar-inner{scrollbar-color:#0002 transparent}
:root[data-theme="light"] .category-label span,:root[data-theme="light"] .nav-count{color:var(--subtle)}
:root[data-theme="light"] .nav-link:hover,:root[data-theme="light"] .icon-button:hover{color:var(--text)}
:root[data-theme="light"] .nav-link.active{background:#efeafc;border-color:#ddd3f6;color:#3d2690;box-shadow:inset 2px 0 var(--accent)}
:root[data-theme="light"] .nav-link[aria-current="page"]:before{background:var(--accent)}
:root[data-theme="light"] .sidebar-note{background:#f6f4fb;color:var(--muted)}
:root[data-theme="light"] .sidebar-note a{color:var(--accent)}
:root[data-theme="light"] .mini-logo{border-color:#ddd3f6;color:var(--accent);background:#f3effc}
:root[data-theme="light"] .breadcrumb strong{color:var(--text)}
:root[data-theme="light"] .button{color:var(--text)}
:root[data-theme="light"] .button:hover{border-color:#cfcbe0}
:root[data-theme="light"] .login-button{border-color:#d6ccf3;background:#f3effc;color:#3d2690}
:root[data-theme="light"] .primary,:root[data-theme="light"] .primary:hover{background:var(--accent);border-color:var(--accent);color:#fff}
:root[data-theme="light"] .primary:hover{background:#4a2fa3}
:root[data-theme="light"] .danger{color:#b4233c;border-color:#efc0c9}
:root[data-theme="light"] .eyebrow,:root[data-theme="light"] .panel-kicker,:root[data-theme="light"] .modal-kicker,:root[data-theme="light"] .preview-kicker{color:#6a52b8}
:root[data-theme="light"] .eyebrow .line{background:#a693de}
:root[data-theme="light"] .hero-text h1 em{color:var(--accent)}
:root[data-theme="light"] .hero-subtitle,:root[data-theme="light"] .reading-panel>p,:root[data-theme="light"] .community-panel>p,:root[data-theme="light"] .category-card p,:root[data-theme="light"] .history-summary,:root[data-theme="light"] .settings-help,:root[data-theme="light"] .modal-subtitle,:root[data-theme="light"] .edit-tip,:root[data-theme="light"] .revision-meta,:root[data-theme="light"] .empty-mini{color:var(--muted)}
:root[data-theme="light"] .orbit,:root[data-theme="light"] .logo-orbit{border-color:#d9d0f2;box-shadow:none}
:root[data-theme="light"] .logo-orbit{background:radial-gradient(ellipse,#e9e0fb80,transparent 70%)}
:root[data-theme="light"] .logo-orbit:before{border-color:#d9d0f2}
:root[data-theme="light"] .hero-city-logo{filter:drop-shadow(0 6px 22px #1d1b2626)}
:root[data-theme="light"] .art-center{background:#f3effc;border-color:#ddd3f6;box-shadow:none}
:root[data-theme="light"] .art-center svg,:root[data-theme="light"] .art-star{color:var(--accent)}
:root[data-theme="light"] .art-caption,:root[data-theme="light"] .city-art-caption{color:var(--subtle)}
:root[data-theme="light"] .home-background{filter:saturate(.8) brightness(1.05);opacity:.35}
:root[data-theme="light"] .searchbar{background:#fff;border-color:#d8d5e4;box-shadow:0 1px 3px #1d1b260d}
:root[data-theme="light"] .searchbar:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px #5b3fb81f}
:root[data-theme="light"] .searchbar svg,:root[data-theme="light"] .search-submit{color:var(--accent)}
:root[data-theme="light"] .search-submit:hover{color:#3d2690}
:root[data-theme="light"] .searchbar input::placeholder,:root[data-theme="light"] .form-field input::placeholder,:root[data-theme="light"] .form-field textarea::placeholder{color:#8d8a9c}
:root[data-theme="light"] .keyboard{border-color:#d8d5e4;color:var(--subtle)}
:root[data-theme="light"] .search-hints{color:var(--subtle)}
:root[data-theme="light"] .search-hints button{color:#4b4760;background:#f3f2f7;border-color:#e3e1ea}
:root[data-theme="light"] .search-hints button:hover{color:var(--accent)}
:root[data-theme="light"] .category-card,:root[data-theme="light"] .reading-panel,:root[data-theme="light"] .community-panel{background:#fff;border-color:#e3e1ea;box-shadow:0 1px 3px #1d1b260a}
:root[data-theme="light"] .category-card:hover{background:#fff;border-color:#cfc5ef;box-shadow:0 10px 26px #1d1b2614}
:root[data-theme="light"] .category-icon:before{background:#ffffffe0}
:root[data-theme="light"] .category-number,:root[data-theme="light"] .category-arrow,:root[data-theme="light"] .start-item span:first-child{color:var(--subtle)}
:root[data-theme="light"] .category-card:hover .category-arrow,:root[data-theme="light"] .start-item:hover,:root[data-theme="light"] .start-item span:last-child,:root[data-theme="light"] .rail-title a,:root[data-theme="light"] .home-settings-link,:root[data-theme="light"] .history-meta button,:root[data-theme="light"] .search-hit{color:var(--accent)}
:root[data-theme="light"] .lavender{--tone:#7154c9}
:root[data-theme="light"] .blue{--tone:#2f6bc4}
:root[data-theme="light"] .pink{--tone:#c2427a}
:root[data-theme="light"] .gold{--tone:#a87410}
:root[data-theme="light"] .mint{--tone:#1f8a62}
:root[data-theme="light"] .peach{--tone:#c25a2e}
:root[data-theme="light"] .activity-mini{border-color:#e3e1ea}
:root[data-theme="light"] .activity-mini:before{background:var(--accent);border-color:#fff}
:root[data-theme="light"] .article-row:hover{border-color:#d6ccf3}
:root[data-theme="light"] .row-icon,:root[data-theme="light"] .history-avatar,:root[data-theme="light"] .user-chip .avatar{border-color:#ddd3f6;color:var(--accent);background:#f3effc}
:root[data-theme="light"] .row-end,:root[data-theme="light"] .reader-meta,:root[data-theme="light"] .back-link,:root[data-theme="light"] .history-meta,:root[data-theme="light"] .catalog-summary,:root[data-theme="light"] .page-footer,:root[data-theme="light"] .footer-brand small,:root[data-theme="light"] .admin-privacy-label,:root[data-theme="light"] .settings-image-status,:root[data-theme="light"] .form-field small,:root[data-theme="light"] .form-note,:root[data-theme="light"] .revision-controls p,:root[data-theme="light"] .pager-link small,:root[data-theme="light"] .reader-position-label,:root[data-theme="light"] #read-percent,:root[data-theme="light"] .home-social-bar>span{color:var(--subtle)}
:root[data-theme="light"] .chip.active{background:#efeafc;color:#3d2690;border-color:#d6ccf3}
:root[data-theme="light"] .chip:hover{background:var(--surface-hover)}
:root[data-theme="light"] .badge{background:#f3effc;border-color:#ddd3f6;color:#4a33a0}
:root[data-theme="light"] .badge-blue{color:#1f5fbf;background:#eaf2fd;border-color:#c4d8f4}
:root[data-theme="light"] .badge-green{color:#17784a;background:#e8f6ee;border-color:#bfe3cf}
:root[data-theme="light"] .status-dot,:root[data-theme="light"] .footer-dot{background:#2a9d6a}
:root[data-theme="light"] .empty-state{border-color:#d8d5e4;background:#fbfbfd}
:root[data-theme="light"] .empty-state svg{color:var(--accent)}
:root[data-theme="light"] .empty-state h2{color:var(--text)}
:root[data-theme="light"] .reader-content{color:#22202c}
:root[data-theme="light"] .reader-content .subsection-title{color:#15131d;border-left-color:var(--accent)}
:root[data-theme="light"] .reader-content .rule-card{background:#fff;border-color:#e3e1ea}
:root[data-theme="light"] .rule-num{background:#f3effc;border-color:#ddd3f6;color:#4a33a0}
:root[data-theme="light"] .reader-content .info-box{color:#22202c;background:#eef4fd;border-color:#c8daf3;border-left-color:#2f6bc4}
:root[data-theme="light"] .reader-content .warn-box{color:#22202c;background:#fff4e5;border-color:#f1d4a4;border-left-color:#d4870f}
:root[data-theme="light"] .rule-list li{border-bottom-color:#eceaf1}
:root[data-theme="light"] .rule-list li:before{color:var(--accent)}
:root[data-theme="light"] .rule-table{border-color:#dedbe7}
:root[data-theme="light"] .rule-table th{color:#2c2840;background:#f4f2f9}
:root[data-theme="light"] .rule-table td,:root[data-theme="light"] .rule-table th{border-bottom-color:#eceaf1}
:root[data-theme="light"] .rule-table tr:nth-child(even) td:not(.penalty-cell){background:#fbfbfd}
:root[data-theme="light"] .protect-card,:root[data-theme="light"] .zone-card,:root[data-theme="light"] .stat-block{background:#fbfbfd;border-color:#e3e1ea}
:root[data-theme="light"] .stat-val{color:var(--accent)}
:root[data-theme="light"] .article-toc h3{color:var(--text)}
:root[data-theme="light"] .article-toc a{color:var(--muted)}
:root[data-theme="light"] .article-toc a:hover,:root[data-theme="light"] .article-toc a.current{color:#3d2690;border-left-color:var(--accent);background:#f3effc}
:root[data-theme="light"] .mobile-toc{color:var(--text);background:#fbfbfd}
:root[data-theme="light"] .mobile-toc a{color:var(--muted)}
:root[data-theme="light"] .mobile-toc a.current{color:#3d2690;background:#f3effc}
:root[data-theme="light"] .read-progress,:root[data-theme="light"] .reader-position-track{background:#ecebf2}
:root[data-theme="light"] .read-progress span,:root[data-theme="light"] .reader-position-progress,:root[data-theme="light"] .route-progress>span{background:var(--accent)}
:root[data-theme="light"] .reader-position{background:#ffffffef;border-color:#e3e1ea;box-shadow:0 4px 16px #1d1b260f}
:root[data-theme="light"] #reader-current-heading{color:var(--text)}
:root[data-theme="light"] .pager-link strong{color:var(--text)}
:root[data-theme="light"] .pager-link>svg{color:var(--accent)}
:root[data-theme="light"] .pager-link:hover{background:#f6f3fd;border-color:#d6ccf3}
:root[data-theme="light"] .saved{color:var(--accent)}
:root[data-theme="light"] .saved svg{fill:#5b3fb833}
:root[data-theme="light"] .field-select,:root[data-theme="light"] .field-input,:root[data-theme="light"] .form-field input,:root[data-theme="light"] .form-field textarea,:root[data-theme="light"] .form-field select{background:#fff;border-color:#d8d5e4;color:var(--text)}
:root[data-theme="light"] .field-select option,:root[data-theme="light"] .form-field select option{background:#fff;color:var(--text)}
:root[data-theme="light"] .form-field,:root[data-theme="light"] .checkbox-field{color:#3b3850}
:root[data-theme="light"] .form-error,:root[data-theme="light"] .error-notice{color:#b4233c}
:root[data-theme="light"] .history-title a:hover{color:var(--accent)}
:root[data-theme="light"] .notice{color:#3b3850;background:#f6f3fd;border-color:#ddd3f6}
:root[data-theme="light"] .notice strong{color:var(--text)}
:root[data-theme="light"] .error-notice{background:#fdecee;border-color:#f3b8c1}
:root[data-theme="light"] .user-menu-pop{background:#fff;border-color:#e3e1ea;box-shadow:0 14px 40px #1d1b2626}
:root[data-theme="light"] .user-menu-pop a,:root[data-theme="light"] .user-menu-pop button{color:#3b3850}
:root[data-theme="light"] .user-menu-pop a:hover,:root[data-theme="light"] .user-menu-pop button:hover{background:#f3effc;color:#3d2690}
:root[data-theme="light"] .user-actions button{color:var(--accent)}
:root[data-theme="light"] .editor-bar,:root[data-theme="light"] .settings-savebar{background:#ffffffef;border-color:#d6ccf3;box-shadow:0 8px 30px #1d1b261a}
:root[data-theme="light"] .editor-bar strong{color:#3d2690}
:root[data-theme="light"] .editor-bar small,:root[data-theme="light"] .settings-savebar>span{color:var(--muted)}
:root[data-theme="light"] .editing [data-block]{outline-color:#b7a6e6}
:root[data-theme="light"] .editing [data-block]:hover,:root[data-theme="light"] .editing [data-block]:focus,:root[data-theme="light"] .editing [data-changed]{background:#f1ecfd}
:root[data-theme="light"] .spinner{border-color:#5b3fb82a;border-top-color:var(--accent)}
:root[data-theme="light"] dialog{background:#fff;border-color:#e3e1ea;box-shadow:0 30px 100px #1d1b2640}
:root[data-theme="light"] dialog::backdrop{background:#1d1b2659}
:root[data-theme="light"] .version-preview{background:#fbfbfd}
:root[data-theme="light"] .diff-entry label,:root[data-theme="light"] .version-diff-label{color:var(--muted)}
:root[data-theme="light"] .diff-old{background:#fdecee;color:#8c1d30;border-left-color:#e48a9b}
:root[data-theme="light"] .diff-new{background:#e8f6ee;color:#14603c;border-left-color:#6cc196}
:root[data-theme="light"] #toast{background:#1d1b26f2;color:#fff;border-color:transparent}
:root[data-theme="light"] #toast.error{background:#b4233cf2;color:#fff}
:root[data-theme="light"] .connection-warning{color:#7a4f00;background:#fff4dc;border-color:#efd394}
:root[data-theme="light"] mark{background:#ffe58a;color:#1d1b26}
:root[data-theme="light"] .catalog-summary b{color:var(--accent)}
:root[data-theme="light"] .city-logo{filter:drop-shadow(0 2px 6px #1d1b2626)}
:root[data-theme="light"] .social-contact{color:#3b3850;background:#fff}
:root[data-theme="light"] .social-contact:hover{background:#f3effc;border-color:#d6ccf3;color:#3d2690}
:root[data-theme="light"] .social-contact .social-arrow{color:var(--accent)}
:root[data-theme="light"] .facebook svg{color:#1877f2}
:root[data-theme="light"] .tiktok svg{color:#1d1b26}
:root[data-theme="light"] .discord svg{color:#5865f2}
:root[data-theme="light"] .community-links .social-contact{background:#fff}
:root[data-theme="light"] .footer-socials .social-contact.compact{color:var(--muted);background:none}
:root[data-theme="light"] .footer-socials .social-contact:hover{color:var(--accent)}
:root[data-theme="light"] .settings-preview-label{color:var(--muted)}
:root[data-theme="light"] .upload-field input::file-selector-button{background:#efeafc;color:#3d2690}
:root[data-theme="light"] .range-field output{color:var(--accent)}
:root[data-theme="light"] .permission-options input,:root[data-theme="light"] .checkbox-field input,:root[data-theme="light"] .range-field input{accent-color:var(--accent)}
:root[data-theme="light"] .ops-grant{border-color:#ddd3f6;background:#f8f6fd}
@media(max-width:760px){
  :root[data-theme="light"] .app-shell{box-shadow:none}
  :root[data-theme="light"] .sidebar{background:#fff;box-shadow:12px 0 40px #1d1b2626}
  :root[data-theme="light"] .sidebar-scrim.open,:root[data-theme="light"] .sidebar-scrim{background:#1d1b2659}
  :root[data-theme="light"] .mobile-bottom-nav{background:#ffffffef;border-top-color:#e3e1ea;box-shadow:0 -6px 24px #1d1b2614}
  :root[data-theme="light"] .mobile-bottom-nav>a,:root[data-theme="light"] .mobile-bottom-nav>button{color:var(--subtle)}
  :root[data-theme="light"] .mobile-bottom-nav .active{color:#3d2690;background:#efeafc}
}

/* Full-width cover image at the top of an article (e.g. งัดร้านลูป). */
.reader-content .section-banner.cover{width:100%;height:auto;max-height:none;border-radius:14px;border:1px solid var(--line);margin:0 0 24px}

/* ---------- Colourful topic icons (colour emoji, no tile) ---------- */
.emoji-icon{display:grid;place-items:center;width:100%;height:100%;font-family:'Segoe UI Emoji','Apple Color Emoji','Noto Color Emoji',sans-serif;font-size:20px;line-height:1;font-style:normal;background:none}
.category-icon{width:46px;height:46px;border:0;background:none;border-radius:13px;isolation:auto}
.category-icon:before{display:none}
.category-icon .emoji-icon{font-size:30px}
.row-icon,:root[data-theme] .row-icon{width:40px;height:40px;border:0;background:none;padding:0;border-radius:11px}
.row-icon .emoji-icon{font-size:24px}
.nav-link .emoji-icon{width:22px;height:22px;flex-shrink:0;font-size:18px}
.reader-title{display:flex;align-items:center;gap:14px}
.reader-title .emoji-icon{width:40px;height:40px;flex-shrink:0;font-size:32px}
@media(max-width:760px){.reader-title .emoji-icon{width:32px;height:32px;font-size:26px}}

/* ---------- Rich editor: toolbar, highlight / text colours, fonts, added blocks, images ---------- */
.rich-toolbar{flex-basis:100%;display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center;padding-top:10px;margin-top:2px;border-top:1px solid #c9a9eb40}
.tb-group{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.tb-label{font-size:12px;color:#b49cc9;margin-right:2px}
.tb-btn{min-width:32px;height:32px;padding:0 9px;border-radius:8px;border:1px solid #c9a9eb55;background:#ffffff10;color:#f1e7fb;font:inherit;font-size:13px;cursor:pointer}
.tb-btn:hover{border-color:#c9a9eb;background:#ffffff1c}
.tb-btn.wide{font-size:12.5px}
.tb-btn.danger{color:#ff8fa0;border-color:#ff8fa077}
.tb-swatch{width:24px;height:24px;border-radius:50%;border:2px solid #ffffff55;cursor:pointer;padding:0}
.tb-swatch:hover{transform:scale(1.12)}
.tb-font{height:32px;border-radius:8px;border:1px solid #c9a9eb55;background:#1d1828;color:#f1e7fb;font:inherit;font-size:12.5px;padding:0 8px;max-width:190px}
:root[data-theme="light"] .rich-toolbar{border-top-color:#e4dcf7}
:root[data-theme="light"] .tb-label{color:var(--muted)}
:root[data-theme="light"] .tb-btn{background:#f6f3ff;border-color:#d6ccf3;color:#2b2140}
:root[data-theme="light"] .tb-btn:hover{border-color:#8f78d8;background:#ede7ff}
:root[data-theme="light"] .tb-btn.danger{color:#c4203c;border-color:#f0b4bf}
:root[data-theme="light"] .tb-swatch{border-color:#00000026}
:root[data-theme="light"] .tb-font{background:#fff;border-color:#d6ccf3;color:#2b2140}
/* phones: one row that scrolls sideways, so the sticky bar does not cover the text */
@media(max-width:760px){.rich-toolbar{flex-wrap:nowrap;overflow-x:auto;gap:12px;padding-bottom:4px;scrollbar-width:thin}.tb-group{flex-wrap:nowrap;flex:none}}

/* highlight (background) and text colours: readable in both themes */
.tb-swatch[data-fmt="c"][data-color="yellow"],mark[data-c="yellow"]{background:#fde68a}
.tb-swatch[data-fmt="c"][data-color="green"],mark[data-c="green"]{background:#bbf7d0}
.tb-swatch[data-fmt="c"][data-color="blue"],mark[data-c="blue"]{background:#bfdbfe}
.tb-swatch[data-fmt="c"][data-color="pink"],mark[data-c="pink"]{background:#fbcfe8}
.tb-swatch[data-fmt="c"][data-color="orange"],mark[data-c="orange"]{background:#fed7aa}
.tb-swatch[data-fmt="c"][data-color="purple"],mark[data-c="purple"]{background:#ddd6fe}
mark[data-c]{color:#1d1b26;border-radius:4px;padding:0 3px;box-decoration-break:clone;-webkit-box-decoration-break:clone}
:root[data-theme="dark"] mark[data-c="yellow"]{background:#facc1540;color:#fef3c7}
:root[data-theme="dark"] mark[data-c="green"]{background:#22c55e38;color:#dcfce7}
:root[data-theme="dark"] mark[data-c="blue"]{background:#3b82f640;color:#dbeafe}
:root[data-theme="dark"] mark[data-c="pink"]{background:#ec489940;color:#fce7f3}
:root[data-theme="dark"] mark[data-c="orange"]{background:#f9731640;color:#ffedd5}
:root[data-theme="dark"] mark[data-c="purple"]{background:#8b5cf645;color:#ede9fe}
.tb-swatch[data-fmt="k"][data-color="red"]{background:#dc2626}.tb-swatch[data-fmt="k"][data-color="orange"]{background:#ea580c}.tb-swatch[data-fmt="k"][data-color="green"]{background:#16a34a}
.tb-swatch[data-fmt="k"][data-color="blue"]{background:#2563eb}.tb-swatch[data-fmt="k"][data-color="purple"]{background:#7c3aed}.tb-swatch[data-fmt="k"][data-color="gray"]{background:#6b7280}
span[data-k="red"]{color:#dc2626}span[data-k="orange"]{color:#ea580c}span[data-k="green"]{color:#16a34a}
span[data-k="blue"]{color:#2563eb}span[data-k="purple"]{color:#7c3aed}span[data-k="gray"]{color:#6b7280}
:root[data-theme="dark"] span[data-k="red"]{color:#f87171}:root[data-theme="dark"] span[data-k="orange"]{color:#fb923c}:root[data-theme="dark"] span[data-k="green"]{color:#4ade80}
:root[data-theme="dark"] span[data-k="blue"]{color:#60a5fa}:root[data-theme="dark"] span[data-k="purple"]{color:#c4b5fd}:root[data-theme="dark"] span[data-k="gray"]{color:#a1a1aa}

/* blocks added in the editor and uploaded images */
.reader-content .rule-figure{margin:22px 0;text-align:center}
.reader-content .rule-figure img{display:block;max-width:100%;height:auto;margin:0 auto;border-radius:14px;border:1px solid var(--line)}
.reader-content .rule-figure figcaption{margin-top:8px;font-size:14px;color:var(--muted)}
.reader-content .rule-figure figcaption:empty{display:none}
.reader-content.editing .rule-figure figcaption:empty{display:block}
.reader-content.editing [data-added]{outline:1.5px dashed #8b5cf6aa;outline-offset:3px;border-radius:6px}
.reader-content.editing [data-added]:empty::before{content:attr(data-ph);color:var(--muted);opacity:.75}
.reader-content .empty-page{padding:40px 20px;text-align:center;color:var(--muted);border:1.5px dashed var(--line);border-radius:14px}

/* ---------- Beginner-first home / start page (design: Figma "Private City Rulebook — UI ผู้เล่นใหม่") ---------- */
.bx-hero{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(280px,1fr);gap:40px;align-items:center}
.bx-hero .hero-text{max-width:680px}
.bx-hero h1{font-size:44px;line-height:1.3;letter-spacing:-.01em}
.bx-hero .hero-subtitle{font-size:18px;line-height:1.7;max-width:600px}
.bx-hero .searchbar{margin:22px 0 12px}
.bx-hero .search-hints{margin:0}
.path-card{background:var(--card,#fff);border:1px solid var(--line);border-radius:22px;padding:26px;display:flex;flex-direction:column;gap:6px;box-shadow:0 10px 30px #1d1b260d}
.path-card h3{font-size:18px;margin:0 0 8px}
.path-step{display:grid;grid-template-columns:32px 1fr auto;gap:12px;align-items:center;padding:9px 6px;border-radius:12px;color:var(--text);font-size:15.5px;text-decoration:none}
.path-step:hover{background:var(--surface-hover)}
.path-step small{color:var(--subtle);font-size:13px}
.path-n{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:color-mix(in srgb,var(--accent) 14%,transparent);color:var(--accent);font-weight:700;font-size:14px}
.path-start{align-self:flex-start;margin-top:10px}
.bx-sec{margin:44px 0 8px}
.bx-sec .section-heading{align-items:flex-end;margin-bottom:20px}
.bx-sec .section-heading h2{font-size:26px;line-height:1.35}
.bx-sec .section-heading p{font-size:15.5px;line-height:1.6;color:var(--muted);margin-top:6px}
.must-grid{display:grid;grid-template-columns:1.25fr 1fr 1fr;grid-auto-rows:minmax(0,auto);gap:14px}
.must-card{background:var(--card,#fff);border:1px solid var(--line);border-radius:18px;padding:22px;display:flex;flex-direction:column;gap:10px;color:var(--text);text-decoration:none;transition:border-color .2s,transform .2s}
.must-card:hover{border-color:var(--accent);transform:translateY(-2px)}
.must-card h3{font-size:19px;line-height:1.5;margin:0}
.must-card p{font-size:15.5px;line-height:1.75;color:var(--muted);margin:0}
.must-n{font-size:13px;font-weight:700;color:var(--accent)}
.must-go{margin-top:auto;font-size:13.5px;font-weight:600;color:var(--accent)}
.must-big{grid-row:span 2;background:#1f1a2e;border-color:#1f1a2e;color:#fff}
.must-big h3{font-size:28px;line-height:1.4}
.must-big p{color:#dcd6ea;font-size:17px}
.must-big .must-n,.must-big .must-go{color:#c9bdf5}
.pen{display:inline-flex;align-self:flex-start;align-items:center;font-size:13px;font-weight:700;padding:3px 11px;border-radius:999px;border:1px solid transparent;line-height:1.6}
.pen-r{background:#fdecee;color:#b4232f;border-color:#f5c2c8}
.pen-y{background:#fff6db;color:#8a5a00;border-color:#f2dc9c}
.must-big .pen-r{background:#b4232f;color:#fff;border-color:#b4232f}
.fines-list{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:12px 20px}
.fine-row{display:flex;gap:16px;align-items:flex-start;background:var(--card,#fff);border:1px solid var(--line);border-radius:16px;padding:16px 20px;color:var(--text);text-decoration:none;height:100%;transition:border-color .2s}
.fine-row:hover{border-color:var(--accent)}
.fine-rank{font-size:24px;line-height:1.2;font-weight:700;color:var(--accent);min-width:30px}
.fine-body{display:flex;flex-direction:column;gap:6px;flex:1;min-width:0}
.fine-body strong{font-size:17px;line-height:1.5}
.fine-text{font-size:15px;line-height:1.7;color:var(--muted)}
.fine-meta{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.fine-where{font-size:12.5px;padding:2px 10px;border-radius:999px;background:var(--surface-hover);color:var(--muted)}
.fine-bar{display:block;height:6px;border-radius:999px;background:color-mix(in srgb,var(--accent) 12%,transparent);margin-top:4px}
.fine-bar i{display:block;height:100%;border-radius:999px;background:var(--accent)}
:root[data-theme="dark"] .path-card,:root[data-theme="dark"] .must-card,:root[data-theme="dark"] .fine-row{--card:var(--surface)}
:root[data-theme="dark"] .must-big{background:#2a2342;border-color:#3a3160}
:root[data-theme="dark"] .pen-r{background:#b4232f2e;color:#ff9aa6;border-color:#b4232f66}
:root[data-theme="dark"] .pen-y{background:#d9a10026;color:#ffd77a;border-color:#d9a10055}
@media(max-width:1100px){.bx-hero{grid-template-columns:1fr}.must-grid{grid-template-columns:1fr 1fr}.must-big{grid-column:span 2;grid-row:auto}}
@media(max-width:760px){.bx-hero h1{font-size:30px}.bx-hero .hero-subtitle{font-size:16px}.bx-sec .section-heading{flex-direction:column;align-items:flex-start}.bx-sec .section-heading h2{font-size:22px}.must-grid,.fines-list{grid-template-columns:1fr}.must-big{grid-column:auto}.must-big h3{font-size:24px}}

/* ---------- Reading: larger type, a "remember this" summary, and "fined often" marks ---------- */
.reader-content{font-size:17px;line-height:1.9}
.reader-content .rule-table,.table-scroll .rule-table{font-size:15.5px;line-height:1.75}
.reader-content .subsection-title{font-size:21px;line-height:1.5;margin-top:32px}
.remember-box{background:color-mix(in srgb,var(--accent) 8%,transparent);border:1px solid color-mix(in srgb,var(--accent) 28%,transparent);border-radius:16px;padding:18px 24px;margin:0 0 26px}
.remember-box h3{font-size:16px;color:var(--accent);margin:0 0 6px}
.remember-box ul{margin:0;padding-left:20px}
.remember-box li{font-size:16.5px;line-height:1.85}
.hot-rule{background:#fffbf2;box-shadow:inset 3px 0 0 #d9a100}
td.hot-rule,tr.hot-rule td{background:#fffbf2}
.hot-badge{display:inline-flex;align-items:center;font-size:12px;font-weight:700;padding:1px 9px;border-radius:999px;background:#8a5a00;color:#fff !important;text-decoration:none;margin-right:6px;vertical-align:2px;line-height:1.7;white-space:nowrap}
:root[data-theme="dark"] .hot-rule,:root[data-theme="dark"] td.hot-rule,:root[data-theme="dark"] tr.hot-rule td{background:#d9a10014}
@media(max-width:760px){.reader-content{font-size:16px}.remember-box{padding:16px 18px}}
