:root {
  --bg: #08111f;
  --panel: rgba(15, 27, 49, 0.86);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f8fafc;
  --muted: #b4c1d4;
  --accent: #f59e0b;
  --accent-2: #38bdf8;
  --shadow: 0 24px 60px rgba(2, 6, 23, 0.42);
}

body {
  font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 30%),
    linear-gradient(180deg, #08111f 0%, #0b1324 100%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(8, 17, 31, 0.92);
  color: var(--text);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar a {
  color: var(--text);
  margin-left: 12px;
  text-decoration: none;
}

.logout-button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}

.container {
  padding: 24px 24px 24px 36px;
}

.card,
.sheet,
.panel,
.student-card,
.messages .message,
/* .weekday-button, */
.auth-card,
table {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.card {
  padding: 22px 24px 24px;
  margin-bottom: 18px;
}

.sheet {
  padding: 22px 24px 24px;
  margin-bottom: 18px;
}

.button {
  display: inline-block;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--accent), #fb7185);
  color: #08111f;
  border-radius: 10px;
  text-decoration: none;
  border: none;
}

.button.secondary {
  background: rgba(2, 6, 23, 0.34);
  color: var(--text);
  border: 1px solid var(--line);
  margin-left: 10px;
}

.app-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 18px;
}

.app-form p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-form label {
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  padding-top: 12px;
}

.app-form input,
.app-form textarea,
.app-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.34);
  color: var(--text);
  font: inherit;
}

.app-form input:focus,
.app-form textarea:focus,
.app-form select:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.app-form textarea {
  min-height: 140px;
  resize: vertical;
}

.app-form p > label {
  grid-column: 1;
}

.app-form p > input:not([type="radio"]),
.app-form p > textarea,
.app-form p > select,
.app-form p > .helptext,
.app-form p > .errorlist,
.app-form p > ul {
  grid-column: 2;
}

.app-form p > ul {
  margin: 0;
}

/* RadioSelect puts the custom class on each input, not on the option list. */
.app-form p:has(input.weekday-radio),
.app-form p:has(input.status-radio) {
  align-items: start;
}

.app-form p:has(input.weekday-radio) > ul,
.app-form p:has(input.status-radio) > ul,
.app-form p:has(input.weekday-radio) > div,
.app-form p:has(input.status-radio) > div {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-form p:has(input.weekday-radio) li,
.app-form p:has(input.status-radio) li {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.28);
}

.app-form p:has(input.weekday-radio) li:has(input:checked),
.app-form p:has(input.status-radio) li:has(input:checked) {
  border-color: rgba(245, 158, 11, 0.75);
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  color: #0b1324;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.18);
}

.app-form p:has(input.weekday-radio) label,
.app-form p:has(input.status-radio) label {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.28);
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
}

.app-form p:has(input.weekday-radio) label:hover,
.app-form p:has(input.status-radio) label:hover {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.1);
}

.app-form p:has(input.weekday-radio) label:has(input:checked),
.app-form p:has(input.status-radio) label:has(input:checked) {
  border-color: rgba(245, 158, 11, 0.75);
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  color: #0b1324;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.18);
}

.app-form input.weekday-radio,
.app-form input.status-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.app-form ul.weekday-radio,
.app-form ul.status-radio {
  grid-column: 2;
}

.app-form ul.weekday-radio input[type="radio"],
.app-form ul.status-radio input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.app-form ul.weekday-radio label,
.app-form ul.status-radio label {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.28);
  cursor: pointer;
}

.app-form ul.weekday-radio label:has(input:checked),
.app-form ul.status-radio label:has(input:checked) {
  border-color: rgba(245, 158, 11, 0.75);
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  color: #0b1324;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.18);
}

.app-form select,
.search-row select,
.typing-select {
  appearance: none;
  padding-right: 44px;
  padding-left: 44px;
  text-align: center;
  text-align-last: center;
  background-color: rgba(2, 6, 23, 0.42);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.weekday-radio,
.status-radio {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.weekday-radio li,
.status-radio li {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.28);
}

.weekday-radio label,
.status-radio label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  cursor: pointer;
  font-weight: 700;
}

.weekday-radio input[type="radio"],
.status-radio input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.weekday-radio li:hover,
.status-radio li:hover {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.1);
}

.weekday-radio li:has(input:checked),
.status-radio li:has(input:checked) {
  border-color: rgba(245, 158, 11, 0.75);
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  color: #0b1324;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.18);
}

.weekday-radio li:has(input:focus-visible),
.status-radio li:has(input:focus-visible) {
  outline: 3px solid rgba(56, 189, 248, 0.38);
  outline-offset: 2px;
}

.app-form .helptext,
.app-form .errorlist {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.app-form .errorlist {
  color: #fca5a5;
  list-style: none;
  padding: 0;
}

.student-card {
  padding: 20px 22px 20px 24px;
  text-decoration: none;
  color: inherit;
}

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

.page-head h2 {
  margin: 0;
}

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

.sheet-row {
  margin: 0 0 14px;
}

.sheet-row.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.sheet-row .label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.sheet-row .value {
  line-height: 1.7;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 18px;
}

.panel {
  min-height: 120px;
  padding: 16px;
}

.student-detail-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.student-detail-card h2 {
  margin-top: 0;
  margin-bottom: 14px;
}

.student-detail-card p {
  margin: 0;
  line-height: 1.7;
}

.student-typing-metrics {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.student-typing-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.student-typing-metrics strong {
  font-size: 1.05rem;
}

.messages .message {
  padding: 10px 12px;
  margin-bottom: 8px;
}

/* .weekday-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 12px 16px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font: inherit;
  cursor: pointer;
}

.weekday-choice {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.weekday-button:hover {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.1);
}

.weekday-choice:checked + .weekday-button {
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  color: #0b1324;
} */

.weekday-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 12px 16px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font: inherit;
  cursor: pointer;
  /* カプセル／ボタン状の初期スタイル */
  background: rgba(2, 6, 23, 0.34);
  border: 1px solid var(--line);
  transition: all 0.2s ease;
}

.weekday-choice {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.weekday-button:hover {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.1);
}

/* 選択（checked）時にグラデーションカラーへ変更 */
.weekday-choice:checked + .weekday-button {
  background: linear-gradient(135deg, var(--accent), #fbbf24) !important;
  color: #0b1324 !important;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25);
}

.app-form .weekday-edit-buttons {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
}

.app-form .weekday-edit-buttons input.weekday-radio:checked + .weekday-button {
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  color: #0b1324;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25);
}

.app-form .status-edit-buttons input.status-radio:checked + .weekday-button {
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  color: #0b1324;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25);
}

.weekday-choice:focus-visible + .weekday-button {
  outline: 3px solid rgba(56, 189, 248, 0.38);
  outline-offset: 2px;
}

.weekday-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 8px 4px;
}

.app-form .weekday-edit-buttons {
  margin: 0;
}

.search-form {
  display: grid;
  gap: 12px;
  margin: 20px 0 12px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.28), rgba(2, 6, 23, 0.18));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.search-label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.search-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.search-row input[type="search"] {
  flex: 1;
  min-width: 0;
  min-height: 56px;
  padding: 0 18px;
  background: rgba(2, 6, 23, 0.42);
  border-color: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.search-row select {
  flex: 0 0 180px;
  min-height: 56px;
  border-radius: 16px;
  color: var(--text);
}

.search-row select option {
  background: #0f1b31;
  color: var(--text);
}

.search-row input[type="search"]::placeholder {
  color: rgba(180, 193, 212, 0.72);
}

.search-row input[type="search"]:focus {
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 3px rgba(245, 158, 11, 0.16);
}

.search-row .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: auto;
  min-width: 104px;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
}

.weekday-button.active {
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  color: #0b1324;
}

.text-button {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--accent-2);
  font: inherit;
}

.portal-hero {
  padding: 32px 0 18px;
}

.hero-copy {
  max-width: 960px;
}

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

.lead {
  margin: 12px 0 0;
  color: var(--muted);
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 28px;
}

.portal-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 240px;
  padding: 32px;
  text-decoration: none;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.portal-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.45);
}

.portal-card.is-loading {
  pointer-events: none;
  cursor: wait;
  opacity: 0.82;
}

.portal-card h2 {
  margin: 0;
  font-size: 1.7rem;
}

.portal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.portal-action {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  color: #0b1324;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(245, 158, 11, 0.2);
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap {
  overflow-x: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-active {
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.2);
  border: 1px solid rgba(74, 222, 128, 0.32);
}

.status-paused {
  color: #fde68a;
  background: rgba(217, 119, 6, 0.2);
  border: 1px solid rgba(250, 204, 21, 0.32);
}

.status-withdrawn {
  color: #fecaca;
  background: rgba(185, 28, 28, 0.2);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.student-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  color: var(--muted);
  font-weight: 700;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

a {
  color: inherit;
}

@media (max-width: 900px) {
  .portal-grid {
    grid-template-columns: 1fr;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .sheet-row.two-col {
    grid-template-columns: 1fr;
  }

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

  .sheet-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-row {
    flex-direction: column;
  }

  .search-row .button {
    width: 100%;
  }

  .search-row input[type="search"] {
    min-height: 52px;
  }

  .search-row select {
    flex-basis: auto;
    width: 100%;
    min-height: 52px;
  }

    .search-row .button {
      min-height: 52px;
    }
}

.typing-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.typing-shell-student {
  grid-template-columns: 220px minmax(0, 1fr);
}

.typing-sidebar {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: rgba(7, 18, 38, 0.82);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 20px;
}

.typing-sidebar-item {
  display: block;
  padding: 14px 16px;
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
}

.typing-sidebar-item.active {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.typing-main {
  display: grid;
  gap: 20px;
}

.typing-page-head,
.typing-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.typing-page-head h1,
.typing-card h2,
.typing-card h3 {
  margin-bottom: 0;
}

.typing-card {
  padding: 24px;
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 22px 50px rgba(2, 6, 23, 0.18);
}

.typing-card p,
.typing-card label,
.typing-card span {
  color: #475569;
}

.typing-card strong,
.typing-card h2,
.typing-card h3 {
  color: #0f172a;
}

.typing-card-header {
  margin-bottom: 18px;
}

.typing-form-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
}

.typing-field {
  display: grid;
  gap: 8px;
}

.typing-field label {
  font-weight: 700;
}

.typing-input,
.typing-select {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #fff;
  color: #0f172a;
  box-sizing: border-box;
}

.typing-input[readonly] {
  background: #e2e8f0;
}

.typing-score-box {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #eff6ff, #e0f2fe);
  border: 1px solid rgba(96, 165, 250, 0.28);
  min-height: 120px;
}

.typing-score-label {
  font-weight: 700;
}

.typing-score-value {
  font-size: 2.5rem;
  font-weight: 900;
  color: #2563eb;
  line-height: 1;
}

.typing-score-note {
  font-size: 0.9rem;
}

.typing-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.typing-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.typing-summary-panel {
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.typing-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.typing-metric-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.typing-metric-card span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.typing-metric-card strong {
  font-size: 1.4rem;
}

.typing-trend-card {
  margin-top: 18px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.typing-chart {
  width: 100%;
  min-height: 260px;
  margin-top: 16px;
  border-radius: 20px;
  background:
    linear-gradient(to bottom, rgba(148, 163, 184, 0.14) 1px, transparent 1px) 0 0 / 100% 52px,
    #fff;
}

.typing-axis-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 700;
}

.typing-chart-labels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
  gap: 8px;
  margin-top: 10px;
  color: #64748b;
  font-size: 0.88rem;
}

.typing-legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #475569;
  flex-wrap: wrap;
}

.typing-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.typing-dot-blue {
  background: #2563eb;
}

.typing-dot-green {
  background: #16a34a;
}

.typing-dot-orange {
  background: #f59e0b;
}

.typing-student-name,
.typing-empty-note {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(239, 246, 255, 0.95);
  color: #1e3a8a;
  border: 1px solid rgba(96, 165, 250, 0.22);
}

.typing-field .errorlist {
  list-style: none;
  padding: 0;
  margin: 0;
  color: #dc2626;
}

.typing-popup-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
}

.typing-popup-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.typing-popup-card {
  position: relative;
  width: min(92vw, 560px);
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(148, 163, 184, 0.28);
  text-align: center;
  transform: translateY(16px) scale(0.96);
  transition: transform 0.24s ease;
}

.typing-popup-overlay.is-visible .typing-popup-card {
  transform: translateY(0) scale(1);
}

.typing-popup-card-loading {
  background: linear-gradient(180deg, #eff6ff, #ffffff);
}

.typing-popup-card-success {
  background: linear-gradient(180deg, #fffbea, #ffffff);
}

.typing-popup-image {
  display: block;
  width: min(100%, 420px);
  margin: 0 auto 16px;
  border-radius: 22px;
}

.typing-popup-title {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: #b45309;
}

.typing-popup-caption {
  margin: 0;
  color: #475569;
  font-size: 1rem;
  line-height: 1.7;
}

.typing-popup-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  font-size: 1.4rem;
  cursor: pointer;
}

/* Growth dashboard and A4 interview report */
.growth-shell { color:#0f172a; background:#f8fbff; }
.growth-head,.period-form { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; }
.period-form { justify-content:flex-start; padding:14px; background:#eef7ff; border-radius:16px; margin-bottom:18px; }
.period-form input { padding:9px; border:1px solid #bfd8ee; border-radius:9px; }
.metric-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin:16px 0; }
.metric-grid>div { background:#fff; border:1px solid #d7e8f5; border-radius:16px; padding:16px; text-align:center; }
.metric-grid strong { display:block; font-size:1.8rem; color:#1766a3; }.metric-grid span { color:#52657a; }
.coverage-warning { padding:14px 18px; border:1px solid #f4c95d; background:#fff8dc; border-radius:14px; margin:14px 0; }
.growth-source-summary { padding:12px 16px; border:1px solid #cfe5f5; background:#fff; border-radius:14px; margin:14px 0; }
.growth-source-summary p { margin:5px 0; }
.growth-two { display:grid; grid-template-columns:1fr 1fr; gap:16px; }.growth-panel,.growth-card { background:#fff; border:1px solid #d7e8f5; border-radius:18px; padding:18px; margin:14px 0; }
.growth-card-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px; }.work-thumb { width:100%; height:150px; object-fit:cover; border-radius:12px; }
.stack-bar { display:flex; height:30px; overflow:hidden; border-radius:9px; background:#e5e7eb; margin:5px 0 10px; }.stack-bar span { min-width:2px; overflow:hidden; padding:6px; font-size:10px; color:#082f49; background:#7dd3fc; }.stack-bar span:nth-child(2){background:#60a5fa}.stack-bar span:nth-child(3){background:#facc15}.stack-bar span:nth-child(4){background:#f9a8d4}.stack-bar span:nth-child(5){background:#86efac}
.typing-bars { height:185px; display:flex; align-items:flex-end; gap:8px; overflow-x:auto; border-bottom:1px solid #94a3b8; }.typing-bars>div { min-width:44px; text-align:center; }.typing-bars span { width:12px; min-height:3px; display:block; background:#3b82f6; margin:auto; border-radius:6px 6px 0 0; }.typing-bars small { font-size:10px; }
.typing-line-chart { display:block; width:100%; max-height:210px; background:#f8fbff; border-radius:10px; }.typing-line-chart line { stroke:#94a3b8; stroke-width:1; }.typing-line-chart polyline { fill:none; stroke:#2563eb; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }.typing-line-chart circle { fill:#f48bb1; stroke:#fff; stroke-width:1; }.goal-count { display:inline-block; margin:4px; padding:8px 12px; border-radius:999px; background:#e9f5fd; }
.episode-source { padding:10px 0; border-bottom:1px solid #e2e8f0; }.assessment-row { border:1px solid #d7e8f5; border-radius:14px; margin:14px 0; padding:14px; }.assessment-row textarea { width:100%; }.evidence-option { display:block; padding:6px; }
.growth-report-page { width:190mm; min-height:277mm; box-sizing:border-box; margin:20px auto; padding:9mm; background:#fff; color:#17324d; font-family:"Noto Sans CJK JP","Noto Sans JP","Yu Gothic",sans-serif; box-shadow:0 10px 35px rgba(15,23,42,.22); font-size:10.5px; line-height:1.45; }
.report-header { border-bottom:3px solid #f7cf4b; padding-bottom:7px; }.report-profile { display:flex; align-items:center; gap:12px; }.report-profile img,.photo-placeholder { width:62px; height:62px; object-fit:cover; border-radius:50%; background:#e8f5ff; display:flex; align-items:center; justify-content:center; }.report-header h1 { margin:0; font-size:25px; color:#0b4a84; }.report-header h2 { display:inline; margin:0 8px 0 0; font-size:16px; }.report-header p { margin:2px 0; }.report-catchphrase { color:#1266a6; font-size:15px; font-weight:800; text-align:right; }
.report-section { border:1px solid #cfe5f5; background:#fbfdff; border-radius:10px; padding:8px 10px; margin-top:8px; break-inside:avoid; }.report-section h3 { color:#fff; background:linear-gradient(90deg,#176ba5,#479bd0); margin:-8px -10px 7px; padding:5px 9px; border-radius:9px 9px 0 0; font-size:13px; }.report-section p { margin:4px 0; }.report-episode { min-height:78px; font-size:11.5px; }.report-columns { display:grid; grid-template-columns:1.15fr .85fr; gap:8px; }.report-main-grid { grid-template-columns:1.18fr .82fr; }
.report-section .report-subheading { margin:7px -3px 4px; border-radius:6px; background:#e9f5fd; color:#145c8c; font-size:11px; }
.report-metrics { text-align:center; padding:12px; background:#fff6cf; border-radius:8px; }.report-metrics strong { display:block; font-size:24px; color:#0b4a84; }.report-works { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }.report-works article { display:grid; gap:2px; }.report-works img,.work-placeholder { width:100%; height:68px; object-fit:cover; border-radius:6px; background:#e8f5ff; display:flex; align-items:center; justify-content:center; }.report-assessment { display:grid; grid-template-columns:1fr auto auto; gap:5px; align-items:center; border-bottom:1px solid #e3edf5; padding:2px 0; }.stars { white-space:nowrap; }.stars i { font-style:normal; font-size:13px; }.star-previous{color:#f6c72e}.star-growth{color:#f48bb1}.star-empty{color:#cbd5e1}.growth-report-page footer { text-align:center; color:#0b4a84; font-weight:800; margin-top:8px; }
.report-line-chart { height:52px; margin-top:4px; }
.report-toolbar,.print-controls { display:flex; gap:10px; justify-content:center; margin:15px; }.print-controls button,.print-controls a { padding:10px 16px; }
@media screen and (max-width:800px){.metric-grid{grid-template-columns:repeat(2,1fr)}.growth-two{grid-template-columns:1fr}.growth-report-page{width:100%;min-height:0}.report-columns{grid-template-columns:1fr}}
@page { size:A4 portrait; margin:10mm; }
@media print { .topbar,.page-bg,.report-toolbar,.print-controls,.messages { display:none!important; } body,.print-report-body,.site-main { margin:0!important; padding:0!important; background:#fff!important; } .growth-report-page { width:190mm; height:277mm; min-height:277mm; margin:0; padding:7mm; box-shadow:none; overflow:hidden; } }

/* Shared detail and growth-form treatment. Keep these screens consistent
   with the rest of the portal instead of relying on browser defaults. */
.growth-shell h1 {
  margin: 0 0 22px;
  color: #0b4a84;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.35;
}

.growth-shell h2,
.growth-shell h3 {
  color: #145c8c;
}

.growth-shell > p:first-child {
  margin: 0 0 18px;
}

.growth-shell .button {
  color: #fff;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(23, 107, 165, .16);
}

.growth-shell .button.secondary {
  color: #145c8c;
  background: #fff;
  border-color: #bfd8ee;
  box-shadow: none;
}

.growth-shell .app-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.growth-shell .app-form > p,
.growth-shell .assessment-field {
  display: grid;
  gap: 7px;
  margin: 0;
}

.growth-shell .app-form > p > label,
.growth-shell .assessment-field > span,
.growth-shell .app-form legend {
  color: #145c8c;
  font-weight: 800;
  line-height: 1.5;
}

.growth-shell .app-form input:not([type="checkbox"]):not([type="radio"]),
.growth-shell .app-form textarea,
.growth-shell .app-form select,
.growth-shell .assessment-field input,
.growth-shell .assessment-field textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #bfd8ee;
  border-radius: 10px;
  background: #fff;
  color: #17324d;
  font: inherit;
}

.growth-shell .app-form textarea,
.growth-shell .assessment-field textarea {
  min-height: 112px;
  resize: vertical;
}

.growth-shell .app-form input:focus,
.growth-shell .app-form textarea:focus,
.growth-shell .app-form select:focus {
  outline: 3px solid rgba(37, 125, 190, .18);
  border-color: #4b9bd0;
}

.growth-shell .app-form .helptext,
.growth-shell .app-form .errorlist,
.growth-shell .muted {
  color: #52657a;
  font-size: .9rem;
}

.growth-shell .app-form .errorlist {
  margin: 0;
  padding-left: 1.2rem;
  color: #b42318;
}

.assessment-list {
  display: grid;
  gap: 14px;
}

.assessment-row {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid #cfe5f5;
  border-radius: 14px;
  background: #fff;
}

.assessment-row legend {
  padding: 0 8px;
  font-size: 1.05rem;
}

.assessment-row .assessment-field + .assessment-field {
  margin-top: 14px;
}

.evidence-picker {
  margin-top: 14px;
  border-top: 1px solid #e3edf5;
  padding-top: 12px;
}

.evidence-picker summary {
  color: #1766a3;
  font-weight: 800;
  cursor: pointer;
}

.evidence-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.evidence-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #e3edf5;
  border-radius: 9px;
  background: #f8fbff;
  color: #334e68;
  line-height: 1.5;
}

.evidence-option input {
  flex: 0 0 auto;
  margin-top: 3px;
}

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

.growth-shell .records {
  width: 100%;
  margin-top: 18px;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  color: #17324d;
  border: 1px solid #cfe5f5;
  border-radius: 14px;
  box-shadow: none;
}

.growth-shell .records th,
.growth-shell .records td {
  padding: 12px 10px;
  border-bottom: 1px solid #e3edf5;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  line-height: 1.5;
}

.growth-shell .records th {
  background: #eef7ff;
  color: #145c8c;
  font-weight: 800;
}

.growth-shell .records tr:last-child td {
  border-bottom: 0;
}

.growth-shell .growth-card a,
.growth-shell .records a {
  color: #1766a3;
  font-weight: 800;
}

.growth-shell .growth-card {
  color: #17324d;
}

@media (max-width: 700px) {
  .container { padding: 16px 12px 24px; }
  .sheet { padding: 18px 14px 20px; }
  .growth-shell .records { display: block; overflow-x: auto; white-space: nowrap; }
  .growth-shell .records th,
  .growth-shell .records td { white-space: normal; min-width: 120px; }
  .growth-shell .records th:last-child,
  .growth-shell .records td:last-child { min-width: 150px; }
  .assessment-row { padding: 14px; }
}

/* Global display modes. All screens use the same width and theme tokens. */
:root { --max-width: 1440px; }

.topbar,
.site-main { width: min(var(--max-width), calc(100vw - 48px)); }

.theme-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(16, 28, 51, .78);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible { border-color: var(--accent-2); outline: none; }

.mobile-menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(16, 28, 51, .78);
  color: var(--text);
  cursor: pointer;
}

.mobile-menu-toggle span {
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform .18s ease, opacity .18s ease;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible {
  border-color: var(--accent-2);
  outline: none;
}

body[data-theme="light"] {
  --bg: #eef6fb; --bg-accent: #dff1fb; --panel: rgba(255, 255, 255, .88);
  --panel-solid: #fff; --line: rgba(53, 108, 145, .22); --text: #17324d;
  --muted: #526b80; --accent: #176ba5; --accent-2: #2e9dd0;
  --shadow: 0 18px 42px rgba(48, 101, 135, .14);
  background: linear-gradient(180deg, #eef7fc 0%, #dceef8 100%); color: var(--text);
}

body[data-theme="gray"] {
  --bg: #e8eaed; --bg-accent: #d8dce1; --panel: rgba(255, 255, 255, .92);
  --panel-solid: #fff; --line: rgba(71, 78, 88, .2); --text: #303640;
  --muted: #68717d; --accent: #59636f; --accent-2: #7f8994;
  --shadow: 0 16px 36px rgba(48, 55, 65, .13);
  background: linear-gradient(180deg, #f0f1f2 0%, #dfe2e5 100%); color: var(--text);
}

body[data-theme="light"] .topbar,
body[data-theme="gray"] .topbar {
  background: rgba(255, 255, 255, .78); color: var(--text);
  border-bottom-color: var(--line); box-shadow: 0 10px 26px rgba(48, 80, 100, .08);
}

body[data-theme="light"] .topnav a,
body[data-theme="light"] .topnav-button,
body[data-theme="light"] .theme-toggle,
body[data-theme="light"] .mobile-menu-toggle,
body[data-theme="gray"] .topnav a,
body[data-theme="gray"] .topnav-button,
body[data-theme="gray"] .theme-toggle,
body[data-theme="gray"] .mobile-menu-toggle {
  background: rgba(255, 255, 255, .82); color: var(--text); border-color: var(--line);
}

body[data-theme="light"] .brand-mark { background: linear-gradient(135deg, #7dd3fc, #dbeafe); color: #0b2a42; }
body[data-theme="gray"] .brand-mark { background: linear-gradient(135deg, #9ca3af, #e5e7eb); color: #303640; }

body[data-theme="light"] .page-bg,
body[data-theme="gray"] .page-bg {
  background-image: linear-gradient(rgba(71, 78, 88, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(71, 78, 88, .06) 1px, transparent 1px);
}

body[data-theme="light"] .card,
body[data-theme="light"] .sheet,
body[data-theme="gray"] .card,
body[data-theme="gray"] .sheet { color: var(--text); border-color: var(--line); }

body[data-theme="gray"] .growth-shell { background: #f6f7f8; }
body[data-theme="light"] .growth-shell,
body[data-theme="gray"] .growth-shell { color: var(--text); }

body[data-theme="light"] .growth-shell h1,
body[data-theme="light"] .growth-shell h2,
body[data-theme="light"] .growth-shell h3,
body[data-theme="gray"] .growth-shell h1,
body[data-theme="gray"] .growth-shell h2,
body[data-theme="gray"] .growth-shell h3 { color: var(--accent); }

@media (max-width: 760px) {
  .topbar, .site-main { width: min(100% - 24px, var(--max-width)); }
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
  }
  .brand { min-width: 0; }
  .mobile-menu-toggle { display: inline-flex; }
  .topnav {
    display: none;
    grid-column: 1 / -1;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 2px;
  }
  .topnav.is-open { display: flex; }
  .topnav a,
  .topnav-button,
  .theme-toggle {
    width: 100%;
    min-height: 48px;
    margin-left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    text-align: center;
  }
  .topnav .inline-form { width: 100%; }
}

/* Student portfolio */
.student-portfolio-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 24px 0 30px;
  padding: 30px 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.student-portfolio-heading h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.25;
}

.student-portfolio-heading .lead {
  max-width: 720px;
  margin-top: 12px;
  line-height: 1.8;
}

.student-portfolio-back,
.student-portfolio-audio,
.student-portfolio-create,
.student-portfolio-button,
.student-portfolio-edit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.student-portfolio-heading-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.student-portfolio-back {
  border: 1px solid var(--line);
  background: rgba(2, 6, 23, .28);
  color: var(--text);
}

.student-portfolio-create {
  color: #08111f;
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  box-shadow: 0 10px 22px rgba(245, 158, 11, .2);
}

.student-portfolio-audio {
  color: #08111f;
  background: linear-gradient(135deg, var(--accent-2), #7dd3fc);
  box-shadow: 0 10px 22px rgba(56, 189, 248, .2);
}

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

.student-portfolio-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}

.student-portfolio-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, .48);
}

.student-portfolio-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(2, 6, 23, .36);
}

.student-portfolio-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .24s ease;
}

.student-portfolio-card:hover .student-portfolio-image img {
  transform: scale(1.025);
}

.student-portfolio-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--accent-2);
  background:
    radial-gradient(circle at 25% 20%, rgba(56, 189, 248, .24), transparent 32%),
    linear-gradient(145deg, rgba(56, 189, 248, .08), rgba(245, 158, 11, .12));
}

.student-portfolio-placeholder span {
  font-size: 3rem;
  line-height: 1;
}

.student-portfolio-placeholder small {
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .14em;
}

.student-portfolio-card-body {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 22px;
}

.student-portfolio-date,
.student-portfolio-software {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

.student-portfolio-card h2 {
  margin: 8px 0 10px;
  overflow-wrap: anywhere;
  font-size: 1.35rem;
  line-height: 1.45;
}

.student-portfolio-software {
  display: inline-flex;
  align-self: flex-start;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(56, 189, 248, .08);
}

.student-portfolio-button {
  width: 100%;
  color: #08111f;
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  box-shadow: 0 10px 22px rgba(245, 158, 11, .2);
}

.student-portfolio-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: auto;
}

.student-portfolio-edit-button {
  width: 100%;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(56, 189, 248, .12);
}

.student-portfolio-button:hover,
.student-portfolio-button:focus-visible,
.student-portfolio-edit-button:hover,
.student-portfolio-edit-button:focus-visible,
.student-portfolio-create:hover,
.student-portfolio-create:focus-visible,
.student-portfolio-audio:hover,
.student-portfolio-audio:focus-visible,
.student-portfolio-back:hover,
.student-portfolio-back:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, .5);
  outline: none;
}

.student-portfolio-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 64px 24px;
  border: 1px dashed var(--line);
  border-radius: 24px;
  background: var(--panel);
  text-align: center;
}

.student-portfolio-empty-icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  margin-bottom: 6px;
  border-radius: 20px;
  color: #08111f;
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  font-size: 1.9rem;
  font-weight: 900;
}

.student-portfolio-empty h2,
.student-portfolio-empty p {
  margin: 0;
}

.student-portfolio-empty p {
  color: var(--muted);
  line-height: 1.7;
}

body[data-theme="light"] .student-portfolio-back,
body[data-theme="gray"] .student-portfolio-back,
body[data-theme="light"] .student-portfolio-edit-button,
body[data-theme="gray"] .student-portfolio-edit-button {
  background: rgba(255, 255, 255, .82);
}

.student-portfolio-form-shell {
  width: min(100%, 920px);
  margin-inline: auto;
}

@media (max-width: 1100px) {
  .student-portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .student-portfolio-heading {
    align-items: flex-start;
    flex-direction: column;
    padding: 24px 20px;
  }

  .student-portfolio-back {
    width: 100%;
  }

  .student-portfolio-heading-actions {
    width: 100%;
    flex-direction: column;
  }

  .student-portfolio-create {
    width: 100%;
  }

  .student-portfolio-audio {
    width: 100%;
  }

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

.typing-popup-close:hover {
  background: rgba(15, 23, 42, 0.14);
}

.auth-loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
}

.auth-loading-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.auth-loading-card {
  width: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  transform: translateY(16px) scale(0.96);
  transition: transform 0.24s ease;
}

.auth-loading-overlay.is-visible .auth-loading-card {
  transform: translateY(0) scale(1);
}

.auth-loading-image {
  display: block;
  width: 400px;
  height: 300px;
  margin: 0 auto;
  max-width: 100%;
  border-radius: 10px;
  object-fit: cover;
  object-position: center;
}

#login-submit-button.is-loading,
#login-submit-button:disabled {
  cursor: wait;
  opacity: 0.82;
}

.global-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.global-loading-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.global-loading-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: #0f1b31;
  color: #f8fafc;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.45);
  font-weight: 700;
}

.global-loading-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: global-loading-spin 760ms linear infinite;
}

.is-loading {
  cursor: wait !important;
  opacity: 0.72;
}

@keyframes global-loading-spin {
  to { transform: rotate(360deg); }
}

.interview-shell { max-width: 980px; }
.interview-lead, .interview-help { color: #52657f; line-height: 1.8; }
.interview-recorder-card, .interview-result-card, .interview-transcript { margin: 24px 0; padding: 24px; border: 1px solid #c7dcf5; border-radius: 16px; background: #f8fbff; }
.interview-status { font-weight: 700; color: #0b4a84; }
.interview-timer { margin: 16px 0; font-size: 42px; font-variant-numeric: tabular-nums; color: #0b4a84; }
.interview-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.interview-hearing-guide { margin-top: 20px; padding: 16px 18px; border: 1px solid #c7dcf5; border-radius: 14px; background: #eef7ff; color: #334e68; }
.interview-hearing-guide h2 { margin: 0 0 6px; color: #145c8c; font-size: 1.05rem; }
.interview-hearing-guide p { margin: 0 0 8px; }
.interview-hearing-guide ul { margin: 0; padding-left: 1.4rem; line-height: 1.8; }
.interview-preview { display: block; width: min(100%, 560px); margin-top: 20px; }
.interview-result-card h2 { margin-top: 0; color: #0b4a84; }
.interview-transcript summary { cursor: pointer; font-weight: 700; color: #0b4a84; }
.interview-transcript p { white-space: pre-wrap; line-height: 1.8; }
.interview-result-card table { width: 100%; border-collapse: collapse; }
.interview-result-card th, .interview-result-card td { padding: 10px 12px; border-bottom: 1px solid #dbe8f6; text-align: left; vertical-align: top; }
.interview-result-card th { color: #0b4a84; white-space: nowrap; }
.interview-review-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
.interview-review-grid .interview-result-card { margin: 0; }
.interview-transcript-panel { position: sticky; top: 20px; max-height: 75vh; overflow: auto; }
@media (max-width: 800px) {
  .interview-review-grid { grid-template-columns: 1fr; }
  .interview-transcript-panel { position: static; max-height: none; }
}

/* Growth and interview screens use light report colors above for print/readability.
   Restore the portal's dark palette when the active display mode is dark (the default). */
body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell {
  color: var(--text);
  background: var(--panel);
}

body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell h1,
body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell h2,
body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell h3,
body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell .app-form > p > label,
body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell .app-form legend {
  color: var(--accent-2);
}

body:not([data-theme="light"]):not([data-theme="gray"]) .growth-panel,
body:not([data-theme="light"]):not([data-theme="gray"]) .growth-card,
body:not([data-theme="light"]):not([data-theme="gray"]) .growth-source-summary,
body:not([data-theme="light"]):not([data-theme="gray"]) .metric-grid > div,
body:not([data-theme="light"]):not([data-theme="gray"]) .assessment-row,
body:not([data-theme="light"]):not([data-theme="gray"]) .interview-result-card,
body:not([data-theme="light"]):not([data-theme="gray"]) .interview-recorder-card {
  color: var(--text);
  background: rgba(15, 27, 49, .92);
  border-color: var(--line);
}

body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell .app-form input:not([type="checkbox"]):not([type="radio"]),
body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell .app-form textarea,
body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell .app-form select,
body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell .assessment-field input,
body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell .assessment-field textarea {
  color: var(--text);
  background: rgba(8, 17, 31, .84);
  border-color: var(--line);
}

body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell .button.secondary {
  color: var(--text);
  background: rgba(2, 6, 23, .46);
  border-color: var(--line);
}

body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell .app-form .helptext,
body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell .muted,
body:not([data-theme="light"]):not([data-theme="gray"]) .interview-lead,
body:not([data-theme="light"]):not([data-theme="gray"]) .interview-help {
  color: var(--muted);
}

body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell .records {
  color: var(--text);
  background: rgba(15, 27, 49, .92);
  border-color: var(--line);
}

body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell .records th {
  color: var(--accent-2);
  background: rgba(56, 189, 248, .12);
}

body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell .records th,
body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell .records td,
body:not([data-theme="light"]):not([data-theme="gray"]) .interview-result-card th,
body:not([data-theme="light"]):not([data-theme="gray"]) .interview-result-card td {
  border-bottom-color: var(--line);
}

body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell .growth-card a,
body:not([data-theme="light"]):not([data-theme="gray"]) .growth-shell .records a {
  color: var(--accent-2);
}

body:not([data-theme="light"]):not([data-theme="gray"]) .interview-result-card h2,
body:not([data-theme="light"]):not([data-theme="gray"]) .interview-result-card th,
body:not([data-theme="light"]):not([data-theme="gray"]) .interview-status,
body:not([data-theme="light"]):not([data-theme="gray"]) .interview-transcript summary {
  color: var(--accent-2);
}

body:not([data-theme="light"]):not([data-theme="gray"]) .interview-hearing-guide {
  background: rgba(56, 189, 248, .1);
  border-color: var(--line);
  color: var(--text);
}

body:not([data-theme="light"]):not([data-theme="gray"]) .interview-hearing-guide h2 {
  color: var(--accent-2);
}

body:not([data-theme="light"]):not([data-theme="gray"]) .typing-line-chart {
  background: rgba(8, 17, 31, .7);
}

@media (max-width: 1100px) {
  .typing-shell,
  .typing-shell-student {
    grid-template-columns: 1fr;
  }

  .typing-sidebar {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

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

@media (max-width: 760px) {
  .app-form p {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .app-form p > label,
  .app-form p > input:not([type="radio"]),
  .app-form p > textarea,
  .app-form p > select,
  .app-form p > .helptext,
  .app-form p > .errorlist,
  .app-form p > ul,
  .app-form p:has(input.weekday-radio) > div,
  .app-form p:has(input.status-radio) > div {
    grid-column: 1;
  }

  .app-form label {
    padding-top: 0;
  }

  .typing-page-head,
  .typing-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .typing-form-grid,
  .typing-summary-grid,
  .typing-metric-grid {
    grid-template-columns: 1fr;
  }

  .typing-card {
    padding: 18px;
  }

  .typing-popup-overlay {
    padding: 16px;
  }

  .typing-popup-card {
    padding: 18px;
    border-radius: 22px;
  }

  .typing-popup-close {
    top: 10px;
    right: 10px;
  }

  .auth-loading-overlay {
    padding: 16px;
  }

  .auth-loading-card {
    padding: 0;
    border-radius: 0;
  }

  .auth-loading-image {
    width: min(100%, 400px);
    height: min(calc((100vw - 32px) * 0.75), 300px);
  }
}
