/* IoT Explorer LMS — shell & pages. Tokens: tokens.css · components: bundle.css (ix-*) */
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); }
.lucide { width: 18px; height: 18px; }
.sm .lucide, .lucide.sm { width: 14px; height: 14px; }
[hidden] { display: none !important; }

/* shell */
.app { display: flex; min-height: 100%; }
.app > .ix-side { position: sticky; top: 0; height: 100vh; flex: none; overflow-y: auto; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ix-header { position: sticky; top: 0; z-index: 20; flex-wrap: nowrap; }
.content { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-6); }
.content.wide { max-width: none; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: flex-end; }
.page-head p { color: var(--ink-muted); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.row-wrap { display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: flex-start; }
.row-wrap > * { flex: 1 1 360px; min-width: 0; }
.ix-bottomnav { display: none; }
.hdr-logo { display: none; }
.menu-wrap { position: relative; }
.menu-wrap .ix-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; }

/* cover cards */
.covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.mod { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-1); color: inherit; text-decoration: none; min-width: 0; }
.mod img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); }
.mod-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.mod-body b { font-size: 13px; line-height: 18px; }
.mod-body .tt { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.mod.locked img { filter: grayscale(.9); opacity: .55; }
.mod.locked { box-shadow: none; }
.mod.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
a.mod:hover { border-color: var(--primary); }
.stars { font-size: 12px; font-weight: 700; color: var(--accent-text); letter-spacing: 1px; }

/* continue card */
.hero-card { padding: 0; overflow: hidden; display: flex; flex-wrap: wrap; }
.hero-card > img { flex: 1 1 340px; max-width: 460px; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.hero-card > div { flex: 1 1 340px; min-width: 0; padding: var(--space-6); display: flex; flex-direction: column; gap: 12px; justify-content: center; }

/* module viewer */
.viewer { display: flex; flex-direction: column; height: calc(100vh - var(--header-h)); }
.viewer-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 10px var(--space-6); background: var(--surface); border-bottom: 1px solid var(--line); }
.viewer-bar .grow { flex: 1; min-width: 0; }
.viewer iframe { flex: 1; width: 100%; border: 0; background: var(--surface); }

/* teacher session */
.stu { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.stu:first-of-type { border-top: 0; }
.stu-main { flex: 1 1 200px; min-width: 0; display: grid; gap: 2px; }
.stu-main span { font-size: 13px; line-height: 19px; color: var(--ink-muted); }
.stu-next { display: flex; align-items: center; gap: 10px; flex: 1 1 240px; min-width: 0; }
.stu-next img { width: 72px; aspect-ratio: 16 / 9; border-radius: 8px; object-fit: cover; flex: none; }
.stu-next div { display: grid; gap: 1px; min-width: 0; font-size: 13px; line-height: 19px; }
.stu-next div span { color: var(--ink-muted); }
.stu-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.check { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.bulk { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: var(--radius-md); background: var(--accent-soft); }
.tabs-cls { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tab-cls { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.tab-cls[aria-selected="true"] { border: 2px solid var(--primary); box-shadow: var(--shadow-1); }
.tab-cls:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.seats { display: flex; gap: 5px; align-items: center; }
.seat { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--primary); color: var(--on-primary); font-size: 12px; }
.seat.free { background: var(--surface); color: var(--ink-muted); border: 1.5px dashed var(--line-strong); box-sizing: border-box; }
.seat.over { background: var(--warning); color: var(--surface); }
.mod-toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.mod-toggles label { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; background: var(--surface); }
.mod-toggles label.on { border-color: var(--primary); background: var(--primary-soft); }
.heat-wrap { overflow-x: auto; }
.ix-heat td.closed { background: var(--bg); outline: 1px dashed var(--line); outline-offset: -1px; }
.ix-heat td button { all: unset; display: block; width: 100%; height: 100%; cursor: pointer; }

/* toast stack */
.toasts { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: grid; gap: 10px; }

/* login */
.login { min-height: 100%; box-sizing: border-box; padding: var(--space-6); display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: stretch; }
.login-art { flex: 1 1 480px; min-width: 0; background: var(--primary); color: var(--on-primary); border-radius: var(--radius-xl); padding: var(--space-10); display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-6); }
.login-art h1 { color: var(--on-primary); }
.login-art .plate { background: var(--surface); border-radius: var(--radius-lg); padding: 16px; display: flex; justify-content: center; }
.login-art .plate img { width: 100%; max-width: 520px; height: auto; }
.login-form { flex: 1 1 400px; min-width: 0; display: flex; align-items: center; justify-content: center; }
.login-form form { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; }
.note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-md); background: var(--surface-2); font-size: 14px; line-height: 21px; color: var(--ink-muted); }

/* landing */
.lp-nav { background: var(--surface); border-bottom: 1px solid var(--line); }
.lp-in { max-width: 1200px; margin: 0 auto; padding-inline: max(24px, env(safe-area-inset-left, 0px)); }
.lp-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 40px; padding-block: 56px 64px; }
.lp-hero > * { flex: 1 1 420px; min-width: 0; }
.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.lp-steps li { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: var(--radius-lg); background: var(--bg); border: 1px solid var(--line); }
.lp-num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: var(--on-primary); font: 800 18px/1 var(--font-display); }

@media (max-width: 1023px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .lp-steps { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .app > .ix-side { display: none; }
  .ix-header { padding: 0 16px; gap: 8px; }
  .ix-search, .ix-me > span:not(.ix-avatar), .hide-sm { display: none; }
  .hdr-logo { display: inline-flex; background: var(--logo-plate); border-radius: 8px; padding: 2px 6px; }
  .hdr-logo img { height: 22px; }
  .content { padding: 16px; padding-bottom: calc(var(--bottomnav-h) + 24px); gap: 16px; }
  .ix-bottomnav { display: grid; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .toasts { bottom: calc(var(--bottomnav-h) + 16px); left: 16px; right: 16px; }
  .covers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login { padding: 0; }
  .login-art { border-radius: 0 0 28px 28px; padding: 20px; flex-basis: 100%; }
  .login-art .lead { display: none; }
  .login-form { padding: 20px; }
}
