/* ============================================================
   Current portal theme
   This file is the stable visual contract loaded after legacy CSS.
   Admin style settings are injected after this by ThemeManager.php.
   ============================================================ */

:root{
  --primary:#489BAD;
  --primary-dark:#347f8d;
  --primary-soft:#eef8fa;
  --primary-soft-2:#f6fbfc;
  --ink:#10252d;
  --muted:#536870;
  --line:#cfe0e5;
  --line-soft:#e7eff2;
  --bg:#f6f9fa;
  --panel:#ffffff;
  --orange:#e7762a;
  --green:#8fb15b;
  --radius:8px;
  --radius-card:10px;
  --portal-radius-card:10px;
  --portal-radius-panel:10px;
  --portal-radius-field:8px;
  --portal-radius-button:8px;
  --portal-page-width:1180px;
  --portal-flow-gap:18px;
  --portal-panel-padding:22px;
  --portal-heading-body-gap:16px;
  --portal-section-heading-top-gap:26px;
  --portal-label-field-gap:10px;
  --portal-field-pad-y:12px;
  --portal-field-pad-x:14px;
  --portal-panel-flow-gap:20px;
  --portal-tight-flow-gap:12px;
  --portal-card-padding:22px;
  --portal-card-gap:18px;
  --portal-card-image-height:175px;
  --portal-card-image-fit:cover;
  --portal-card-border-width:1px;
  --portal-card-shadow:0 1px 2px rgba(16,37,45,.035),0 12px 28px rgba(16,37,45,.055);
  --shadow:var(--portal-card-shadow);
  --shadow-lift:0 2px 6px rgba(16,37,45,.06),0 18px 40px rgba(16,37,45,.10);
}

body{background:var(--portal-bg,var(--bg));color:var(--portal-ink,var(--ink));}
.container,.portal-module-page{max-width:var(--portal-page-width)!important;}

.panel,.product-card,.dashboard-side-card,.bundle-panel,.bundle-tile,.product-media-card,.course-nav,.lesson,.table-panel,.page-title,.tool-hero,.tool-card,.tk-feature,.hub-welcome,.hub-nav-card,.hub-image-card,.toolhub-card,.reset-card,.capacity-card,.capacity-hero,.ebook-page,.reduce-card,.noise-panel,.mobile-step-card,.sidebar-support,.admin-card,.admin-note,.admin-list-item,.game-card-editor,.game-admin-note,.game-json-details,.dm-list,.dm-chat,.admin-dm-list,.admin-dm-chat,.reflection-view-card,.reflection-structured-row,.feedback-box,.feedback-message,.empty-state,.notice-info,.product-empty,.portal-module-hero,.portal-module-card,.portal-module-panel,.community-card,.community-panel{
  border-radius:var(--portal-radius-card)!important;
}

.btn,.top-btn,.nav a,.mobile-nav a,.notify-toggle,.hub-nav-button,.pill-button,.primary-button,.secondary-button,.tool-back-link,.admin-tabs a,.game-admin-tabs a,.game-admin-nav a:not(.round),.course-nav .back-link,.wwe-back{
  border-radius:var(--portal-radius-button)!important;
}

input:not([type="checkbox"]):not([type="radio"]),select,textarea,.field input,.field select,.field textarea,.admin-form-full input,.admin-form-full select,.admin-form-full textarea,.game-admin-form input,.game-admin-form select,.game-admin-form textarea,.dm-compose textarea,.dm-start textarea,.admin-dm-compose textarea{
  border-radius:var(--portal-radius-field)!important;
}

.image-slot.small,.image-slot.tiny,.continue-card .image-slot,.product-cover-small,.product-pdf-frame,.video-file-box video,.product-media-card video{border-radius:8px!important;}

/* Native module shell */
.portal-module-page{margin:0 auto 52px;}
.portal-module-hero{background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;margin:0 0 22px!important;}
.portal-module-kicker{margin:0 0 9px;color:var(--primary-dark);font-size:12px;font-weight:750;letter-spacing:.12em;text-transform:uppercase;}
.portal-module-hero h1{font-family:var(--head);font-size:clamp(26px,3vw,36px);line-height:1.14;letter-spacing:-.025em;margin:0 0 10px;color:var(--ink);}
.portal-module-description,.portal-module-description p{margin:0!important;}
.portal-module-description p + p{margin-top:10px!important;}
.portal-module-description p:last-child{max-width:68ch;color:var(--muted);font-size:15.5px;line-height:1.62;}
.portal-module-content{display:grid;gap:22px!important;}
.portal-module-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;}
.portal-module-card,.portal-module-panel{background:#fff;border:1px solid var(--line);box-shadow:var(--shadow);padding:clamp(18px,2.5vw,26px);}
.portal-module-panel,.portal-module-card{display:flex!important;flex-direction:column!important;gap:var(--portal-panel-flow-gap)!important;}
.portal-module-card h2,.portal-module-card h3,.portal-module-panel h2,.portal-module-panel h3{margin-top:0;color:var(--ink);line-height:1.22!important;}
.portal-module-card p,.portal-module-panel p{color:var(--muted);line-height:1.62;}
.portal-module-actions{display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:12px!important;margin-top:0!important;margin-bottom:0!important;}
.portal-module-muted{color:var(--muted);}
.portal-module-panel > :where(h1,h2,h3,h4,h5,h6,p,ul,ol,div,form,fieldset,figure,label,textarea,select,input){margin-top:0;margin-bottom:0;}
.portal-module-panel > :where(h2,h3,h4,h5,h6):not(:first-child),.portal-module-section-heading:not(:first-child),.portal-module-subheading:not(:first-child){margin-top:var(--portal-section-heading-top-gap)!important;}
.portal-module-panel :where(label,.portal-module-field-label,.portal-module-label){display:block;font-weight:700;line-height:1.35;margin:0 0 var(--portal-label-field-gap)!important;}
.portal-module-field{display:grid!important;gap:var(--portal-label-field-gap)!important;}
.portal-module-field > :where(label,.portal-module-label,.portal-module-field-label){margin:0!important;}
.portal-module-page :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea){width:100%;box-sizing:border-box!important;padding:var(--portal-field-pad-y) var(--portal-field-pad-x)!important;min-height:44px;border:1px solid var(--line)!important;background:#fff;color:var(--ink);font:inherit!important;line-height:1.5!important;}
.portal-module-page textarea{min-height:110px;resize:vertical;}
.portal-module-page :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea):focus{outline:none!important;border-color:var(--primary)!important;box-shadow:0 0 0 3px rgba(72,155,173,.14)!important;}

/* Whole-portal spacing contract */
body :where(.admin-form-full,.panel-body,.dm-compose,.dm-start,.admin-dm-compose,.community-form,.reflection-form,.capacity-card,.ebook-page,.tool-card,.portal-module-page) :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),select,textarea){box-sizing:border-box!important;padding:var(--portal-field-pad-y) var(--portal-field-pad-x)!important;min-height:44px;line-height:1.5!important;}
body :where(.admin-form-full,.panel-body,.dm-compose,.dm-start,.admin-dm-compose,.community-form,.reflection-form,.capacity-field,.field,.portal-module-page) label > :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){margin-top:var(--portal-label-field-gap)!important;}
body :where(.panel-body,.admin-form-full,.admin-card,.admin-note,.admin-list-item,.tool-card,.capacity-card-body,.ebook-page-body,.lesson,.dm-chat,.dm-list,.admin-dm-chat,.admin-dm-list,.community-card,.community-panel,.reflection-view-card,.reflection-structured-row,.portal-module-card,.portal-module-panel) > :where(h1,h2,h3,h4,h5,h6){margin-bottom:0!important;line-height:1.22!important;}
body :where(.panel-body,.admin-form-full,.admin-card,.tool-card,.capacity-card-body,.ebook-page-body,.lesson,.dm-chat,.dm-list,.admin-dm-chat,.admin-dm-list,.community-card,.community-panel,.reflection-view-card,.reflection-structured-row,.portal-module-card,.portal-module-panel) > :where(h1,h2,h3,h4,h5,h6) + :where(p,div,form,fieldset,ul,ol,section,article,label,textarea,input,select,.admin-actions,.field,.capacity-field,.portal-module-field,.portal-module-actions){margin-top:var(--portal-heading-body-gap)!important;}
body :where(.panel-body,.admin-form-full,.admin-card,.tool-card,.capacity-card-body,.ebook-page-body,.lesson,.dm-chat,.dm-list,.admin-dm-chat,.admin-dm-list,.community-card,.reflection-view-card,.portal-module-card,.portal-module-panel) > :where(h2,h3,h4,h5,h6):not(:first-child){margin-top:var(--portal-section-heading-top-gap)!important;}
body :where(.admin-actions,.portal-module-actions,.finish-actions,.capacity-actions,.choice-row){gap:12px!important;}

body.portal-dashboard-list :where([data-home-nav].hub-card-grid,.hub-image-card-grid){display:grid!important;grid-template-columns:1fr!important;}
body.portal-dashboard-list :where([data-home-nav].hub-card-grid,.hub-image-card-grid) > .hub-nav-card{display:grid!important;grid-template-columns:180px minmax(0,1fr)!important;}
body.portal-dashboard-compact-cards :where([data-home-nav].hub-card-grid,.hub-image-card-grid){gap:18px!important;}
body.portal-dashboard-compact-cards :where([data-home-nav].hub-card-grid,.hub-image-card-grid) .hub-nav-content{padding:20px!important;}
body.portal-dashboard-compact-cards :where([data-home-nav].hub-card-grid,.hub-image-card-grid) .hub-nav-media{min-height:150px!important;}

@media(max-width:760px){
  .portal-module-grid{grid-template-columns:1fr;}
  .portal-module-page{margin-bottom:38px;}
  body.portal-dashboard-list :where([data-home-nav].hub-card-grid,.hub-image-card-grid) > .hub-nav-card{display:flex!important;flex-direction:column!important;grid-template-columns:none!important;}
}
