@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Source+Serif+4:opsz,wght@8..60,500;8..60,650&display=swap");

:root {
  --ink: #16202c;
  --ink-soft: #3d4a5c;
  --paper: #f6f1e8;
  --card: #fffdf8;
  --line: #e4d8c4;
  --navy: #121c2b;
  --navy-2: #1c2b40;
  --brass: #b8893a;
  --brass-2: #d4a85a;
  --ok: #2f6b4f;
  --ok-bg: #e6f3ea;
  --warn: #8a4b12;
  --warn-bg: #fff1dd;
  --bad: #8b2e2e;
  --bad-bg: #fdeaea;
  --info: #245a78;
  --info-bg: #e7f2f8;
  --shadow: 0 10px 30px rgba(18, 28, 43, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Cairo", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(184, 137, 58, 0.12), transparent 50%),
    var(--paper);
}

h1, h2, .brand-en { font-family: "Source Serif 4", "Cairo", serif; }
h1 { font-size: 1.75rem; margin: 0 0 6px; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; margin: 28px 0 12px; }
p { line-height: 1.65; }

a { color: var(--navy-2); }
.app { min-height: 100vh; }
.app.authed { display: grid; grid-template-columns: 260px minmax(0, 1fr); align-items: stretch; }

.sidebar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #f4efe6;
  padding: 28px 20px;
  min-height: 100vh;
  position: sticky;
  top: 0;
}
.brand { display: block; text-decoration: none; color: inherit; margin-bottom: 28px; }
.brand strong { display: block; font-size: 1.35rem; }
.brand span { display: block; color: var(--brass-2); font-size: 0.82rem; margin-top: 2px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a {
  color: #d9d2c5;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
}
.sidebar nav a:hover, .sidebar nav a.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.sidebar nav a.active { box-shadow: inset 3px 0 0 var(--brass); }

.main { padding: 28px 32px 48px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.global-search {
  display: flex;
  gap: 8px;
  flex: 1 1 220px;
  min-width: min(100%, 220px);
  max-width: 420px;
}
.global-search input {
  min-height: 2.25rem;
  margin: 0;
}
.userchip { color: var(--ink-soft); font-size: 0.92rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lead { color: var(--ink-soft); margin: 0 0 20px; }
.kicker { color: var(--brass); font-size: 0.8rem; letter-spacing: 0.08em; margin: 0 0 8px; }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.cards.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) {
  .cards.stats { grid-template-columns: 1fr; }
}
.stat, .card, li.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  list-style: none;
}
.stat strong { display: block; font-size: 1.8rem; margin-top: 6px; font-family: "Source Serif 4", serif; }
.stat .muted, .muted { color: var(--ink-soft); font-size: 0.92rem; }

ul.list { padding: 0; margin: 0; display: grid; gap: 10px; }
.table-wrap {
  overflow: auto;
  max-height: min(70vh, 760px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-wrap th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 var(--line);
}
.table-wrap tbody tr:nth-child(even) td,
.table-wrap tr:nth-child(even) td { background: #faf6ee; }
.table-wrap tr:hover td { background: #fff6e4; }
.table-wrap .nowrap { white-space: nowrap; }
.data-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0;
}
.data-composer { margin: 0 0 16px; }
.data-composer > summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.data-composer > summary::-webkit-details-marker { display: none; }
.data-composer[open] { padding-bottom: 4px; }
.data-composer .grid { margin-top: 12px; }
.q-summary { cursor: pointer; font-weight: 600; line-height: 1.45; }
.q-summary::-webkit-details-marker { display: none; }
.q-clip {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.q-details { margin-top: 8px; }
.q-options.compact { gap: 4px; }
.q-options.compact li { padding: 5px 10px; font-size: 0.86rem; }
.toolbar.card { padding: 12px 14px; align-items: end; }
.when-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.when-time { font-weight: 700; white-space: nowrap; }
.when-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lesson-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.lesson-row-actions form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  flex: 1 1 auto;
}
.lesson-row-actions select { min-width: 7.5rem; max-width: 11rem; }
.lesson-row-actions input[name="note"] {
  width: 10rem;
  flex: 0 1 10rem;
  min-width: 7rem;
}
th { font-size: 0.82rem; letter-spacing: 0.04em; color: var(--ink-soft); background: #faf6ee; }
tr:last-child td { border-bottom: 0; }

form.grid, .grid { display: grid; gap: 12px; align-items: end; }
form.grid.card, .grid.card { padding: 16px 18px; margin: 0 0 16px; }
@media (min-width: 800px) {
  /* Default card forms: 2 columns so pages stay compact */
  form.grid.card:not(.cols-1):not(.cols-3) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  form.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  form.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  form.grid.cols-1 { grid-template-columns: 1fr; }
}
form.grid > h1,
form.grid > h2,
form.grid > h3,
form.grid > p,
form.grid > .muted,
form.grid > .lead,
form.grid > .lead-tight,
form.grid > .actions,
form.grid > .span-2,
form.grid > .lesson-journal-fields,
form.grid > button,
form.grid > .btn,
form.grid > .rep-form-actions,
form.grid label.span-2,
form.grid label:has(textarea) {
  grid-column: 1 / -1;
}
.login-card form.grid {
  grid-template-columns: 1fr !important;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  min-width: 0;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="color"]),
select,
textarea {
  font: inherit;
  font-weight: 400;
  min-height: 2.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 100%;
  max-width: 100%;
  background: #fff;
  color: var(--ink);
  line-height: 1.35;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%233d4a5c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.75rem center;
  padding-inline-end: 0.75rem;
  padding-inline-start: 2rem;
}
html[dir="rtl"] select {
  background-position: right 0.75rem center;
  padding-inline-start: 0.75rem;
  padding-inline-end: 2rem;
}
textarea {
  min-height: 6rem;
  resize: vertical;
  line-height: 1.5;
}
input[type="file"] {
  font: inherit;
  width: 100%;
  max-width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #faf6ee;
  color: var(--ink);
  min-height: 2.5rem;
}
input[type="checkbox"],
input[type="radio"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  accent-color: var(--navy);
  flex-shrink: 0;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(184, 137, 58, 0.45);
  outline-offset: 1px;
  border-color: var(--brass);
}

[hidden] { display: none !important; }
.btn,
button,
a.btn {
  box-sizing: border-box;
  border: 1px solid transparent;
  background: var(--navy);
  color: #fff;
  min-height: 2.5rem;
  padding: 0.45rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  width: auto;
  max-width: 100%;
  white-space: nowrap;
}
.btn:hover,
button:hover,
a.btn:hover { background: #24344d; }
.btn.ghost,
a.btn.ghost,
button.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn.ghost:hover,
a.btn.ghost:hover,
button.btn.ghost:hover {
  background: #faf6ee;
  border-color: #d7c9b0;
}
.btn.brass,
button.btn.brass { background: var(--brass); color: #fff; border-color: var(--brass); }
.btn.brass:hover,
button.btn.brass:hover { background: #a37630; }
.btn.danger,
button.btn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.danger:hover,
button.btn.danger:hover { background: #742525; }
.btn.ghost.danger,
button.btn.ghost.danger {
  background: transparent;
  color: var(--bad);
  border-color: #e8c4c4;
}
.btn.ghost.danger:hover,
button.btn.ghost.danger:hover {
  background: var(--bad-bg);
  border-color: #d9a0a0;
}
.btn.block,
button.btn.block { width: 100%; justify-self: stretch; }
.btn.sm,
button.btn.sm,
a.btn.sm {
  min-height: 2.1rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.88rem;
}

/* Prevent grid cells from stretching buttons to full column width */
form.grid > .btn,
form.grid > button,
.grid > .btn,
.grid > button {
  justify-self: start;
  align-self: end;
}
.login-card form.grid > .btn,
.login-card form.grid > button {
  width: 100%;
  justify-self: stretch;
}

.inline-form { display: inline-flex; vertical-align: middle; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions .btn,
.actions button,
.topbar .btn {
  min-height: 2.25rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.9rem;
}
li.card.actions,
.card.actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  align-items: end;
}
.toolbar form { flex: 1; min-width: 240px; }
.toolbar label { flex: 1; min-width: 160px; }
.toolbar > button,
.toolbar > .btn,
.toolbar form > button,
.toolbar form > .btn {
  flex: 0 0 auto;
  width: auto;
}

.table-wrap form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
}
.table-wrap form.toolbar { margin: 0; }
.table-wrap select,
.table-wrap input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.table-wrap .btn,
.table-wrap button {
  width: auto;
  min-width: 0;
  min-height: 2.25rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.9rem;
}
.table-wrap input[name="note"],
.table-wrap input[type="text"],
.table-wrap input:not([type]) {
  min-width: 8rem;
  flex: 1 1 8rem;
}
.table-wrap .actions { gap: 6px; }

fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0;
  background: #fff;
}
fieldset legend {
  padding: 0 6px;
  font-weight: 600;
  color: var(--ink);
}
fieldset label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  color: var(--ink);
}

.q-bank-toolbar { margin-bottom: 12px; }
.q-bank-list { margin-top: 4px; }
.q-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.q-card-main { flex: 1; min-width: 0; }
.q-card-head { margin-bottom: 8px; }
.q-prompt { margin: 0 0 10px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.q-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.q-options li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #faf6ee;
  border: 1px solid transparent;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.q-options li.q-correct {
  background: var(--ok-bg);
  border-color: #c6e2d2;
  color: var(--ok);
  font-weight: 600;
}
.q-card-actions { flex: 0 0 auto; }
form.grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 700px) {
  .q-card { flex-direction: column; }
  .q-card-actions { align-self: stretch; }
  .q-card-actions .btn { width: 100%; }
}

.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--bad-bg); color: var(--bad); }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: var(--info-bg);
  color: var(--info);
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }

.empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.5);
}
.empty p { margin: 0 0 12px; }
.split { display: grid; gap: 16px; }
@media (min-width: 960px) {
  .split { grid-template-columns: 1.1fr 0.9fr; }
}
.stat a, a.stat { text-decoration: none; color: inherit; display: block; }
.stat:hover { border-color: var(--brass); }
.meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0 16px; }
.block { margin-top: 8px; }
table a { font-weight: 600; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background:
    linear-gradient(160deg, #121c2b 0%, #24344d 48%, #3d2c14 100%);
  background-size: cover;
  background-position: center;
}
.login-shell.has-photo { background-color: #121c2b; }
.login-card {
  width: min(440px, 100%);
  background: var(--card);
  border-radius: 22px;
  padding: 36px 32px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.28);
}
.brand-logo { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; margin-bottom: 8px; background: #fff; }
.portal-grid { display: grid; gap: 12px; margin-top: 8px; }
.portal-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}
.portal-card:hover { border-color: var(--brass); }
.portal-card strong { display: block; margin-bottom: 4px; }
.portal-card span { color: var(--ink-soft); font-size: 0.9rem; }
.login-card h1 { margin-bottom: 4px; }
.login-card .lead { margin-bottom: 22px; }

.timetable { min-width: 760px; table-layout: fixed; }
.timetable th, .timetable td { vertical-align: top; min-width: 110px; }
.timetable .time-col { width: 64px; color: #3d4a5c; }
.timetable .slot {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff7ea;
  border: 1px solid #e4d8c4;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 6px;
}
.timetable .slot strong { display: block; margin-bottom: 4px; }
.timetable .slot.hw { background: #fff8e4; border-color: #d4a85a; }
.receipt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.receipt-sheet h1 { margin-bottom: 4px; }

@media (max-width: 860px) {
  .app.authed { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; }
  .sidebar nav { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 20px 16px 40px; }
}

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; color: var(--ink-soft); font-size: .92rem; }
.crumbs a { color: var(--navy-2); text-decoration: none; }
.crumbs-sep { opacity: .45; }
.lib-filters { align-items: end; flex-wrap: wrap; gap: 10px; }
.library-page .page-head { margin-bottom: 6px; }
.lib-shelves {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin: 0 0 24px;
}
.library-page h2 { margin: 8px 0 12px; font-size: 1.15rem; }
.lib-books {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin: 0 0 24px;
}
.lib-shelf {
  position: relative;
  display: grid;
  gap: 5px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(160deg, #fffdf8 0%, #f4ead6 100%);
  border: 1px solid #e2d4b8;
  border-radius: 16px;
  padding: 18px 16px 16px 26px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  min-height: 130px;
  transition: box-shadow .18s, transform .18s;
}
.lib-shelf:hover { box-shadow: 0 4px 18px rgba(0,0,0,.12); transform: translateY(-2px); }
html[dir="rtl"] .lib-shelf { padding: 18px 26px 16px 16px; }
.lib-shelf-mark {
  position: absolute;
  inset-block: 12px;
  inset-inline-start: 0;
  width: 9px;
  border-radius: 0 6px 6px 0;
  background: var(--brass);
}
html[dir="rtl"] .lib-shelf-mark { border-radius: 6px 0 0 6px; }
.lib-shelf.lib-school .lib-shelf-mark { background: #6b3e1f; }
.lib-shelf.lib-grade  .lib-shelf-mark { background: #245a78; }
.lib-shelf.lib-subject .lib-shelf-mark { background: #2f6b4f; }
.lib-shelf strong { font-family: "Source Serif 4", serif; font-size: 1.1rem; line-height: 1.35; }
.lib-shelf .muted  { font-size: .85rem; }
.lib-shelf em { font-style: normal; color: var(--brass); font-size: .85rem; margin-top: 4px; }
.lib-shelf-title { margin-top: 8px; }
.lib-book {
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: box-shadow .18s, transform .18s;
}
.lib-book:hover { box-shadow: 0 5px 18px rgba(0,0,0,.12); transform: translateY(-2px); }
.lib-book-inner { display: grid; grid-template-columns: 56px 1fr; min-height: 150px; }
.lib-spine {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px 6px;
  color: #f4efe6;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: .7rem;
  letter-spacing: .12em;
  font-weight: 700;
}
.lib-book.tone-official .lib-spine  { background: #6b3e1f; }
.lib-book.tone-reference .lib-spine { background: #245a78; }
.lib-book.tone-worksheet .lib-spine { background: #2f6b4f; }
.lib-book.tone-research  .lib-spine { background: #5a3d6b; }
.lib-book.tone-other     .lib-spine { background: #3d4a5c; }
.lib-book-body { padding: 12px 14px 14px; display: grid; align-content: start; gap: 5px; }
.lib-book-body strong { font-family: "Source Serif 4", serif; font-size: 1rem; line-height: 1.4; }
.lib-book-body .kicker { font-size: .75rem; font-weight: 600; letter-spacing: .04em; opacity: .65; text-transform: uppercase; }
.lib-book-body .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lib-cover { min-height: 150px; background: #e8dcc8; }
.lib-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.search-hits { margin-bottom: 18px; }
.nav-group { display: grid; gap: 6px; margin: 0 0 14px; }
.nav-group strong {
  display: block;
  color: var(--brass, #d4a85a);
  font-size: .72rem;
  letter-spacing: .06em;
  padding: 8px 12px 4px;
}
.nt-bell { position: relative; }
.nt-count {
  position: absolute;
  top: -7px;
  inset-inline-end: -6px;
  background: #8b2e2e;
  color: #fff;
  border-radius: 99px;
  min-width: 1.15rem;
  height: 1.15rem;
  font-size: .7rem;
  display: grid;
  place-items: center;
}
.nt-unread { box-shadow: inset 3px 0 0 #d4a85a; }
.lesson-book { margin-bottom: 20px; }
.skill-eval { align-items: end; }
.skill-eval label { min-width: 140px; }
.teacher-card { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.teacher-avatar { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; border: 2px solid #e4d8c4; }
.rich-tools { display: flex; gap: 6px; margin-bottom: 6px; }
.rich-body { line-height: 1.7; }
.rich-body ul, .rich-body ol { padding-inline-start: 1.4rem; }
.quiz-timer { font-weight: 700; color: #8b2e2e; }
.cert-card { text-align: center; padding: 48px 24px; }
.cert-card h1 { font-size: 2rem; margin: 8px 0 16px; }
.shop-books {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  margin: 0 0 20px;
}
.shop-book {
  display: grid;
  grid-template-rows: 230px auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.shop-book:hover { border-color: var(--brass); }
.shop-book:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.shop-cover {
  background: #e8dcc8;
  min-height: 230px;
}
.shop-cover-link { display: block; color: inherit; text-decoration: none; }
.shop-cover img { width: 100%; height: 230px; object-fit: cover; display: block; }
.shop-cover-fallback {
  display: grid;
  place-items: center;
  color: #f4efe6;
  font-weight: 700;
  letter-spacing: .08em;
}
.shop-cover-fallback span {
  font-family: "Source Serif 4", serif;
  font-size: 4.6rem;
  line-height: 1;
}
.shop-book.tone-official .shop-cover-fallback { background: #6b3e1f; }
.shop-book.tone-worksheet .shop-cover-fallback { background: #2f6b4f; }
.shop-book.tone-research .shop-cover-fallback { background: #5a3d6b; }
.shop-book.tone-other .shop-cover-fallback { background: #3d4a5c; }
.shop-book-body { padding: 12px 14px 14px; display: grid; align-content: start; gap: 6px; }
.shop-book-body strong, .shop-book-body strong a {
  font-family: "Source Serif 4", serif;
  color: inherit;
  text-decoration: none;
}
.shop-price { font-weight: 700; color: var(--brass); margin: 0; }
.shop-dialog:not([open]) { display: none; }
.shop-dialog[open] {
  display: block;
  width: min(780px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  background: var(--card);
  color: inherit;
  box-shadow: var(--shadow);
}
.shop-dialog::backdrop { background: rgba(20, 16, 12, .55); }
.shop-dialog-grid {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
}
.shop-dialog .shop-cover { min-height: 280px; height: 100%; }
.shop-dialog .shop-cover img { height: 100%; min-height: 280px; }
.shop-dialog-body { padding: 16px 18px 20px; display: grid; align-content: start; gap: 8px; }
.shop-dialog-close { justify-self: end; margin: 0; }
.shop-dialog-desc { margin: 0; line-height: 1.75; }
@media (max-width: 640px) {
  .shop-dialog-grid { grid-template-columns: 1fr; }
  .shop-dialog .shop-cover, .shop-dialog .shop-cover img { min-height: 180px; height: 180px; }
}
.reader-app { display: grid; gap: 12px; }
.reader-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.reader-body { display: grid; grid-template-columns: minmax(0,1fr) minmax(140px,200px); gap: 12px; align-items: start; }
.reader-canvas { background: #fff; border: 1px solid var(--line); border-radius: 12px; height: 70vh; min-height: 420px; overflow: auto; padding: 12px; position: relative; }
.reader-canvas.pdf-native { padding: 0; overflow: hidden; }
.reader-pdf-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.reader-pdf-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(255, 253, 248, .55);
  color: var(--ink, #16202c);
  font-weight: 600;
  z-index: 2;
  transition: opacity .2s ease;
}
.reader-pdf-overlay.is-hidden { opacity: 0; visibility: hidden; }
.reader-app.reader-night .reader-pdf-overlay { background: rgba(26, 34, 48, .55); color: #f4efe6; }
.reader-app.reader-night .reader-pdf-frame { filter: invert(0.92) hue-rotate(180deg); }
.reader-canvas.epub-view { overflow: hidden; padding: 0; direction: ltr; }
.reader-canvas.epub-view .empty { padding: 24px; }
.reader-canvas canvas, .reader-canvas img { display: block; margin: 0 auto; }
.reader-canvas .epub-container,
.reader-canvas iframe { width: 100% !important; height: 100% !important; border: 0; }
.reader-marks ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.reader-marks li { display: flex; gap: 6px; align-items: center; }
.reader-app.reader-night { color: #f4efe6; }
.reader-app.reader-night .reader-canvas { background: #1a2230; border-color: #2a3648; }
.reader-app.reader-night .reader-marks { background: #1a2230; border-color: #2a3648; color: #f4efe6; }
@media (max-width: 860px) {
  .reader-body { grid-template-columns: 1fr; }
  .reader-canvas { height: 60vh; min-height: 360px; }
}

.io-toolbar {
  align-items: center;
  margin-bottom: 14px;
}
.io-toolbar .io-import {
  display: inline-flex;
  margin: 0;
}
.io-toolbar .io-import input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.io-toolbar .io-import label.btn {
  cursor: pointer;
  margin: 0;
}

.reports-hub .rep-overview,
.reports-hub .rep-group,
.reports-hub .rep-narrative {
  margin-bottom: 32px;
}
.reports-hub .lead-tight {
  margin: 0 0 14px;
}
.reports-hub .rep-group > h2,
.reports-hub .rep-narrative > h2,
.reports-hub .rep-overview > h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}
.reports-hub .rep-cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.reports-hub .rep-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
  min-width: 0;
}
.reports-hub .rep-card-body {
  flex: 1 1 auto;
  min-width: 0;
}
.reports-hub .rep-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.reports-hub .rep-card p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}
.reports-hub .rep-card-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.reports-hub .rep-card-actions .btn {
  flex: 0 0 auto;
  white-space: nowrap;
  width: auto;
}
.reports-hub .rep-create,
.reports-hub .rep-edit {
  margin-bottom: 16px;
}
.reports-hub .rep-form-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}
.reports-hub .rep-table {
  margin-top: 4px;
}
.reports-hub .rep-table td.rep-summary {
  max-width: 28rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.4;
}
.reports-hub .rep-row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}
.reports-hub .rep-row-actions .inline-form,
.reports-hub .rep-row-actions form {
  display: inline-flex;
  margin: 0;
}
.reports-hub .rep-row-actions .btn,
.reports-hub .rep-row-actions button {
  width: auto;
  flex: 0 0 auto;
}
.report-sheet .rep-section {
  margin-top: 22px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.report-sheet .rep-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}
@media (max-width: 700px) {
  .reports-hub .rep-row-actions {
    justify-content: flex-start;
  }
}

.lesson-journal-fields {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
}
@media (min-width: 800px) {
  .lesson-journal-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }
}
.lesson-journal-fields h2 {
  margin: 8px 0 4px;
  grid-column: 1 / -1;
}
.lesson-journal-fields > .muted,
.lesson-journal-fields label.span-2,
.lesson-journal-fields .toolbar.skill-eval {
  grid-column: 1 / -1;
}
.lesson-journal-fields > .muted {
  margin: 0 0 8px;
}
.toolbar.skill-eval {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
  margin: 0 0 8px;
}
.toolbar.skill-eval label {
  min-width: 0;
  margin: 0;
}
.skill-chips {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}
.skill-chips .stat strong {
  font-size: 1.35rem;
}
.lesson-timeline td .skill-chips {
  margin: 0;
}
.lesson-timeline .stat {
  padding: 6px 8px;
}
.student-journal .lesson-timeline {
  margin-bottom: 8px;
}

.fin-row-actions {
  min-width: 20rem;
  max-width: 28rem;
  vertical-align: middle;
  white-space: nowrap;
}
.fin-action-btns {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  width: max-content;
  max-width: 100%;
}
.fin-action-btns > a,
.fin-action-btns > .btn,
.fin-action-btns > .inline-form,
.fin-action-btns > form {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  width: auto !important;
}
.fin-action-btns .btn,
.fin-action-btns button {
  width: auto !important;
  white-space: nowrap;
}
.fin-pay-inline {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  max-width: 100%;
  overflow-x: auto;
}
.fin-pay-inline input,
.fin-pay-inline select {
  width: auto;
  min-width: 5.5rem;
  flex: 0 1 auto;
}
.fin-pay-inline input[name="amount"] { min-width: 5rem; max-width: 6.5rem; }
.fin-pay-inline input[name="reference"] { min-width: 7rem; max-width: 9rem; }
.fin-pay-inline input[name="name"] { min-width: 8rem; flex: 1 1 10rem; }
.fin-pay-inline button,
.fin-pay-inline .btn {
  flex: 0 0 auto;
  width: auto;
  white-space: nowrap;
}
.pkg-edit-row { margin: 0; }
.packages-steps {
  margin: 0 0 12px;
  padding-inline-start: 1.25rem;
  line-height: 1.55;
}
.packages-cta { margin: 0 0 18px; }
.enroll-wizard .enroll-step {
  margin-bottom: 16px;
}
.enroll-wizard fieldset.enroll-step {
  border: 1px solid var(--line, #e4d8c4);
  border-radius: 14px;
  padding: 16px 18px 18px;
  background: #fffdf8;
}
.enroll-wizard legend {
  padding: 0 8px;
  font-weight: 700;
  font-size: 1.02rem;
}
.enroll-hint {
  margin: 0 0 12px;
  font-size: .92rem;
  line-height: 1.45;
}
.enroll-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}
.enroll-progress a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #3d4a5c;
  background: #fff;
  border: 1px solid #e4d8c4;
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
  font-size: .85rem;
  font-weight: 600;
}
.enroll-progress a span {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: #121c2b;
  color: #fff;
  font-size: .78rem;
}
.enroll-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 8px 0 24px;
}
.enroll-sticky {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  background: rgba(255, 253, 248, .94);
  border: 1px solid #e4d8c4;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(22, 32, 44, .08);
}
.login-links { margin-top: 16px; }
.front-public {
  background: var(--fp-bg, #f7f1e6);
  color: var(--fp-text, #16202c);
  min-height: 100vh;
  font-family: var(--fp-font-ar, Cairo, sans-serif);
}
html[lang="en"] .front-public { font-family: var(--fp-font-en, "Source Serif 4", serif); }
.front-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  background: var(--fp-header-bg, #121c2b);
  color: var(--fp-header-text, #fff);
}
.front-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}
.front-brand img { height: 36px; width: auto; border-radius: 6px; }
.front-top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.front-top-actions .btn.ghost { color: inherit; border-color: rgba(255,255,255,.35); }
.front-btn, .front-public .btn.brass,
.front-public .fp-el-button .btn,
.fp-canvas .fp-el-button .btn {
  background: var(--fp-btn-bg, #c4a35a) !important;
  color: var(--fp-btn-text, #121c2b) !important;
  border-color: transparent !important;
}
.front-block.front-hero .fp-el-button { color: inherit; }
.front-block.front-hero .fp-el-button .front-btn,
.front-block.front-hero .fp-el-button .btn {
  background: var(--fp-btn-bg, #c4a35a) !important;
  color: var(--fp-btn-text, #121c2b) !important;
}
.front-flash { margin: 12px 22px 0; }
.front-preview-banner {
  background: #8b2e2e;
  color: #fff;
  text-align: center;
  padding: 8px;
  font-weight: 600;
  font-size: .9rem;
}
.front-page { display: grid; gap: 0; }
.front-block { padding: 40px 22px; position: relative; }
.front-layout-content-start .fp-stage { margin-inline-end: auto; }
.front-layout-content-center .fp-stage { margin-inline: auto; }
.front-layout-content-end .fp-stage { margin-inline-start: auto; }
.front-layout-split-media {
  background-size: cover;
  background-position: center;
}
.front-layout-split-media .fp-stage {
  margin-inline-start: auto;
  background: rgba(255,253,248,.92);
  border-radius: 16px;
  padding: 8px;
}
.fp-stage {
  position: relative;
  width: min(920px, 100%);
  min-height: 220px;
}
.front-hero .fp-stage,
.front-block.front-hero .fp-stage { min-height: min(52vh, 420px); }
.front-block.front-hero {
  background: linear-gradient(160deg, var(--fp-header-bg, #121c2b), #3d2c14);
  color: #fff;
  background-size: cover;
  background-position: center;
}
.fp-el {
  position: absolute;
  margin: 0;
  max-width: 42rem;
  line-height: 1.45;
  z-index: 1;
}
.fp-el-heading {
  font-size: calc(clamp(1.6rem, 3.5vw, 2.6rem) * var(--fp-title-scale, 1));
  font-weight: 700;
}
.fp-el-text { font-weight: 400; opacity: .95; }
.fp-el-button { display: inline-flex; color: inherit; }
.fp-el-button .btn,
.fp-el-button .front-btn {
  pointer-events: none;
  user-select: none;
}
.fp-el-image {
  display: grid;
  gap: 6px;
  background: #fffdf8;
  border: 1px solid #e4d8c4;
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
}
.fp-el-image img { width: 100%; height: auto; display: block; max-height: 220px; object-fit: cover; }
.fp-el-cap { padding: 6px 8px; font-size: .85rem; color: var(--fp-text, #16202c); }
.fp-el-placeholder {
  display: grid;
  place-items: center;
  min-height: 100px;
  background: #eee6d8;
  color: #666;
  font-weight: 700;
}
.front-foot { padding: 28px 22px; text-align: center; opacity: .8; }

/* Studio builder */
.fp-studio-chrome { margin-bottom: 10px; }
.fp-studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0 4px;
}
.fp-lang-toggle { display: inline-flex; gap: 4px; }
.fp-lang-toggle button,
.fp-tabs button,
.fp-align-btn,
button.fp-pick {
  background: #fff !important;
  color: #16202c !important;
  border: 1px solid #e4d8c4 !important;
  box-shadow: none;
}
.fp-lang-toggle button:hover,
.fp-tabs button:hover,
.fp-align-btn:hover,
button.fp-pick:hover {
  background: #faf6ee !important;
  color: #16202c !important;
}
.fp-lang-toggle .active,
.fp-tabs button.active,
.fp-align-btn.active {
  background: #121c2b !important;
  color: #fff !important;
  border-color: #121c2b !important;
}
.fp-studio-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 14px;
  align-items: start;
}
@media (max-width: 980px) {
  .fp-studio-body { grid-template-columns: 1fr; }
}
.fp-canvas-shell {
  border: 1px solid #e4d8c4;
  border-radius: 14px;
  overflow: hidden;
  background: #ebe4d8;
}
.fp-canvas-toolbar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #fffdf8;
  border-bottom: 1px solid #e4d8c4;
}
.fp-canvas {
  min-height: calc(100vh - 220px);
  max-height: calc(100vh - 160px);
  overflow: auto;
  background: var(--fp-bg, #f7f1e6);
  color: var(--fp-text, #16202c);
}
.fp-canvas-empty { padding: 40px 20px; text-align: center; }
.fp-canvas .front-block.is-editable {
  outline: 1px dashed transparent;
  cursor: pointer;
}
.fp-canvas .front-block.is-editable:hover {
  outline-color: rgba(196,163,90,.55);
}
.fp-canvas .front-block.is-selected {
  outline: 2px solid #c4a35a;
}
.fp-canvas .fp-el.is-editable {
  cursor: grab;
  outline: 1px dashed transparent;
  padding: 2px;
  touch-action: none;
  user-select: none;
}
.fp-canvas .fp-el.is-editable:hover { outline-color: rgba(18,28,43,.35); }
.fp-canvas .fp-el.is-selected {
  outline: 2px solid #121c2b;
  z-index: 3;
  background: rgba(255,255,255,.08);
}
.fp-canvas .fp-el.is-dragging {
  cursor: grabbing;
  outline: 2px solid #c4a35a;
  z-index: 5;
  opacity: .95;
}
.fp-inspector {
  max-height: calc(100vh - 140px);
  overflow: auto;
  position: sticky;
  top: 12px;
}
.fp-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 12px;
}
.fp-tabs button {
  border-radius: 8px;
  padding: 8px 4px;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 2.4rem;
  width: 100%;
}
.fp-inspector-body h3 { margin: 0 0 10px; font-size: 1rem; }
.fp-field {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  font-size: .9rem;
}
.fp-field span { font-weight: 600; color: #445; }
.fp-swatch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 8px;
  margin: 0 0 14px;
}
.fp-swatch {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 0;
  font-size: .72rem;
  font-weight: 600;
  color: #445;
  text-align: center;
  cursor: pointer;
}
.fp-swatch input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  padding: 0 !important;
  border: 1px solid #d7c9b0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  cursor: pointer;
  box-sizing: border-box;
}
.fp-swatch input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.fp-swatch input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 7px;
}
.fp-swatch input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 7px;
}
.fp-align-stack { display: grid; gap: 8px; }
.fp-align-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.fp-dir-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.fp-align-btn {
  border-radius: 8px;
  padding: 8px 4px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 2.25rem;
  width: 100%;
}
.fp-upload-row { display: grid; gap: 6px; }
.fp-block-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.fp-block-item {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid #e4d8c4;
  border-radius: 10px;
  padding: 6px 8px;
  background: #fff;
}
.fp-block-item.active { border-color: #c4a35a; box-shadow: 0 0 0 1px #c4a35a; }
.fp-handle { cursor: grab; color: #888; padding: 0 4px; user-select: none; }
.fp-pick {
  border: 0 !important;
  background: transparent !important;
  color: #16202c !important;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: start;
  flex: 1;
  min-height: auto;
  padding: 4px 0;
  width: auto;
  max-width: none;
  white-space: normal;
}
.fp-block-item.active .fp-pick {
  color: #16202c !important;
}
.front-admin-block { margin-bottom: 16px; }
.packages-cta { margin: 0 0 18px; }
label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
label.check input { width: auto; min-height: auto; }

/* LMS landing (Eduxo-style sections) */
.lms-landing { background: var(--fp-bg, #f7f1e6); }
.lms-top .lms-top-contact {
  color: inherit;
  text-decoration: none;
  opacity: .9;
  font-size: .9rem;
  align-self: center;
}
.lms-page { display: grid; gap: 0; }
.lms-section { position: relative; }
.lms-wrap {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
  padding: 56px 0;
}
.lms-hero {
  min-height: min(78vh, 640px);
  display: grid;
  align-items: end;
  padding: 64px 22px 56px;
  color: #fff;
  background:
    linear-gradient(160deg, rgba(18, 28, 43, .92), rgba(61, 44, 20, .75)),
    var(--fp-header-bg, #121c2b);
  background-size: cover;
  background-position: center;
}
.lms-hero-inner { width: min(720px, 100%); }
.lms-hero h1 {
  margin: 0 0 14px;
  font-size: calc(clamp(2rem, 5vw, 3.2rem) * var(--fp-title-scale, 1));
  line-height: 1.15;
}
.lms-lead {
  margin: 0 0 22px;
  font-size: 1.1rem;
  line-height: 1.65;
  color: rgba(255,255,255,.9);
  max-width: 36rem;
}
.lms-cta-row { display: flex; flex-wrap: wrap; gap: 10px; }
.lms-cta-secondary {
  background: transparent !important;
  color: #fff !important;
  border-color: rgba(255,255,255,.45) !important;
}
.lms-cta-band .lms-cta-secondary {
  color: var(--fp-text, #16202c) !important;
  border-color: #d7c9b0 !important;
}
.lms-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.lms-card, .lms-program, .lms-quote {
  background: #fffdf8;
  border: 1px solid #e4d8c4;
  border-radius: 16px;
  padding: 22px;
}
.lms-card h3, .lms-program h3 { margin: 0 0 8px; font-size: 1.15rem; }
.lms-card p, .lms-program p, .lms-quote p { margin: 0; line-height: 1.6; color: #445; }
.lms-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--fp-primary, #c4a35a), #8b6914);
  opacity: .9;
}
.lms-stats {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  text-align: center;
}
.lms-stat strong {
  display: block;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--fp-primary, #c4a35a);
  line-height: 1.1;
}
.lms-stat span { color: #556; font-weight: 600; }
.lms-about {
  display: grid;
  gap: 28px;
  align-items: center;
}
@media (min-width: 860px) {
  .lms-about { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
}
.lms-about-media img {
  width: 100%;
  border-radius: 18px;
  display: block;
  object-fit: cover;
  max-height: 360px;
}
.lms-about-copy h2 { margin-top: 0; font-size: calc(1.7rem * var(--fp-title-scale, 1)); }
.lms-mv {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
@media (min-width: 640px) {
  .lms-mv { grid-template-columns: 1fr 1fr; }
}
.lms-mv h3 { margin: 0 0 6px; font-size: 1rem; color: var(--fp-primary, #c4a35a); }
.lms-mv p { margin: 0; line-height: 1.55; }
.lms-tag {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(196,163,90,.2);
  color: #6a5220;
  margin-bottom: 8px;
}
.lms-price { margin-top: 12px; font-weight: 700; color: var(--fp-header-bg, #121c2b); }
.lms-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
@media (min-width: 800px) {
  .lms-steps { grid-template-columns: repeat(2, 1fr); }
}
.lms-steps li {
  display: flex;
  gap: 14px;
  background: #fffdf8;
  border: 1px solid #e4d8c4;
  border-radius: 16px;
  padding: 18px;
}
.lms-step-num {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--fp-primary, #c4a35a);
  line-height: 1;
}
.lms-steps h3 { margin: 0 0 6px; }
.lms-steps p { margin: 0; color: #556; line-height: 1.55; }
.lms-quote footer {
  margin-top: 14px;
  display: grid;
  gap: 2px;
}
.lms-quote footer span { color: #778; font-size: .9rem; }
.lms-faq-item {
  border: 1px solid #e4d8c4;
  border-radius: 12px;
  background: #fffdf8;
  padding: 0 16px;
  margin-bottom: 10px;
}
.lms-faq-item summary {
  cursor: pointer;
  font-weight: 700;
  padding: 14px 0;
  list-style: none;
}
.lms-faq-item summary::-webkit-details-marker { display: none; }
.lms-faq-a { padding: 0 0 14px; color: #445; line-height: 1.6; }
.lms-cta-band {
  text-align: center;
  background: linear-gradient(135deg, #121c2b, #3d2c14);
  color: #fff;
  border-radius: 20px;
  padding: 40px 24px;
  margin: 24px auto 48px;
  width: min(1120px, calc(100% - 40px));
}
.lms-cta-band h2 { margin: 0 0 10px; }
.lms-cta-band p { margin: 0 0 18px; opacity: .9; }
.lms-cta-band .lms-cta-row { justify-content: center; }
.lms-footer {
  background: var(--fp-header-bg, #121c2b);
  color: var(--fp-header-text, #fff);
  padding: 8px 0 28px;
}
.lms-footer .lms-wrap { padding-top: 36px; padding-bottom: 12px; }
.lms-footer a { color: inherit; }
.lms-footer-blurb { max-width: 36rem; line-height: 1.6; opacity: .9; }
.lms-footer-contact { display: flex; flex-wrap: wrap; gap: 12px; }
.lms-copy { opacity: .65; font-size: .9rem; margin-top: 18px; }

/* Section editor */
.fp-sec-editor { display: grid; gap: 14px; }
.fp-sec-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 980px) {
  .fp-sec-layout { grid-template-columns: 1fr; }
}
.fp-sec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fp-sec-item {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid #e4d8c4;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}
.fp-sec-item.active { border-color: #c4a35a; box-shadow: 0 0 0 1px #c4a35a; }
.fp-sec-item.disabled { opacity: .55; }
.fp-sec-fields { display: grid; gap: 10px; }
.fp-sec-fields .fp-item-row {
  border: 1px solid #e4d8c4;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
  background: #fffdf8;
}
.fp-preview-frame {
  width: 100%;
  min-height: calc(100vh - 200px);
  border: 1px solid #e4d8c4;
  border-radius: 14px;
  background: #fff;
}

@media print {
  @page { size: A4; margin: 14mm; }
  .sidebar, .topbar, .no-print, .flash { display: none !important; }
  .app.authed { display: block; background: #fff; }
  .main { padding: 0; }
  .receipt-sheet, .card { box-shadow: none; border: 0; }
  .io-toolbar, .rep-card-actions { display: none !important; }
}
