:root {
  color-scheme: light;
  --bg: #f7f7f3;
  --surface: #ffffff;
  --surface-2: #f0f4f5;
  --text: #1d2528;
  --muted: #667174;
  --line: #d9e0df;
  --accent: #1f7a70;
  --accent-dark: #145f57;
  --warn: #b45f06;
  --danger: #b3261e;
  --shadow: 0 14px 34px rgba(31, 45, 48, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Yu Gothic UI", Meiryo, sans-serif;
}

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

a {
  color: var(--accent-dark);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 22px;
  background: #18282a;
  color: #fff;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #f4c35a;
  color: #172527;
  font-weight: 800;
  font-size: 24px;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 26px;
  letter-spacing: 0;
}

.brand-kicker,
.eyebrow {
  color: #8da3a6;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #dce8e8;
  text-align: left;
  cursor: pointer;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.nav-submenu {
  display: grid;
  gap: 6px;
  margin-top: -4px;
  padding-left: 14px;
}

.nav-submenu[hidden] {
  display: none;
}

.nav-sub-button {
  width: 100%;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #cfe0e1;
  text-align: left;
  cursor: pointer;
}

.nav-sub-button:hover,
.nav-sub-button.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.storage-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #cfe0e1;
}

.user-note {
  margin-top: 4px;
  margin-bottom: 12px;
}

.storage-note span,
.storage-note strong,
.storage-note small {
  display: block;
}

.storage-note span {
  font-size: 12px;
  color: #8da3a6;
}

.storage-note small {
  margin-top: 6px;
  color: #8da3a6;
  line-height: 1.4;
  word-break: break-all;
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.content {
  padding: 34px;
  overflow-x: hidden;
}

.auth-view {
  display: grid;
  min-height: calc(100vh - 72px);
  place-items: center;
}

.auth-view[hidden] {
  display: none;
}

.auth-card {
  width: min(520px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(32, 44, 40, 0.08);
}

.auth-card h2 {
  margin: 0;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin: 4px 0 20px;
  border-bottom: 1px solid var(--line);
}

.auth-tab {
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.active {
  border-bottom-color: var(--accent);
  color: var(--accent-dark);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form[hidden] {
  display: none;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 700;
}

.auth-form label span {
  font-size: 13px;
  color: var(--muted);
}

.auth-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fbfdfc;
  font: inherit;
}

.auth-form input:focus {
  outline: 3px solid rgba(35, 132, 116, 0.16);
  border-color: var(--accent);
  background: #fff;
}

.auth-form .primary-button {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  justify-content: center;
}

.auth-message {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--danger);
  font-size: 14px;
}

.storage-banner {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #e3c16c;
  border-radius: 8px;
  background: #fff8e5;
  color: #59410b;
  line-height: 1.6;
}

.storage-banner strong {
  display: block;
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.banner-actions small {
  color: inherit;
  opacity: 0.8;
}

.view {
  display: none;
}

.view[hidden] {
  display: none !important;
}

.view.active {
  display: block;
}

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

.page-head h2,
.page-head p,
.panel h3 {
  margin: 0;
}

.page-head h2 {
  font-size: 32px;
  letter-spacing: 0;
}

.primary-button,
.ghost-button,
.danger-button,
.small-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
}

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

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

.primary-button.is-busy,
.ghost-button.is-busy {
  position: relative;
  padding-left: 38px;
}

.primary-button.is-busy::before,
.ghost-button.is-busy::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.ghost-button,
.small-button {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.danger-button {
  background: #fff5f3;
  border-color: #f0b8b2;
  color: var(--danger);
}

.small-button {
  min-height: 34px;
  padding: 6px 10px;
}

.question-generation-status {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #b7d9d2;
  border-radius: 8px;
  background: #f0fbf8;
  color: var(--text);
}

.question-generation-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.question-generation-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--accent);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.question-generation-track {
  position: relative;
  overflow: hidden;
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: #dbe7e4;
}

.question-generation-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.3s ease;
}

.question-generation-status.indeterminate .question-generation-track span {
  width: 42% !important;
  animation: progress-slide 1.2s ease-in-out infinite;
}

.question-generation-status p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

@keyframes progress-slide {
  0% {
    transform: translateX(-120%);
  }
  50% {
    transform: translateX(60%);
  }
  100% {
    transform: translateX(240%);
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat,
.panel,
.table-panel,
.form-panel,
.detail-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat {
  padding: 18px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
}

.panel,
.table-panel,
.form-panel,
.detail-card {
  padding: 18px;
}

.panel-head,
.toolbar,
.filters,
.form-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-total {
  color: var(--muted);
  font-weight: 700;
}

.panel-caption {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.billing-plan-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.billing-plan-card.current {
  border-color: var(--accent);
  background: #eef7f4;
}

.billing-plan-card h4 {
  margin: 4px 0 6px;
  font-size: 20px;
  letter-spacing: 0;
}

.billing-plan-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.billing-plan-actions button {
  flex: 1 1 140px;
}

.stack-list {
  display: grid;
  gap: 10px;
}

.learning-chart-panel {
  margin-top: 18px;
}

.learning-chart {
  display: grid;
  grid-template-columns: repeat(29, minmax(34px, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 190px;
  padding-top: 8px;
  overflow-x: auto;
}

.chart-day {
  display: grid;
  grid-template-rows: 22px 1fr 22px;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.chart-value,
.chart-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.chart-bar-wrap {
  display: flex;
  align-items: end;
  justify-content: center;
  min-height: 118px;
  border-radius: 8px;
  background: #edf2f1;
  overflow: hidden;
}

.chart-bar {
  width: 70%;
  min-height: 4px;
  border-radius: 6px 6px 0 0;
  background: var(--accent);
}

.chart-day.planned .chart-bar {
  background: #d6a23f;
}

.chart-day.planned .chart-bar-wrap {
  background: #f7eed9;
}

.chart-day.today .chart-value,
.chart-day.today .chart-label {
  color: var(--accent-dark);
  font-weight: 800;
}

.chart-day.today .chart-bar-wrap {
  outline: 2px solid rgba(31, 122, 112, 0.24);
  outline-offset: 2px;
}

.cumulative-chart {
  display: grid;
  gap: 10px;
}

.cumulative-chart svg {
  width: 100%;
  min-height: 220px;
}

.cumulative-chart .axis {
  stroke: var(--line);
  stroke-width: 2;
}

.cumulative-chart .today-line {
  stroke: #9aa8aa;
  stroke-dasharray: 5 5;
  stroke-width: 1.5;
}

.cumulative-chart .value-guide {
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
}

.cumulative-chart .actual-guide {
  stroke: rgba(31, 122, 112, 0.45);
}

.cumulative-chart .projected-guide {
  stroke: rgba(214, 162, 63, 0.55);
}

.cumulative-chart .target-guide {
  stroke: rgba(79, 96, 170, 0.45);
}

.cumulative-chart .actual-line,
.cumulative-chart .projection-line,
.cumulative-chart .target-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cumulative-chart .actual-line {
  stroke: var(--accent);
  stroke-width: 4;
}

.cumulative-chart .projection-line {
  stroke: #d6a23f;
  stroke-width: 3;
  stroke-dasharray: 8 7;
}

.cumulative-chart .target-line {
  stroke: #4f60aa;
  stroke-width: 3;
}

.cumulative-chart text {
  fill: var(--muted);
  font-size: 12px;
}

.cumulative-chart .axis-value {
  font-weight: 800;
}

.cumulative-chart .actual-value {
  fill: var(--accent-dark);
}

.cumulative-chart .projected-value {
  fill: #9b6d13;
}

.cumulative-chart .target-value {
  fill: #39458b;
}

.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 18px;
  height: 4px;
  border-radius: 999px;
}

.legend-actual {
  background: var(--accent);
}

.legend-projection {
  background: #d6a23f;
}

.legend-target {
  background: #4f60aa;
}

.empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.due-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.due-title {
  margin: 0 0 4px;
  font-weight: 700;
}

.due-item .video-url {
  margin-bottom: 6px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.align-start {
  justify-content: flex-start;
}

.filters {
  margin-bottom: 14px;
}

.home-filter {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 14px;
}

.home-filter label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.home-filter select {
  min-width: 180px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
  color: var(--text);
}

.filters input,
.filters select,
.form-panel input,
.form-panel select,
.form-panel textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  color: var(--text);
}

.form-panel textarea {
  min-height: 120px;
  resize: vertical;
}

.master-panel {
  max-width: 980px;
}

.master-search {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.master-search[hidden],
.master-list[hidden],
.master-form[hidden],
.master-panel[hidden] {
  display: none;
}

.master-search label span,
.master-detail-form label > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-weight: 700;
}

.master-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  color: var(--text);
}

.master-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.master-section {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.master-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.master-tabs[hidden] {
  display: none;
}

.master-tab {
  min-height: 40px;
  padding: 9px 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.master-tab.active {
  border-bottom-color: var(--accent);
  color: var(--accent-dark);
}

.master-tab-panel[hidden] {
  display: none;
}

.section-head {
  margin-bottom: 12px;
}

.section-head h4 {
  margin: 0;
  font-size: 16px;
}

.selection-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfa;
}

.selection-summary {
  margin-right: auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.content-question-list-note > .filters > .danger-button {
  display: none;
}

.compact-list {
  margin-top: 12px;
}

.plan-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px auto;
  gap: 10px;
  align-items: end;
}

.plan-controls label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-weight: 700;
}

.plan-controls input,
.plan-controls select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  color: var(--text);
}

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

.master-detail-form {
  padding-top: 4px;
}

.master-form input,
.master-form select,
.master-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  color: var(--text);
}

.master-form input,
.master-form select {
  min-height: 42px;
}

.detail-form-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-form-head[hidden] {
  display: none;
}

.detail-form-head h3,
.detail-form-head p {
  margin: 0;
}

.master-textarea {
  display: grid;
  gap: 7px;
  grid-column: 1 / -1;
}

.master-textarea span {
  color: var(--muted);
  font-weight: 700;
}

.master-textarea textarea {
  min-height: 150px;
  line-height: 1.7;
  resize: vertical;
}

.target-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 110px;
  gap: 10px;
}

.time-target-input-row {
  grid-template-columns: minmax(0, 1fr) 90px 110px;
}

.unit-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px auto;
  align-items: center;
  gap: 8px;
}

.calc-icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.calc-icon-button:hover {
  border-color: rgba(32, 132, 117, 0.45);
  background: #f3faf8;
}

.calculator-icon {
  width: 18px;
  height: 22px;
  position: relative;
  display: block;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.calculator-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 3px;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
}

.calculator-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 3px;
  height: 3px;
  border-radius: 1px;
  background: currentColor;
  box-shadow:
    5px 0 0 currentColor,
    10px 0 0 currentColor,
    0 5px 0 currentColor,
    5px 5px 0 currentColor,
    10px 5px 0 currentColor;
}

.unit-input span {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.unit-input input[readonly] {
  background: #f6f8f8;
  color: var(--muted);
}

.prompt-check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.prompt-check-group legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.prompt-check-group label {
  display: inline-flex;
  width: auto;
  min-width: 92px;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 700;
}

.prompt-check-group input {
  width: auto;
}

.master-list {
  display: grid;
  gap: 10px;
}

.master-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
}

.master-row:hover {
  border-color: rgba(31, 122, 112, 0.45);
  background: #eef6f4;
}

.master-row strong,
.master-row span {
  display: block;
}

.master-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.master-summary {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
  white-space: normal;
}

.master-row-cue {
  align-self: center;
  color: var(--accent-dark);
  font-weight: 700;
}

.master-table {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.master-table-head,
.master-table-row {
  display: grid;
  grid-template-columns: 88px minmax(220px, 1fr) 130px 130px;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
}

.master-table-head {
  background: #f3f7f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.master-table-row {
  border: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.master-table-row > *,
.master-table-head > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.master-table-row:hover,
.master-table-row.active {
  background: #eef6f4;
}

.admin-user-table-expanded {
  min-width: 0;
  width: 100%;
}

.admin-user-table-expanded .master-table-head,
.admin-user-table-expanded .master-table-row {
  grid-template-columns: minmax(180px, 1.2fr) minmax(100px, 0.8fr) minmax(96px, 0.65fr) minmax(70px, 0.5fr) minmax(180px, 1.2fr) minmax(110px, 0.75fr);
}

.admin-pricing-plan-table .master-table-head,
.admin-pricing-plan-table .master-table-row {
  grid-template-columns: 80px minmax(82px, 0.65fr) minmax(132px, 0.9fr) minmax(150px, 1fr) minmax(112px, 0.75fr) minmax(190px, 1.2fr) 48px;
  min-width: 0;
}

.pricing-plan-model {
  display: grid;
  gap: 2px;
}

.pricing-plan-model small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-usage-summary {
  grid-column: 1 / -1;
  margin-top: 4px;
}

.admin-usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.admin-usage-grid div {
  min-height: 62px;
  padding: 10px;
  border: 1px solid #dbe7e3;
  border-radius: 8px;
  background: #fff;
}

.admin-usage-grid span,
.admin-usage-grid strong {
  display: block;
}

.admin-usage-grid span {
  color: var(--muted);
  font-size: 12px;
}

.admin-usage-grid strong {
  margin-top: 6px;
  color: var(--text);
}

.admin-usage-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.master-table-row.static-row {
  cursor: default;
}

.master-table-row.static-row:hover {
  background: #fff;
}

.master-table-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-question-table .master-table-head,
.content-question-table .master-table-row {
  grid-template-columns: 32px 88px minmax(220px, 1fr) 130px 130px;
}

.table-check-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.table-check-cell input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.pagination span {
  color: var(--muted);
  font-weight: 700;
}

.content-question-list-note {
  display: grid;
  gap: 10px;
}

.filters select {
  max-width: 180px;
}

.video-table {
  min-width: 980px;
}

.compact-video-table {
  min-width: 760px;
}

.compact-video-table .table-row {
  grid-template-columns: 32px minmax(260px, 1.8fr) 120px 80px 120px minmax(220px, auto);
}

.mock-exam-section,
.mock-exam-runtime {
  display: grid;
  gap: 14px;
}

.mock-exam-config-form {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.mock-exam-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfa;
}

.section-subtitle {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.mock-countdown {
  color: var(--danger);
  font-size: 18px;
  font-weight: 800;
}

.mock-exam-controls {
  display: flex;
  justify-content: space-between;
}

.mock-exam-nav-actions {
  display: inline-flex;
  gap: 8px;
}

.mock-score-chart {
  width: 100%;
  max-width: 680px;
  height: auto;
}

.mock-score-chart circle {
  fill: var(--accent);
}

.compact-stats {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.learning-method-actions {
  display: flex;
  justify-content: flex-start;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.8fr) 150px 140px 70px 140px 260px;
  gap: 12px;
  align-items: center;
  padding: 13px 8px;
  border-bottom: 1px solid var(--line);
}

.table-row:last-child {
  border-bottom: 0;
}

.table-head {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.video-title {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}

.video-url {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.muted-url {
  color: var(--muted);
}

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e7f1ef;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.badge.complete {
  background: #eee;
  color: #555;
}

.form-panel {
  display: grid;
  max-width: 760px;
  gap: 16px;
}

.edit-only-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.edit-only-fields[hidden] {
  display: none;
}

.form-panel label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-weight: 700;
}

.title-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.title-row input[readonly] {
  background: #f6f8f8;
  color: var(--muted);
}

.detail-card {
  display: grid;
  gap: 18px;
  max-width: 880px;
}

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

.detail-field {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.detail-field span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

.history-list {
  margin: 0;
  padding-left: 20px;
}

.detail-comment {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  line-height: 1.7;
}

.practice-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.practice-block p {
  margin: 0 0 8px;
  line-height: 1.7;
}

.practice-layout {
  display: grid;
  gap: 14px;
}

.practice-list {
  display: grid;
  gap: 8px;
}

.practice-question-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
}

.practice-question-row.correct {
  border-color: rgba(31, 122, 112, 0.45);
  background: #eef6f4;
}

.practice-question-row.wrong {
  border-color: #f0b8b2;
  background: #fff5f3;
}

.practice-question-row.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(31, 122, 112, 0.12);
}

.practice-answer-area {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.choice-list {
  display: grid;
  gap: 8px;
}

.choice-list label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.choice-list input[type="radio"] {
  margin-top: 8px;
}

.choice-label {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

.practice-explanation {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.practice-next-actions {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}

.practice-next-actions .primary-button {
  width: 100%;
}

.practice-complete-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(31, 122, 112, 0.24);
  border-radius: 8px;
  background: #eef6f4;
  color: var(--muted);
  line-height: 1.6;
}

.practice-record-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #efd9a8;
  border-radius: 8px;
  background: #fffaf0;
}

.practice-record-panel h3 {
  margin: 0 0 4px;
}

.practice-record-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.practice-record-buttons {
  padding-top: 0;
}

.content-markdown-preview {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0f10;
  color: #f8fafc;
}

.markdown-body {
  min-width: 0;
  line-height: 1.75;
}

.markdown-body h3,
.markdown-body h4,
.markdown-body h5 {
  margin: 0 0 12px;
  color: inherit;
  line-height: 1.35;
}

.markdown-body p {
  margin: 0 0 14px;
}

.markdown-body ul {
  margin: 8px 0 14px 22px;
  padding: 0;
}

.markdown-body li {
  margin: 4px 0;
}

.markdown-body code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.18);
  font-family: Consolas, "Courier New", monospace;
}

.code-card {
  overflow: hidden;
  margin: 14px 0 18px;
  border: 1px solid #2d3338;
  border-radius: 8px;
  background: #171a1d;
}

.code-card-head {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #2d3338;
  color: #f8fafc;
  font-weight: 700;
}

.code-card pre {
  overflow-x: auto;
  margin: 0;
  padding: 14px;
}

.code-card code {
  padding: 0;
  background: transparent;
  color: #e5e7eb;
  font-size: 0.92rem;
}

.markdown-choice-list {
  gap: 14px;
}

.markdown-choice {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.practice-answer-area > .markdown-body {
  padding: 18px;
  border-radius: 8px;
  background: #0b0f10;
  color: #f8fafc;
}

.choice-list .markdown-body {
  flex: 1 1 auto;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  padding: 12px 14px;
  border-radius: 8px;
  background: #18282a;
  color: #fff;
  box-shadow: var(--shadow);
}

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

.time-calculator-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.time-calculator-dialog::backdrop {
  background: rgba(11, 29, 31, 0.32);
}

.time-calculator-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
  background: var(--surface);
}

.calculator-display {
  width: 100%;
  min-height: 54px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--text);
  font-size: 1.7rem;
  font-weight: 800;
  text-align: right;
}

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

.calculator-keypad button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
}

.calculator-keypad button:hover {
  border-color: rgba(32, 132, 117, 0.45);
  background: #f3faf8;
}

.calculator-keypad [data-calc-action="equals"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 14px;
  }

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

  .nav-button {
    text-align: center;
  }

  .storage-note {
    display: none;
  }

  .content {
    padding: 22px 14px;
  }

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

  .learning-chart {
    grid-template-columns: repeat(29, minmax(34px, 1fr));
    row-gap: 14px;
  }

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

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

  .master-table-head,
  .master-table-row {
    min-width: 680px;
  }
}

@media (max-width: 640px) {
  .billing-plan-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .billing-plan-actions button {
    width: 100%;
  }

  .page-head,
  .due-item,
  .filters,
  .home-filter,
  .toolbar,
  .row-actions,
  .form-actions,
  .master-form,
  .master-row,
  .title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .title-row {
    display: flex;
  }

  .master-form,
  .master-row {
    display: flex;
  }

  .stats-grid,
  .detail-grid,
  .edit-only-fields {
    grid-template-columns: 1fr;
  }

  .filters select {
    max-width: none;
  }

  .home-filter label,
  .home-filter select {
    width: 100%;
  }
}

@media (max-width: 760px) {
  body {
    min-width: 0;
  }

  button,
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    gap: 10px;
    padding: 10px 12px 12px;
    box-shadow: 0 10px 26px rgba(15, 30, 32, 0.18);
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    font-size: 20px;
  }

  .brand h1 {
    font-size: 21px;
    line-height: 1.1;
  }

  .brand-kicker,
  .eyebrow {
    font-size: 11px;
  }

  .user-note {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 10px;
    margin: 4px 0 0;
    padding: 9px 10px;
  }

  .user-note span {
    grid-column: 1 / -1;
  }

  .user-note strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .storage-note:not(.user-note) {
    display: none;
  }

  .nav,
  .nav-submenu {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0 0 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar,
  .nav-submenu::-webkit-scrollbar {
    display: none;
  }

  .nav-button,
  .nav-sub-button {
    flex: 0 0 auto;
    width: auto;
    min-height: 42px;
    padding: 10px 13px;
    text-align: center;
    white-space: nowrap;
  }

  .nav-submenu {
    padding-left: 0;
  }

  .content {
    padding: 16px 10px 28px;
  }

  .auth-view {
    min-height: calc(100svh - 176px);
    place-items: start stretch;
  }

  .auth-card {
    width: 100%;
    padding: 22px 18px;
    box-shadow: none;
  }

  .page-head {
    gap: 12px;
    margin-bottom: 16px;
  }

  .page-head h2 {
    font-size: 27px;
    line-height: 1.25;
  }

  .panel,
  .table-panel,
  .form-panel,
  .detail-card,
  .stat {
    box-shadow: 0 8px 22px rgba(31, 45, 48, 0.06);
  }

  .panel,
  .table-panel,
  .form-panel,
  .detail-card {
    padding: 14px;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .stat {
    padding: 14px;
  }

  .stat strong {
    font-size: 26px;
  }

  .primary-button,
  .ghost-button,
  .danger-button,
  .small-button {
    min-height: 44px;
    padding: 10px 13px;
  }

  .toolbar,
  .filters,
  .form-actions,
  .row-actions,
  .master-actions,
  .pagination,
  .banner-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .toolbar > *,
  .filters > *,
  .form-actions > *,
  .row-actions > *,
  .master-actions > *,
  .pagination > *,
  .banner-actions > * {
    width: 100%;
  }

  .toggle {
    min-height: 42px;
  }

  .content-question-list-note > .filters > .danger-button {
    display: none;
  }

  .selection-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .selection-summary {
    grid-column: 1 / -1;
    margin-right: 0;
  }

  .selection-toolbar .danger-button {
    grid-column: 1 / -1;
  }

  .home-filter {
    justify-content: stretch;
    margin-top: 0;
  }

  .home-filter label {
    display: grid;
    gap: 6px;
  }

  .learning-chart {
    grid-template-columns: repeat(29, 42px);
    margin: 0 -4px;
    padding: 10px 4px 4px;
  }

  .chart-day {
    min-width: 42px;
  }

  .cumulative-chart svg {
    min-height: 180px;
  }

  .due-item {
    display: grid;
    grid-template-columns: 1fr;
  }

  .due-item .row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-panel {
    overflow-x: visible;
  }

  .video-table,
  .compact-video-table {
    min-width: 0;
  }

  .table-head {
    display: none;
  }

  .video-table .table-row.table-head,
  .compact-video-table .table-row.table-head {
    display: none;
  }

  .table-row,
  .compact-video-table .table-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 12px;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(31, 45, 48, 0.05);
  }

  .table-row:last-child {
    margin-bottom: 0;
    border-bottom: 1px solid var(--line);
  }

  .table-row > span {
    min-width: 0;
  }

  .table-row:not(.table-head) > span:nth-child(2) {
    grid-column: 2;
  }

  .table-row:not(.table-head) > span:nth-child(3),
  .table-row:not(.table-head) > span:nth-child(4),
  .table-row:not(.table-head) > span:nth-child(5) {
    grid-column: 1 / -1;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f7fbfa;
    color: var(--text);
  }

  .video-table:not(.compact-video-table) .table-row:not(.table-head) > span:nth-child(n + 2):nth-child(-n + 5)::before,
  .compact-video-table .table-row:not(.table-head) > span:nth-child(n + 3):nth-child(-n + 5)::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .video-table:not(.compact-video-table) .table-row:not(.table-head) > span:nth-child(2)::before {
    content: "学習対象";
  }

  .video-table:not(.compact-video-table) .table-row:not(.table-head) > span:nth-child(3)::before,
  .compact-video-table .table-row:not(.table-head) > span:nth-child(3)::before {
    content: "前回学習日";
  }

  .video-table:not(.compact-video-table) .table-row:not(.table-head) > span:nth-child(4)::before,
  .compact-video-table .table-row:not(.table-head) > span:nth-child(4)::before {
    content: "回数";
  }

  .video-table:not(.compact-video-table) .table-row:not(.table-head) > span:nth-child(5)::before,
  .compact-video-table .table-row:not(.table-head) > span:nth-child(5)::before {
    content: "次回予定";
  }

  .video-title {
    line-height: 1.45;
  }

  .video-url {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .table-row .row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-column: 1 / -1;
    gap: 8px;
    padding-top: 2px;
  }

  .table-check-cell {
    justify-content: flex-start;
    align-self: start;
    padding-top: 2px;
  }

  .table-check-cell input {
    width: 22px;
    height: 22px;
  }

  .master-panel {
    max-width: none;
  }

  .master-tabs,
  .auth-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .master-tabs::-webkit-scrollbar,
  .auth-tabs::-webkit-scrollbar {
    display: none;
  }

  .master-tab,
  .auth-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .master-tabs {
    position: relative;
    gap: 4px;
    margin-inline: -4px;
    padding-inline: 4px;
  }

  .master-tabs::before,
  .master-tabs::after {
    position: sticky;
    z-index: 2;
    display: none;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    align-self: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 12px rgba(31, 45, 48, 0.18);
    color: var(--accent-dark);
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
  }

  .master-tabs::before {
    content: "‹";
    left: 0;
    margin-right: -18px;
  }

  .master-tabs::after {
    content: "›";
    position: sticky;
    right: 0;
    margin-left: -18px;
  }

  .master-tabs.can-scroll-left::before,
  .master-tabs.can-scroll-right::after {
    display: grid;
  }

  .master-form,
  .master-row,
  .plan-controls,
  .target-input-row,
  .time-target-input-row,
  .unit-input,
  .edit-only-fields,
  .detail-grid,
  .title-row {
    grid-template-columns: 1fr;
  }

  .unit-input {
    gap: 6px;
  }

  .master-row {
    align-items: stretch;
  }

  .master-row-cue {
    justify-self: start;
  }

  .master-table {
    overflow-x: visible;
    border: 0;
    background: transparent;
  }

  .master-table-head {
    display: none;
  }

  .master-table-row,
  .admin-user-table-expanded .master-table-row,
  .admin-pricing-plan-table .master-table-row,
  .content-question-table .master-table-row {
    display: grid;
    grid-template-columns: 1fr;
    min-width: 0;
    gap: 8px;
    margin-bottom: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(31, 45, 48, 0.05);
  }

  .master-table-row strong {
    white-space: normal;
  }

  .content-question-table .master-table-row {
    cursor: pointer;
  }

  .content-question-table .master-table-row > span:nth-child(3),
  .content-question-table .master-table-row > span:nth-child(n + 6) {
    display: none;
  }

  .pagination {
    justify-content: stretch;
  }

  .pagination span {
    text-align: center;
  }

  .practice-question-row,
  .markdown-choice {
    grid-template-columns: 1fr;
  }

  .choice-list label {
    padding: 12px;
  }

  .choice-list input[type="radio"] {
    width: 20px;
    height: 20px;
  }

  .mock-exam-status {
    align-items: stretch;
    flex-direction: column;
  }

  .mock-countdown {
    font-size: 22px;
  }

  .mock-exam-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .mock-exam-nav-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mock-exam-controls > .danger-button,
  .mock-exam-controls > .primary-button {
    width: 100%;
  }

  .toast {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
  }
}

@media (max-width: 420px) {
  .content {
    padding-inline: 8px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .due-item .row-actions,
  .table-row .row-actions,
  .mock-exam-nav-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .content {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .panel,
  .table-panel,
  .form-panel,
  .detail-card,
  .stat,
  .stack-list,
  .due-item,
  .master-section,
  .master-tab-panel,
  .content-question-list-note,
  .panel-head > * {
    min-width: 0;
  }

  .primary-button,
  .ghost-button,
  .danger-button,
  .small-button {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .nav-button,
  .nav-sub-button,
  .master-tab,
  .auth-tab {
    white-space: nowrap;
  }

  .master-tabs,
  .auth-tabs {
    flex-wrap: nowrap;
  }

  .master-tab,
  .auth-tab {
    min-width: max-content;
  }

  .due-item {
    overflow: hidden;
  }

  .due-item > * {
    min-width: 0;
  }

  .video-table,
  .compact-video-table,
  .master-table,
  .content-question-table,
  .plan-preview-table {
    width: 100%;
    min-width: 0;
  }

  .master-table-row,
  .admin-user-table-expanded .master-table-row,
  .admin-pricing-plan-table .master-table-row,
  .content-question-table .master-table-row {
    width: 100%;
    min-width: 0;
  }

  .master-table-row > *,
  .content-question-table .master-table-row > *,
  .table-row > * {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .content-question-table .master-table-row > span:nth-child(2)::before,
  .content-question-table .master-table-row > span:nth-child(4)::before,
  .content-question-table .master-table-row > span:nth-child(5)::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .content-question-table .master-table-row > span:nth-child(2)::before {
    content: "問題No.";
  }

  .content-question-table .master-table-row > span:nth-child(4)::before {
    content: "登録状態";
  }

  .content-question-table .master-table-row > span:nth-child(5)::before {
    content: "作成日";
  }

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

  .target-input-row,
  .time-target-input-row,
  .plan-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .plan-controls label,
  .plan-controls button {
    min-width: 0;
  }

  .cumulative-chart svg {
    height: 280px;
    min-height: 280px;
  }

  .chart-legend {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mock-exam-controls {
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }

  .mock-exam-controls > .primary-button,
  .mock-exam-controls > .danger-button {
    min-height: 52px;
    margin-top: 8px;
  }

  .compact-video-table .table-row:not(.table-head) {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .compact-video-table .table-row:not(.table-head) > span:nth-child(2) {
    grid-column: 2;
  }

  .compact-video-table .table-row:not(.table-head) > span:nth-child(3),
  .compact-video-table .table-row:not(.table-head) > span:nth-child(4),
  .compact-video-table .table-row:not(.table-head) > span:nth-child(5) {
    grid-column: 1 / -1;
  }

  .content-question-table .master-table-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .content-question-table .master-table-row > .table-check-cell {
    grid-column: 1;
    grid-row: 1 / span 3;
  }

  .content-question-table .master-table-row > span:nth-child(2) {
    grid-column: 2;
    width: fit-content;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef5f3;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 800;
  }

  .content-question-table .master-table-row > strong {
    grid-column: 2;
    font-size: 15px;
    line-height: 1.45;
  }

  .content-question-table .master-table-row > span:nth-child(4),
  .content-question-table .master-table-row > span:nth-child(5) {
    grid-column: 2;
    color: var(--muted);
    font-size: 13px;
  }

  .content-question-table .master-table-row > span:nth-child(2)::before,
  .content-question-table .master-table-row > span:nth-child(4)::before,
  .content-question-table .master-table-row > span:nth-child(5)::before {
    display: none;
  }
}
