/* Round-037a hub polish — matches docs/design/round-037 */
/* Round-061 A1: shared tokens + is-hub chrome (DEC-K82) */
:root {
  --hub-blue: #1d5fd1;
  --hub-blue-soft: #eaf1fd;
  --hub-line: #e3e8ef;
  --hub-bg: #f5f7fa;
  --hub-ok: #1a7f37;
  --hub-bad: #c62828;
  --hub-surface: #fff;
  --hub-chip-bg: #eef1f4;
  --hub-track: #e8ecf1;
  --hub-blue-solid: #1d5fd1;
  --hub-link: #0a4a9c;
  --hub-warn-bg: #fff3e6;
  --hub-warn-fg: #9a5b00;
  --hub-max: 1100px;
  --hub-quiz-max: 760px;
  --hub-space-1: 8px;
  --hub-space-2: 12px;
  --hub-space-3: 16px;
  --hub-space-4: 24px;
  --hub-space-5: 32px;
  --hub-tap: 48px;
  --hub-tap-min: 44px;
  --hub-radius: 10px;
  --hub-font-body: 1.0625rem;
  --hub-font-stem: 1.125rem;
  --hub-leading: 1.7;
  --hub-input-line: #758997;
}

body.app-shell.is-hub {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
    "Yu Gothic UI", Meiryo, sans-serif;
  font-variant-numeric: tabular-nums;
  background: var(--hub-bg);
  padding-left: 0 !important;
  padding-bottom: calc(var(--footer-h) + var(--safe-b));
  font-size: var(--hub-font-body);
  line-height: var(--hub-leading);
}

body.app-shell.is-hub.is-quiz {
  padding-bottom: var(--safe-b);
}

/* G1: app.css .app-main { max-width:720px } was clamping the hub. */
body.app-shell.is-hub .app-main {
  max-width: none;
  width: 100%;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}

/* A11y: footer links on hub bg need ≥4.5:1 (bootstrap #0d6efd is 4.19). */
body.app-shell.is-hub .app-footer a {
  color: var(--hub-link);
  text-decoration: underline;
}

body.app-shell.is-hub > .app-header {
  display: none;
}

@media (max-width: 991px) {
  body.app-shell.is-hub .hub-topnav {
    display: none;
  }
}

@media (min-width: 992px) {
  body.app-shell.is-hub {
    padding-bottom: 0;
  }
  body.app-shell.is-hub > .app-tabs {
    display: none;
  }
}

.hub-shell {
  min-height: 100dvh;
}

.hub-quiz-back {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  min-height: var(--hub-tap-min);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--hub-blue);
  font-weight: 700;
}

.hub-topnav__badge {
  display: inline-flex;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  margin-left: 0.25rem;
  border-radius: 999px;
  background: var(--hub-bad);
  color: #fff;
  font-size: 0.65rem;
  line-height: 1.15rem;
  align-items: center;
  justify-content: center;
}

/* Focus / empty / disabled shared chrome */
.hub-btn:focus-visible,
.hub-chip:focus-visible,
.hub-topnav a:focus-visible,
.app-tabs a:focus-visible,
.hub-mode:focus-visible {
  outline: 2px solid var(--hub-blue);
  outline-offset: 2px;
}

.hub-empty {
  padding: var(--hub-space-4);
  text-align: center;
  color: var(--muted);
  background: var(--hub-surface);
  border: 1px dashed var(--hub-line);
  border-radius: var(--hub-radius);
}

.hub-btn:disabled,
.hub-btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.hub-save-status {
  font-size: 0.85rem;
  color: var(--muted);
}
.hub-save-status.is-ok {
  color: var(--hub-ok);
}
.hub-save-status.is-err {
  color: var(--hub-bad);
}

.hub-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  min-height: 56px;
  padding: 0.5rem 1.25rem;
  background: var(--hub-surface);
  border-bottom: 1px solid var(--hub-line);
}

.hub-custom-section,
.hub-chip-row,
.hub-session-parts {
  scroll-margin-top: 72px;
}

.hub-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--hub-blue);
  font-weight: 700;
}

.hub-brand__mark {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--hub-blue-solid);
  color: #fff;
  font-size: 0.85rem;
}

.hub-exam-switch {
  position: relative;
}

.hub-exam-switch summary {
  list-style: none;
  cursor: pointer;
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--hub-chip-bg);
  color: var(--fg);
  font-weight: 600;
}

.hub-exam-switch summary::-webkit-details-marker {
  display: none;
}

.hub-exam-switch__menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: min(12rem, calc(100vw - 2.5rem));
  max-width: calc(100vw - 2.5rem);
  padding: 0.35rem;
  background: var(--hub-surface);
  border: 1px solid var(--hub-line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
}

.hub-exam-switch__menu a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

.hub-exam-switch__menu a[aria-current="true"] {
  background: var(--hub-blue-soft);
  color: var(--hub-blue);
}
@media (hover: hover) {
  .hub-exam-switch__menu a:hover {
    background: var(--hub-blue-soft);
    color: var(--hub-blue);
  }
}

.hub-topnav {
  margin-left: auto;
  display: flex;
  gap: 0.25rem;
}

.hub-topnav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
}

.hub-topnav a[aria-current="page"] {
  background: var(--hub-blue-soft);
  color: var(--hub-blue);
}

.hub-page {
  max-width: var(--hub-max);
  margin: 0 auto;
  padding: 1.25rem max(var(--hub-space-3), 16px) 2.5rem;
}

.hub-crumb {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}

.hub-crumb a {
  color: var(--hub-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hub-h1 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hub-lead {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.hub-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.hub-stat-boxes {
  display: flex;
  gap: 0.65rem;
}

.hub-stat-box {
  min-width: 7.5rem;
  padding: 0.65rem 0.85rem;
  background: var(--hub-surface);
  border: 1px solid var(--hub-line);
  border-radius: 12px;
}

.hub-stat-box__label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.hub-stat-box__value {
  font-size: 1.25rem;
  font-weight: 800;
}

.hub-stat-box__value.is-ok {
  color: var(--hub-ok);
}

.hub-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

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

@media (max-width: 520px) {
  .hub-shortcut-grid {
    grid-template-columns: 1fr;
  }
}

.hub-scard {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1rem 1.05rem;
  border-radius: 14px;
  border: 1px solid var(--hub-line);
  background: var(--hub-surface);
  text-decoration: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  min-height: var(--tap);
}

.hub-scard--primary {
  background: var(--hub-blue-solid);
  border-color: var(--hub-blue);
  color: #fff;
}

.hub-scard__kicker {
  display: block;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.hub-scard__main {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
}

.hub-scard__sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.85rem;
  opacity: 0.85;
}

.hub-panel {
  background: var(--hub-surface);
  border: 1px solid var(--hub-line);
  border-radius: 16px;
  padding: 0.85rem 1rem 1.1rem;
}

.hub-tabs {
  display: flex;
  gap: 0.15rem;
  border-bottom: 1px solid var(--hub-line);
  margin: 0 0 1rem;
  overflow-x: auto;
}

.hub-tab {
  flex: 0 0 auto;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  font-weight: 700;
  white-space: nowrap;
}

.hub-tab.is-active {
  color: var(--hub-blue);
  border-bottom-color: var(--hub-blue);
}

.hub-tab .hub-tab__long {
  display: inline;
}

.hub-tab .hub-tab__short {
  display: none;
}

@media (max-width: 640px) {
  .hub-tab .hub-tab__long {
    display: none;
  }
  .hub-tab .hub-tab__short {
    display: inline;
  }
}

.hub-year-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.1fr) minmax(120px, 0.9fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--hub-line);
}

@media (max-width: 800px) {
  .hub-year-row {
    grid-template-columns: 1fr;
  }
}

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

.hub-year-row__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.hub-year-row__meta {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.hub-progress {
  display: block;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--hub-track);
  overflow: hidden;
}

.hub-progress > span {
  display: block;
  height: 100%;
  background: var(--hub-blue-solid);
  border-radius: inherit;
}

.hub-progress-meta {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.hub-year-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.hub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  color: var(--fg);
}

.hub-btn--primary {
  background: var(--hub-blue-solid);
  color: #fff;
}

.hub-btn--soft {
  background: var(--hub-blue-soft);
  color: var(--hub-blue);
}

.hub-btn--outline {
  border-color: var(--hub-line);
  background: var(--hub-surface);
  color: var(--hub-blue);
}

.hub-btn--block {
  width: 100%;
}

.hub-btn--ghost {
  background: var(--hub-surface);
  border-color: var(--hub-line);
}

.hub-tile-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, 1fr);
}

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

@media (max-width: 560px) {
  .hub-tile-grid {
    grid-template-columns: 1fr;
  }
}

.hub-tile {
  padding: 0.95rem 1rem;
  border: 1px solid var(--hub-line);
  border-radius: 14px;
  background: var(--hub-surface);
}

.hub-tile__head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.hub-tile__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.hub-tile__count {
  color: var(--muted);
  font-size: 0.85rem;
}

.hub-tile__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.45rem;
  gap: 0.5rem;
}

.hub-tile__link {
  color: var(--hub-blue);
  font-weight: 700;
  text-decoration: none;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  padding: 0;
  min-height: var(--tap);
}

.hub-exam-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1000px) {
  .hub-exam-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .hub-exam-grid {
    grid-template-columns: 1fr;
  }
}

.hub-exam-card {
  display: block;
  padding: 1.05rem 1.1rem;
  background: var(--hub-surface);
  border: 1px solid var(--hub-line);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
}

.hub-exam-mark {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  border-radius: 8px;
}
.hub-exam-card__name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--hub-blue);
}
.hub-exam-card__title {
  flex: 1;
  min-width: 0;
}
.hub-exam-card__title .hub-chip {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 0.35rem;
}

.hub-exam-card__meta {
  display: block;
  margin: 0.35rem 0 0.65rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.hub-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hub-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--hub-line);
  background: var(--hub-surface);
  color: var(--muted);
  font-size: 0.9rem;
}

.hub-chip--check {
  position: relative;
  cursor: pointer;
  color: var(--fg);
  gap: 0;
}

.hub-chip--check input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.hub-chip--check:has(input:checked),
.hub-chip.is-on,
.hub-chip--on {
  background: var(--hub-blue-solid);
  border-color: var(--hub-blue);
  color: #fff;
  font-weight: 700;
}

.hub-chip--soft:has(input:checked) {
  background: var(--hub-blue-soft);
  border-color: var(--hub-blue);
  color: var(--hub-blue);
}

.hub-session-grid {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 1rem;
}

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

.hub-card {
  background: var(--hub-surface);
  border: 1px solid var(--hub-line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.85rem;
}

/* Round-058 F2: guide body tables.
   UI-mobile T01: sentences in any column wrap (the last column held whole sentences and pushed
   the page to 560px). A minimum width keeps short cells like ページ from breaking per letter. */
.hub-guide-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 0.75rem 0;
}
.hub-guide-body th,
.hub-guide-body td {
  min-width: 4.5em;
  border: 1px solid var(--hub-line);
  padding: 0.4rem 0.55rem;
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
}
.hub-guide-body thead th {
  background: var(--hub-chip-bg, #eef2f6);
  font-weight: 700;
}

.hub-card__title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.hub-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 0.9rem;
}

.hub-fieldset legend {
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.hub-qtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.hub-qtable th,
.hub-qtable td {
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--hub-line);
  text-align: left;
  vertical-align: top;
}

.hub-qtable th {
  color: var(--muted);
  font-weight: 600;
}

/* Sweep 11/13: at 390px the 区分・分野 columns shrank to one character per line.
   3em holds two characters with the cell padding; wider pushed 文字大 past 390px,
   and at 320px the table has no room for it. */
@media (min-width: 360px) {
  .hub-qtable td:nth-child(2),
  .hub-qtable td:nth-child(3) {
    min-width: 3em;
  }
}

.hub-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: var(--hub-warn-bg);
  color: var(--hub-warn-fg);
  font-size: 0.78rem;
  font-weight: 700;
}

.hub-mark-ok {
  color: var(--hub-ok);
  font-weight: 800;
}
.hub-mark-ng {
  color: var(--hub-bad);
  font-weight: 800;
}
.hub-mark-none {
  color: #9aa3af;
}

.hub-pager {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  margin-top: 0.85rem;
}

.hub-custom-section {
  background: var(--hub-surface);
  border: 1px solid var(--hub-line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.85rem;
}

.hub-custom-section__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.hub-custom-section__head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.hub-linkish {
  background: none;
  border: 0;
  color: var(--hub-blue);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem;
}

.hub-session-parts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem 1rem;
}

@media (max-width: 800px) {
  .hub-session-parts {
    grid-template-columns: 1fr;
  }
}

.hub-session-parts__row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.hub-session-parts__label {
  min-width: 4.5rem;
  font-weight: 700;
}

.hub-custom-form {
  padding-bottom: 5.5rem;
}

.hub-sticky-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--footer-h, 56px) + var(--safe-b, 0px) + 0.5rem);
  width: min(calc(100% - 1.5rem), var(--hub-max));
  z-index: 70;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--hub-surface);
  border: 1px solid var(--hub-line);
  border-radius: 14px;
  box-shadow: 0 -6px 20px rgba(16, 24, 40, 0.08);
  pointer-events: auto;
}

.hub-sticky-bar .hub-btn {
  position: relative;
  z-index: 1;
  min-height: 44px;
  flex-shrink: 0;
}

@media (min-width: 992px) {
  .hub-sticky-bar {
    bottom: 1rem;
  }
}

.hub-sticky-bar__count {
  font-weight: 800;
  color: var(--hub-blue);
}

.hub-foot {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.hub-foot a {
  color: var(--muted);
}

.hub-neigh {
  display: flex;
  gap: 0.4rem;
}

.hub-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: var(--tap);
}

/* ==========================================================================
   Round-053 — dark tokens, quiz screen, onboarding, search, editor, stats
   ========================================================================== */
:root[data-theme="dark"] {
  --hub-blue: #8ab4f8;
  --hub-blue-soft: #1f2a3d;
  --hub-blue-solid: #2f6fdc;
  --hub-line: #2c313a;
  --hub-bg: #121417;
  --hub-surface: #1a1d21;
  --hub-chip-bg: #252a31;
  --hub-track: #2c313a;
  --hub-ok: #56d364;
  --hub-bad: #ff7b72;
  --hub-link: #8ab4f8;
  --hub-warn-bg: #3a2c14;
  --hub-warn-fg: #f0b45b;
  --hub-input-line: #91abbd;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --hub-blue: #8ab4f8;
    --hub-blue-soft: #1f2a3d;
    --hub-blue-solid: #2f6fdc;
    --hub-line: #2c313a;
    --hub-bg: #121417;
    --hub-surface: #1a1d21;
    --hub-chip-bg: #252a31;
    --hub-track: #2c313a;
    --hub-ok: #56d364;
    --hub-bad: #ff7b72;
    --hub-link: #8ab4f8;
    --hub-warn-bg: #3a2c14;
    --hub-warn-fg: #f0b45b;
    --hub-input-line: #91abbd;
  }
}

.hub-stat-box__sub {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.hub-list {
  margin: 0;
  padding-left: 1.1rem;
}

.hub-list li {
  margin: 0.25rem 0;
}

.hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0;
}

.hub-actions form {
  display: inline;
}

.hub-field {
  display: block;
  margin: 0 0 0.75rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.hub-input {
  display: block;
  width: 100%;
  min-height: var(--tap);
  margin-top: 0.25rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--hub-line);
  border-radius: 10px;
  background: var(--hub-surface);
  color: var(--fg);
  font: inherit;
  font-weight: 400;
}

.hub-input[readonly] {
  background: var(--hub-chip-bg);
  color: var(--muted);
  cursor: not-allowed;
}

textarea.hub-input {
  min-height: 5rem;
  resize: vertical;
}

.hub-note {
  margin: 0 0 0.85rem;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--hub-warn-fg);
  background: var(--hub-warn-bg);
  color: var(--hub-warn-fg);
  font-size: 0.9rem;
}

.hub-note--bad {
  border-color: var(--hub-bad);
  color: var(--hub-bad);
}

.hub-badge--ai {
  margin-left: 0.4rem;
  background: var(--hub-blue-soft);
  color: var(--hub-blue);
  vertical-align: middle;
}

/* ---- Question screen (S2-1) ---- */
.hub-quiz {
  max-width: 780px;
  margin: 0 auto;
  padding-bottom: 6rem;
}

.hub-quiz__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.hub-quiz__title {
  margin: 0;
  font-weight: 800;
  font-size: 1.05rem;
}

.hub-quiz__sub {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.hub-quiz__progress {
  margin-bottom: 0.85rem;
  height: 10px;
}

.hub-quiz__tools {
  position: relative;
  flex: 0 0 auto;
}

.hub-quiz__tools > summary {
  list-style: none;
}

.hub-quiz__tools > summary::-webkit-details-marker {
  display: none;
}

.hub-quiz__tools-body {
  margin-top: 0.5rem;
  padding: 0.75rem 0.9rem;
  background: var(--hub-surface);
  border: 1px solid var(--hub-line);
  border-radius: 12px;
  width: min(92vw, 420px);
}

.hub-quiz__tools-close {
  display: none;
  margin-bottom: 0.5rem;
}

.hub-quiz__source {
  margin: 0.15rem 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--fg);
}

/* A05 / Round-061: <640px open as full-width sheet below head (not inside flex row) */
@media (max-width: 639px) {
  .hub-quiz__head {
    flex-wrap: wrap;
  }
  .hub-quiz__tools {
    flex: 1 1 100%;
    order: 3;
  }
  .hub-quiz__tools[open] .hub-quiz__tools-body {
    width: 100%;
    max-width: none;
    position: static;
    box-shadow: none;
  }
  .hub-quiz__tools[open] .hub-quiz__tools-close {
    display: inline-flex;
  }
  .hub-quiz__crumb {
    flex: 1 1 auto;
    min-width: 0;
  }
}

@media (min-width: 640px) {
  .hub-quiz__tools-body {
    position: absolute;
    right: 0;
    z-index: 55;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.14);
  }
}

@media (max-width: 639px), (pointer: coarse) {
  .hub-kbd {
    display: none !important;
  }
}

.hub-quiz__body {
  padding: 1.1rem 1.15rem;
}

.hub-stem {
  margin: 0 0 1rem;
  font-size: 1.08rem;
  line-height: 1.75;
}

.hub-case {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--hub-line);
  border-radius: 12px;
  background: var(--hub-chip-bg);
}

.hub-choice-hint {
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.hub-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 56px;
  margin: 0 0 0.6rem;
  padding: 0.8rem 1rem;
  border: 2px solid var(--hub-line);
  border-radius: 12px;
  background: var(--hub-surface);
  color: var(--fg);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.hub-choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

@media (hover: hover) {
  .hub-choice:hover {
    border-color: var(--hub-blue);
  }
}

.hub-choice:has(input:checked) {
  border-color: var(--hub-blue-solid);
  background: var(--hub-blue-soft);
}

.hub-choice:has(input:focus-visible) {
  outline: 3px solid var(--hub-blue);
  outline-offset: 2px;
}

.hub-choice.is-correct {
  border-color: var(--hub-ok);
  background: color-mix(in srgb, var(--hub-ok) 14%, var(--hub-surface));
}

.hub-choice.is-correct::after {
  content: "✓ 正解";
  margin-left: auto;
  color: var(--hub-ok);
  font-weight: 800;
  white-space: nowrap;
}

.hub-choice.is-wrong {
  border-color: var(--hub-bad);
  background: color-mix(in srgb, var(--hub-bad) 12%, var(--hub-surface));
}

.hub-choice.is-wrong::after {
  content: "✕ あなたの解答";
  margin-left: auto;
  color: var(--hub-bad);
  font-weight: 800;
  white-space: nowrap;
}

.hub-result {
  margin: 0 0 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--hub-line);
  background: var(--hub-chip-bg);
  font-weight: 800;
}

.hub-result--ok {
  border-color: var(--hub-ok);
  color: var(--hub-ok);
}

.hub-result--ng {
  border-color: var(--hub-bad);
  color: var(--hub-bad);
}

.hub-explain {
  line-height: 1.75;
}

.hub-explain__sub {
  margin: 0.9rem 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 800;
}

.hub-foot--bad {
  color: var(--hub-bad);
}

/* UI-mobile F01: every action is a .hub-quiz__act holding one button. Messages take
   the whole row; the main action fills the rest; the sub action keeps its label on
   one line and moves to its own row when both no longer fit (narrow or large text). */
.hub-quiz__bar {
  position: sticky;
  bottom: calc(var(--footer-h) + var(--safe-b));
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.7rem 0;
  /* Solid from the first line: a hint at the top of the bar must not sit on the passage. */
  background: linear-gradient(transparent, var(--hub-bg) 0.7rem);
}

@media (min-width: 992px) {
  .hub-quiz__bar {
    bottom: 0.5rem;
  }
}

.hub-quiz__hint {
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--hub-bad) 10%, var(--hub-surface));
  color: var(--hub-bad);
  font-size: 0.95rem;
  font-weight: 700;
}

/* No bottom tabs while solving: sit on the screen edge, keep clear of the home bar. */
body.is-quiz .hub-quiz__bar {
  bottom: 0;
  padding-bottom: calc(0.7rem + var(--safe-b));
}

.hub-quiz__bar > p {
  flex: 1 1 100%;
  margin: 0;
}

.hub-quiz__act {
  display: flex;
  flex: 999 1 9rem;
  min-width: 0;
  margin: 0;
}

.hub-quiz__act--sub {
  flex: 1 1 auto;
}

.hub-quiz__act > .hub-btn {
  flex: 1 1 auto;
  min-width: 0;
}

.hub-quiz__act--sub > .hub-btn {
  white-space: nowrap;
}

.hub-quiz__bar .hub-btn {
  min-height: 52px;
  font-size: 1.05rem;
}

/* Sweep 11/13: before a ○× answer the bar has no action; sticky, it covered the lower
   part of the ○/× buttons on a 390×844 screen. */
.hub-quiz__bar--flow {
  position: static;
  background: none;
}

#answer-form > .hub-quiz__msg {
  margin: 0.5rem 0 0;
}

/* Typing on a phone: the keyboard takes the bottom of the screen, so the bar
   stays in the page flow instead of covering the field being typed in. */
@media (hover: none) and (pointer: coarse) {
  .hub-quiz:has(#answer-form :is(input:not([type=radio]):not([type=checkbox]):not([type=hidden]), textarea, select):focus) .hub-quiz__bar {
    position: static;
  }
}

.hub-kbd {
  margin-left: 0.6rem;
  padding: 0.05rem 0.4rem;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.75;
}

/* Audit 2026-11-11: on the dark primary button the faded hint fell to 3.38:1. */
:root[data-theme="dark"] .hub-kbd {
  opacity: 1;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hub-kbd {
    opacity: 1;
  }
}

@media (hover: none) {
  .hub-kbd {
    display: none;
  }
}

.hub-btn--ox {
  min-width: 96px;
  min-height: 56px;
  margin-right: 0.6rem;
  font-size: 1.5rem;
}

/* ---- Onboarding (S2-6) ---- */
.hub-onboard {
  margin: 0 0 1.1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--hub-blue);
  border-radius: 14px;
  background: var(--hub-blue-soft);
}

.hub-onboard__steps {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(3, 1fr);
  margin: 0.6rem 0 0.85rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (max-width: 700px) {
  .hub-onboard__steps {
    grid-template-columns: 1fr;
  }
}

.hub-onboard__steps li {
  counter-increment: step;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  background: var(--hub-surface);
  border: 1px solid var(--hub-line);
}

.hub-onboard__steps li::before {
  content: counter(step);
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: 0.45rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--hub-blue-solid);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

/* ---- Search / owner tables (S2-5, S1-1) ---- */
.hub-search-form {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 2fr 1fr auto;
  align-items: end;
  margin-bottom: 1rem;
}

@media (max-width: 700px) {
  .hub-search-form {
    grid-template-columns: 1fr;
  }
}

.hub-hit {
  display: block;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--hub-line);
  color: inherit;
  text-decoration: none;
}

.hub-hit__meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.hub-mark {
  background: color-mix(in srgb, var(--hub-warn-fg) 30%, transparent);
  color: inherit;
}

.hub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

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

.hub-table th {
  color: var(--muted);
  font-weight: 600;
}

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

/* ---- Owner editor (S1-1) ---- */
.hub-edit-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: start;
}

@media (max-width: 991px) {
  .hub-edit-grid {
    grid-template-columns: 1fr;
  }
}

.hub-edit-preview {
  position: sticky;
  top: 72px;
}

/* UI-mobile §7: a choice wraps and grows (question_edit.js); the box and number sit on its
   first line. Bootstrap floats <legend>, so the first row must clear it or it is squeezed. */
.hub-edit-choice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  clear: both;
}
/* The answer box sits in a 44px label (easy to tap), centred on the choice's first line. */
.hub-edit-choice__ans {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: calc(1rem + 2px + 1.6em);
  min-height: 44px;
  margin: 0;
  cursor: pointer;
}
.hub-edit-choice__ans > input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
}
.hub-edit-choice__no {
  flex: none;
  padding-top: calc(0.5rem + 1px);
  line-height: 1.6;
  font-weight: 700;
}
textarea.hub-input.hub-edit-choice__text {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--tap);
  margin: 0;
  line-height: 1.6;
  resize: none;
  overflow-wrap: anywhere;
  field-sizing: content;
}

.hub-lock {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
  background: var(--hub-chip-bg);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.hub-gate {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--hub-bad);
  border-radius: 10px;
  color: var(--hub-bad);
}

.hub-gate ul {
  margin: 0.3rem 0 0;
  padding-left: 1.1rem;
}

/* ---- Stats dashboard on hub components (S2-3) ---- */
.hub-quiz--wide {
  max-width: 980px;
}

.hub-grid-2 {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 0.75rem;
}

.hub-grid-2 .hub-stat-box {
  min-width: 0;
}

.hub-section-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* ---- Mock (S2-4) ---- */
.hub-mock-top {
  position: sticky;
  top: 56px;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--hub-line);
  border-radius: 12px;
  background: var(--hub-surface);
}

.hub-mock-timer {
  font-variant-numeric: tabular-nums;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--hub-blue);
}

.hub-mock-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-height: 12rem;
  overflow: auto;
}

.hub-mock-nav button {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid var(--hub-line);
  border-radius: 8px;
  background: var(--hub-surface);
  color: var(--fg);
  font-size: 0.78rem;
  cursor: pointer;
}

.hub-mock-nav button.answered {
  background: var(--hub-blue-soft);
  border-color: var(--hub-blue);
}

.hub-mock-nav button.marked {
  outline: 2px solid var(--hub-warn-fg);
}

.hub-mock-nav button.current {
  border: 2px solid var(--hub-blue-solid);
  font-weight: 800;
}

/* ---- Edge-swipe hint ---- */
@media (prefers-reduced-motion: reduce) {
  .hub-choice {
    transition: none;
  }
}


/* Round-054 U4 — stats dashboard (ISS-0051): today / week line / field bars / sessions / mocks */
.dash-sub {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.dash-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.dash-head .hub-card__title {
  margin: 0;
}

.dash-head form {
  margin: 0;
}

.dash-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.dash-empty__line {
  margin: 0;
  font-weight: 600;
}

.dash-review__line {
  margin: 0 0 0.5rem;
}

.dash-review .hub-actions {
  margin: 0.25rem 0 0;
}

.dash-big {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 800;
}

.dash-week {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
}

.dash-week__axis {
  stroke: var(--hub-line);
  stroke-width: 1;
}

.dash-week__line {
  fill: none;
  stroke: var(--hub-blue-solid);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.dash-week__dot {
  fill: var(--hub-surface);
  stroke: var(--hub-blue-solid);
  stroke-width: 2;
}

.dash-week__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  max-width: 560px;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  text-align: center;
  font-size: 0.85rem;
}

.dash-week__days li {
  display: flex;
  flex-direction: column;
}

.dash-week__d,
.dash-week__a {
  color: var(--muted);
  font-size: 0.75rem;
}

.dash-bars {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dash-bar {
  display: grid;
  grid-template-columns: minmax(6.5rem, 30%) 1fr 3.6rem;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0;
  font-size: 0.9rem;
}

.dash-bar__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-bar__track {
  height: 12px;
}

.dash-bar__track > span.is-bad {
  background: var(--hub-bad);
}

.dash-bar__track > span.is-mid {
  background: var(--hub-warn-fg);
}

.dash-bar__track > span.is-ok {
  background: var(--hub-ok);
}

.dash-bar__val {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dash-session {
  padding: 0.35rem 0;
}

.dash-session__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.dash-details > summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 1.05rem;
}

.dash-details > section {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--hub-line);
}

@media (max-width: 520px) {
  .dash-bar {
    grid-template-columns: minmax(5rem, 34%) 1fr 3.2rem;
    gap: 0.4rem;
  }
}

/* ---- V10 custom dialog ---- */
.hub-custom-dlg {
  border: none;
  padding: 0;
  margin: auto;
  width: min(720px, 100vw);
  max-height: min(85vh, 100%);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.28);
  background: var(--hub-surface, #fff);
  color: inherit;
}
.hub-custom-dlg::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.hub-custom-dlg__panel {
  display: flex;
  flex-direction: column;
  max-height: min(85vh, 100dvh);
}
.hub-custom-dlg__hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem 0.5rem;
  border-bottom: 1px solid var(--hub-line, #e3e8ef);
  flex-shrink: 0;
}
.hub-custom-dlg__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
}
.hub-custom-dlg__close {
  flex-shrink: 0;
  white-space: nowrap;
}
.hub-custom-dlg__bd {
  overflow: auto;
  padding: 0.75rem 1rem 1rem;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
}
.hub-custom-dlg__ft {
  position: sticky;
  bottom: 0;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--hub-line, #e3e8ef);
  background: var(--hub-surface, #fff);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-bottom: 3.5rem; /* clear bottom nav on mobile */
}
.hub-custom-dlg__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.hub-custom-dlg__actions .hub-btn {
  min-height: 44px;
  justify-content: center;
}
.hub-custom-dlg__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.5rem 1rem 0;
}
.hub-custom-dlg__reset-note {
  margin: 0;
  padding: 0 1rem 0.75rem;
  font-size: 0.8rem;
}
html.hub-custom-dlg-open,
html.hub-custom-dlg-open body {
  overflow: hidden;
  position: relative;
  width: 100%;
}
@media (max-width: 640px) {
  .hub-custom-dlg {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  .hub-custom-dlg__panel {
    max-height: 100dvh;
    height: 100%;
  }
}

/* Round-058 G: marks, plan table, counting CTA */
.hub-mark-btn {
  font-size: 1.15rem;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0.2rem 0.55rem;
  line-height: 1.2;
}
/* Sweep 11/13: the plan card's buttons and minutes field were 36–40px high. */
.hub-today .hub-btn {
  min-height: var(--tap);
}

.hub-today__min {
  width: 4.5rem;
  min-height: var(--tap);
}

.hub-mark-btn.hub-chip--on {
  background: var(--hub-blue-solid);
  border-color: var(--hub-blue);
  color: #fff;
}
.hub-btn--counting,
.hub-btn--counting[disabled] {
  opacity: 0.45;
  background: var(--hub-chip-bg);
  border-color: var(--hub-line);
  color: var(--muted, #667);
  box-shadow: none;
}
.hub-plan-table .hub-plan-col-cap,
.hub-plan-table .hub-plan-col-later {
  white-space: nowrap;
}
/* Sweep 11/13: #8a93a0 was 3.1:1 on white; the muted token keeps past days quieter at 4.5:1+. */
.hub-plan-table tr.hub-plan-past td {
  color: var(--muted);
}
@media (max-width: 420px) {
  .hub-plan-table .hub-plan-col-cap,
  .hub-plan-table .hub-plan-col-later {
    white-space: nowrap;
  }
}


/* Round-061 A2: home / year / field */
.hub-home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.hub-home-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.hub-home-h1 { margin: 0; }
.hub-home-switch {
  min-height: 36px;
  font-size: 0.85rem;
}
.hub-resume {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  background: var(--hub-blue-soft);
  border-radius: 14px;
  padding: 10px 12px;
  margin: 0.4rem 0 0.9rem;
}
.hub-resume__meta {
  display: block;
  color: var(--muted);
}
.hub-resume__go {
  min-height: 40px;
  white-space: nowrap;
  flex-shrink: 0;
}
.hub-quick {
  margin: 0.5rem 0 1rem;
}
.hub-quick__forms {
  display: grid;
  gap: 0.5rem;
}
.hub-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.hub-mode {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--hub-surface);
  border: 1px solid var(--hub-line);
  border-radius: 14px;
  padding: 12px;
  min-height: 104px;
  color: inherit;
  text-decoration: none;
}
.hub-mode__t { font-weight: 800; font-size: 1rem; }
.hub-mode__d { font-size: 0.82rem; color: var(--muted); }
.hub-mode__s {
  margin-top: auto;
  font-size: 0.78rem;
  color: var(--hub-link);
  font-weight: 700;
}
.hub-mode--na { background: var(--hub-chip-bg); }
.hub-mode--na .hub-mode__s { color: var(--hub-warn-fg); }
.hub-reflect { margin-top: 1.25rem; }
.hub-reflect__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.hub-home-custom { margin-top: 1rem; }
.hub-sub-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
  font-size: 0.9rem;
}
.hub-sub-links a { color: var(--hub-link); }
.hub-row-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--hub-surface);
  border: 1px solid var(--hub-line);
  border-radius: 14px;
  min-height: 72px;
}
.hub-row-card__meta { color: var(--muted); font-size: 0.9rem; }
.hub-row-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
@media (min-width: 900px) {
  .hub-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hub-reflect__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 320px) {
  .hub-modes, .hub-reflect__grid { grid-template-columns: 1fr; }
}

/* Round-063: answer text and per-blank result after a slot question. */
.hub-slot-review__answer,
.hub-slot-review__title {
  margin: 0 0 0.35rem;
}
.hub-slot-review__rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hub-slot-review__rows li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.2rem 0;
  overflow-wrap: anywhere;
}
.hub-slot-review__label {
  font-weight: 700;
}
.hub-quiz__body select {
  max-width: 100%;
}

/* UI-mobile F02/F03: answer fields. Every choice in full, fields 48px, text 16px or more. */
.hub-slot {
  min-width: 0;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}
.hub-slot__label {
  display: block;
  float: none;
  width: auto;
  margin: 0 0 0.4rem;
  padding: 0;
  color: var(--fg);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.5;
}
.hub-slot__hint {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}
.hub-slot__field,
.hub-slot__select {
  width: 100%;
  min-height: var(--hub-tap);
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--hub-input-line);
  border-radius: 12px;
  background-color: var(--hub-surface);
  color: var(--fg);
  font-size: max(1rem, 16px);
  line-height: 1.6;
}
.hub-slot__select {
  padding-right: 2.25rem;
  text-overflow: ellipsis;
}
.hub-slot__field--num {
  max-width: 14rem;
}
textarea.hub-slot__field {
  resize: vertical;
}
textarea.hub-slot__field[rows="1"] {
  resize: none;
}
.hub-choice-list {
  display: grid;
  gap: 0.6rem;
}
.hub-choice--text {
  align-items: flex-start;
  margin: 0;
  font-weight: 500;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.hub-choice__mark {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.25rem;
  border: 2px solid var(--hub-input-line);
  border-radius: 50%;
  background: var(--hub-surface);
}
.hub-choice:has(input[type="checkbox"]) .hub-choice__mark {
  border-radius: 5px;
}
.hub-choice:has(input:checked) .hub-choice__mark {
  border-color: var(--hub-blue-solid);
  background: var(--hub-blue-solid);
  box-shadow: inset 0 0 0 3px var(--hub-surface);
}
.hub-choice__text {
  flex: 1 1 auto;
  min-width: 0;
}
.hub-choice__no {
  font-weight: 800;
}
.hub-choice-ref {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--hub-line);
  border-radius: 12px;
  background: var(--hub-surface);
}
.hub-choice-ref__title {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}
.hub-choice-ref__list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hub-choice-ref__item {
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.hub-pick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.hub-pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--hub-tap);
  min-height: var(--hub-tap);
  padding: 0 0.8rem;
  border: 2px solid var(--hub-line);
  border-radius: 12px;
  background: var(--hub-surface);
  font-weight: 700;
  cursor: pointer;
}
.hub-pick input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.hub-pick:has(input:checked) {
  border-color: var(--hub-blue-solid);
  background: var(--hub-blue-soft);
}
.hub-pick:has(input:checked) span::before {
  content: "✓ ";
}
.hub-pick:has(input:focus-visible) {
  outline: 3px solid var(--hub-blue);
  outline-offset: 2px;
}
/* Before answering: whether this question is graded, self-checked or has no official key. */
.hub-answer-mode {
  margin: 0 0 0.9rem;
  padding: 0.55rem 0.8rem;
  border-left: 4px solid var(--hub-input-line);
  border-radius: 6px;
  background: var(--hub-chip-bg);
  font-size: 0.92rem;
  line-height: 1.6;
}
.hub-answer-mode strong {
  display: block;
}

/* UI-mobile T05: マイページ — sections in one column, PC two columns for the settings. */
.hub-btn--danger {
  border-color: var(--hub-bad);
  background: var(--hub-surface);
  color: var(--hub-bad);
}

/* Sweep 11/13 (UI-mobile §7): マイセット編集の行。「外す」が文字だけの小さなリンクだった。 */
.set-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.set-item__name {
  min-width: 0;
  padding-top: 0.6rem;
}

.set-item__remove {
  flex: none;
  white-space: nowrap;
}
.me-page {
  max-width: 960px;
  margin: 0 auto;
}
.me-page__title {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 800;
}
.me-page__user {
  margin: 0 0 1rem;
  color: var(--muted);
}
.me-section {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--hub-line);
  border-radius: 16px;
  background: var(--hub-surface);
}
.me-section__title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 800;
}
.me-section__note {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.me-section__warn {
  color: var(--hub-bad);
  font-weight: 700;
}
.me-section--danger {
  margin-top: 2rem;
  border-color: color-mix(in srgb, var(--hub-bad) 45%, var(--hub-line));
}
.me-form__save {
  min-height: var(--hub-tap);
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
}
.me-links {
  margin: 0;
  padding: 0;
  list-style: none;
}
.me-links li + li {
  border-top: 1px solid var(--hub-line);
}
.me-links a {
  display: flex;
  align-items: center;
  min-height: var(--hub-tap);
  color: var(--hub-link);
  font-weight: 700;
}
@media (min-width: 992px) {
  .me-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
  }
  .me-form .me-form__save {
    grid-column: 1 / -1;
  }
}

/* UI-mobile T05: list rows used by 年度・練習・模試・頻出・履歴 had no CSS at all. Same look
   as .hub-row-card: title and counts on the left, actions on the right, wrap on phones. */
.hub-muted {
  color: var(--muted);
  font-size: 0.9rem;
}
.hub-stack,
.hub-session-list {
  display: grid;
  gap: 0.6rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}
.hub-session-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 0.75rem;
  min-height: 64px;
  padding: 0.8rem 1rem;
  border: 1px solid var(--hub-line);
  border-radius: 14px;
  background: var(--hub-surface);
}
.hub-session-row > :first-child {
  flex: 1 1 12rem;
  min-width: 0;
}
.hub-session-row .hub-row-actions {
  flex: 0 1 auto;
}
.hub-session-row .hub-row-actions form {
  margin: 0;
}

/* UI-mobile T05: 403 / 404 pages. */
.status-page {
  max-width: 560px;
  margin: 2rem auto;
}
.status-page__title {
  font-size: 1.4rem;
  font-weight: 800;
}
.status-page__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* UI-mobile T05: owner tables (問題エディタ) scroll inside their box with readable columns
   instead of breaking 資格・回・問 one letter per line. */
.hub-table-wrap > .hub-table {
  min-width: 40rem;
}
