/* v30: shared accessible controls, responsive administration and AI hub. */
:root { --hub-ink:#153449; --hub-muted:#526a7a; --hub-line:#dce7ef; }
:where(button,input,select,textarea,a,summary):focus-visible { outline:3px solid #0b75ad; outline-offset:3px; }
:where(input,select,textarea) { scroll-margin-block:100px; }
:where(button,.button):disabled { opacity:.55; cursor:not-allowed; }
:where(.portal-main,.hub-provider,.hub-form-grid,.hub-routes) > * { min-width:0; }
.portal-main :is(h1,h2,h3) { text-wrap:balance; }
.portal-main :is(.panel,.hub-section) { scroll-margin-top:24px; }
.portal-main .panel-head { flex-wrap:wrap; gap:14px; }
.portal-main .page-head-actions { flex-wrap:wrap; }
.portal-main .page-head-actions .button { white-space:normal; text-align:center; }
.portal-main :is(.ai-provider-banner,.ai-admin-head,.promotion-head) { overflow-wrap:anywhere; }
.portal-main .ai-admin-tabs { max-width:100%; overflow-x:auto; overscroll-behavior-inline:contain; }
.portal-main .ai-admin-tabs button { flex:0 0 auto; min-height:44px; }
.ai-hub { color:var(--hub-ink); max-width:1500px; margin-inline:auto; }
.ai-hub :is(p,small) { line-height:1.6; }
.ai-hub small { color:var(--hub-muted); font-size:.8rem; }
.ai-hub label { display:flex; flex-direction:column; gap:8px; font-size:.87rem; font-weight:650; min-width:0; }
.ai-hub label small { font-weight:400; }
.ai-hub input:not([type=checkbox]),.ai-hub select { width:100%; min-width:0; min-height:46px; background:#fff; color:var(--hub-ink); border:1px solid #adbfcc; border-radius:10px; padding:10px 12px; font:inherit; }
.ai-hub .button { white-space:normal; min-height:44px; text-align:center; line-height:1.4; }
.ai-hub code { font-size:.85em; overflow-wrap:anywhere; }
.hub-hero { display:flex; justify-content:space-between; align-items:center; gap:28px; padding:36px; border-radius:22px; background:linear-gradient(115deg,#0c3d59,#146781); color:#fff; margin-bottom:22px; }
.hub-hero .eyebrow { color:#b8e2ef; font-size:.7rem; letter-spacing:.13em; }
.hub-hero h1 { font-size:clamp(2rem,3vw,3rem); letter-spacing:-.04em; line-height:1.12; margin:13px 0; }
.hub-hero p { color:#e0f0f7; margin:0; font-size:1rem; }
.hub-hero-actions { display:grid; gap:10px; flex:0 1 240px; }
.hub-hero-actions .button { background:#fff; color:#104661; border:1px solid #fff; }
.hub-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-bottom:24px; }
.hub-metrics article { border:1px solid var(--hub-line); background:#fff; border-radius:16px; padding:22px; }
.hub-metrics article>span { display:block; font-size:.82rem; font-weight:650; color:var(--hub-muted); }
.hub-metrics strong { display:block; font-size:2.15rem; line-height:1.35; margin-top:8px; font-variant-numeric:tabular-nums; }
.hub-metrics strong small { font-size:1rem; font-weight:500; }
.hub-metrics p { margin:5px 0 0; font-size:.75rem; color:var(--hub-muted); }
.hub-section { padding:26px; border:1px solid var(--hub-line); background:#fff; border-radius:18px; margin:22px 0; }
.hub-section-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:20px; }
.hub-section-head h2 { margin:8px 0 0; font-size:1.4rem; line-height:1.3; letter-spacing:-.02em; }
.hub-section-head p { color:var(--hub-muted); font-size:.85rem; margin:10px 0 0; }
.hub-routes { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.hub-routes>.button { grid-column:1/-1; justify-self:start; }
.hub-caption { font-size:.8rem; color:var(--hub-muted); font-weight:400; line-height:1.6; overflow-wrap:anywhere; }
.hub-notice { border:1px solid #c9e1ea; border-left:4px solid #2886a7; padding:18px 20px; border-radius:12px; background:#f2f9fc; margin:20px 0; font-size:.85rem; overflow-wrap:anywhere; }
.hub-notice p { margin:6px 0 0; }
.hub-notice--warning { background:#fff9ef; border-color:#e7cca3; border-left-color:#a96313; color:#62421c; }
.hub-pill { display:inline-flex; align-items:center; border-radius:24px; background:#eef3f7; color:#405f73; padding:5px 10px; font-size:.68rem; font-weight:700; line-height:1.5; white-space:nowrap; }
.hub-pill--ready { background:#e8f5ed; color:#216645; }
.hub-profile>summary { display:flex; justify-content:space-between; align-items:center; gap:14px; cursor:pointer; list-style:none; min-height:50px; }
.hub-profile>summary::-webkit-details-marker { display:none; }
.hub-profile>summary strong,.hub-profile>summary small { display:block; margin-top:7px; }
.hub-profile>summary strong { font-size:1.2rem; }
.hub-summary-arrow { font-size:1.5rem; }
.hub-profile[open] .hub-summary-arrow { transform:rotate(180deg); }
.hub-details-body { margin-top:22px; border-top:1px solid var(--hub-line); padding-top:2px; }
.hub-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.hub-wide { grid-column:1/-1; }
.ai-hub .hub-check { flex-direction:row; align-items:flex-start; gap:10px; font-weight:500; line-height:1.6; }
.ai-hub .hub-check input { width:19px; height:19px; min-width:19px; margin:3px 0 0; accent-color:#0b668e; }
.hub-consent { background:#f3f7fa; border:1px solid var(--hub-line); border-radius:10px; padding:13px; }
.hub-catalog { margin:32px 0; }
.hub-toolbar { display:flex; flex-wrap:wrap; align-items:end; gap:16px; padding:18px; margin-bottom:20px; background:#eaf1f6; border:1px solid #d7e4ed; border-radius:14px; }
.hub-search { flex:1 1 230px; }
.hub-toolbar>label:not(.hub-search) { flex:0 1 230px; }
.hub-toolbar>span { padding-bottom:12px; }
.hub-provider-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:start; }
.hub-provider { background:#fff; border:1px solid var(--hub-line); border-radius:18px; padding:24px; box-shadow:0 4px 18px #173b4f04; scroll-margin-top:24px; overflow-wrap:anywhere; }
.hub-provider:target { border-color:#1378a3; box-shadow:0 0 0 3px #d3e9f3; }
.hub-provider[hidden] { display:none; }
.hub-provider--retired { background:#f4f6f8; }
.hub-provider-heading { display:flex; align-items:center; gap:12px; }
.hub-provider-heading>div:nth-child(2) { flex:1; min-width:0; }
.hub-provider-heading h3 { font-size:1.1rem; line-height:1.4; margin:2px 0 0; }
.hub-provider-heading small { font-size:.66rem; }
.hub-provider-logo { display:grid; place-items:center; flex:0 0 42px; height:42px; background:#e9f3f8; border:1px solid #d6e9f1; border-radius:12px; color:#1b6684; font-size:.8rem; font-weight:800; letter-spacing:.02em; }
.hub-provider-description { font-size:.85rem; margin:20px 0 16px; color:var(--hub-muted); }
.hub-provider-limit { background:#f5f8fa; border:1px solid #e5edf2; border-radius:12px; padding:14px 16px; font-size:.79rem; }
.hub-provider-limit strong { font-size:.75rem; }
.hub-provider-limit p { margin:6px 0 0; color:var(--hub-muted); }
.hub-provider-links { display:flex; flex-wrap:wrap; gap:6px 18px; margin:16px 0; }
.hub-provider-links a { display:inline-flex; align-items:center; min-height:34px; font-size:.76rem; color:#08608a; text-decoration:underline; text-underline-offset:3px; }
.hub-provider-status { display:flex; flex-wrap:wrap; gap:6px 14px; color:var(--hub-muted); font-size:.71rem; border-top:1px solid var(--hub-line); padding:13px 0; }
.hub-status-ok { color:#236644; font-weight:650; }
.hub-connection>summary { min-height:46px; cursor:pointer; display:flex; align-items:center; justify-content:space-between; padding:10px 14px; background:#eff5f9; color:#164c6a; border-radius:10px; list-style:none; font-size:.83rem; font-weight:700; }
.hub-connection>summary::-webkit-details-marker { display:none; }
.hub-connection[open]>summary { margin-bottom:20px; }
.hub-connection[open]>summary>span:last-child { transform:rotate(45deg); }
.hub-connection-body .hub-form-grid { margin-top:20px; gap:16px; }
.hub-full { width:100%; }
.hub-actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.hub-actions form { flex:1 1 130px; }
.hub-actions form .button { width:100%; font-size:.8rem; }
.hub-diagnostics { margin:20px 0; border:1px solid var(--hub-line); border-radius:12px; padding:16px; font-size:.8rem; background:#f8fafc; }
.hub-diagnostics>p { margin:6px 0 14px; color:var(--hub-muted); }
.hub-diagnostics dl { margin:0 0 12px; }
.hub-diagnostics dl>div { display:flex; justify-content:space-between; gap:16px; padding:7px 0; border-bottom:1px solid #e4ecf1; }
.hub-diagnostics dt { color:var(--hub-muted); }
.hub-diagnostics dd { margin:0; text-align:right; font-variant-numeric:tabular-nums; }
.hub-danger>summary { min-height:44px; padding:10px 0; cursor:pointer; color:#974329; font-size:.8rem; }
.hub-danger p { font-size:.8rem; color:var(--hub-muted); }
.hub-empty { padding:35px; text-align:center; background:#fff; border:1px dashed #adc4d2; border-radius:14px; }
/* Public site: readable long content, safe controls and no off-canvas form fields. */
body:not(.portal-body) :is(.page-content,.article-content,.rich-text) { overflow-wrap:anywhere; }
body:not(.portal-body) :is(.page-content,.article-content,.rich-text) img { max-width:100%; height:auto; }
body:not(.portal-body) :is(.page-content,.article-content,.rich-text) table { display:block; max-width:100%; overflow-x:auto; }
body:not(.portal-body) :is(.hero-actions,.booking-actions) { flex-wrap:wrap; }
body:not(.portal-body) :is(.program-card,.teacher-card,.price-card) .button { white-space:normal; text-align:center; }
@media (prefers-reduced-motion:reduce) { .ai-hub *, .ai-hub *::before,.ai-hub *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
@media (max-width:1250px) and (min-width:901px) { .hub-provider-grid { grid-template-columns:minmax(0,1fr); } }
@media (max-width:760px) {
  .hub-hero { padding:24px; flex-direction:column; align-items:stretch; gap:20px; }
  .hub-hero-actions { flex:auto; display:flex; flex-wrap:wrap; }
  .hub-hero-actions>.button { flex:1 1 180px; }
  .hub-provider-grid { grid-template-columns:minmax(0,1fr); }
  .hub-section-head { align-items:flex-start; flex-direction:column; }
  .hub-metrics { gap:10px; }
  .hub-metrics article { padding:16px 12px; }
  .hub-metrics article>span { font-size:.73rem; }
  .hub-metrics strong { font-size:1.8rem; }
  .hub-metrics p { display:none; }
  .hub-routes { grid-template-columns:minmax(0,1fr); }
  .hub-routes>.button { width:100%; }
  .portal-main .ai-settings-layout { grid-template-columns:minmax(0,1fr); }
  .portal-main .ai-provider-banner { display:flex; flex-direction:column; align-items:stretch; gap:12px; }
  .portal-main .ai-provider-banner__privacy { min-width:0; max-width:none; }
}
@media (max-width:520px) {
  .hub-hero,.hub-section,.hub-provider { padding:20px 16px; border-radius:14px; }
  .hub-hero h1 { font-size:2.15rem; }
  .hub-form-grid { grid-template-columns:minmax(0,1fr); }
  .hub-metrics { grid-template-columns:minmax(0,1fr); }
  .hub-metrics article { display:flex; justify-content:space-between; align-items:center; gap:15px; padding:12px 16px; border-radius:12px; }
  .hub-metrics article>span { font-size:.8rem; max-width:180px; }
  .hub-metrics strong { margin:0; font-size:1.7rem; }
  .hub-provider-heading { flex-wrap:wrap; }
  .hub-provider-heading>.hub-pill { margin-left:54px; }
  .hub-provider-heading>div:nth-child(2) { flex-basis:calc(100% - 54px); }
  .hub-toolbar>label { flex-basis:100%!important; }
  .hub-toolbar>span { padding:0; }
  .hub-notice { padding:15px; }
  .hub-actions>.button { flex:1 1 100%; }
  .hub-diagnostics dl>div { flex-direction:column; gap:2px; }
  .hub-diagnostics dd { text-align:left; }
  .ai-hub input:not([type=checkbox]),.ai-hub select,.portal-main :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { font-size:16px; }
  .portal-main .panel-head>div { min-width:0; max-width:100%; }
  body:not(.portal-body) .hero-actions>.button { width:100%; }
  body:not(.portal-body) :is(input,select,textarea) { font-size:16px; }
  body:not(.portal-body) .section-heading { padding-inline:4px; }
}
/* Keep the custom publish checkbox in its label, not in the page width. */
.portal-main .promotion-switch-card { position:relative; }
.portal-main .promotion-switch-card>input { width:1px!important; height:1px!important; min-width:1px!important; min-height:1px!important; padding:0; margin:-1px; border:0; clip-path:inset(50%); overflow:hidden; }
.portal-main .promotion-switch-card:has(input:focus-visible) { outline:3px solid #0b75ad; outline-offset:3px; }
.portal-main .promotion-search,.portal-main .promotion-search input { min-width:0; }
.portal-main .ai-admin-kpis article>div { min-width:0; overflow-wrap:anywhere; }
@media(max-width:480px) { .portal-main .ai-admin-kpis { grid-template-columns:minmax(0,1fr); } }
