@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700;800&display=swap");

:root {
  --teal: #1ba89f;
  --teal-dark: #137d76;
  --teal-bg: #e7f6f4;
  --pink: #e8627c;
  --pink-bg: #fff0f3;
  --ink: #17211f;
  --body: #455553;
  --muted: #62736f;
  --faint: #a9b5b2;
  --line: #dfe6e4;
  --bg: #f7f9f8;
  --surface: #fff;
  --sub: #f1f4f3;
  --danger: #b42318;
  --ok: #167847;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
[hidden] { display: none !important; }
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html {
  background: var(--bg);
}
body {
  background: var(--bg);
  color: var(--body);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 3px solid rgba(27, 168, 159, 0.35);
  outline-offset: 2px;
}

.container {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 56px;
}
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.page-kicker {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 700;
}
.page-title {
  color: var(--ink);
  font-size: 26px;
  line-height: 1.35;
  font-weight: 800;
}
.page-description {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}
.section {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.section:first-child {
  border-top: 0;
  padding-top: 0;
}
.section-heading {
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.5;
}
.section-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 14px;
}

.btn {
  align-items: center;
  background: var(--teal-dark);
  border: 1px solid var(--teal-dark);
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 7px;
  justify-content: center;
  line-height: 1.2;
  min-height: 42px;
  padding: 10px 15px;
  text-decoration: none;
}
.btn:hover {
  background: #10665f;
  border-color: #10665f;
}
.btn.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn.secondary:hover {
  background: var(--sub);
  border-color: var(--faint);
}
.btn.pink {
  background: #b84360;
  border-color: #b84360;
}
.btn.pink:hover {
  background: #9e3450;
  border-color: #9e3450;
}
.btn.full {
  width: 100%;
}
.btn:disabled {
  cursor: default;
  opacity: 0.55;
}
.icon-button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  display: inline-flex;
  height: 40px;
  justify-content: center;
  width: 40px;
}
.icon-button:hover {
  background: var(--sub);
}
.icon-button svg,
.btn svg,
.nav-icon svg,
.empty-icon svg,
.lesson-thumb svg {
  height: 18px;
  stroke-width: 2;
  width: 18px;
}

.field {
  margin-bottom: 16px;
}
.field label {
  color: var(--ink);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}
.field-help {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 400;
  margin-top: 2px;
}
input,
textarea,
select {
  background: #fff;
  border: 1px solid #cbd7d4;
  border-radius: 6px;
  color: var(--ink);
  font-size: 15px;
  padding: 10px 11px;
  width: 100%;
}
input:disabled {
  background: var(--sub);
  color: var(--muted);
}
textarea {
  min-height: 104px;
  resize: vertical;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  outline: 2px solid rgba(27, 168, 159, 0.16);
}
input[type="search"] {
  -webkit-appearance: none;
}
.form-grid {
  display: grid;
  gap: 0 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-span-2 {
  grid-column: 1 / -1;
}

.check-row {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  gap: 12px;
  padding: 15px 2px;
}
.check-row:last-child {
  border-bottom: 0;
}
.check-row input[type="checkbox"] {
  accent-color: var(--teal);
  flex: 0 0 auto;
  height: 20px;
  margin-top: 3px;
  width: 20px;
}
.cr-body {
  flex: 1;
  min-width: 0;
}
.cr-task {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.check-row.done .cr-task {
  color: var(--muted);
  text-decoration: line-through;
}
.cr-detail {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.cr-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
  margin-top: 7px;
}
.cr-links a {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 700;
}
.progress {
  background: #e6edeb;
  border-radius: 2px;
  height: 7px;
  overflow: hidden;
}
.progress > i {
  background: var(--teal);
  display: block;
  height: 100%;
  transition: width 0.25s ease;
}
.progress-label {
  color: var(--muted);
  font-size: 12px;
  margin-top: 7px;
}
.badge,
.month-pill {
  align-items: center;
  background: var(--teal-bg);
  border-radius: 4px;
  color: var(--teal-dark);
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  padding: 3px 7px;
}
.badge.pink {
  background: var(--pink-bg);
  color: #b3435a;
}
.month-pill {
  background: var(--ink);
  color: #fff;
}

.tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  overflow-x: auto;
}
.tabs .tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 1px;
  white-space: nowrap;
}
.tabs .tab.active {
  border-bottom-color: var(--teal);
  color: var(--ink);
}
.filter-tabs {
  gap: 8px;
  overflow: visible;
}
.filter-tabs .tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
}
.filter-tabs .tab.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.readonly-item {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.readonly-item:last-child {
  border-bottom: 0;
}
.readonly-item .k {
  color: var(--muted);
  font-size: 11px;
}
.readonly-item .v {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
  white-space: pre-wrap;
}
.readonly-grid {
  display: grid;
  gap: 0 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.notice {
  background: var(--sub);
  border-left: 3px solid var(--faint);
  color: var(--body);
  font-size: 13px;
  line-height: 1.7;
  margin-top: 10px;
  padding: 10px 12px;
}
.notice.error {
  background: #fff1f0;
  border-color: var(--danger);
  color: var(--danger);
}
.course-guide > p {
  font-size: 14px;
}
.course-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.course-setting-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.loading,
.empty {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  justify-content: center;
  min-height: 180px;
  text-align: center;
}
.empty {
  flex-direction: column;
  gap: 8px;
}
.empty-icon {
  color: var(--faint);
}

#auth-gate {
  background: var(--bg);
  display: none;
  inset: 0;
  overflow-y: auto;
  padding: 0;
  position: fixed;
  z-index: 99999;
}
.gate-layout {
  display: block;
  margin: 0 auto;
  max-width: 480px;
  padding: 80px 0;
}
.gate-brand {
  border-bottom: 1px solid var(--line);
  padding: 28px 40px;
}
.gate-logo,
.site-brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 18px;
  font-weight: 800;
  gap: 9px;
  text-decoration: none;
}
.brand-mark {
  align-items: center;
  background: var(--teal);
  border-radius: 5px;
  color: #fff;
  display: inline-flex;
  height: 26px;
  justify-content: center;
  width: 26px;
}
.brand-mark svg {
  height: 16px;
  width: 16px;
}
.gate-brand p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 20px;
  max-width: 270px;
}
.gate-panel {
  padding: 36px 40px;
}
.gate-card {
  max-width: 400px;
}
.gate-card h1 {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.4;
  margin-bottom: 6px;
}
.gate-card > p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 22px;
}
.login-btn {
  align-items: center;
  background: #5865f2;
  border-radius: 6px;
  color: #fff;
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  text-decoration: none;
}

#student-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: block;
  left: 0;
  position: sticky;
  right: 0;
  top: 0;
  z-index: 500;
}
#student-nav .nav-inner {
  align-items: center;
  display: flex;
  gap: 26px;
  margin: 0 auto;
  max-width: 1100px;
  min-height: 64px;
  padding: 0;
}
#student-nav .nav-item {
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
  min-height: 64px;
  padding: 2px 0 0;
  text-decoration: none;
}
#student-nav .nav-item:hover,
#student-nav .nav-item.active {
  border-bottom-color: var(--teal);
  color: var(--ink);
}
.nav-icon {
  display: inline-flex;
}
#toast-container {
  align-items: center;
  bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  left: 0;
  pointer-events: none;
  position: fixed;
  right: 0;
  z-index: 9999;
}
.toast {
  background: var(--ink);
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  max-width: min(88vw, 420px);
  opacity: 0;
  padding: 10px 16px;
  pointer-events: auto;
  transform: translateY(8px);
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.error {
  background: #8a1c17;
}
.toast.success {
  background: var(--ok);
}

.home-grid {
  display: grid;
  gap: 42px;
  grid-template-columns: minmax(0, 1fr) 300px;
}
.home-aside {
  min-width: 0;
}
.welcome {
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}
.welcome-name {
  color: var(--ink);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.35;
}
.progress-overview {
  align-items: end;
  display: grid;
  gap: 18px;
  grid-template-columns: 90px minmax(0, 1fr);
  margin-top: 20px;
}
.progress-number {
  color: var(--teal-dark);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}
.next-task {
  background: var(--teal-bg);
  border-left: 3px solid var(--teal);
  margin-top: 22px;
  padding: 16px;
}
.next-task .next-label {
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
}
.next-task .next-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  margin: 4px 0 10px;
}
.aside-section {
  border-top: 1px solid var(--line);
  padding: 20px 0;
}
.aside-section:first-child {
  border-top: 0;
  padding-top: 0;
}
.aside-section h2 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 8px;
}
.roadmap-summary {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 20px;
}
.roadmap-summary .progress {
  flex: 1;
}
.accordion {
  border-bottom: 1px solid var(--line);
}
.accordion:first-of-type {
  border-top: 1px solid var(--line);
}
.accordion.current {
  border-left: 3px solid var(--teal);
}
.accordion-head {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  display: flex;
  justify-content: space-between;
  padding: 16px 10px;
  text-align: left;
  width: 100%;
}
.accordion.current .accordion-head {
  background: var(--teal-bg);
}
.acc-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}
.acc-count {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.acc-arrow {
  color: var(--muted);
  display: flex;
  transition: transform 0.15s ease;
}
.accordion.open .acc-arrow {
  transform: rotate(180deg);
}
.accordion-body {
  display: none;
  padding: 2px 12px 10px;
}
.accordion.open .accordion-body {
  display: block;
}
.library-tools {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
}
.library-search {
  max-width: 440px;
  position: relative;
  width: 100%;
}
.library-search svg {
  color: var(--muted);
  height: 17px;
  left: 11px;
  position: absolute;
  top: 12px;
  width: 17px;
}
.library-search input {
  padding-left: 35px;
}
.result-count {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
}
.lesson-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.library-groups { display: grid; gap: 24px; }
.library-group-heading { align-items: baseline; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; margin-bottom: 12px; padding-bottom: 8px; }
.library-group-heading h2 { color: var(--ink); font-size: 17px; margin: 0; }
.library-group-heading span { color: var(--muted); font-size: 12px; }
.library-phase-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 22px; }
.library-phase-tabs .tab { align-items: flex-start; border-radius: 9px; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.library-phase-tabs .tab span { font-size: 13px; font-weight: 800; }
.library-phase-tabs .tab small { color: var(--muted); font-size: 10.5px; }
.library-phase-tabs .tab.active small { color: rgba(255,255,255,.8); }
.library-thumb-check-item { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.library-thumb-check-item .lesson-card { border: 0; border-radius: 0; }
.library-card-check { align-items: center; background: var(--surface); border: 0; border-bottom: 1px solid var(--line); display: flex; gap: 7px; margin: 0; padding: 9px 11px; }
.library-card-check input { height: 18px; margin: 0; width: 18px; }
.library-card-check span { color: var(--teal-dark); font-size: 12px; font-weight: 800; }
.library-thumb-check-item.done .lesson-thumb { filter: saturate(.55); opacity: .72; }
.library-thumb-check-item.done .lesson-title { text-decoration: line-through; }
.lesson-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: inherit;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  width: 100%;
}
.lesson-card:hover {
  border-color: var(--teal);
}
.lesson-thumb {
  align-items: center;
  aspect-ratio: 16 / 9;
  background: var(--sub);
  color: var(--faint);
  display: flex;
  justify-content: center;
}
.lesson-thumb img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}
.lesson-body {
  padding: 12px;
}
.lesson-track {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 7px;
}
.lesson-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}
.modal-overlay {
  align-items: center;
  background: rgba(23, 33, 31, 0.48);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 2000;
}
.modal-overlay.show {
  display: flex;
}
.modal {
  background: #fff;
  border-radius: 8px;
  max-height: min(80vh, 720px);
  max-width: 760px;
  overflow-y: auto;
  padding: 24px;
  width: 100%;
}
.modal-header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}
.modal-header h2 {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.5;
}
.modal-close {
  flex: 0 0 auto;
}
.resource-embed {
  aspect-ratio: 16 / 9;
  background: #000;
  margin: 8px 0;
  width: 100%;
}
.resource-embed iframe {
  border: 0;
  height: 100%;
  width: 100%;
}
.resource-link-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--teal-dark);
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
  padding: 10px 12px;
  text-decoration: none;
}
.video-status-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin: 0 0 16px;
}
.video-status-row .video-status-text {
  color: var(--muted);
  font-size: 12px;
}
.video-status-row .btn {
  font-size: 12.5px;
  min-height: 34px;
  padding: 6px 12px;
}
.week-switch {
  align-items: center;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  margin-bottom: 22px;
  text-align: center;
}
.week-switch .label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
  padding: 0 8px;
}
.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.metric-grid .field {
  margin-bottom: 0;
}
.history-scroll {
  overflow-x: auto;
}
.history-table {
  border-collapse: collapse;
  font-size: 12px;
  min-width: 560px;
  width: 100%;
}
.history-table th,
.history-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  text-align: left;
  white-space: nowrap;
}
.history-table th {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 800px) {
  .container {
    padding: 24px 0 88px;
    width: min(100% - 32px, 620px);
  }
  .page-title {
    font-size: 23px;
  }
  #student-nav {
    border-bottom: 0;
    border-top: 1px solid var(--line);
    bottom: 0;
    position: fixed;
    top: auto;
  }
  #student-nav .nav-inner {
    gap: 0;
    justify-content: space-around;
    min-height: 58px;
    padding: 0 6px var(--safe-bottom);
  }
  #student-nav .site-brand {
    display: none;
  }
  #student-nav .nav-item {
    border-bottom: 0;
    border-top: 2px solid transparent;
    flex: 1;
    flex-direction: column;
    font-size: 10px;
    gap: 2px;
    justify-content: center;
    min-height: 58px;
    min-width: 0;
    padding: 5px 2px 2px;
  }
  #student-nav .nav-label {
    line-height: 1.2;
    white-space: nowrap;
  }
  #student-nav .nav-item:hover,
  #student-nav .nav-item.active {
    border-bottom: 0;
    border-top-color: var(--teal);
  }
  #student-nav .nav-icon svg {
    height: 18px;
    width: 18px;
  }
  #toast-container {
    bottom: calc(72px + var(--safe-bottom));
  }
  .home-grid {
    gap: 0;
    grid-template-columns: 1fr;
  }
  .home-aside {
    border-top: 1px solid var(--line);
    margin-top: 24px;
    padding-top: 20px;
  }
  .lesson-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gate-layout {
    padding: 0;
  }
  .gate-brand {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    padding: 28px 24px;
  }
  .gate-brand p {
    display: none;
  }
  .gate-panel {
    padding: 48px 24px;
  }
}
@media (max-width: 480px) {
  .container {
    width: min(100% - 24px, 620px);
  }
  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding-bottom: 18px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-span-2 {
    grid-column: auto;
  }
  .readonly-grid {
    grid-template-columns: 1fr;
  }
  .lesson-grid {
    gap: 10px;
  }
  .lesson-body {
    padding: 10px;
  }
  .lesson-title {
    font-size: 12px;
  }
  .filter-tabs {
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .library-tools {
    align-items: stretch;
    flex-direction: column;
  }
  .result-count {
    text-align: right;
  }
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    border-radius: 8px 8px 0 0;
    max-height: 88vh;
    padding: 20px 16px calc(20px + var(--safe-bottom));
  }
  .welcome-name {
    font-size: 24px;
  }
}

/* ===== staff.html（講師・運営用。入力フォームなし・受講生の下タブナビ無し） ===== */
.badge.warn {
  background: #fff3d6;
  color: #8a5a00;
}
.badge.danger {
  background: #fde8e6;
  color: var(--danger);
}
.staff-topbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 18px;
}
.staff-me {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  gap: 8px;
}
.staff-actions {
  display: flex;
  gap: 8px;
}
.staff-summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}
.staff-summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}
.staff-summary-card.warn {
  background: #fff8ea;
  border-color: #f2d38f;
}
.staff-summary-num {
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
}
.staff-summary-label {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.staff-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.staff-filters input[type="search"] {
  border: 1px solid var(--line);
  border-radius: 6px;
  flex: 1 1 220px;
  padding: 9px 12px;
}
.staff-filters select {
  border: 1px solid var(--line);
  border-radius: 6px;
  flex: 0 0 auto;
  padding: 9px 10px;
}
.staff-table-wrap {
  overflow-x: auto;
}
.staff-table {
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 980px;
  width: 100%;
}
.staff-table th,
.staff-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}
.staff-table th {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.staff-table tbody tr {
  cursor: pointer;
}
.staff-table tbody tr:hover {
  background: var(--sub);
}
.staff-name {
  color: var(--ink);
  font-weight: 700;
}
.staff-kana,
.staff-sub {
  color: var(--muted);
  font-size: 11px;
}
.staff-progress-cell {
  width: 110px;
}
.staff-progress-text {
  font-size: 11.5px;
  margin-bottom: 4px;
}
.staff-payment-cell {
  width: 110px;
}
.staff-detail-section {
  margin-top: 18px;
}
.staff-detail-section h3 {
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 8px;
}
.staff-month-block {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 8px;
  padding: 10px 12px;
}
.staff-month-block summary {
  cursor: pointer;
  list-style: none;
}
.staff-month-block summary::-webkit-details-marker {
  display: none;
}
.staff-month-title {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
}
.staff-task-line {
  font-size: 12.5px;
  padding: 4px 0 4px 2px;
}
.staff-task-line.done {
  color: var(--body);
}
.staff-task-line.pending {
  color: var(--faint);
}
.staff-tabs {
  -webkit-overflow-scrolling: touch;
}
.staff-checkbox {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 12.5px;
  gap: 6px;
}
.staff-checkbox input {
  accent-color: var(--teal);
  height: 16px;
  width: 16px;
}
.staff-link {
  color: var(--teal-dark);
  cursor: pointer;
  font-weight: 700;
}
.staff-link:hover {
  text-decoration: underline;
}
.staff-followup-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.staff-followup-row {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1.2fr 2fr auto;
  padding: 12px 14px;
}
.staff-followup-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.staff-followup-seen {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}
.staff-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.staff-chip {
  background: var(--sub);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
}
.staff-chip:hover {
  background: var(--pink-bg);
}
.staff-review-cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.staff-rank-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 140px 1fr 90px;
  margin-bottom: 8px;
}
.staff-rank-name {
  font-size: 13px;
  font-weight: 700;
}
@media (max-width: 800px) {
  .staff-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .staff-filters input[type="search"] {
    flex-basis: 100%;
  }
  .staff-followup-row {
    grid-template-columns: 1fr;
  }
  .staff-followup-seen {
    text-align: left;
  }
  .staff-rank-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* 運営プレビュー（?staff_preview=）バナー。#student-nav（sticky top:0）の直前に挿入されるので
   ドキュメント順に並ぶだけで良く、position:fixed は使わない（下タブナビ・トーストとも重ならない） */
#staff-preview-bar {
  align-items: center;
  background: var(--teal-bg);
  border-bottom: 2px solid var(--pink);
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
  padding: 10px 16px;
}
.staff-preview-msg {
  color: var(--teal-dark);
  flex: 1 1 240px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}
.staff-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#staff-preview-bar .btn {
  font-size: 12px;
  min-height: 32px;
  padding: 6px 10px;
}

/* 占いアフィコース */
.fortune-home,
.fortune-sheet,
.fortune-progress-summary,
.fortune-phase {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.fortune-home {
  padding: 22px;
}
.fortune-home-heading,
.page-header {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
}
.fortune-home-heading h2 {
  color: var(--ink);
  font-size: 22px;
  margin: 4px 0 6px;
}
.fortune-home-heading p,
.fortune-source-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.fortune-source-note {
  margin-bottom: 8px;
}
.fortune-source-note .text-link {
  margin-left: 8px;
}
.fortune-progress-card {
  align-items: center;
  background: var(--sub);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(112px, auto) 1fr;
  margin: 20px 0;
  padding: 16px;
}
.fortune-next-phase {
  color: var(--muted);
  font-size: 13px;
  margin: 5px 0 12px;
}
.fortune-progress-summary {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 14px;
  padding: 14px 16px;
}
.fortune-progress-summary > span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.fortune-phase-list {
  display: grid;
  gap: 10px;
}
.fortune-now-task,
.fortune-phase-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.fortune-now-task {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 14px 16px;
}
.fortune-now-task span,
.fortune-now-task small {
  color: var(--muted);
  display: block;
  font-size: 12px;
}
.fortune-now-task span {
  color: var(--teal-dark);
  font-weight: 800;
  margin-bottom: 3px;
}
.fortune-now-task strong {
  color: var(--ink);
  display: block;
  font-size: 14px;
  line-height: 1.5;
}
.fortune-now-task small {
  margin-top: 3px;
}
.fortune-phase-switcher {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}
.fortune-phase-button {
  align-items: center;
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 8px;
  justify-content: space-between;
  padding: 10px 12px;
  text-align: left;
}
.fortune-phase-button:hover,
.fortune-phase-button.active {
  border-color: var(--teal);
}
.fortune-phase-button.active {
  background: var(--teal-bg);
  color: var(--ink);
}
.fortune-phase-button span {
  font-size: 13px;
  font-weight: 700;
}
.fortune-phase-button small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.fortune-phase-panel {
  padding: 16px;
}
.fortune-phase-panel-heading {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}
.fortune-phase-panel-heading h2 {
  color: var(--ink);
  font-size: 17px;
  margin: 0;
}
.fortune-phase-panel-heading p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0;
}
.fortune-task-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fortune-task-filters button {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 9px;
}
.fortune-task-filters button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.fortune-group-select {
  display: grid;
  gap: 5px;
  margin: 14px 0;
}
.fortune-group-select span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.fortune-group-select select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 9px 10px;
  width: 100%;
}
.fortune-phase {
  overflow: hidden;
}
.fortune-phase summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  list-style: none;
  padding: 15px 16px;
}
.fortune-phase summary::-webkit-details-marker {
  display: none;
}
.fortune-phase summary strong,
.fortune-phase summary small {
  display: block;
}
.fortune-phase summary strong {
  color: var(--ink);
  font-size: 15px;
}
.fortune-phase summary small,
.fortune-phase-count {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.fortune-phase-body {
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
}
.fortune-group + .fortune-group {
  margin-top: 18px;
}
.fortune-group h3 {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 8px;
}
.fortune-task {
  border-top: 1px solid var(--line);
  padding: 11px 0;
}
.fortune-task:first-of-type {
  border-top: 0;
}
.fortune-task-main,
.fortune-task-check {
  align-items: flex-start;
  display: flex;
}
.fortune-task-main {
  gap: 10px;
  justify-content: space-between;
}
.fortune-task-check {
  cursor: pointer;
  flex: 1;
  gap: 10px;
  min-width: 0;
}
.fortune-task.current {
  background: var(--teal-bg);
  border-radius: 6px;
  margin: 5px -8px;
  padding: 11px 8px;
}
.fortune-current-label {
  background: var(--teal);
  border-radius: 999px;
  color: #fff;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 7px;
}
.fortune-task input {
  accent-color: var(--teal);
  flex: 0 0 auto;
  height: 18px;
  margin-top: 2px;
  width: 18px;
}
.fortune-task.done .fortune-task-title {
  color: var(--muted);
  text-decoration: line-through;
}
.fortune-task.gate {
  background: var(--pink-bg);
  border-radius: 6px;
  margin-top: 8px;
  padding: 12px;
}
.fortune-task-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}
.fortune-task-details {
  margin: 7px 0 0 28px;
}
.fortune-task-details summary {
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
}
.fortune-task-detail-body {
  border-left: 2px solid var(--line);
  margin-top: 7px;
  padding-left: 10px;
}
.fortune-task-detail {
  color: var(--body);
  font-size: 13px;
  line-height: 1.65;
}
.fortune-task-detail span {
  color: var(--faint);
  font-size: 12px;
  font-weight: 700;
  margin-right: 6px;
}
.fortune-task-metas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 7px;
}
.fortune-task-meta {
  color: var(--muted);
  font-size: 12px;
}
.fortune-task-meta span {
  color: var(--faint);
  margin-right: 4px;
}
.fortune-task-empty {
  margin-top: 12px;
}
/* フリーランスのタスク行だけで使う。kpiバッジと動画/資料リンク（常に見える部分） */
.fortune-task-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
  margin: 5px 0 0 28px;
}
.fortune-task-links a {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 700;
}
.fortune-number,
.fortune-gate-label {
  color: var(--teal-dark);
  display: inline-block;
  font-size: 12px;
  margin-right: 7px;
}
.fortune-gate-label {
  color: var(--pink-dark);
}
.fortune-task-meta a,
.text-link {
  color: var(--teal-dark);
  font-weight: 700;
}
.fortune-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.fortune-tabs .tab {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 11px;
}
.fortune-tabs .tab:hover {
  border-color: var(--teal);
  color: var(--ink);
}
.fortune-tabs .tab.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.fortune-tabs .tab:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--teal) 35%, transparent);
  outline-offset: 2px;
}
.fortune-sheet {
  padding: 18px;
}
.fortune-sheet > h2 {
  color: var(--ink);
  font-size: 19px;
  margin: 0 0 16px;
}
.fortune-image {
  margin: 0 0 18px;
}
.fortune-image img {
  border: 1px solid var(--line);
  border-radius: 7px;
  display: block;
  max-width: 100%;
}
.fortune-image figcaption {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}
.fortune-rows {
  display: grid;
  gap: 0;
}
.fortune-row {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(var(--fortune-columns), minmax(0, 1fr));
  padding: 10px 0;
}
.fortune-row > div {
  color: var(--body);
  font-size: 13px;
  line-height: 1.65;
  min-width: 0;
  white-space: pre-wrap;
}
.fortune-inline-tab,
.fortune-search-results button {
  background: transparent;
  border: 0;
  color: var(--teal-dark);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
  text-decoration: underline;
}
.fortune-table-wrap {
  overflow-x: auto;
}
.fortune-table {
  border-collapse: collapse;
  min-width: 620px;
  width: 100%;
}
.fortune-table td {
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.55;
  padding: 9px;
  vertical-align: top;
  white-space: pre-wrap;
}
.fortune-copy {
  align-items: flex-start;
  background: var(--sub);
  border-radius: 8px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 14px;
}
.fortune-copy h3 {
  color: var(--ink);
  font-size: 14px;
  margin: 0 0 8px;
}
.fortune-copy pre {
  font-family: inherit;
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
  white-space: pre-wrap;
}
.fortune-search-results {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.fortune-search-results button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  text-decoration: none;
}
.fortune-search-results strong,
.fortune-search-results span {
  display: block;
}
.fortune-search-results span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.fortune-progress-panel > p {
  color: var(--muted);
  font-size: 13px;
}
.fortune-progress-table > div {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto auto;
  padding: 10px 0;
}
.fortune-progress-table strong {
  color: var(--ink);
  font-size: 13px;
}
.fortune-progress-table span {
  color: var(--muted);
  font-size: 12px;
}

/* 教材ライブラリ。目次を軸にし、長い教材本文と移動操作を分離する。 */
.fortune-library-header { margin-bottom: 16px; }
.fortune-library-start {
  align-items: center;
  background: linear-gradient(120deg, var(--teal-dark), #225e63);
  border-radius: 14px;
  color: #fff;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 22px;
}
.fortune-library-eyebrow { color: #bdebe7; display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; margin-bottom: 5px; }
.fortune-library-start h2 { color: #fff; font-size: 18px; line-height: 1.55; margin: 0; }
.fortune-library-start p { color: #d9f1ef; font-size: 12px; margin: 5px 0 0; }
.fortune-library-start-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 8px; }
.fortune-library-start .btn { background: #fff; color: var(--teal-dark); }
.fortune-library-start .btn.secondary { background: transparent; border-color: rgba(255,255,255,.55); color: #fff; }
.fortune-library-browser { margin-top: 22px; }
.fortune-library-browser-head { align-items: end; display: flex; gap: 18px; justify-content: space-between; margin-bottom: 10px; }
.fortune-library-browser-head h2 { color: var(--ink); font-size: 21px; margin: 3px 0; }
.fortune-library-browser-head p { color: var(--muted); font-size: 13px; margin: 0; }
.fortune-library-layout { align-items: start; display: grid; gap: 16px; grid-template-columns: minmax(210px, 250px) minmax(0, 1fr); margin-top: 10px; }
.fortune-library-index { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px; position: sticky; top: 16px; }
.fortune-library-index section + section { border-top: 1px solid var(--line); margin-top: 9px; padding-top: 9px; }
.fortune-library-index h3 { color: var(--faint); font-size: 11px; letter-spacing: .04em; margin: 4px 7px 6px; }
.fortune-library-index button { appearance: none; background: transparent; border: 0; border-radius: 7px; color: var(--ink); cursor: pointer; display: block; font: inherit; padding: 9px 10px; text-align: left; width: 100%; }
.fortune-library-index button:hover { background: var(--sub); }
.fortune-library-index button.active { background: var(--teal-bg); box-shadow: inset 3px 0 var(--teal); }
.fortune-library-index button span { display: block; font-size: 13px; font-weight: 800; }
.fortune-library-index button small { color: var(--muted); display: block; font-size: 10.5px; line-height: 1.45; margin-top: 2px; }
.fortune-library-mobile-select { display: none; }
.fortune-sheet-heading { align-items: flex-start; border-bottom: 1px solid var(--line); display: flex; gap: 14px; justify-content: space-between; margin: 0 0 16px; padding-bottom: 14px; }
.fortune-sheet-heading span { color: var(--teal-dark); font-size: 11px; font-weight: 800; }
.fortune-sheet-heading h2 { color: var(--ink); font-size: 20px; margin: 3px 0; }
.fortune-sheet-heading p { color: var(--muted); font-size: 12px; margin: 0; }
.fortune-index-jump { appearance: none; background: transparent; border: 0; color: var(--teal-dark); cursor: pointer; display: none; font: inherit; font-size: 12px; font-weight: 700; padding: 5px; }
@media (max-width: 800px) {
  .fortune-home,
  .fortune-sheet {
    padding: 16px;
  }
  .fortune-progress-card,
  .fortune-progress-summary,
  .fortune-progress-table > div {
    grid-template-columns: 1fr;
  }
  .fortune-now-task,
  .fortune-phase-panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .fortune-phase-switcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fortune-task-filters {
    width: 100%;
  }
  .fortune-progress-summary > span {
    white-space: normal;
  }
  .fortune-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .fortune-copy {
    flex-direction: column;
  }
  .fortune-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .fortune-library-start { align-items: flex-start; flex-direction: column; padding: 18px; }
  .fortune-library-start-actions { width: 100%; }
  .fortune-library-start-actions .btn { flex: 1 1 140px; text-align: center; }
  .fortune-library-browser-head { align-items: stretch; flex-direction: column; }
  .fortune-library-browser-head .library-search { max-width: none; }
  .fortune-library-layout { grid-template-columns: 1fr; }
  .fortune-library-index { display: none; }
  .fortune-library-mobile-select { display: grid; gap: 5px; margin: 14px 0 8px; }
  .fortune-library-mobile-select span { color: var(--muted); font-size: 12px; font-weight: 700; }
  .fortune-library-mobile-select select { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font: inherit; font-size: 15px; font-weight: 700; padding: 12px; width: 100%; }
  .fortune-index-jump { display: block; }
  .library-phase-tabs { display: flex; overflow-x: auto; padding-bottom: 5px; }
  .library-phase-tabs .tab { flex: 0 0 116px; }
}
