/* StikDex v0.08.5 — central semantic typography and Text Size presets.
   Permanent rule: new components must consume these semantic tokens instead
   of introducing arbitrary tiny font sizes. STANDARD preserves the current
   intended hierarchy; desktop and Pocket/mobile values remain independent. */

:root{
  --stik-text-page-title:28px;
  --stik-text-section-title:20px;
  --stik-text-card-title:12px;
  --stik-text-body:11px;
  --stik-text-control:10px;
  --stik-text-meta:9px;
  --stik-text-badge:8px;
  --stik-text-min-essential:9px;
}

html[data-stik-text-size="compact"]{
  --stik-text-page-title:26px;
  --stik-text-section-title:18px;
  --stik-text-card-title:11px;
  --stik-text-body:10px;
  --stik-text-control:9.5px;
  --stik-text-meta:8.5px;
  --stik-text-badge:8px;
}

html[data-stik-text-size="large"]{
  --stik-text-page-title:31px;
  --stik-text-section-title:23px;
  --stik-text-card-title:14px;
  --stik-text-body:13px;
  --stik-text-control:12px;
  --stik-text-meta:11px;
  --stik-text-badge:10px;
  --stik-text-min-essential:10px;
}

html[data-stik-text-size="extra-large"]{
  --stik-text-page-title:34px;
  --stik-text-section-title:25px;
  --stik-text-card-title:15px;
  --stik-text-body:14px;
  --stik-text-control:13px;
  --stik-text-meta:12px;
  --stik-text-badge:11px;
  --stik-text-min-essential:11px;
}

/* The control is shared, but its composition is native to each platform. */
.stik-text-size-settings{display:grid;gap:8px}
.stik-text-size-copy{display:grid;gap:3px;padding:0 3px}
.stik-text-size-copy strong{font-size:var(--stik-text-card-title);line-height:1.2}
.stik-text-size-copy small{color:var(--muted);font-size:var(--stik-text-meta);line-height:1.4}
.stik-text-size-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.stik-text-size-option,.stik-text-size-reset{
  min-width:0;min-height:42px;padding:8px 10px;border:1px solid var(--line);
  border-radius:10px;background:var(--panel-soft);color:var(--text);
  font:900 var(--stik-text-control)/1.2 Arial,Helvetica,sans-serif;cursor:pointer;
}
.stik-text-size-option{display:flex;align-items:center;gap:7px;text-align:left}
.stik-text-size-option::before{content:"○";color:var(--muted);font-size:14px}
.stik-text-size-option[aria-checked="true"]{border-color:#ff5b70;background:color-mix(in srgb,var(--panel-soft) 84%,#ff425d 16%)}
.stik-text-size-option[aria-checked="true"]::before{content:"●";color:#ff6477}
.stik-text-size-reset{width:100%;color:var(--muted);background:transparent}
.stik-text-size-option:focus-visible,.stik-text-size-reset:focus-visible{outline:2px solid #6bcfff;outline-offset:2px}

/* Desktop semantic mappings. Titles grow less aggressively than metadata. */
html:not(.stik-mobile-layout) .workspace-route-line strong,
html:not(.stik-mobile-layout) .nav-main{font-size:var(--stik-text-card-title)!important}
html:not(.stik-mobile-layout) .workspace-route-line span,
html:not(.stik-mobile-layout) .nav-sub{font-size:var(--stik-text-meta)!important}
html:not(.stik-mobile-layout) .search-wrap input,
html:not(.stik-mobile-layout) .deal-quick-input,
html:not(.stik-mobile-layout) input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html:not(.stik-mobile-layout) select,
html:not(.stik-mobile-layout) textarea{font-size:var(--stik-text-control)!important}
html:not(.stik-mobile-layout) .section-head h2,
html:not(.stik-mobile-layout) .health-head h2,
html:not(.stik-mobile-layout) .analytics-head h2{font-size:var(--stik-text-page-title)!important}
html:not(.stik-mobile-layout) .section-head p,
html:not(.stik-mobile-layout) .health-head p,
html:not(.stik-mobile-layout) .analytics-head p{font-size:var(--stik-text-body)!important;line-height:1.5}
html:not(.stik-mobile-layout) .badge,
html:not(.stik-mobile-layout) .generation-card-status-badge,
html:not(.stik-mobile-layout) .v004-status-badge,
html:not(.stik-mobile-layout) .pending-order-badge,
html:not(.stik-mobile-layout) .pending-age-badge{font-size:var(--stik-text-badge)!important}
html:not(.stik-mobile-layout) .card-label .name,
html:not(.stik-mobile-layout) .needed-tile-name,
html:not(.stik-mobile-layout) .dex-board-tile strong,
html:not(.stik-mobile-layout) .pending-card-identity strong,
html:not(.stik-mobile-layout) .upgrade-card-name strong{font-size:var(--stik-text-card-title)!important;min-width:0}
html:not(.stik-mobile-layout) .card-label .dex,
html:not(.stik-mobile-layout) .pending-card-meta,
html:not(.stik-mobile-layout) .needed-tile-region,
html:not(.stik-mobile-layout) .dex-board-tile-dex,
html:not(.stik-mobile-layout) .upgrade-card-name small{font-size:var(--stik-text-meta)!important}
html:not(.stik-mobile-layout) #dashboardView .home-panel-head h3,
html:not(.stik-mobile-layout) #dashboardView .home-collection-head h3{font-size:var(--stik-text-section-title)!important}
html:not(.stik-mobile-layout) #dashboardView .home-panel-head p,
html:not(.stik-mobile-layout) #dashboardView .home-collection-head p,
html:not(.stik-mobile-layout) #dashboardView .dash-v2-activity-copy small{font-size:var(--stik-text-body)!important}
html:not(.stik-mobile-layout) #dashboardView .dash-v2-activity-copy strong,
html:not(.stik-mobile-layout) #dashboardView .dash-v2-region-name strong{font-size:var(--stik-text-card-title)!important}
html:not(.stik-mobile-layout) #dashboardView .dash-v2-activity-time,
html:not(.stik-mobile-layout) #dashboardView .dash-v2-region-name small,
html:not(.stik-mobile-layout) #dashboardView .dash-v2-region-track-head small,
html:not(.stik-mobile-layout) #dashboardView .dash-v2-region-numbers small,
html:not(.stik-mobile-layout) #dashboardView .dash-v2-region-numbers em{font-size:var(--stik-text-meta)!important}

/* Buttons and rows adapt without restoring oversized empty delivery lanes. */
html:not(.stik-mobile-layout) .action-btn,
html:not(.stik-mobile-layout) .filter-btn,
html:not(.stik-mobile-layout) .jump-btn,
html:not(.stik-mobile-layout) .home-tool-btn,
html:not(.stik-mobile-layout) .home-spotlight-open,
html:not(.stik-mobile-layout) .home-rail-search,
html:not(.stik-mobile-layout) .pending-order-row-actions button,
html:not(.stik-mobile-layout) .v005-binder-entry button,
html:not(.stik-mobile-layout) .v005-binder-form button,
html:not(.stik-mobile-layout) .v008-binder-label-dialog button,
html:not(.stik-mobile-layout) .pokemon-focus-panel button{font-size:var(--stik-text-control)!important;line-height:1.2}
html[data-stik-text-size="large"]:not(.stik-mobile-layout) .pending-order-row-actions button,
html[data-stik-text-size="extra-large"]:not(.stik-mobile-layout) .pending-order-row-actions button{white-space:normal!important;padding-block:6px!important;height:auto!important;min-height:44px}
html:not(.stik-mobile-layout) #pendingView .pending-order-row-fact strong,
html:not(.stik-mobile-layout) #pendingView .pending-order-row-progress strong{font-size:var(--stik-text-card-title)!important}
html:not(.stik-mobile-layout) #pendingView .pending-order-row-fact small,
html:not(.stik-mobile-layout) #pendingView .pending-order-row-progress small{font-size:var(--stik-text-meta)!important}
html:not(.stik-mobile-layout) .v005-binder-entry strong,
html:not(.stik-mobile-layout) .v005-custom-head h2,
html:not(.stik-mobile-layout) .binder-card-viewer-head strong{font-size:var(--stik-text-card-title)!important}
html:not(.stik-mobile-layout) .v005-binder-entry-meta,
html:not(.stik-mobile-layout) .v005-binder-entry small,
html:not(.stik-mobile-layout) .binder-card-viewer-head span,
html:not(.stik-mobile-layout) .v008-binder-label-note{font-size:var(--stik-text-meta)!important}

/* Desktop public views retain a real More entry for viewer-local display settings. */
body.view-only .desktop-more-shell,
body.trial-mode .desktop-more-shell,
body.play-mode .desktop-more-shell{display:block!important}
body.view-only .desktop-owner-only,
body.trial-mode .desktop-owner-only,
body.play-mode .desktop-owner-only{display:none!important}

/* Mobile/PWA uses separate values and keeps the established three-across grids. */
@media (max-width:760px), (pointer:coarse) and (max-width:960px) and (max-height:600px){
  :root{
    --stik-text-page-title:27px;
    --stik-text-section-title:18px;
    --stik-text-card-title:12px;
    --stik-text-body:14px;
    --stik-text-control:10px;
    --stik-text-meta:10px;
    --stik-text-badge:9px;
    --stik-text-min-essential:9px;
  }
  html[data-stik-text-size="compact"]{
    --stik-text-page-title:25px;--stik-text-section-title:17px;--stik-text-card-title:11px;
    --stik-text-body:13px;--stik-text-control:9px;--stik-text-meta:9px;--stik-text-badge:8.5px;
  }
  html[data-stik-text-size="large"]{
    --stik-text-page-title:30px;--stik-text-section-title:20px;--stik-text-card-title:13px;
    --stik-text-body:16px;--stik-text-control:12px;--stik-text-meta:11px;--stik-text-badge:10px;--stik-text-min-essential:10px;
  }
  html[data-stik-text-size="extra-large"]{
    --stik-text-page-title:32px;--stik-text-section-title:22px;--stik-text-card-title:14px;
    --stik-text-body:17px;--stik-text-control:13px;--stik-text-meta:12px;--stik-text-badge:11px;--stik-text-min-essential:11px;
  }
  html[data-stik-text-size="compact"]{--v004-font-display:clamp(27px,8vw,36px);--v004-font-title:clamp(19px,5.6vw,25px);--v004-font-heading:16px;--v004-font-body:13px;--v004-font-meta:10px}
  html[data-stik-text-size="standard"]{--v004-font-display:clamp(28px,8.5vw,38px);--v004-font-title:clamp(20px,6vw,27px);--v004-font-heading:17px;--v004-font-body:14px;--v004-font-meta:11px}
  html[data-stik-text-size="large"]{--v004-font-display:clamp(30px,9vw,40px);--v004-font-title:clamp(22px,6.4vw,29px);--v004-font-heading:19px;--v004-font-body:16px;--v004-font-meta:12px}
  html[data-stik-text-size="extra-large"]{--v004-font-display:clamp(32px,9.4vw,42px);--v004-font-title:clamp(24px,6.8vw,31px);--v004-font-heading:21px;--v004-font-body:17px;--v004-font-meta:13px}
  .stik-text-size-settings{grid-column:1/-1;padding:9px;border:1px solid var(--v004-border,var(--line));border-radius:14px;background:var(--v004-surface-raised,var(--panel-soft))}
  .stik-text-size-options{grid-template-columns:repeat(2,minmax(0,1fr))}
  .stik-text-size-option,.stik-text-size-reset{min-height:46px;font-size:var(--stik-text-control)!important}
  .pocket-more-group h4{font-size:var(--stik-text-meta)!important}
  .pocket-more-action strong{font-size:var(--stik-text-control)!important;line-height:1.2;white-space:normal}
  .pocket-more-action small{font-size:var(--stik-text-meta)!important;line-height:1.3}
  .pocket-sheet-head h3{font-size:var(--stik-text-section-title)!important}
  .search-wrap input,.deal-quick-input,input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),select,textarea{font-size:max(16px,var(--stik-text-control))!important}
  .dex-board-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .dex-board-tile strong,.needed-tile-name,.card-label .name,.pending-card-identity strong{font-size:var(--stik-text-card-title)!important;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .dex-board-tile-dex,.card-label .dex,.pending-card-meta,.v004-mobile-meta{font-size:var(--stik-text-meta)!important}
  .v004-status,.v004-status-badge,.generation-card-status-badge,.badge,.pending-age-badge{font-size:var(--stik-text-badge)!important;line-height:1.15}
  .pocket-home-actions button strong,.home-focus-grid .focus-copy strong{font-size:var(--stik-text-card-title)!important}
  .pocket-home-actions button small,.home-focus-grid .focus-copy small,.home-focus-grid .focus-copy span{font-size:var(--stik-text-meta)!important}
  .pending-order-toolbar button,.pending-selection-bar button,.pending-order-dialog button,.mobile-pending-order-row button,
  .binder-card-viewer-panel button,.v005-binder-form button,.v008-binder-label-dialog button,.pokemon-focus-panel button{font-size:var(--stik-text-control)!important;line-height:1.2;white-space:normal}
  .binder-card-viewer-head strong,.v005-binder-entry strong,.v008-binder-label-dialog h2{font-size:var(--stik-text-card-title)!important}
  .binder-card-viewer-head span,.v005-binder-entry-meta,.v008-binder-label-note{font-size:var(--stik-text-meta)!important}
  .v005-binder-dialog,.v008-binder-label-dialog,.pending-order-dialog,.pokemon-focus-panel{max-height:calc(100dvh - 20px);overflow:auto;overscroll-behavior:contain}
}

@media (max-width:350px){
  .stik-text-size-options{grid-template-columns:1fr}
  html[data-stik-text-size="extra-large"] .pocket-more-grid{grid-template-columns:1fr!important}
}

@media (orientation:landscape) and (max-height:600px) and (pointer:coarse){
  .stik-text-size-settings{padding:7px}
  .stik-text-size-option,.stik-text-size-reset{min-height:42px}
}
