#aioshe-app, .aioshe-gate {
  --aioshe-forest: #0f4c3a;
  --aioshe-forest-dark: #0b3626;
  --aioshe-forest-tint: #e4efe9;
  --aioshe-amber: #c8842a;
  --aioshe-amber-tint: #f5e6cb;
  --aioshe-ink: #13201c;
  --aioshe-paper: #f6f4ea;
  --aioshe-paper-2: #eee9d9;
  --aioshe-steel: #5b6b68;
  --aioshe-line: #d9d2bd;
  --aioshe-white: #fffdf7;
  --aioshe-red: #a1382e;
  --aioshe-red-tint: #f6e2df;
  --aioshe-sidebar-w: 252px;
  font-family: 'IBM Plex Sans', Arial, sans-serif;
  color: var(--aioshe-ink);
}
#aioshe-app *, .aioshe-gate * { box-sizing: border-box; }
.aioshe-display { font-family: 'Fraunces', Georgia, serif; }
.aioshe-mono { font-family: 'IBM Plex Mono', monospace; }
#aioshe-app button, .aioshe-gate button { font-family: inherit; cursor: pointer; }

.aioshe-app-loading { padding: 60px 24px; text-align: center; color: var(--aioshe-steel); font-size: 14px; }

/* ---------------- Shell (full-screen dashboard) ---------------- */
body.aioshe-fullscreen-body { margin: 0; padding: 0; background: var(--aioshe-paper); }
/* Belt-and-suspenders: force out the WP admin bar and its layout offset
   on this page, regardless of how/when show_admin_bar was evaluated. */
body.aioshe-fullscreen-body #wpadminbar { display: none !important; }
html.wp-toolbar { margin-top: 0 !important; }
.aioshe-app-shell { display: flex; min-height: 100vh; }
#aioshe-app { position: relative; z-index: 100000; }

.aioshe-sidebar {
  width: var(--aioshe-sidebar-w); flex-shrink: 0; background: var(--aioshe-forest-dark); color: #fff;
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100002;
  transition: transform .25s ease;
}
.aioshe-sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.aioshe-sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.aioshe-sidebar-brand-name { font-family: 'Fraunces', serif; font-weight: 600; font-size: 15.5px; }
.aioshe-sidebar-brand-sub { font-size: 10.5px; color: rgba(255,255,255,.6); }

.aioshe-sidebar-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.aioshe-nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; background: none; border: none; color: rgba(255,255,255,.78);
  padding: 10px 12px; border-radius: 6px; font-size: 14px; margin-bottom: 2px; text-align: left;
}
.aioshe-nav-item svg { flex-shrink: 0; opacity: .85; }
.aioshe-nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.aioshe-nav-item.active { background: var(--aioshe-amber); color: var(--aioshe-forest-dark); font-weight: 600; }
.aioshe-nav-item.active svg { opacity: 1; }

.aioshe-sidebar-account { border-top: 1px solid rgba(255,255,255,.12); padding: 14px; }
.aioshe-account-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.aioshe-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--aioshe-amber); color: var(--aioshe-forest-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; flex-shrink: 0; }
.aioshe-account-text { line-height: 1.3; flex: 1; min-width: 0; }
.aioshe-account-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.aioshe-account-role { font-size: 11px; color: rgba(255,255,255,.6); }
.aioshe-logout-link { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: rgba(255,255,255,.55); text-decoration: none; padding: 6px 4px; border-radius: 5px; }
.aioshe-logout-link:hover { color: #fff; background: rgba(255,255,255,.07); }

.aioshe-menu-toggle { display: none; position: fixed; top: 16px; left: 16px; z-index: 100003; background: var(--aioshe-forest-dark); color: #fff; border: none; width: 38px; height: 38px; border-radius: 8px; align-items: center; justify-content: center; }
.aioshe-sidebar-scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 100001; }

.aioshe-main { flex: 1; min-width: 0; margin-left: var(--aioshe-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.aioshe-topbar { background: var(--aioshe-white); border-bottom: 1px solid var(--aioshe-line); padding: 18px 36px; position: sticky; top: 0; z-index: 100000; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.aioshe-topbar-title h1 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 21px; margin: 0; }
.aioshe-topbar-title span { font-size: 12.5px; color: var(--aioshe-steel); }
.aioshe-topbar-logout { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--aioshe-steel); text-decoration: none; padding: 8px 14px; border: 1px solid var(--aioshe-line); border-radius: 6px; background: var(--aioshe-white); }
.aioshe-topbar-logout:hover { background: var(--aioshe-paper-2); color: var(--aioshe-ink); }
.aioshe-content { padding: 30px 36px 80px; max-width: 1180px; flex: 1; }

@media (max-width: 900px) {
  .aioshe-sidebar { transform: translateX(-100%); }
  .aioshe-sidebar.open { transform: translateX(0); }
  .aioshe-main { margin-left: 0; }
  .aioshe-menu-toggle { display: flex; }
  .aioshe-sidebar-scrim.show { display: block; }
  .aioshe-topbar { padding-left: 64px; }
}

/* ---------------- Reusable ---------------- */
.aioshe-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--aioshe-forest); color: #fff; border: 1px solid var(--aioshe-forest); padding: 10px 16px; border-radius: 6px; font-size: 13.5px; font-weight: 500; text-decoration: none; }
.aioshe-btn:hover { background: var(--aioshe-forest-dark); }
.aioshe-btn-ghost { background: none; color: var(--aioshe-forest); border: 1px solid var(--aioshe-forest); }
.aioshe-btn-ghost:hover { background: var(--aioshe-forest-tint); }
.aioshe-btn-amber { background: var(--aioshe-amber); border-color: var(--aioshe-amber); color: var(--aioshe-forest-dark); }
.aioshe-btn-red { background: none; color: var(--aioshe-red); border: 1px solid var(--aioshe-red); }
.aioshe-btn-red:hover { background: var(--aioshe-red-tint); }
.aioshe-btn-small { padding: 6px 11px; font-size: 12px; }
.aioshe-btn-block { width: 100%; justify-content: center; }
.aioshe-btn:disabled { opacity: .5; }
.aioshe-loading { padding: 30px 0; color: var(--aioshe-steel); font-size: 13.5px; }

.aioshe-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; margin-bottom: 30px; }
.aioshe-stat-card { background: var(--aioshe-white); border: 1px solid var(--aioshe-line); border-radius: 8px; padding: 18px 20px; }
.aioshe-stat-card.highlight { border-color: var(--aioshe-amber); background: var(--aioshe-amber-tint); }
.aioshe-stat-number { display: block; font-family: 'Fraunces', serif; font-size: 28px; font-weight: 600; color: var(--aioshe-forest-dark); }
.aioshe-stat-label { font-size: 12px; color: var(--aioshe-steel); margin-top: 2px; }

.aioshe-section-title { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 600; margin: 0 0 14px; }
.aioshe-card { background: var(--aioshe-white); border: 1px solid var(--aioshe-line); border-radius: 8px; padding: 20px; }

.aioshe-data { width: 100%; border-collapse: collapse; background: var(--aioshe-white); border: 1px solid var(--aioshe-line); border-radius: 8px; overflow: hidden; }
.aioshe-data th { text-align: left; font-size: 11.5px; color: var(--aioshe-steel); font-weight: 600; padding: 11px 14px; background: var(--aioshe-paper-2); border-bottom: 1px solid var(--aioshe-line); }
.aioshe-data td { padding: 11px 14px; font-size: 13.5px; border-bottom: 1px solid var(--aioshe-line); vertical-align: middle; }
.aioshe-data tr:last-child td { border-bottom: none; }
.aioshe-pill { font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 500; white-space: nowrap; }
.pill-green { background: var(--aioshe-forest-tint); color: var(--aioshe-forest-dark); }
.pill-red { background: var(--aioshe-red-tint); color: var(--aioshe-red); }

.aioshe-progress-track { height: 8px; background: var(--aioshe-paper-2); border-radius: 20px; overflow: hidden; }
.aioshe-progress-fill { height: 100%; background: linear-gradient(90deg, var(--aioshe-forest), #1c7a5c); border-radius: 20px; transition: width .4s ease; }

/* ---------------- Courses ---------------- */
.aioshe-catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 18px; }
.aioshe-course-card { background: var(--aioshe-white); border: 1px solid var(--aioshe-line); border-radius: 8px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.aioshe-course-code { font-size: 10.5px; letter-spacing: .5px; color: var(--aioshe-forest); font-weight: 700; }
.aioshe-course-card h3 { font-family: 'Fraunces', serif; font-size: 16.5px; margin: 0; font-weight: 600; line-height: 1.3; }
.aioshe-course-desc { font-size: 13px; color: var(--aioshe-steel); line-height: 1.5; flex: 1; }
.aioshe-course-meta { display: flex; gap: 12px; font-size: 12px; color: var(--aioshe-steel); border-top: 1px solid var(--aioshe-line); padding-top: 9px; }
.aioshe-course-actions { display: flex; gap: 8px; margin-top: 2px; }
.aioshe-enrolled-pill { font-size: 12px; color: var(--aioshe-forest); background: var(--aioshe-forest-tint); padding: 6px 10px; border-radius: 5px; text-align: center; font-weight: 500; }

/* ---------------- Course editor ---------------- */
.aioshe-edit-form label { display: block; font-size: 12.5px; color: var(--aioshe-steel); margin-bottom: 14px; }
.aioshe-edit-form input[type=text], .aioshe-edit-form input[type=number], .aioshe-edit-form textarea { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid var(--aioshe-line); border-radius: 5px; font-size: 13.5px; background: var(--aioshe-white); color: var(--aioshe-ink); }
.aioshe-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 640px) { .aioshe-edit-grid { grid-template-columns: 1fr; } }
.aioshe-builder-block { background: var(--aioshe-paper-2); border: 1px solid var(--aioshe-line); border-radius: 6px; padding: 12px; margin-bottom: 10px; }
.aioshe-builder-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.aioshe-builder-row input { flex: 1; padding: 8px 10px; border: 1px solid var(--aioshe-line); border-radius: 5px; font-size: 13px; }
.aioshe-builder-lessons { margin-left: 18px; }
.aioshe-builder-remove { background: none; border: none; color: var(--aioshe-red); font-size: 16px; line-height: 1; padding: 2px 6px; }
.aioshe-builder-add { font-size: 12.5px; background: var(--aioshe-white); border: 1px dashed var(--aioshe-line); border-radius: 5px; padding: 7px 12px; color: var(--aioshe-forest); }
.aioshe-option-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.aioshe-option-row input[type=radio] { accent-color: var(--aioshe-forest); }
.aioshe-option-row input[type=text] { flex: 1; padding: 7px 9px; border: 1px solid var(--aioshe-line); border-radius: 5px; font-size: 12.5px; }
.aioshe-form-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ---------------- Learning player / exam ---------------- */
.aioshe-module { border: 1px solid var(--aioshe-line); border-radius: 8px; margin-bottom: 12px; background: var(--aioshe-white); overflow: hidden; }
.aioshe-module-head { padding: 12px 15px; font-weight: 600; font-size: 14px; background: var(--aioshe-paper-2); border-bottom: 1px solid var(--aioshe-line); }
.aioshe-lesson { display: flex; align-items: center; gap: 11px; padding: 11px 15px; border-bottom: 1px solid var(--aioshe-line); font-size: 13.5px; }
.aioshe-lesson:last-child { border-bottom: none; }
.aioshe-lesson-check { width: 19px; height: 19px; border-radius: 50%; border: 2px solid var(--aioshe-line); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; color: transparent; }
.aioshe-lesson.done .aioshe-lesson-check { background: var(--aioshe-forest); border-color: var(--aioshe-forest); color: #fff; }
.aioshe-lesson.done .aioshe-lesson-title { color: var(--aioshe-steel); text-decoration: line-through; }
.aioshe-lesson-title { flex: 1; }
.aioshe-lesson-mark { font-size: 11.5px; background: var(--aioshe-paper-2); border: 1px solid var(--aioshe-line); padding: 5px 10px; border-radius: 5px; }
.aioshe-gate-box { margin-top: 18px; padding: 20px; border-radius: 8px; background: var(--aioshe-forest-tint); border: 1px solid var(--aioshe-forest); }
.aioshe-gate-box.locked { background: var(--aioshe-paper-2); border-color: var(--aioshe-line); color: var(--aioshe-steel); }
.aioshe-exam-question { background: var(--aioshe-white); border: 1px solid var(--aioshe-line); border-radius: 8px; padding: 16px 18px; margin-bottom: 12px; }
.aioshe-exam-question p { margin: 0 0 10px; font-weight: 500; font-size: 14px; }
.aioshe-exam-option { display: flex; align-items: center; gap: 9px; padding: 8px 4px; font-size: 13.5px; border-radius: 5px; }
.aioshe-exam-option:hover { background: var(--aioshe-paper-2); }
.aioshe-exam-option input { accent-color: var(--aioshe-forest); }
.aioshe-exam-result { padding: 20px; border-radius: 8px; margin-top: 16px; }
.aioshe-exam-result.pass { background: var(--aioshe-forest-tint); border: 1px solid var(--aioshe-forest); }
.aioshe-exam-result.fail { background: var(--aioshe-red-tint); border: 1px solid var(--aioshe-red); }

.aioshe-wallet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 16px; }
.aioshe-wallet-card { background: var(--aioshe-white); border: 1px solid var(--aioshe-line); border-radius: 8px; padding: 16px; }
.aioshe-wallet-card h4 { font-family: 'Fraunces', serif; margin: 0 0 4px; font-size: 15px; }

/* ---------------- Verify ---------------- */
.aioshe-verify-box { max-width: 460px; }
.aioshe-verify-form { display: flex; gap: 8px; margin-bottom: 20px; }
.aioshe-verify-form input { flex: 1; padding: 10px 12px; border: 1px solid var(--aioshe-line); border-radius: 6px; font-size: 13.5px; }
.aioshe-verify-result { border-radius: 8px; padding: 18px; }
.aioshe-verify-result.valid { background: var(--aioshe-forest-tint); border: 1px solid var(--aioshe-forest); }
.aioshe-verify-result.bad { background: var(--aioshe-red-tint); border: 1px solid var(--aioshe-red); }
.aioshe-verify-badge { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.aioshe-verify-result table { width: 100%; border-collapse: collapse; }
.aioshe-verify-result th { text-align: left; font-size: 12px; color: var(--aioshe-steel); font-weight: 500; padding: 4px 0; width: 38%; }
.aioshe-verify-result td { font-size: 12.5px; padding: 4px 0; }

/* ---------------- Settings ---------------- */
.aioshe-settings-grid { display: grid; grid-template-columns: 1fr 300px; gap: 26px; align-items: start; }
@media (max-width: 900px) { .aioshe-settings-grid { grid-template-columns: 1fr; } }
.aioshe-settings-section { margin-bottom: 26px; }
.aioshe-settings-section h3 { font-family: 'Fraunces', serif; font-size: 15px; margin: 0 0 12px; }
.aioshe-field-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--aioshe-line); }
.aioshe-field-row:last-child { border-bottom: none; }
.aioshe-field-label { font-size: 13.5px; }
.aioshe-field-hint { font-size: 11.5px; color: var(--aioshe-steel); margin-top: 2px; }
.aioshe-field-row input[type=text], .aioshe-field-row input[type=number] { padding: 8px 10px; border: 1px solid var(--aioshe-line); border-radius: 5px; font-size: 13px; width: 170px; }
.aioshe-color-input { width: 44px; height: 32px; border: 1px solid var(--aioshe-line); border-radius: 5px; padding: 2px; background: var(--aioshe-white); }
.aioshe-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; display: inline-block; }
.aioshe-switch input { opacity: 0; width: 0; height: 0; }
.aioshe-switch-track { position: absolute; inset: 0; background: var(--aioshe-line); border-radius: 20px; transition: .2s; }
.aioshe-switch-track:before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.aioshe-switch input:checked + .aioshe-switch-track { background: var(--aioshe-forest); }
.aioshe-switch input:checked + .aioshe-switch-track:before { transform: translateX(18px); }
.aioshe-preview-card { background: var(--aioshe-forest-dark); border-radius: 10px; padding: 20px; color: #fff; position: sticky; top: 90px; }
.aioshe-preview-card h4 { font-family: 'Fraunces', serif; margin: 0 0 4px; font-size: 15px; }
.aioshe-preview-card p { font-size: 11.5px; color: rgba(255,255,255,.65); margin: 0 0 16px; }
.aioshe-preview-swatch { display: flex; gap: 8px; margin-bottom: 16px; }
.aioshe-preview-swatch div { flex: 1; height: 36px; border-radius: 6px; }
.aioshe-settings-toast { display: none; background: var(--aioshe-forest-tint); border: 1px solid var(--aioshe-forest); color: var(--aioshe-forest-dark); padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
.aioshe-settings-toast.show { display: block; }

/* ---------------- Login / register gate ---------------- */
.aioshe-gate { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 50px 16px; }
.aioshe-gate-card { max-width: 380px; width: 100%; background: var(--aioshe-white); border: 1px solid var(--aioshe-line); border-radius: 8px; padding: 32px; }
.aioshe-gate-card h2 { font-family: 'Fraunces', serif; font-size: 22px; margin: 0 0 6px; }
.aioshe-gate-card p { color: var(--aioshe-steel); font-size: 13.5px; margin: 0 0 20px; }
.aioshe-gate-card label { display: block; font-size: 13px; color: var(--aioshe-steel); margin-bottom: 14px; }
.aioshe-gate-card input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--aioshe-line); border-radius: 5px; font-size: 14px; box-sizing: border-box; }
.aioshe-gate-switch { font-size: 13px; color: var(--aioshe-steel); margin: 4px 0 0; }
.aioshe-gate-switch a { color: var(--aioshe-forest); font-weight: 600; }
.aioshe-auth-message { margin-top: 14px; font-size: 13px; padding: 10px 12px; border-radius: 5px; }
.aioshe-auth-message.is-error { background: var(--aioshe-red-tint); color: var(--aioshe-red); }
