/* SGP432D V16: Paito 4D contrast, scoped to the studio only. */
/* Default dark mode: explicit surfaces instead of inherited --card. */
body:not(.light) #sgpPaitoStudio{--sgps-surface:#10173c;--sgps-surface-alt:#171f4b;--sgps-ink:#f3f5ff;--sgps-muted:#c3c9e6;--sgps-line:#47507d;--sgps-field:#101633;--sgps-field-ink:#f7fbff;--sgps-head:#081a79;color:var(--sgps-ink)!important;color-scheme:dark}
body.light #sgpPaitoStudio{--sgps-surface:#fff;--sgps-surface-alt:#eef0f8;--sgps-ink:#171d3c;--sgps-muted:#464c6a;--sgps-line:#c3c7df;--sgps-field:#fff;--sgps-field-ink:#171d3c;--sgps-head:#121e60;color:var(--sgps-ink)!important;color-scheme:light}
#sgpPaitoStudio .sgps-filters,#sgpPaitoStudio .sgps-actions,#sgpPaitoStudio .sgps-primary,#sgpPaitoStudio .sgps-card{background:var(--sgps-surface)!important;color:var(--sgps-ink)!important;border-color:var(--sgps-line)!important}
#sgpPaitoStudio .sgps-filters label,#sgpPaitoStudio .sgps-heading h2,#sgpPaitoStudio .sgps-card h3,#sgpPaitoStudio .sgps-statline,#sgpPaitoStudio .sgps-bottom,#sgpPaitoStudio .sgps-note{color:var(--sgps-ink)!important;opacity:1!important}
#sgpPaitoStudio .sgps-heading p,#sgpPaitoStudio .sgps-card p,#sgpPaitoStudio .sgps-statline span,#sgpPaitoStudio .sgps-note,#sgpPaitoStudio #sgpsCount,#sgpPaitoStudio #sgpsProgress{color:var(--sgps-muted)!important;opacity:1!important}
#sgpPaitoStudio .sgps-filters select,#sgpPaitoStudio .sgps-filters input,#sgpPaitoStudio .sgps-actions button:not(.on):not([data-color]),#sgpPaitoStudio .sgps-heading button,#sgpPaitoStudio .sgps-bottom button,#sgpPaitoStudio .sgps-card button{background:var(--sgps-field)!important;color:var(--sgps-field-ink)!important;border-color:var(--sgps-line)!important;opacity:1!important}
#sgpPaitoStudio .sgps-actions button.on,#sgpPaitoStudio .sgps-digits button.on{background:#081a79!important;color:#fff!important;border-color:#c9a84d!important}
#sgpPaitoStudio .sgps-palette button[data-color]{color:transparent!important;border-color:transparent!important;opacity:1!important;filter:none!important;box-shadow:none}#sgpPaitoStudio .sgps-palette button[data-color].selected{outline:3px solid #081a79!important;outline-offset:2px;box-shadow:0 0 0 2px var(--sgps-surface)!important}
#sgpPaitoStudio .sgps-table{background:var(--sgps-surface)!important;color:var(--sgps-ink)!important}
#sgpPaitoStudio .sgps-table thead th{background:var(--sgps-head)!important;color:#fff!important;border-color:#353f76!important}
#sgpPaitoStudio .sgps-table tbody tr{background:var(--sgps-surface)!important;color:var(--sgps-ink)!important}
#sgpPaitoStudio .sgps-table tbody tr:nth-child(even){background:var(--sgps-surface-alt)!important}
#sgpPaitoStudio .sgps-table td{color:var(--sgps-ink)!important;border-color:var(--sgps-line)!important;opacity:1!important}
#sgpPaitoStudio .sgps-cell{background:var(--sgps-field);color:var(--sgps-field-ink);border-color:var(--sgps-line)}
/* User-selected brush colors are inline styles; do not override their background. */
#sgpPaitoStudio .sgps-cell[style*="background"]{color:#152a40!important}
#sgpPaitoStudio .sgps-channel{background:#d9ddf3!important;color:#06145b!important}
#sgpPaitoStudio .sgps-channel.toto{background:#d5daf6!important;color:#08186b!important}
#sgpPaitoStudio .sgps-heat td,#sgpPaitoStudio .sgps-heat th{border-color:var(--sgps-line)!important;color:var(--sgps-ink)}
#sgpPaitoStudio .sgps-statline{border-color:var(--sgps-line)!important}
#sgpPaitoStudio button:focus-visible,#sgpPaitoStudio input:focus-visible,#sgpPaitoStudio select:focus-visible{outline:3px solid #c9a84d!important;outline-offset:2px}
#sgpPaitoStudio .sgps-hero,#sgpPaitoStudio .sgps-hero h1{color:#fff!important}
#sgpPaitoStudio .sgps-hero p{color:#e0f2ff!important}
#sgpPaitoStudio .sgps-kicker{color:#a0efff!important}
/* Browser-generated date fields remain legible in each color scheme. */
body.light #sgpPaitoStudio input[type=date]{color-scheme:light}
body:not(.light) #sgpPaitoStudio input[type=date]{color-scheme:dark}

/* Palette uses inline background colors generated by the existing JS; never override them with !important. */

#sgpPaitoStudio .sgps-hero{background:linear-gradient(135deg,#07103d,#081a79)!important;border:1px solid #c9a84d} #sgpPaitoStudio .sgps-hero h2{color:white} #sgpPaitoStudio .sgps-tablewrap{overflow-x:auto}

/* V10: accessible Cambodia hour filters, isolated from digit painting. */
#sgpPaitoStudio .cambodia-hour-filter{background:var(--sgps-surface)!important;color:var(--sgps-ink)!important;border-color:var(--sgps-line)!important;padding:16px;}
#sgpPaitoStudio .cambodia-hour-filter>strong{display:block;color:var(--sgps-ink)!important;font-size:15px;line-height:1.5;}
#sgpPaitoStudio .cambodia-hour-buttons{grid-template-columns:repeat(auto-fit,minmax(88px,1fr));gap:8px;}
#sgpPaitoStudio .cambodia-hour-buttons button{background:var(--sgps-field)!important;color:var(--sgps-field-ink)!important;border:1px solid var(--sgps-line)!important;min-height:48px;font-size:14px;line-height:1.4;opacity:1!important;white-space:normal;box-shadow:none;}
#sgpPaitoStudio .cambodia-hour-buttons button small{color:inherit!important;opacity:1!important;font-size:12px;font-weight:600;}
#sgpPaitoStudio .cambodia-hour-buttons button[aria-pressed="true"]{background:#071456!important;color:#fff!important;border:2px solid #d8b85a!important;box-shadow:inset 0 0 0 1px #071456;}
#sgpPaitoStudio .cambodia-hour-buttons button:not([aria-pressed="true"]):hover{background:var(--sgps-surface-alt)!important;color:var(--sgps-ink)!important;}
#sgpPaitoStudio .sgps-filters label{font-size:14px;line-height:1.5;min-width:0;}
#sgpPaitoStudio .sgps-filters select,#sgpPaitoStudio .sgps-filters input{height:44px;font-size:14px;line-height:1.4;box-sizing:border-box;}
#sgpPaitoStudio .sgps-filters select option{background:var(--sgps-field);color:var(--sgps-field-ink);}
@media(max-width:600px){#sgpPaitoStudio .cambodia-hour-buttons{grid-template-columns:repeat(3,minmax(0,1fr));}#sgpPaitoStudio .cambodia-hour-buttons button:first-child{grid-column:1/-1;}#sgpPaitoStudio .sgps-filters{padding:12px;gap:10px;}#sgpPaitoStudio .sgps-filters label{flex:1 1 calc(50% - 10px);}#sgpPaitoStudio .sgps-filters select,#sgpPaitoStudio .sgps-filters input{font-size:16px;}}
