/* NOPPON v58 · Focused learning workspace
   Presentation only. Inherits the user's theme and preserves the motion login,
   teacher-selected card variants, access rules and data workflows. */
:root, body {
  --ws-radius: 20px;
  --ws-line: color-mix(in srgb, var(--border) 86%, var(--ink));
  --ws-soft: color-mix(in srgb, var(--card) 92%, var(--maroon-soft));
  --ws-muted: color-mix(in srgb, var(--ink) 72%, var(--card));
  --ws-shadow: 0 2px 4px rgba(var(--theme-deep-rgb), .025), 0 10px 28px rgba(var(--theme-deep-rgb), .045);
}
body { background-image: none; }
body.dark { --ws-shadow: 0 8px 24px rgba(0, 0, 0, .14); }
main { max-width: 1200px; padding: 0 28px 32px; }
body.admin-active main { max-width: 1280px; }

/* A compact, calm header. The intro animation is intentionally untouched. */
.hero {
  padding: 24px 28px 48px;
  border-radius: 0 0 28px 28px;
  background: linear-gradient(115deg, var(--theme-hero-end), var(--theme-hero-mid));
  box-shadow: none;
}
.hero::before, .hero::after, .hero > .orb { display: none; }
.hero-top, .hero-greet { max-width: 1144px; }
.hero-top { gap: 24px; align-items: center; }
.hero-top .brand { min-width: 0; gap: 12px; }
.hero-top .brand > div:last-child { min-width: 0; }
.hero-top .brand .logo { width: 48px; height: 48px; flex: 0 0 48px; }
.hero-top .brand h1 { font-size: 18px; line-height: 1.35; letter-spacing: .025em; }
.hero-top .brand small { max-width: 440px; font-size: 11px; line-height: 1.5; opacity: .8; }
.hero-top .hbtns { gap: 7px; flex-shrink: 0; }
.hero-top .hbtns > button {
  min-height: 44px; min-width: 44px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.23); box-shadow: none;
  background: rgba(255,255,255,.08); color: #fff;
}
.hero-top .hbtns > .hero-session-logout { background: #a42f35; border-color: #e6a0a3; }
.hero-top .hero-theme-action::before, .hero-top .hero-teacher-action::before { display: none; }
.hero-greet { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 24px; }
.hero-greet h2 { font-size: 20px; font-weight: 500; gap: 10px; }
.hero-greet p { margin: 0; font-size: 13px; opacity: .85; }
.hero-greet .greet-clock { padding: 5px 10px; border-radius: 9px; font-size: 16px; font-variant-numeric: tabular-nums; }
.search-wrap { max-width: 1200px; padding-inline: 28px; margin-top: -25px; margin-bottom: 28px; }
.search-box { min-height: 54px; border-radius: 14px; background: var(--card); border: 1px solid var(--ws-line); box-shadow: var(--ws-shadow); }
.search-box input { font-size: 16px; }
.search-box:focus-within { transform: none; }

/* Identity is concise; work and courses come before promotional media. */
.hero-user {
  margin: 0 0 22px; padding: 24px; border: 1px solid var(--ws-line); border-radius: var(--ws-radius);
  color: var(--ink); background: var(--card); box-shadow: var(--ws-shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.hero-user::before, .hero-user::after { display: none; }
.hero-user .hu-top { flex: 1; min-width: 0; gap: 16px; margin: 0; }
.hero-user .hu-avatar { width: 72px; height: 72px; flex: 0 0 72px; border-radius: 22px; background: var(--maroon-soft); box-shadow: none; }
.hero-user .hu-name { min-width: 0; }
.hero-user .hu-name h3 { color: var(--ink); font-size: clamp(19px, 2.2vw, 26px); line-height: 1.5; overflow-wrap: anywhere; }
.hero-user .hu-name > span { color: var(--ws-muted); font-size: 12px; }
.hero-user .hu-name .hu-kicker { color: var(--maroon); font-size: 10px; letter-spacing: .14em; }
.hero-user .hu-out { display: none; } /* Logout remains prominently in the global header. */
.hero-user .hu-stats { flex: 0 1 auto; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.hero-user .hu-stat { min-width: 76px; min-height: 68px; padding: 10px 16px; border: 1px solid var(--ws-line); border-radius: 12px; background: var(--ws-soft); box-shadow: none; }
.hero-user .hs-value { font-size: 20px; color: var(--ink); }
.hero-user .hs-label { color: var(--ws-muted); font-size: 12px; }
.workspace-quicklinks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 28px; }
.workspace-quicklink {
  display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 82px; padding: 16px;
  color: var(--ink); text-align: left; background: var(--card); border: 1px solid var(--ws-line);
  border-radius: 16px; cursor: pointer; font-family: inherit; transition: border-color .18s, background-color .18s;
}
.workspace-quicklink > .uic { flex: 0 0 40px; width: 40px; height: 40px; padding: 9px; border-radius: 12px; color: var(--maroon); background: var(--maroon-soft); }
.workspace-quicklink > span:last-child { min-width: 0; }
.workspace-quicklink b { display: block; font: 500 15px/1.5 'Kanit', sans-serif; }
.workspace-quicklink small { display: block; color: var(--ws-muted); font-size: 12px; line-height: 1.5; }
.workspace-quicklink:hover { border-color: var(--maroon); background: var(--ws-soft); }
.workspace-section-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 30px 0 16px; }
.workspace-section-heading h2 { color: var(--ink); font: 600 23px/1.45 'Kanit', sans-serif; margin: 0; }
.workspace-section-heading p { color: var(--ws-muted); font-size: 13px; margin: 3px 0 0; }
.workspace-section-heading > span { color: var(--ws-muted); font-size: 12px; padding: 7px 11px; border: 1px solid var(--ws-line); border-radius: 9px; }
.home-summary { margin: 0 0 14px; padding: 14px 18px; border-radius: 14px; background: var(--ws-soft); box-shadow: none; border: 1px solid var(--ws-line); }
.section-label { margin-top: 30px; font-size: 21px; color: var(--ink); }
.section-label::before { width: 5px; height: 20px; border-radius: 3px; box-shadow: none; }

/* A quieter card system; teacher-selected circle, glass and compact variants survive. */
.menu-grid { gap: 16px; }
body[data-system-card-style="square"] .menu-card {
  display: grid; grid-template-columns: 52px minmax(0,1fr); align-content: start; align-items: center;
  gap: 8px 14px; min-height: 155px; padding: 22px; text-align: left;
  background: var(--card); border: 1px solid var(--ws-line); border-radius: var(--ws-radius); box-shadow: var(--ws-shadow);
}
body[data-system-card-style="square"] .menu-card::before,
body[data-system-card-style="square"] .menu-card::after { display: none; }
body[data-system-card-style="square"] .menu-card .micon { grid-row: 1 / 3; width: 52px; height: 52px; margin: 0; border-radius: 15px; border: 0; box-shadow: none; background: var(--ac-soft, var(--maroon-soft)); }
body[data-system-card-style="square"] .menu-card h3 { grid-column: 2; font-size: 17px; line-height: 1.5; text-wrap: wrap; }
body[data-system-card-style="square"] .menu-card .count { grid-column: 2; justify-self: start; min-height: 0; padding: 0; font-size: 12px; border: 0; border-radius: 0; background: none; color: var(--ws-muted); }
body[data-system-card-style="square"] .menu-card p { grid-column: 1 / -1; margin-top: 6px; color: var(--ws-muted); font-size: 13px; line-height: 1.65; }
body[data-system-card-style="square"] .link-card { background: var(--card); border: 1px solid var(--ws-line); border-radius: var(--ws-radius); box-shadow: var(--ws-shadow); }
.link-card h3 { line-height: 1.5; }
.link-card .icon, .menu-card .micon { box-shadow: none; }
.know-card.card-base { box-shadow: var(--ws-shadow); border-color: var(--ws-line); }
.know-content .know-name { font-size: 17px; line-height: 1.55; }
.know-content .know-dom { color: var(--ws-muted); font-size: 13px; }
.know-content { padding: 20px; }
.know-section-head h2 { font-size: 28px; }
.announce { margin: 0 0 20px; padding: 18px 20px; border-radius: 16px; font-size: 14px; line-height: 1.7; box-shadow: none; }
.cover-carousel { box-shadow: var(--ws-shadow); border-radius: var(--ws-radius); }

/* Existing real assignment counts stay authoritative. */
.swk-home-card { padding: 24px; gap: 18px; border: 1px solid color-mix(in srgb, var(--maroon) 30%, var(--border)); border-radius: var(--ws-radius); background: var(--ws-soft); box-shadow: none; margin-bottom: 16px; }
.swk-home-card::after { display: none; }
.swk-home-icon { box-shadow: none; background: var(--maroon); }
.swk-home-copy h3 { font-size: 23px; }
.swk-home-copy p { font-size: 14px; color: var(--ws-muted); }
.swk-home-chips { gap: 8px; margin-top: 12px; }
.swk-home-chips span { border-radius: 8px; font-size: 12px; padding: 7px 10px; color: var(--ws-muted); }
.swk-home-chips b { font-size: 15px; }
.swk-home-card > button { min-height: 46px; padding: 12px 20px; font-size: 14px; background: var(--maroon); box-shadow: none; }
body.dark .swk-home-card > button { color: var(--paper); }
:is(.swk-student-card, .swk-admin-card, .research-panel, .student-analytics-card, .card) { border-radius: var(--ws-radius); box-shadow: var(--ws-shadow); }
:is(.swk-student-kpis, .swk-admin-kpis) > div { border-radius: 14px; box-shadow: none; }

/* Clear teacher tool navigation with keyboard-accessible filtering. */
.admin-overview { padding: 28px; border-radius: var(--ws-radius); background: var(--card); color: var(--ink); border: 1px solid var(--ws-line); box-shadow: var(--ws-shadow); }
.admin-overview::before, .admin-overview::after { display: none; }
.admin-overview h3 { color: var(--ink); font-size: 26px; }
.admin-overview p { color: var(--ws-muted); opacity: 1; font-size: 14px; }
.admin-overview .admin-metric { background: var(--ws-soft); border-color: var(--ws-line); box-shadow: none; min-height: 86px; }
.admin-overview .admin-metric b { color: var(--ink); }
.admin-overview .admin-metric span { color: var(--ws-muted); font-size: 13px; }
.admin-overview .admin-role-chip { color: var(--ws-muted); background: var(--ws-soft); border-color: var(--ws-line); font-size: 12px; }
.admin-version-badge { color: var(--maroon); background: var(--maroon-soft); border-color: var(--ws-line); }
.admin-overview-logout { color: #a42f35; background: var(--card); border-color: #d8a0a2; box-shadow: none; }
.admin-overview .admin-overview-logout { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; }
.admin-overview .admin-overview-logout > span { display: inline; }
.admin-overview .admin-overview-logout > .uic { display: inline-flex; width: 18px; height: 18px; }
body.dark .admin-overview-logout { color: #ffa9b0; border-color: #a86d73; }
.admin-tool-finder { margin: 20px 0 10px; }
.admin-tool-finder label { display: block; margin-bottom: 7px; font: 500 14px 'Kanit', sans-serif; color: var(--ink); }
.admin-tool-finder input { width: 100%; min-height: 48px; padding: 10px 14px; font-size: 16px; border-radius: 12px; color: var(--ink); border: 1px solid var(--ws-line); background: var(--card); }
.admin-tool-finder > span { display: block; min-height: 23px; margin-top: 6px; font-size: 12px; color: var(--ws-muted); }
.admin-jumpbar .admin-jump[hidden] { display: none; }
.admin-jumpbar { position: relative; top: auto; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; padding: 12px; border: 1px solid var(--ws-line); border-radius: 16px; background: var(--card); box-shadow: none; overflow: visible; }
.admin-jumpbar .admin-jump { justify-content: flex-start; padding: 10px 12px; min-height: 46px; white-space: normal; text-align: left; font-size: 13px; background: var(--ws-soft); color: var(--ink); border: 1px solid transparent; border-radius: 10px; box-shadow: none; }
.admin-jumpbar .admin-jump:hover { border-color: var(--maroon); color: var(--maroon); }
.admin-jumpbar .admin-jump { display: flex; gap: 10px; min-height: 56px; }
.admin-jumpbar .admin-jump > .uic { flex: 0 0 32px; width: 32px; height: 32px; padding: 6px; background: var(--maroon-soft); color: var(--maroon); border-radius: 9px; }
.admin-jumpbar .admin-jump[aria-current="true"] { border-color: var(--maroon); }
#adminArea > [id] { scroll-margin-top: 20px; }
#adminArea :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), select, textarea) { font-size: 16px; border-radius: 11px; }
#adminArea :is(.admin-section-head, .swk-admin-heading) h3 { line-height: 1.5; }
.admin-student-table :is(th,td) { padding-block: 15px; }
.admin-student-table tbody tr:hover { background: var(--ws-soft); }

/* Forms, keyboard and touch. No new animation dependency. */
:is(.btn, .back-btn, .swk-card-foot button, .admin-row-actions button) { border-radius: 11px; box-shadow: none; min-height: 44px; }
:is(.modal, .swk-modal, .student-notification-center, .theme-studio) { border-radius: 24px; }
:where(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid var(--maroon); outline-offset: 3px; }
.hero :where(button):focus-visible { outline-color: #fff; }
.workspace-skip { position: fixed; left: 16px; top: 8px; z-index: 100100; padding: 12px 18px; background: var(--card); color: var(--ink); border-radius: 10px; transform: translateY(-180%); }
.workspace-skip:focus { transform: none; }
.bottom-nav { border-radius: 18px; border: 1px solid var(--ws-line); background: var(--card); box-shadow: 0 5px 24px rgba(var(--theme-deep-rgb),.12); }
.bottom-nav .nav-btn { border-radius: 12px; }
.bottom-nav .nav-btn.active:not(.nav-btn-center) { box-shadow: none; }
.bottom-nav .nb-label { font-size: 12px; }
.bottom-nav .nav-btn-center .uic { box-shadow: 0 0 0 5px var(--card); }
@media (min-width: 1000px) {
  body[data-system-card-style="square"] .menu-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 960px) {
  .hero-top { align-items: stretch; flex-direction: column; gap: 16px; }
  .hero-top .hbtns { width: 100%; flex-wrap: wrap; }
  .hero-top .hbtns > button { flex: 1 0 44px; }
  .hero-greet { align-items: flex-start; flex-direction: column; gap: 6px; }
  .workspace-quicklinks { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hero-user { align-items: flex-start; flex-direction: column; }
  .hero-user .hu-stats { width: 100%; }
  .hero-user .hu-stat { flex: 1; }
  .admin-jumpbar { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  main { padding-inline: 16px; }
  .hero { padding: 20px 16px 42px; border-radius: 0 0 22px 22px; }
  .hero-top .brand h1 { font-size: 17px; overflow-wrap: anywhere; }
  .hero-top .brand small { max-width: none; font-size: 11px; white-space: normal; }
  .hero-top .hbtns { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 5px; }
  .hero-top .hbtns > button { min-width: 0; width: 100%; min-height: 50px; padding: 5px 2px; flex-direction: column; gap: 3px; }
  .hero-top .hero-action-label { display: inline; font-size: 11px; }
  .hero-top .hero-action-label .action-full { display: none; }
  .hero-top .hero-action-label .action-short { display: inline; }
  .hero-top .theme-color-signal { display: none; }
  .hero-greet { margin-top: 20px; }
  .hero-greet h2 { font-size: 18px; }
  .search-wrap { padding-inline: 16px; margin-bottom: 20px; }
  .hero-user { padding: 18px; gap: 16px; margin-bottom: 16px; }
  .hero-user .hu-avatar { width: 58px; height: 58px; flex-basis: 58px; border-radius: 18px; }
  .hero-user .hu-top { gap: 12px; }
  .hero-user .hu-kicker { display: none; }
  .hero-user .hu-name h3 { font-size: 19px; }
  .hero-user .hu-name > span { font-size: 12px; }
  .hero-user .hu-stat { min-height: 52px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .hero-user .hs-value { font-size: 17px; }
  .swk-home-card { grid-template-columns: 44px minmax(0,1fr); padding: 18px; gap: 12px; }
  .swk-home-icon { width: 44px; height: 44px; border-radius: 13px; }
  .swk-home-copy h3 { font-size: 21px; }
  .swk-home-copy p { font-size: 13px; }
  .swk-home-card > button { grid-column: 1 / -1; width: 100%; }
  .swk-home-chips { gap: 5px; }
  .swk-home-chips span { font-size: 11px; padding: 5px 7px; }
  .workspace-quicklinks { gap: 8px; margin-bottom: 22px; }
  .workspace-quicklink { gap: 9px; padding: 12px; min-height: 78px; }
  .workspace-quicklink > .uic { width: 32px; height: 32px; flex-basis: 32px; padding: 6px; border-radius: 9px; }
  .workspace-quicklink b { font-size: 14px; }
  .workspace-quicklink small { font-size: 11px; }
  body[data-system-card-style="square"] .menu-grid { grid-template-columns: 1fr; gap: 12px; }
  body[data-system-card-style="square"] .menu-card { min-height: 126px; padding: 18px; }
  body[data-system-card-style="square"] .menu-card h3 { font-size: 16px; }
  .workspace-section-heading h2 { font-size: 21px; }
  .admin-overview { padding: 20px; }
  .admin-overview h3 { font-size: 23px; }
  .admin-jumpbar { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 8px; gap: 6px; }
  .admin-jumpbar .admin-jump { padding: 10px; font-size: 12px; }
  .admin-role-strip { flex-wrap: wrap; }
  .bottom-nav-wrap { left: 10px; right: 10px; }
  .bottom-nav .nb-label { font-size: 11px; }
}
@media (max-width: 359px) {
  .hero-top .hbtns { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  .hero-top .hbtns > button { flex-direction: row; gap: 5px; }
  .workspace-quicklink { flex-direction: column; align-items: flex-start; gap: 6px; }
}
@media (hover: hover) and (pointer: fine) {
  body[data-system-card-style="square"][data-card-motion="lift"] .menu-card:hover { transform: translateY(-3px); border-color: var(--maroon); box-shadow: var(--ws-shadow); }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-quicklink, .menu-card, .link-card, .swk-student-card { transition: none !important; transform: none !important; }
}
@media (forced-colors: active) {
  .workspace-quicklink, .hero-user, .swk-home-card, .admin-jumpbar .admin-jump { border: 1px solid CanvasText; }
}
