/* ============================================================
   Prompt Hacker - GSM-Corporate-Design, iPad-first
   ============================================================ */

:root {
  --gsm-blau: #006AB3;
  --gsm-orange: #F7B800;
  --gsm-magenta: #AD007C;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --danger: #dc2626;
  --warning: #d97706;
  --bg-card: #ffffff;
  --bg-page: #f0f4f8;
  --bg-soft: #eef2f7;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #d9e2ec;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg-page);
  color: var(--text);
  font-family: 'Lato', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea {
  font: inherit;
}

h1, h2, h3 {
  font-family: Arial, sans-serif;
  letter-spacing: 0;
}

.ws-header {
  background: linear-gradient(135deg, #0d1b2a, #1c3a5e);
  color: white;
  padding: 14px 20px;
  box-shadow: var(--shadow);
}

.header-logos {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-gsm {
  width: 112px;
  height: auto;
  display: block;
}

.logo-wk {
  width: 54px;
  height: 54px;
  object-fit: contain;
  margin-left: auto;
}

.student-chip,
.student-logout,
.dashboard-logout {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
}

.student-logout {
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.18);
}

.student-logout:hover {
  background: rgba(255, 255, 255, 0.28);
}

.header-text {
  min-width: 0;
  flex: 1;
}

.ws-title {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
  font-weight: 800;
}

.ws-subtitle {
  margin: 4px 0 0;
  font-size: 0.95rem;
  opacity: 0.9;
  line-height: 1.35;
}

.top-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(240, 244, 248, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.top-tab {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 700;
}

.top-tab.active {
  background: var(--gsm-blau);
  color: white;
}

.top-tab.locked {
  color: #7b8794;
  background: rgba(100, 116, 139, 0.08);
}

.top-tab.locked::after {
  content: " gesperrt";
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--gsm-magenta);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 70px;
}

.screen { display: none; }
.screen.active {
  display: block;
  animation: fadeIn 0.24s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero {
  display: block;
  margin-bottom: 22px;
}

.hero-copy {
  padding: 22px 0 0;
  max-width: 100%;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: var(--gsm-magenta);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.hero h2 {
  margin: 0;
  max-width: 820px;
  color: var(--gsm-blau);
  font-size: clamp(1.7rem, 3.2vw, 2.75rem);
  line-height: 1.12;
}

.hero p {
  max-width: 100%;
  margin: 18px 0 0;
  font-size: 1.08rem;
  line-height: 1.6;
}

.hero-actions,
.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.lock-inline {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin: 12px 0 0;
  padding: 9px 12px;
  border-left: 4px solid var(--gsm-magenta);
  border-radius: var(--radius-sm);
  background: rgba(173, 0, 124, 0.08);
  color: var(--text);
  font-weight: 800;
}

.lock-inline.unlocked {
  border-left-color: var(--success);
  background: var(--success-bg);
}

.hero-lock-note {
  display: flex;
  width: 100%;
  margin: -6px 0 16px;
}

.pulse-lock {
  animation: pulseLock 0.85s ease;
}

@keyframes pulseLock {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.015); }
}

.btn-outline.is-locked {
  border-color: #94a3b8;
  color: #64748b;
  background: #f8fafc;
}

.hero-media img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  background: white;
}

.prompt-primer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  gap: 18px;
  align-items: start;
  border-top: 5px solid var(--gsm-orange);
}

.prompt-primer h3 {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

.prompt-primer p {
  max-width: 62ch;
  margin: 0;
}

.mini-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.mini-examples span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 106, 179, 0.1);
  color: var(--gsm-blau);
  font-weight: 800;
}

.primer-figure {
  margin: 0;
}

.prompt-flow {
  display: grid;
  gap: 10px;
}

.flow-step {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 2px 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(0, 106, 179, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(0, 106, 179, 0.08);
}

.flow-step:not(:last-of-type)::after {
  content: "";
  position: absolute;
  left: 31px;
  bottom: -11px;
  width: 3px;
  height: 12px;
  border-radius: 999px;
  background: var(--gsm-blau);
}

.flow-number {
  grid-row: span 2;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gsm-blau);
  color: white;
  font-weight: 900;
}

.flow-step strong {
  color: var(--gsm-blau);
  font-size: 1.02rem;
}

.flow-step span:last-child {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.primer-figure img {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.primer-figure figcaption {
  margin-top: 4px;
  padding: 10px 12px;
  border-left: 4px solid var(--gsm-orange);
  border-radius: var(--radius-sm);
  background: rgba(247, 184, 0, 0.14);
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.42;
}

.notice-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 16px;
}

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

.assignment-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 1fr);
  gap: 12px 26px;
  align-items: start;
  padding: 24px 28px;
  border-left: 7px solid var(--gsm-blau);
  background:
    linear-gradient(90deg, rgba(0, 106, 179, 0.08), rgba(255, 255, 255, 0) 42%),
    var(--bg-card);
}

.assignment-card .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: 0;
  font-size: 0.92rem;
}

.assignment-card h3 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.15;
}

.assignment-card .clean-list {
  display: grid;
  gap: 8px;
  font-size: 1.08rem;
}

.prompt-primer .eyebrow {
  font-size: 0.92rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid rgba(217, 226, 236, 0.8);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.card h3 {
  margin: 0 0 10px;
  color: var(--gsm-blau);
}

.card p {
  line-height: 1.58;
}

.notice-card details {
  margin: 12px 0;
  color: var(--text-muted);
}

.notice-card summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--gsm-blau);
  font-weight: 700;
}

.consent-row {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 12px;
  font-weight: 700;
}

.consent-row input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
}

.clean-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.7;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-ghost,
.btn-outline,
.btn-back {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  border: 0;
  background: var(--gsm-blau);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #005494;
  box-shadow: 0 2px 8px rgba(0, 106, 179, 0.3);
}

.btn-secondary {
  border: 0;
  background: var(--gsm-orange);
  color: #3f2d00;
}

.btn-danger {
  border: 0;
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.28);
}

.btn-ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
}

.btn-outline {
  border: 2px solid var(--gsm-blau);
  background: white;
  color: var(--gsm-blau);
}

.inline-link-btn {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  text-decoration: none;
  margin-top: 8px;
}

.pdf-card {
  border-left: 7px solid var(--gsm-blau);
}

.basics-card {
  border-left-color: var(--gsm-orange);
}

.worksheet-pdf-card {
  border-left-color: var(--gsm-magenta);
}

.pdf-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 14px;
}

.pdf-card-head h3 {
  margin-bottom: 6px;
}

.pdf-card-head p {
  max-width: 78ch;
  margin: 0;
}

.pdf-frame-wrap {
  width: 100%;
  min-height: 620px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-soft);
}

.pdf-frame {
  display: block;
  width: 100%;
  height: min(78vh, 860px);
  min-height: 620px;
  border: 0;
  background: white;
}

.btn-back {
  border: 0;
  background: transparent;
  color: var(--gsm-blau);
  padding-left: 0;
}

.btn-primary:active,
.btn-secondary:active,
.btn-danger:active,
.btn-ghost:active,
.btn-outline:active,
.btn-back:active,
.top-tab:active {
  transform: translateY(1px);
}

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

.generate-button {
  cursor: pointer;
  width: fit-content;
  margin: 8px auto 0;
  padding: 0;
  border: solid 4px #161616;
  border-top: none;
  border-radius: 20px;
  position: relative;
  overflow: visible;
  background: #161616;
  color: inherit;
  box-shadow:
    0 4px 10px #00000062,
    0 10px 40px -10px #000000a6,
    0 12px 45px -15px #00000071;
  transition: all 0.3s ease;
}

.generate-inner {
  padding: 12px 30px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  border-top: solid 1px #6f86b4;
  border-left: solid 1px #111827;
  border-right: solid 1px #111827;
  border-bottom: solid 3px #374e72;
  border-radius: 16px;
  background: linear-gradient(180deg, #5771a5, #000);
  color: #fff;
  text-shadow: 1px 1px #000, 0 0 9px #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -10px 14px rgba(0, 0, 0, 0.55);
}

.generate-svgs {
  position: relative;
  margin-top: 9px;
  z-index: 10;
  display: inline-flex;
}

.generate-svgs > * {
  filter: drop-shadow(0 0 6px #fff) drop-shadow(1px 1px 0 #000);
}

.generate-svgs .svg-s {
  position: absolute;
  font-size: 0.8rem;
  left: 20px;
  top: -4px;
}

.generate-button:active {
  box-shadow: none;
  transform: translateY(2px);
}

.generate-button:focus-visible {
  outline: 3px solid rgba(0, 106, 179, 0.36);
  outline-offset: 4px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin: 4px 0 18px;
}

.screen-title {
  margin: 0;
  color: var(--gsm-blau);
  font-size: 1.55rem;
}

.game-task-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.44fr) minmax(0, 1fr);
  gap: 14px 24px;
  align-items: center;
  margin: 0 0 18px;
  padding: 22px 24px;
  border: 2px solid rgba(0, 106, 179, 0.22);
  border-left: 8px solid var(--gsm-magenta);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(173, 0, 124, 0.09), rgba(0, 106, 179, 0.08)),
    white;
  box-shadow: var(--shadow);
}

.game-task-card .eyebrow {
  font-size: 0.92rem;
}

.game-task-card h3 {
  margin: 3px 0 0;
  color: var(--gsm-blau);
  font-size: 1.55rem;
  line-height: 1.18;
}

.game-task-card p {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.52;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.request-round-btn {
  width: fit-content;
  margin-top: 10px;
}

.reflection-card {
  margin-top: 14px;
  border-left: 6px solid var(--gsm-orange);
}

.reflection-card h3 {
  margin-bottom: 6px;
}

.reflection-card textarea {
  width: 100%;
  min-height: 118px;
  margin-top: 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.45;
}

.reflection-card textarea:focus {
  outline: none;
  border-color: var(--gsm-blau);
}

.reflection-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.level-card {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 14px;
  text-align: left;
  background: white;
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.level-card:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.lock-note {
  grid-column: 1 / -1;
  border-left: 5px solid var(--gsm-magenta);
  font-weight: 900;
}

.locked-panel {
  max-width: 760px;
  border-top: 5px solid var(--gsm-magenta);
}

.level-card:hover,
.level-card:focus-visible {
  border-color: var(--gsm-blau);
  box-shadow: var(--shadow-lg);
}

.level-card.solved {
  border-color: var(--success);
  background: linear-gradient(135deg, white 68%, var(--success-bg));
}

.level-portrait {
  width: 104px;
  height: 128px;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.level-card h3 {
  margin: 0;
  color: var(--gsm-blau);
  font-size: 1.05rem;
}

.level-subtitle,
.level-desc {
  margin: 6px 0 0;
}

.level-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.level-desc {
  line-height: 1.45;
}

.level-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-muted);
}

.difficulty-badge,
.solved-badge,
.progress-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 0.82rem;
  font-weight: 900;
}

.difficulty-badge {
  background: var(--bg-soft);
  color: var(--text-muted);
}

.difficulty-badge[data-level="Einfach"] { background: #dcfce7; color: #15803d; }
.difficulty-badge[data-level="Mittel"] { background: #fef3c7; color: #b45309; }
.difficulty-badge[data-level="Schwer"] { background: #fee2e2; color: #b91c1c; }

.solved-badge {
  background: var(--success);
  color: white;
}

.progress-pill {
  background: rgba(0, 106, 179, 0.1);
  color: var(--gsm-blau);
}

.game-layout {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 16px;
}

.game-main,
.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guardian-card {
  border-left: 5px solid var(--gsm-magenta);
}

.guardian-header {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}

.guardian-image {
  width: 78px;
  height: 88px;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.guardian-header h2 {
  margin: 0;
  color: var(--gsm-blau);
}

.chat-log {
  min-height: 260px;
  max-height: 50vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.chat-msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: msgIn 0.2s ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--gsm-blau);
  color: white;
  border-bottom-right-radius: 2px;
}

.chat-msg.ai {
  align-self: flex-start;
  background: var(--bg-soft);
  color: var(--text);
  border-bottom-left-radius: 2px;
}

.chat-msg.ai.intro {
  background: rgba(173, 0, 124, 0.08);
  border-left: 3px solid var(--gsm-magenta);
  font-style: italic;
}

.chat-msg.thinking {
  color: var(--text-muted);
  font-style: italic;
}

.chat-msg.thinking::after {
  content: '';
  display: inline-block;
  width: 18px;
  animation: dots 1s infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

.chat-msg.error {
  background: #fee2e2;
  color: #991b1b;
}

.chat-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-form textarea,
.task-answer {
  width: 100%;
  min-height: 96px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  resize: vertical;
  background: white;
  line-height: 1.45;
}

.chat-form textarea {
  flex: 1;
  min-height: 48px;
  max-height: 200px;
}

.chat-form textarea:focus,
.task-answer:focus {
  outline: none;
  border-color: var(--gsm-blau);
}

.status-card { padding: 16px; }

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.status-row + .status-row {
  border-top: 1px solid var(--border);
}

.status-label,
.muted {
  color: var(--text-muted);
}

.status-value {
  font-size: 1.08rem;
  font-weight: 900;
}

.status-value.solved {
  color: var(--success);
}

.small { font-size: 0.88rem; }

.hint-display {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.hint-item {
  background: rgba(247, 184, 0, 0.16);
  border-left: 3px solid var(--gsm-orange);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  line-height: 1.4;
}

.hint-num {
  color: var(--warning);
  font-weight: 900;
}

.worksheet-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.worksheet-tab {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--gsm-blau);
  cursor: pointer;
  font-weight: 900;
}

.worksheet-tab.active {
  background: var(--gsm-blau);
  color: white;
  border-color: var(--gsm-blau);
}

.worksheet-panel {
  display: none;
}

.worksheet-panel.active {
  display: block;
}

.info-card {
  border-top: 5px solid var(--gsm-orange);
}

.info-figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 18px;
}

.info-figure-grid figure,
.wide-info-figure {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
}

.info-figure-grid img,
.wide-info-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.info-figure-grid figcaption,
.wide-info-figure figcaption {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.example-card {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--gsm-blau);
  background: var(--bg-soft);
}

.example-card strong,
.example-card span {
  display: block;
}

.example-card strong {
  margin-bottom: 6px;
  color: var(--gsm-blau);
}

.safe-example {
  border-left-color: var(--success);
}

.safe-example strong {
  color: var(--success);
}

.danger-example {
  border-left-color: var(--gsm-magenta);
}

.danger-example strong {
  color: var(--gsm-magenta);
}

.wide-info-figure {
  margin: 16px 0;
}

.keyword-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.keyword-grid span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 106, 179, 0.1);
  color: var(--gsm-blau);
  font-weight: 900;
}

.task-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.task-head h3 {
  display: inline;
  margin-left: 10px;
}

.task-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gsm-orange);
  color: #3f2d00;
  font-weight: 900;
}

.niveau-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.niveau-switch button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 900;
}

.niveau-switch button.active {
  background: var(--gsm-magenta);
  color: white;
}

.niveau-content {
  display: none;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  margin-bottom: 12px;
}

.niveau-content.active {
  display: block;
}

.prompt-box {
  padding: 12px 14px;
  margin: 8px 0 12px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--gsm-magenta);
  background: rgba(173, 0, 124, 0.08);
  font-weight: 700;
}

.task-card.saved .card {
  border-color: rgba(22, 163, 74, 0.45);
}

.save-task {
  margin-top: 10px;
}

.summary-card h2 {
  margin-top: 0;
  color: var(--gsm-blau);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.summary-tile {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.summary-tile strong {
  display: block;
  color: var(--gsm-magenta);
  font-size: 1.7rem;
  line-height: 1;
  margin-bottom: 8px;
}

.tutor-card {
  border-top: 5px solid var(--gsm-magenta);
}

.tutor-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.tutor-head img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.tutor-log {
  min-height: 140px;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  margin-bottom: 10px;
}

#tutor-log .chat-msg.ai {
  position: relative;
  margin-left: 48px;
}

#tutor-log .chat-msg.ai::before {
  content: "";
  position: absolute;
  left: -48px;
  top: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card) url("/static/img/gsm_avatar.png") center / contain no-repeat;
  border: 2px solid white;
  box-shadow: var(--shadow);
}

.login-page {
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(0, 106, 179, 0.15), transparent 36%),
              var(--bg-page);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(100%, 620px);
  padding: 28px;
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-lg);
}

.compact-login {
  width: min(100%, 480px);
}

.login-brand {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.login-brand img:first-child {
  width: 150px;
  height: auto;
}

.login-brand img:last-child {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.login-card h1 {
  margin: 0 0 8px;
  color: var(--gsm-blau);
  font-size: 2.2rem;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.login-form label {
  display: grid;
  gap: 6px;
  font-weight: 900;
}

.login-form input {
  min-height: 46px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.form-error {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fee2e2;
  color: #991b1b;
  font-weight: 800;
}

.privacy-details {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.privacy-details summary {
  min-height: 36px;
  cursor: pointer;
  color: var(--gsm-blau);
  font-weight: 900;
}

.teacher-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.2fr);
  gap: 16px;
}

.dashboard-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-left: 5px solid var(--gsm-blau);
}

.dashboard-tools .screen-title {
  margin-bottom: 6px;
}

.dashboard-tools p {
  margin: 0;
}

.dashboard-tool-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.dashboard-tool-actions .btn-primary,
.dashboard-tool-actions .btn-secondary,
.dashboard-tool-actions .btn-outline,
.dashboard-tool-actions .btn-danger {
  min-width: 132px;
  justify-content: center;
  margin-top: 0;
}

.session-report-viewer {
  border-top: 5px solid var(--gsm-orange);
}

.session-report-content {
  display: grid;
  gap: 16px;
}

.report-student {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fbfdff;
}

.report-student > header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(0, 106, 179, 0.09);
}

.report-student h3,
.report-student h4 {
  margin: 0;
  color: var(--gsm-blau);
}

.report-student header span {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
}

.report-student > section {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.report-student h4 {
  margin-bottom: 10px;
}

.report-subsection {
  padding: 10px 0;
  border-top: 1px solid rgba(217, 226, 236, 0.8);
}

.report-subsection:first-of-type {
  border-top: 0;
}

.report-subsection summary {
  min-height: 38px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.report-subsection summary span {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.report-dialogue {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.report-turn,
.report-answer {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: white;
  border-left: 4px solid var(--border);
}

.report-turn.is-user {
  border-left-color: var(--gsm-blau);
}

.report-turn.is-ai {
  border-left-color: var(--gsm-magenta);
}

.report-turn p,
.report-answer p {
  margin: 5px 0 0;
  white-space: pre-wrap;
}

.compact-head {
  align-items: center;
}

.request-list {
  display: grid;
  gap: 12px;
}

.request-group-title {
  margin: 12px 0 0;
  color: var(--gsm-blau);
  font-size: 1.05rem;
}

.request-card {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border-left: 4px solid var(--gsm-magenta);
}

.request-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
}

.student-table {
  display: grid;
  gap: 8px;
}

.student-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.3fr;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.student-row small {
  display: block;
  color: var(--text-muted);
  margin-top: 2px;
}

.student-head {
  font-weight: 900;
  color: var(--gsm-blau);
}

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

.dashboard-actions .btn-primary,
.dashboard-actions .btn-secondary,
.dashboard-actions .btn-danger,
.dashboard-actions .btn-outline,
.dashboard-actions .btn-ghost {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 0.9rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.62);
}

.modal-overlay[hidden] { display: none; }

.modal {
  width: min(100%, 590px);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-lg);
}

.success-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(135deg, var(--success), #22c55e);
  color: white;
}

.success-banner h2 { margin: 0; }
.success-icon { font-size: 2rem; font-weight: 900; }

.modal-body {
  padding: 20px 24px;
}

.modal-body h3 {
  color: var(--gsm-magenta);
  margin: 4px 0 8px;
}

.lesson-real-world {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.lesson-real-world p {
  margin: 5px 0 0;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 24px 22px;
}

.ws-footer {
  text-align: center;
  padding: 18px 16px 30px;
}

@media (max-width: 860px) {
  .hero,
  .prompt-primer,
  .notice-grid,
  .game-layout,
  .dashboard-grid,
  .info-figure-grid,
  .example-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 10px 0 0;
  }

  .assignment-card {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .game-task-card {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .section-head,
  .task-head,
  .dashboard-tools,
  .pdf-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .pdf-frame-wrap,
  .pdf-frame {
    min-height: 560px;
  }
}

@media (max-width: 560px) {
  .ws-header {
    padding: 12px 14px;
  }

  .header-logos {
    gap: 10px;
  }

  .logo-gsm {
    width: 78px;
  }

  .logo-wk {
    width: 42px;
    height: 42px;
  }

  .student-chip {
    display: none;
  }

  .student-logout {
    padding: 4px 10px;
  }

  .ws-subtitle {
    font-size: 0.82rem;
  }

  .top-tabs {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .container {
    padding: 18px 12px 60px;
  }

  .level-card {
    grid-template-columns: 82px 1fr;
  }

  .level-portrait {
    width: 82px;
    height: 104px;
  }

  .guardian-header {
    grid-template-columns: 64px 1fr;
  }

  .guardian-header .difficulty-badge {
    grid-column: 1 / -1;
    width: fit-content;
  }

  .guardian-image {
    width: 64px;
    height: 78px;
  }

  .chat-form {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-form .btn-primary {
    width: 100%;
  }

  .student-row {
    grid-template-columns: 1fr;
  }

  .pdf-frame-wrap,
  .pdf-frame {
    min-height: 480px;
  }
}

@media print {
  body.report-print-mode .ws-header,
  body.report-print-mode .dashboard-kpis,
  body.report-print-mode .dashboard-tools,
  body.report-print-mode .dashboard-grid,
  body.report-print-mode .session-report-viewer .section-head button {
    display: none !important;
  }

  body.report-print-mode {
    background: white;
  }

  body.report-print-mode .container {
    max-width: none;
    padding: 0;
  }

  body.report-print-mode .session-report-viewer {
    display: block !important;
    border: 0;
    box-shadow: none;
  }

  body.report-print-mode .report-student {
    break-inside: avoid;
  }
}
