:root {
  color-scheme: light;
  --primary-purple: #4b0082;
  --accent-cyan: #00ced1;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #fbfbff;
  --surface-strong: #f0fbfc;
  --ink: #333333;
  --text-dark: #333333;
  --text-light: #5a5a5a;
  --muted: #5a5a5a;
  --line: rgba(75, 0, 130, 0.12);
  --teal: #4b0082;
  --teal-dark: #36005e;
  --coral: #00aeb1;
  --amber: #7b1fa2;
  --blue: #283593;
  --green: #087d7f;
  --danger: #b94545;
  --violet: #7b1fa2;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
  --transition: all 0.25s ease;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Poppins", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.app-shell {
  width: 90%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 0 52px;
}

.container {
  width: 90%;
  max-width: 1240px;
  margin: 0 auto;
}

header {
  background: var(--surface);
  padding: 15px 0;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 45px;
}

.logo-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-img {
  height: 45px;
  width: auto;
}

.nav-wrapper {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 25px;
}

.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary-purple);
}

.btn-nav {
  padding: 8px 20px;
  border: 2px solid var(--primary-purple);
  color: var(--primary-purple);
  border-radius: 50px;
  font-weight: 600;
}

.btn-nav:hover {
  background: var(--primary-purple);
  color: #fff;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 2px solid var(--primary-purple);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--primary-purple);
  border-radius: 2px;
  transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  display: none;
}

.toolbox-banner {
  margin-top: 75px;
  background: linear-gradient(135deg, var(--primary-purple), #283593);
  color: #fff;
  padding: 54px 0 42px;
  text-align: center;
}

.toolbox-banner h1 {
  margin: 0 0 10px;
  font-size: 3rem;
  line-height: 1.15;
}

.toolbox-banner p {
  max-width: 780px;
  margin: 0 auto 22px;
  opacity: 0.92;
  font-size: 1.08rem;
}

.command-preview {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.93rem;
}

.command-preview span {
  opacity: 0.7;
}

.ai-tabs-wrap {
  background: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.ai-subtabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
  padding: 22px 0;
}

.ai-subtab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  padding: 26px 28px;
  border: 1px solid rgba(75, 0, 130, 0.08);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text-dark);
  box-shadow: var(--shadow);
  font-size: 1.08rem;
  font-weight: 700;
  text-align: center;
  transition: var(--transition);
}

.ai-subtab:hover {
  color: var(--primary-purple);
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.ai-subtab.active {
  border-color: var(--primary-purple);
  background: linear-gradient(135deg, var(--primary-purple), #7b1fa2);
  color: #fff;
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(75, 0, 130, 0.22);
}

.ai-subtab.active:hover {
  color: #fff;
}

footer {
  background-color: var(--primary-purple);
  color: #e0e0e0;
  padding: 30px 0;
  font-size: 0.9rem;
  margin-top: 70px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.footer-content p {
  margin: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 12px 0;
  background: rgba(246, 247, 242, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 205px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--teal);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
  box-shadow: inset 0 -8px 18px rgba(0, 0, 0, 0.12);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.quick-links {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 4px;
}

.quick-links a {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.quick-links a:hover,
.quick-links a:focus-visible {
  background: rgba(31, 122, 114, 0.1);
  color: var(--teal-dark);
}

.top-actions {
  display: flex;
  gap: 8px;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-action,
.primary-button,
.ghost-button,
.quiet-button,
.link-button,
.tool-tab,
.status-button,
.score-button,
.mini-delete {
  border: 0;
  border-radius: var(--radius);
}

.icon-action {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(24, 35, 33, 0.08);
}

.icon-action:hover {
  color: var(--teal-dark);
}

.intro-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 20px;
  align-items: stretch;
  margin: 16px 0 20px;
  padding: 26px;
  border: 1px solid rgba(31, 122, 114, 0.13);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.96), rgba(237, 245, 242, 0.92)),
    var(--surface);
  box-shadow: var(--shadow);
}

.intro-copy {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 10px;
  font-size: 2.3rem;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.lede {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  display: flex;
  min-height: 112px;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid rgba(31, 122, 114, 0.15);
  border-radius: var(--radius);
  background: #fdfefe;
}

.metric-card strong {
  color: var(--teal-dark);
  font-size: 1.62rem;
  line-height: 1;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.87rem;
}

.metric-card.accent-green strong {
  color: var(--green);
}

.metric-card.accent-amber strong {
  color: var(--amber);
  font-size: 1.25rem;
}

.tools-layout {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.tool-nav {
  position: sticky;
  top: 88px;
  display: grid;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 32px rgba(24, 35, 33, 0.06);
}

.nav-group {
  margin: 10px 8px 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tool-tab {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.tool-tab:hover,
.tool-tab:focus-visible {
  background: var(--surface-strong);
  color: var(--ink);
}

.tool-tab.active {
  background: var(--teal);
  color: #fff;
}

.tool-tab span {
  overflow-wrap: anywhere;
  font-weight: 800;
}

.tool-stage {
  min-width: 0;
}

.tool-panel {
  min-height: 650px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
  align-items: start;
}

.wide-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.75fr);
  gap: 18px;
}

.tool-form,
.preview-box,
.result-panel,
.flash-area,
.document-preview,
.certificate-preview,
.wheel-card,
.timer-card,
.score-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.tool-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cdd8d2;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(31, 122, 114, 0.2);
  outline-offset: 2px;
}

.field-grid {
  display: grid;
  gap: 12px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.primary-button,
.ghost-button,
.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  font-weight: 900;
}

.primary-button {
  background: var(--teal);
  color: #fff;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost-button:hover {
  border-color: rgba(31, 122, 114, 0.35);
  background: var(--surface-strong);
}

.quiet-button {
  background: transparent;
  color: var(--teal-dark);
}

.quiet-button:hover {
  background: rgba(31, 122, 114, 0.08);
}

.link-button {
  padding: 0;
  background: transparent;
  color: var(--teal-dark);
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.align-end {
  align-self: end;
}

.preview-box,
.document-preview {
  min-width: 0;
  min-height: 280px;
  padding: 16px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--teal-dark);
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 900;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed #cdd8d2;
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  padding: 16px;
}

.stack {
  display: grid;
  gap: 12px;
}

.list-card,
.subject-card,
.plan-item,
.group-card,
.worksheet-item,
.rubric-card,
.note-card,
.ticket-card,
.bingo-cell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.list-card p,
.subject-card p,
.plan-item p,
.group-card p,
.worksheet-item p,
.rubric-card p,
.note-card p,
.ticket-card p {
  margin-bottom: 6px;
}

.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.item-head span,
.answer-line,
.small-meta {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.mini-delete {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--danger);
}

.mini-delete:hover {
  border-color: rgba(185, 69, 69, 0.25);
  background: rgba(185, 69, 69, 0.08);
}

.choice-list,
.simple-list {
  display: grid;
  gap: 5px;
  margin: 8px 0;
  padding-left: 18px;
}

.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.data-table input,
.data-table textarea {
  min-height: 38px;
}

.result-panel {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.result-panel span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.result-panel strong {
  color: var(--teal-dark);
  font-size: 2.15rem;
  line-height: 1;
}

.result-panel p {
  margin: 0;
  color: var(--muted);
}

.subject-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.subject-card strong,
.plan-item strong {
  display: block;
}

.subject-card p {
  color: var(--muted);
}

.plan-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-item strong {
  color: var(--blue);
}

.flash-area {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.flash-card {
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: 270px;
  border: 1px solid rgba(31, 122, 114, 0.26);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(31, 122, 114, 0.08), rgba(73, 104, 168, 0.08)),
    #fff;
  color: var(--ink);
  padding: 24px;
  text-align: center;
}

.flash-card span {
  color: var(--coral);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.flash-card strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 1.5rem;
  line-height: 1.25;
}

.card-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.status-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  gap: 6px;
}

.status-button {
  min-height: 34px;
  padding: 6px 8px;
  background: #eef1ec;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.status-button.active.present {
  background: rgba(75, 125, 66, 0.14);
  color: var(--green);
}

.status-button.active.late {
  background: rgba(185, 131, 29, 0.16);
  color: var(--amber);
}

.status-button.active.absent {
  background: rgba(185, 69, 69, 0.12);
  color: var(--danger);
}

.picked-name {
  display: grid;
  place-items: center;
  min-height: 86px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--teal-dark);
  font-size: 1.35rem;
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
}

.group-output {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.group-card h3 {
  color: var(--blue);
}

.group-card ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.worksheet-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.worksheet-item {
  min-height: 58px;
  font-size: 1.05rem;
  font-weight: 900;
}

.answer-key {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.answer-key h3 {
  color: var(--coral);
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.answer-grid span {
  padding: 8px;
  border-radius: var(--radius);
  background: #f7f0e5;
  font-weight: 900;
}

.toggle-line {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

.wheel-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(320px, 1.18fr);
  gap: 18px;
  align-items: start;
}

.wheel-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 18px;
}

.wheel-wrap {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 1;
}

.wheel-pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  z-index: 2;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 34px solid var(--coral);
  filter: drop-shadow(0 4px 8px rgba(24, 35, 33, 0.18));
}

.wheel-disc {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 10px solid #fff;
  border-radius: 50%;
  background: conic-gradient(var(--teal), var(--amber), var(--blue), var(--coral), var(--green), var(--teal));
  box-shadow: 0 18px 45px rgba(24, 35, 33, 0.16);
  overflow: hidden;
  transition: transform 3.1s cubic-bezier(0.12, 0.72, 0.18, 1);
}

.wheel-label {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 46%;
  height: 24px;
  margin-top: -12px;
  padding-left: 18%;
  padding-right: 10px;
  color: #fff;
  font-size: clamp(0.62rem, 1.4vw, 0.92rem);
  font-weight: 900;
  line-height: 24px;
  text-align: right;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  transform: rotate(var(--angle)) translateX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

.wheel-label b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wheel-center {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34%;
  aspect-ratio: 1;
  border: 7px solid #fff;
  border-radius: 50%;
  background: var(--surface);
  color: var(--teal-dark);
  text-align: center;
  font-size: clamp(0.9rem, 2vw, 1.25rem);
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(24, 35, 33, 0.18);
  overflow-wrap: anywhere;
  padding: 10px;
}

.wheel-result {
  width: 100%;
  min-height: 64px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--teal-dark);
  padding: 12px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.item-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.item-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 4px 10px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.document-preview {
  background: #fff;
}

.document-preview h3,
.certificate-preview h3 {
  color: var(--teal-dark);
}

.document-section {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.document-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.rubric-table {
  min-width: 900px;
}

.rubric-table textarea {
  min-height: 78px;
}

.certificate-preview {
  min-height: 440px;
  padding: 18px;
}

.certificate-paper {
  display: grid;
  place-items: center;
  min-height: 390px;
  border: 6px double var(--teal);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(31, 122, 114, 0.06), rgba(185, 131, 29, 0.08)),
    #fffdf8;
  padding: 28px;
  text-align: center;
}

.certificate-paper h3 {
  margin-bottom: 12px;
  color: var(--teal-dark);
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  text-transform: uppercase;
}

.certificate-paper .student-name {
  margin: 14px 0;
  color: var(--coral);
  font-size: clamp(1.7rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
}

.certificate-paper p {
  max-width: 620px;
  margin-inline: auto;
  color: #3f4b48;
  font-size: 1rem;
}

.signature-line {
  display: inline-block;
  min-width: 210px;
  margin-top: 32px;
  padding-top: 8px;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-weight: 800;
}

.timer-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 22px;
}

.timer-circle {
  display: grid;
  place-items: center;
  width: min(100%, 360px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--teal) var(--progress, 0deg), #e9eee9 0deg);
}

.timer-face {
  display: grid;
  place-items: center;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.timer-time {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  font-weight: 900;
  line-height: 1;
}

.timer-label {
  color: var(--muted);
  font-weight: 900;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.score-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-top: 5px solid var(--team-color, var(--teal));
}

.score-card h3 {
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.score-value {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
}

.score-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.score-button {
  min-height: 36px;
  background: #eef1ec;
  color: var(--ink);
  font-weight: 900;
}

.score-button:hover {
  background: var(--surface-strong);
}

.note-output {
  min-height: 300px;
  white-space: pre-wrap;
}

.bingo-grid {
  display: grid;
  gap: 8px;
}

.bingo-grid.size-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bingo-grid.size-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bingo-grid.size-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.bingo-cell {
  display: grid;
  place-items: center;
  min-height: 88px;
  text-align: center;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(360px, calc(100% - 36px));
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  font-weight: 800;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1080px) {
  .menu-toggle {
    display: flex;
  }

  .nav-wrapper {
    display: none;
  }

  .mobile-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 5%;
    right: 5%;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    padding: 15px;
    z-index: 999;
  }

  .mobile-menu.open {
    display: block;
  }

  .mobile-menu ul {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .mobile-menu a {
    display: block;
    padding: 12px 15px;
    border-radius: 10px;
    font-weight: 500;
  }

  .mobile-menu a:hover,
  .mobile-menu a:focus {
    background: rgba(75, 0, 130, 0.06);
    color: var(--primary-purple);
  }

  .mobile-menu .btn-nav {
    text-align: center;
    margin-top: 5px;
  }

  .intro-panel,
  .tools-layout,
  .split-grid,
  .wide-grid,
  .wheel-layout {
    grid-template-columns: 1fr;
  }

  .tool-nav {
    position: static;
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-group {
    grid-column: 1 / -1;
  }

  .score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1320px);
    padding-top: 10px;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .toolbox-banner {
    padding: 40px 0;
  }

  .toolbox-banner h1 {
    font-size: 1.9rem;
  }

  .toolbox-banner p {
    font-size: 0.94rem;
  }

  .ai-subtabs {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .brand {
    min-width: 0;
    flex: 1;
  }

  .quick-links {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .intro-panel,
  .tool-panel {
    padding: 16px;
  }

  h1 {
    font-size: 1.78rem;
  }

  .metric-grid,
  .field-grid.two,
  .field-grid.three,
  .field-grid.four,
  .tool-nav,
  .group-output,
  .worksheet-list,
  .answer-grid,
  .card-controls,
  .score-grid,
  .score-actions {
    grid-template-columns: 1fr;
  }

  .panel-header,
  .subject-card {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-actions {
    justify-content: stretch;
  }

  .panel-actions .ghost-button,
  .panel-actions .primary-button,
  .panel-actions .quiet-button {
    width: 100%;
  }

  .data-table {
    min-width: 620px;
  }

  .bingo-cell {
    min-height: 68px;
    font-size: 0.82rem;
  }
}

@media print {
  body {
    background: #fff;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .topbar,
  .intro-panel,
  .tool-nav,
  .tool-form,
  .panel-actions,
  .card-controls,
  .summary-row .link-button,
  .mini-delete,
  .toast {
    display: none !important;
  }

  .tools-layout,
  .split-grid,
  .wide-grid,
  .wheel-layout {
    display: block;
  }

  .tool-panel {
    min-height: auto;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .preview-box,
  .result-panel,
  .flash-area,
  .list-card,
  .worksheet-item,
  .plan-item,
  .group-card,
  .document-preview,
  .certificate-preview,
  .wheel-card,
  .timer-card,
  .score-card,
  .bingo-cell {
    border-color: #aaa;
    box-shadow: none;
  }

  .certificate-paper {
    min-height: 86vh;
  }
}
