:root {
  --bg0: #f3efe6;
  --bg1: #e7eef2;
  --ink: #1c2430;
  --muted: #5b6775;
  --accent: #0f6a5b;
  --line: rgba(28, 36, 48, 0.12);
  --font-sans: "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif;
  --font-display: "Avenir Next", "Hiragino Sans", "Noto Sans JP", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: var(--font-sans);
  background:
    radial-gradient(900px 480px at 10% -10%, #fff8e8 0%, transparent 55%),
    radial-gradient(700px 420px at 100% 0%, #d9ebe6 0%, transparent 50%),
    linear-gradient(160deg, var(--bg0), var(--bg1));
}

.shell {
  max-width: 40rem;
  margin: 0 auto;
  padding: 18vh 1.5rem 3rem;
}

.shell-login {
  max-width: 56rem;
  padding-top: 8vh;
}

.shell-login .site-banner--hero {
  max-width: none;
  width: 100%;
}

.shell-login .site-banner-hero-wrap {
  margin-bottom: 1.5rem;
}

.brand {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  line-height: 1;
}

.site-banner {
  display: block;
  height: auto;
  max-width: 100%;
  border-radius: 0.55rem;
  overflow: hidden;
}

.site-banner--hero {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
}

.site-banner--sm {
  width: 400px;
  max-width: min(400px, 100%);
}

.site-banner-hero-wrap {
  margin: 0 0 1.25rem;
  text-align: center;
}

.site-banner-link {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
}

h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 600;
}

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

.meta {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.meta a {
  color: var(--accent);
}

.shell-wide {
  max-width: 52rem;
  padding-top: 3rem;
}

/* 教師の作業画面（入力・評定など）は横幅いっぱい */
.shell-fluid {
  max-width: none;
  width: 100%;
  padding-top: 3rem;
}

/* 教科担任ダッシュボード: 左寄せ */
.shell-dash {
  max-width: 72rem;
  width: 100%;
  margin-left: 0;
  margin-right: auto;
  padding-top: 3rem;
}

.brand-sm {
  font-size: 1.6rem;
  margin: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  margin-bottom: 0.55rem;
  min-height: 0;
  line-height: 1.2;
}

.topbar .site-banner-link {
  flex: 0 1 auto;
  min-width: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.4rem;
  margin: 0 0 1.15rem;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.25;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.crumb-label {
  color: var(--muted);
  margin-right: 0.15rem;
}

.crumb-sep {
  color: var(--muted);
  user-select: none;
}

.crumb-current {
  color: var(--ink);
  font-weight: 600;
}

.form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.login-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.75rem 0 0.5rem;
}

.login-demo-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
  margin-top: 1.25rem;
}

.login-panel {
  margin-top: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.login-panel h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.login-panel .lead {
  flex: 1;
}

.login-panel .form {
  margin-top: 0.85rem;
}

.login-org-link {
  margin: 0.85rem 0 0;
  font-size: 0.95rem;
}

.login-org-link a {
  color: var(--accent);
}

@media (max-width: 40rem) {
  .login-demo-cols {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
}

.form input {
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: rgba(255, 255, 255, 0.75);
}

.form button,
.linkish {
  appearance: none;
  border: 0;
  border-radius: 0.4rem;
  background: var(--accent);
  color: #fff;
  font: inherit;
  padding: 0.75rem 1rem;
  cursor: pointer;
}

.linkish {
  background: transparent;
  color: var(--accent);
  padding: 0.35rem 0.5rem;
  text-decoration: underline;
}

.flash {
  margin: 1rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 0.4rem;
}

.flash-error {
  background: #fde8e6;
  color: #8a2b22;
}

.panel {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

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

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

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

code {
  font-size: 0.9em;
}

.nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav a:hover {
  text-decoration: underline;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.actions {
  margin: 1.25rem 0 0;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 0.4rem;
  padding: 0.7rem 1rem;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.85rem;
  margin-top: 1.75rem;
}

.dash-groups {
  display: grid;
  gap: 2rem;
  margin-top: 1.75rem;
}

.dash-group h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.dash-group .menu-grid {
  margin-top: 0;
}

.work-pane-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem 1rem;
  margin: 0 0 0.85rem;
}

.work-pane-bar .grade-item-bar {
  margin: 0;
  flex: 1 1 auto;
}

.work-pane-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.work-pane-bar:has(.grade-item-bar) .work-pane-actions {
  margin-left: auto;
}

.work-context {
  margin: 0.15rem 0 0.85rem;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink);
}

.work-context strong {
  font-weight: 700;
  color: var(--accent);
}

.work-layout {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-top: 1.25rem;
}

.work-layout--solo {
  grid-template-columns: 1fr;
}

.work-context + .work-layout,
.work-top-tabs + .work-layout {
  margin-top: 0;
}

.work-side {
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.work-nav {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.65rem;
}

.score-dist {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.55rem 0.45rem 0.4rem;
}

.score-dist-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent);
  text-align: center;
}

.score-dist canvas {
  display: block;
  width: 100%;
  height: auto;
}

.score-dist-axis {
  margin: 0.2rem 0 0;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
}

.work-nav-group + .work-nav-group {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.work-nav-subject {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent);
}

.work-nav-current {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.score-picker {
  display: grid;
  gap: 1.25rem;
  max-width: 36rem;
  margin-top: 1rem;
}

.score-picker-group {
  margin: 0;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.55);
}

.score-picker-group legend {
  padding: 0 0.35rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.score-picker-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.score-picker-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  font: inherit;
}

.score-picker-option input {
  margin: 0;
}

.score-picker-option.is-active,
.score-picker-option:has(input:checked) {
  border-color: rgba(15, 106, 91, 0.45);
  background: rgba(15, 106, 91, 0.1);
  color: var(--accent);
  font-weight: 600;
}

.work-nav a {
  display: block;
  padding: 0.35rem 0.4rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: 0.3rem;
  font-size: 0.92rem;
}

.work-nav a:hover,
.work-nav a.is-active {
  background: rgba(15, 106, 91, 0.12);
  color: var(--accent);
}

.work-input-alerts {
  border: 1px solid rgba(160, 90, 40, 0.35);
  border-radius: 0.5rem;
  background: rgba(255, 248, 235, 0.9);
  padding: 0.55rem 0.6rem;
}

.work-input-alerts-head {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #8a4b16;
}

.work-input-alert-block + .work-input-alert-block {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(160, 90, 40, 0.2);
}

.work-input-alert-title {
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #8a4b16;
}

.work-input-alert-msg {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #5c3a1a;
}

.work-main {
  min-width: 0;
}

.work-top-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.15rem 0.1rem;
  margin: 0 0 1rem;
  padding: 0;
  border-bottom: 3px solid var(--line);
}

.work-top-tab {
  display: inline-block;
  padding: 0.55rem 0.95rem 0.5rem;
  margin-bottom: -3px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0.35rem 0.35rem 0 0;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
  background: transparent;
}

.work-top-tab:hover {
  color: var(--accent);
  background: rgba(15, 106, 91, 0.06);
}

.work-top-tab.is-active {
  color: var(--accent);
  font-weight: 700;
  border-bottom-color: var(--accent);
  background: rgba(15, 106, 91, 0.06);
}

.work-panel {
  min-height: 8rem;
}

.work-panel > .meta {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  margin-bottom: 0.85rem;
  color: var(--muted);
}

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

.menu-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.55);
  color: inherit;
  text-decoration: none;
}

.menu-card strong {
  font-size: 1.05rem;
}

.menu-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.form-inline {
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  align-items: end;
  margin-bottom: 1.5rem;
}

.form select {
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: rgba(255, 255, 255, 0.75);
}

.check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.7rem;
}

.menu-card-accent {
  border-color: rgba(15, 106, 91, 0.35);
  background: rgba(15, 106, 91, 0.08);
}

.sheet-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0 0.75rem;
}

.sheet-toolbar--inline {
  justify-content: flex-start;
}

.sheet-toolbar-lead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.sheet-toolbar-title {
  line-height: 1.4;
}

.sheet-toolbar--inline .sheet-status {
  margin-left: 0;
}

.sheet-status {
  margin-left: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.sheet-status[data-kind="dirty"] {
  color: #9a5b00;
}

.sheet-status[data-kind="error"] {
  color: #8a2b22;
}

.sheet-status[data-kind="ok"] {
  color: var(--accent);
}

.sheet-wrap {
  overflow: auto;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.7);
}

.sheet {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  max-width: 100%;
  font-size: 0.92rem;
}

.sheet th,
.sheet td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0;
  white-space: nowrap;
}

.sheet th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef4f2;
  padding: 0.55rem 0.65rem;
  font-weight: 600;
  text-align: center;
}

.sheet .sticky-col {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f7faf8;
  padding: 0.45rem 0.65rem;
  min-width: 4.5rem;
}

.sheet .sheet-seat {
  min-width: 2.25rem;
  width: 2.25rem;
  max-width: 2.5rem;
  padding: 0.45rem 0.25rem;
  text-align: center;
}

.sheet .sticky-col-2 {
  left: 2.25rem;
  min-width: 7rem;
  border-right: 2px solid var(--line);
}

.sheet thead .sticky-col {
  z-index: 3;
}

.sheet td.meta {
  color: var(--muted);
}

.sheet-cell {
  width: 4.5rem;
  border: 0;
  background: transparent;
  text-align: right;
  padding: 0.45rem 0.5rem;
  font: inherit;
}

.sheet-cell:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: #fff;
}

.sheet-cell.is-dirty {
  background: #fff6e5;
}

.sheet-cell.is-over-fullmark {
  background: #fde8e6;
  box-shadow: inset 0 0 0 2px rgba(138, 43, 34, 0.45);
}

.sheet-fullmark-hint {
  font-weight: 500;
  font-size: 0.78em;
  color: var(--muted);
}

.work-pane-bar--scores {
  justify-content: flex-start;
  gap: 0.75rem 1rem;
}

.work-pane-bar--scores .score-fullmark-summary {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.work-pane-bar--scores .sheet-status {
  margin-left: 0;
  text-align: left;
}

.score-need-fullmarks {
  font-size: 1.05rem;
  color: #8a2b22;
  font-weight: 600;
}

.sheet-fullmarks {
  width: auto;
  min-width: 12rem;
}

.sheet-total-h,
.sheet-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sheet-total {
  min-width: 3.5rem;
  font-weight: 600;
  color: var(--ink);
}

.muted {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.85em;
}

.meta-inline {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.35rem 0.75rem;
}

.perm-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 2rem;
  margin: 0.5rem 0 1.25rem;
  align-items: start;
}

.perm-col h2 {
  margin: 0 0 0.65rem;
}

.perm-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

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

.flash-slot {
  min-height: 1.55rem;
  margin: 0.35rem 0 0.65rem;
}

.flash-msg {
  margin: 0;
  min-height: 1.35rem;
  font-size: 0.9rem;
  line-height: 1.35;
  font-weight: 600;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.flash-msg.is-on {
  opacity: 1;
}

.settings-layout {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 1.5rem;
  align-items: start;
}

.settings-nav {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.75rem;
}

.settings-nav-title {
  margin: 0 0 0.5rem;
  font-weight: 700;
  color: var(--accent);
}

.settings-nav a {
  display: block;
  padding: 0.35rem 0.4rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: 0.3rem;
  font-size: 0.92rem;
}

.settings-nav a:hover,
.settings-nav a.is-active {
  background: rgba(15, 106, 91, 0.12);
  color: var(--accent);
}

.settings-nav-foot {
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

.settings-main h2 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.05rem;
}

.pattern-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0 0.85rem;
}

.pattern-tab {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-width: 4.5rem;
  padding: 0.55rem 0.9rem;
  border: 2px solid var(--accent);
  border-radius: 0.45rem;
  background: #fff;
  color: var(--accent);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(28, 36, 48, 0.08);
  transition: background 0.12s ease, color 0.12s ease, transform 0.08s ease;
}

.pattern-tab:hover {
  background: rgba(15, 106, 91, 0.1);
}

.pattern-tab:active {
  transform: translateY(1px);
  box-shadow: none;
}

.pattern-tab.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.pattern-tab.is-active .pattern-tab-no,
.pattern-tab.is-active .pattern-tab-label {
  color: #fff;
}

.pattern-tab.is-empty:not(.is-active) {
  border-style: dashed;
  opacity: 0.85;
}

.pattern-tab.is-empty .pattern-tab-label {
  color: var(--muted);
  font-weight: 400;
}

.pattern-tab.is-active.is-empty .pattern-tab-label {
  color: rgba(255, 255, 255, 0.85);
}

.pattern-tab-no {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.pattern-tab-label {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  max-width: 6.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pattern-editor {
  margin: 0 0 1.5rem;
  padding: 1rem 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.55);
}

.pattern-editor h2 {
  margin: 0 0 0.85rem;
  color: var(--accent);
}

.pattern-editor .form {
  margin-top: 0;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.inline-form {
  display: inline;
  margin: 0;
}

.button-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.term-slot {
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  padding: 0.75rem 1rem 1rem;
  margin: 0 0 1rem;
  background: rgba(255, 255, 255, 0.4);
}

.term-slot legend {
  padding: 0 0.35rem;
  font-weight: 700;
  color: var(--accent);
}

.name-with-short {
  display: grid;
  grid-template-columns: 1fr 7.5rem;
  gap: 0.75rem;
  align-items: end;
}

.name-with-short .short-name input {
  max-width: 100%;
}

.term-pattern-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
  align-items: end;
}

.term-pattern-row label {
  min-width: 0;
}

@media (max-width: 700px) {
  .name-with-short {
    grid-template-columns: 1fr;
  }
  .term-pattern-row {
    grid-template-columns: 1fr;
  }
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

button.linkish {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

p.error {
  color: #a33;
  background: rgba(170, 50, 50, 0.08);
  border: 1px solid rgba(170, 50, 50, 0.25);
  border-radius: 0.4rem;
  padding: 0.6rem 0.8rem;
}

.school-home-panel {
  margin: 1rem 0 1.5rem;
}

.col-order {
  width: 4.5rem;
  white-space: nowrap;
}

.order-btns {
  display: flex;
  gap: 0.2rem;
}

.order-btn {
  min-width: 1.75rem;
  padding: 0.15rem 0.35rem;
  font-size: 0.9rem;
  line-height: 1.2;
}

.order-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.subject-edit {
  margin: 0;
  gap: 0.4rem;
  align-items: center;
}

.subject-edit input[type="text"] {
  min-width: 10rem;
}

.teacher-cred-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  line-height: 1.3;
}

.teacher-cred-cell code {
  font-size: 0.92rem;
}

.teacher-cred-pass {
  color: var(--muted);
  font-weight: 600;
}

.teacher-furigana-input {
  width: 100%;
  min-width: 10rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  font: inherit;
  box-sizing: border-box;
}

.table-actions.actions-tight {
  gap: 0.35rem;
}

.btn-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--accent);
  border-radius: 0.3rem;
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}

.btn-compact:hover {
  background: rgba(15, 106, 91, 0.08);
}

.btn-compact-danger {
  border-color: rgba(170, 50, 50, 0.45);
  color: #a33;
}

.btn-compact-danger:hover {
  background: rgba(170, 50, 50, 0.08);
}

.cred-notice {
  background: rgba(15, 106, 91, 0.08);
  border: 1px solid rgba(15, 106, 91, 0.25);
  border-radius: 0.5rem;
  padding: 0.85rem 1rem 1rem;
  margin: 1rem 0 1.25rem;
}

.cred-notice h2 {
  margin: 0 0 0.35rem;
  color: var(--accent);
}

.cred-list {
  display: grid;
  gap: 0.45rem;
  margin: 0.75rem 0 0;
}

.cred-list > div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.5rem;
  align-items: baseline;
}

.cred-list dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.cred-list dd {
  margin: 0;
}

.cred-list code {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.assign-filters {
  margin: 1rem 0 0.5rem;
  align-items: flex-end;
}

.assign-filters select {
  min-width: 12rem;
}

.grade-tabs {
  margin-top: 1.25rem;
}

.assign-classes {
  margin: 0.5rem 0 1.5rem;
}

.class-toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.class-toggle-row {
  margin: 0 0 0.75rem;
}

.class-toggle-row:last-child {
  margin-bottom: 0;
}

.assign-overview {
  margin: 1.25rem 0 1.5rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.55);
}

.assign-overview h2 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  color: var(--accent);
}

.assign-overview-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}

.assign-overview-list li {
  font-size: 0.98rem;
  line-height: 1.45;
}

.roster-form {
  margin: 1rem 0 1.5rem;
}

.roster-csv-label {
  display: block;
  width: 100%;
}

.roster-csv {
  display: block;
  width: 100%;
  min-height: 12rem;
  margin-top: 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre;
  tab-size: 4;
}

.roster-preview {
  margin: 0 0 2rem;
}

.roster-class {
  margin: 0 0 1.75rem;
}

.roster-class h2 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  color: var(--accent);
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
}

.roster-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-height: 3.1rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.65);
}

.roster-cell.has-note,
.roster-cell.has-gender {
  padding-right: 1.6rem;
}

.roster-cell.has-note.has-gender {
  padding-right: 2.4rem;
}

.roster-cell.is-missing {
  background: rgba(196, 90, 40, 0.12);
  border-color: rgba(196, 90, 40, 0.45);
  color: #9a4a1f;
}

.roster-seat {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.roster-cell.is-missing .roster-seat {
  color: #9a4a1f;
}

.roster-name {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  word-break: break-all;
}

.roster-furigana {
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--muted);
  word-break: break-all;
}

.roster-corner {
  position: absolute;
  top: 0.25rem;
  right: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  line-height: 1;
  pointer-events: none;
}

.roster-gender {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.roster-note-mark {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

.roster-note-popup {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  z-index: 5;
  min-width: 10rem;
  max-width: 16rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: #fff;
  box-shadow: 0 6px 18px rgba(28, 36, 48, 0.14);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
}

.roster-cell.has-note:hover .roster-note-popup,
.roster-cell.has-note:focus-within .roster-note-popup {
  opacity: 1;
  visibility: visible;
}

p.warn {
  color: #8a5a00;
  background: rgba(200, 140, 20, 0.1);
  border: 1px solid rgba(200, 140, 20, 0.3);
  border-radius: 0.4rem;
  padding: 0.6rem 0.8rem;
}

@media (max-width: 900px) {
  .roster-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

.class-toggle-form {
  margin: 0;
}

.class-toggle {
  min-width: 4.25rem;
  padding: 0.7rem 1rem;
  border: 2px solid var(--accent);
  border-radius: 0.45rem;
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(28, 36, 48, 0.08);
  transition: background 0.12s ease, color 0.12s ease, transform 0.08s ease;
}

.class-toggle:hover {
  background: rgba(15, 106, 91, 0.1);
}

.class-toggle:active {
  transform: translateY(1px);
  box-shadow: none;
}

.class-toggle.is-on {
  background: var(--accent);
  color: #fff;
}

@media (max-width: 800px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
}

/* 評定処理・得点入力 */
.grade-item-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
}

.grade-hidden-note {
  margin-left: 0.35rem;
  color: #9a5b00;
  font-size: 0.9rem;
  font-weight: 600;
}

.grade-item-h {
  font-size: 0.88rem;
  line-height: 1.25;
  vertical-align: middle;
}

.grade-item-h .grade-item-no,
.grade-item-h .grade-item-short {
  display: block;
  text-align: center;
}

.grade-item-h .grade-item-no {
  font-size: 0.78rem;
  font-weight: 600;
  color: #3a4540;
}

.grade-item-h .grade-item-short {
  font-size: 0.92rem;
  font-weight: 700;
}

.grade-item-h--aggregate {
  background: #f7e8e6;
}

.grade-item-h--symbol {
  background: #e8eef7;
}

.grade-cell--aggregate .sheet-cell {
  background: #faf3f2;
  color: var(--muted);
}

.grade-cell--symbol .sheet-cell {
  text-align: center;
  font-weight: 600;
}

.grade-cell--symbol .sheet-cell.is-absent,
.grade-cell--symbol .sheet-cell.is-missing {
  text-align: center;
}

.sheet-cell-host {
  position: relative;
  display: block;
  width: 4.5rem;
  min-height: 100%;
}

.sheet-cell-host .sheet-cell {
  width: 100%;
  box-sizing: border-box;
}

.sheet-cell-host .sheet-cell-face {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-weight: 600;
  line-height: 1.2;
  font: inherit;
}

.sheet-cell-host.is-absent .sheet-cell-face {
  color: #8a2b22;
}

.sheet-cell-host.is-missing .sheet-cell-face {
  color: #5b6775;
}

.sheet-cell-host:not(:focus-within):not(.is-editing) .sheet-cell {
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.sheet-cell-host:focus-within .sheet-cell-face,
.sheet-cell-host.is-editing .sheet-cell-face {
  visibility: hidden;
}

.sheet-cell.is-absent {
  color: #8a2b22;
}

.sheet-cell.is-missing {
  color: #6b5b00;
  font-weight: 600;
}

.sheet-cell.is-blank {
  background: rgba(255, 214, 120, 0.45);
}

.grade-scope-note {
  margin-left: 0.25rem;
}

.grade-weight-note {
  margin: 0 0 0.75rem;
}

.sheet-weights {
  width: max-content;
}

.sheet-weights .weight-name-h,
.sheet-weights .weight-name {
  min-width: 8rem;
  text-align: left;
}

.sheet-weights .weight-cell {
  text-align: right;
  min-width: 4.5rem;
}

.settings-weight-block {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid #d7dee6;
}

.weight-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  margin: 0.75rem 0 1rem;
  align-items: flex-end;
}

.weight-filter label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.9rem;
}

.weight-filter select {
  min-width: 10rem;
}

.sheet-ratios {
  width: max-content;
}

.sheet-ratios .ratio-row-h,
.sheet-ratios .sticky-col {
  min-width: 5.5rem;
  text-align: left;
}

.sheet-ratios .ratio-kanten-label {
  padding-left: 1.1rem;
  font-weight: 500;
  color: #4a5560;
}

.sheet-ratios .ratio-term-label {
  font-weight: 700;
}

.ratio-yearend {
  margin-top: 1.25rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #f7faf8;
  max-width: 40rem;
}

.ratio-yearend-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.ratio-yearend-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.65rem 0 0.4rem;
}

.ratio-yearend-hint {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
}

.ratio-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.ratio-chart-card {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.75rem 0.85rem 0.5rem;
  background: #fafcfb;
}

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

.ratio-chart-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.ratio-chart-term-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.ratio-chart-term-pick select {
  min-width: 8rem;
  font-size: 0.9rem;
}

.ratio-chart-card canvas {
  width: 100%;
  display: block;
}

.sheet-ratios .ratio-term-pct {
  text-align: right;
  background: #f3f6f4;
  color: #2c5f4a;
  font-weight: 600;
}

.sheet-ratios .ratio-cell,
.sheet-ratios .ratio-fullmark {
  text-align: right;
  min-width: 4.25rem;
}

.sheet-ratios .ratio-fullmark-row th,
.sheet-ratios .ratio-fullmark-row td {
  border-bottom: 2px solid #c5ced8;
}

.sheet-ratios .ratio-term-row th,
.sheet-ratios .ratio-term-row td {
  border-top: 1px solid #c5ced8;
  background: #f7faf8;
}

.sheet-ratios .ratio-test-group {
  background: #f0f4f8;
  text-align: center;
  font-weight: 600;
  border-left: 2px solid #9aafbc;
}

.sheet-ratios .ratio-test-kanten {
  background: #f5f8fb;
  font-weight: 500;
}

.sheet-ratios th.ratio-test-start,
.sheet-ratios td.ratio-test-start {
  border-left: 2px solid #9aafbc;
}

/* 表の右端（学年末グループの右）を区切りと同じ太さに */
.sheet-ratios tr > th:last-child,
.sheet-ratios tr > td:last-child {
  border-right: 2px solid #9aafbc;
}

.sheet-ratios .ratio-test-fullmark,
.sheet-ratios .ratio-test-cell {
  background: #fafcfd;
}

.sheet-cell.is-readonly {
  cursor: default;
}

.sheet-cell.is-official {
  background: #eef1ef;
  color: #3a4540;
}

.sheet-cell.is-mikomi {
  background: #fff6e8;
}

.grade-test-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
}

.grade-test-bar .button,
.grade-test-bar .sheet-status {
  margin-left: 0.25rem;
}

.grade-item-bar .button#sheet-save,
.grade-item-bar .sheet-status {
  margin-left: 0.15rem;
}

.grade-test-tab {
  display: inline-block;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  text-decoration: none;
  color: inherit;
  font-size: 0.9rem;
  background: #f4f7f5;
}

.grade-test-tab:hover {
  background: #e8eee9;
}

.grade-test-tab.is-active {
  background: #1f4d3a;
  border-color: #1f4d3a;
  color: #fff;
}

.grade-dialog {
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 1.1rem 1.25rem 1.25rem;
  max-width: 28rem;
  width: calc(100% - 2rem);
  background: #f7faf8;
  color: var(--ink);
  box-shadow: 0 12px 40px rgba(20, 40, 35, 0.18);
}

.grade-dialog::backdrop {
  background: rgba(20, 35, 30, 0.35);
}

.grade-dialog h2 {
  margin: 0 0 0.85rem;
  font-size: 1.1rem;
}

.grade-dlg-field {
  display: grid;
  gap: 0.3rem;
  margin: 0 0 0.75rem;
}

.grade-dlg-field span {
  font-size: 0.88rem;
  color: var(--muted);
}

.grade-dlg-field input,
.grade-dlg-field select {
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  background: rgba(255, 255, 255, 0.85);
}

.grade-dlg-opts {
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  padding: 0.55rem 0.75rem 0.75rem;
  margin: 0 0 0.85rem;
}

.grade-dlg-opts legend {
  padding: 0 0.3rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.grade-dlg-opts .check {
  white-space: normal;
}

.sym-sup {
  display: inline;
  font-size: 0.68em;
  vertical-align: super;
  line-height: 1;
  margin: 0 0.02em;
}

.grade-dlg-sources {
  margin: 0 0 0.85rem;
}

.grade-source-list {
  display: grid;
  gap: 0.35rem;
  max-height: 12rem;
  overflow: auto;
  padding: 0.35rem 0;
}

.grade-vis-list {
  display: grid;
  gap: 0.4rem;
  max-height: 16rem;
  overflow: auto;
  padding: 0.25rem 0 0.5rem;
}

.grade-vis-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.7);
}

.grade-vis-check {
  flex: 1;
  min-width: 0;
  margin: 0 !important;
  padding-bottom: 0 !important;
}

.grade-vis-move {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.grade-vis-move .button {
  padding: 0.25rem 0.45rem;
  min-width: 2rem;
  line-height: 1.2;
}

.ayumi-unsaved-dialog .ayumi-unsaved-msg {
  margin: 0 0 1rem;
}

.ayumi-unsaved-dialog .grade-dlg-actions {
  justify-content: flex-end;
}

.grade-dlg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.calc-term-bar {
  flex-wrap: wrap;
}

.sheet-calc th,
.sheet-calc td {
  text-align: center;
  white-space: nowrap;
}

.sheet .sticky-col.sheet-class,
.sheet th.sheet-class,
.sheet td.sheet-class {
  left: 0;
  min-width: 2.6rem;
  width: 2.6rem;
  max-width: 2.6rem;
  padding: 0.45rem 0.3rem;
  text-align: center;
  z-index: 2;
  box-sizing: border-box;
}

.sheet .sticky-col-seat {
  left: 2.6rem;
  z-index: 2;
}

.sheet:has(.sheet-class) .sticky-col-2 {
  left: 4.85rem;
}

.sheet thead .sheet-class,
.sheet thead .sticky-col-seat,
.sheet:has(.sheet-class) thead .sticky-col-2 {
  z-index: 4;
}

.sheet-calc .sticky-col-2,
.sheet-calc td.sticky-col-2 {
  text-align: left;
}

.sheet-calc .calc-term-h,
.sheet-calc .calc-detail-h {
  font-size: 0.82rem;
  min-width: 3.2rem;
}

.sheet-calc .calc-term-h,
.sheet-calc .calc-kanten-h {
  border-bottom-color: rgba(28, 36, 48, 0.08);
}

.sheet-calc .calc-sub-h {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 2.6rem;
}

.sheet-calc .calc-detail-sogo {
  min-width: 3.4rem;
}

.sheet-calc .calc-sym-h {
  font-size: 0.82rem;
  min-width: 2.4rem;
}

.sheet-calc .calc-hyoutei,
.sheet-calc .calc-detail-k-symbol {
  font-weight: 700;
}

.sheet-calc .calc-mark {
  min-width: 2.2rem;
}

.sheet-calc .calc-memo-h {
  min-width: 8rem;
  font-size: 0.82rem;
}

.sheet-calc .calc-memo-cell {
  padding: 0.15rem;
  text-align: left;
}

.sheet-calc .calc-memo-input {
  width: 8.5rem;
  min-width: 6rem;
  text-align: left;
}

.analysis-split {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
}

.analysis-roster {
  min-width: 0;
}

.analysis-roster.sheet-wrap {
  overflow: visible;
  max-height: none;
}

.sheet-analysis th,
.sheet-analysis td {
  white-space: nowrap;
}

.sheet-analysis .sticky-col-2 {
  text-align: left;
  border-right: 0;
}

.analysis-detail {
  min-width: 0;
}

.analysis-detail > .analysis-student-label {
  margin: 0 0 0.35rem;
}

.analysis-pane {
  position: sticky;
  top: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.65rem 0.75rem 0.85rem;
  min-height: 12rem;
}

.analysis-pane-title {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.analysis-student-label {
  margin: 0 0 0.45rem;
  line-height: 1.35;
  font-size: 0.95rem;
}

.analysis-block {
  margin: 0 0 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.analysis-block:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.analysis-block-title {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}

.analysis-block-lead {
  margin: -0.15rem 0 0.4rem;
}

.analysis-sub-title {
  margin: 0.45rem 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.analysis-block--soon {
  opacity: 0.72;
}

.analysis-block--soon .analysis-block-title,
.analysis-block--soon p {
  margin-bottom: 0.2rem;
}

.analysis-past-year {
  margin-top: 0.65rem;
}

.analysis-past-year:first-of-type {
  margin-top: 0.35rem;
}

.analysis-past-sheet th[scope="row"] {
  min-width: 3.5rem;
}

.analysis-year-wrap {
  overflow-x: auto;
  margin: 0;
}

.analysis-year-sheet {
  width: max-content;
  font-size: 0.8rem;
  border-collapse: collapse;
}

.analysis-year-sheet th,
.analysis-year-sheet td {
  text-align: center;
  padding: 0.15rem 0.3rem;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.2;
}

.analysis-year-sheet th[scope="row"] {
  text-align: left;
  font-weight: 600;
  padding-left: 0.2rem;
}

.analysis-cell {
  white-space: nowrap;
  min-width: 3.2rem;
  vertical-align: bottom;
}

.analysis-cell-main {
  line-height: 1.2;
}

.analysis-cell strong {
  display: inline;
}

.analysis-cell .meta {
  display: inline;
  font-size: 0.85em;
  margin-left: 0.15rem;
}

.analysis-bar {
  display: block;
  height: 0.32rem;
  margin-top: 0.18rem;
  background: rgba(30, 50, 45, 0.1);
  border-radius: 999px;
  overflow: hidden;
  min-width: 2.8rem;
}

.analysis-bar-fill {
  display: block;
  height: 100%;
  width: calc(var(--pct, 0) * 1%);
  max-width: 100%;
  background: var(--bar-color, var(--accent));
  border-radius: inherit;
}

.analysis-score-sheet {
  width: max-content;
  font-size: 0.8rem;
  border-collapse: collapse;
}

.analysis-score-sheet th,
.analysis-score-sheet td {
  text-align: center;
  padding: 0.15rem 0.35rem;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.2;
}

.analysis-score-sheet th[scope="row"],
.analysis-score-name {
  text-align: left;
  font-weight: 600;
  padding-left: 0.2rem;
}

.analysis-score-cell .is-mikomi {
  color: var(--accent);
}

.analysis-score-bar-cell {
  min-width: 5.5rem;
  width: 5.5rem;
  padding-left: 0.25rem !important;
  padding-right: 0.35rem !important;
}

.analysis-bar--row {
  margin-top: 0;
  min-width: 4.5rem;
  width: 100%;
}

.analysis-score-note {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
}

.analysis-parts-sheet .analysis-bar {
  margin-top: 0;
}

.analysis-block-lead {
  font-size: 0.78rem;
}

.analysis-mark {
  font-weight: 700;
  color: var(--accent);
}

.analysis-memo-cell {
  padding: 0.1rem 0.15rem !important;
  min-width: 6.5rem;
}

.analysis-memo-input {
  width: 7.5rem;
  min-width: 5.5rem;
  max-width: 10rem;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  padding: 0.2rem 0.35rem;
  font: inherit;
  font-size: 0.8rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.9);
}

.analysis-memo-input.is-dirty {
  outline: 1px solid var(--accent);
}

.analysis-mark-notes {
  margin: 0.15rem 0 0.35rem;
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.analysis-highlight-term {
  margin: 0 0 0.35rem;
}

.analysis-highlight-term .analysis-sub-title {
  margin: 0.2rem 0 0.1rem;
}

.sheet-analysis .analysis-row {
  cursor: pointer;
}

.sheet-analysis .analysis-row:hover td {
  background: rgba(45, 122, 104, 0.06);
}

.sheet-analysis .analysis-row.is-selected td {
  background: rgba(45, 122, 104, 0.12);
}

.sheet-analysis .analysis-row.is-selected td.sticky-col {
  background: #e7f3ef;
}

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

  .analysis-pane {
    position: static;
  }
}

.calc-dist--side {
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.calc-dist--side .calc-dist-title {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.calc-dist--side .sheet-calc-dist {
  width: 100%;
  font-size: 0.82rem;
}

.calc-dist--side .sheet-calc-dist th,
.calc-dist--side .sheet-calc-dist td {
  text-align: center;
  min-width: 1.6rem;
  padding: 0.28rem 0.2rem;
}

.calc-dist--side .sheet-calc-dist .calc-dist-class-h {
  text-align: left;
  min-width: 1.8rem;
  padding-left: 0.35rem;
  font-weight: 600;
}

.calc-dist--side .calc-dist-total th,
.calc-dist--side .calc-dist-total td {
  font-weight: 700;
  border-top: 1px solid var(--line);
}

/* 学年処理・定期テスト入力状況 */
.year-test-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.15rem 0.1rem;
  margin: 0.5rem 0 1rem;
  padding: 0;
  border-bottom: 3px solid var(--line);
}

.year-test-bar .grade-test-tab {
  margin-bottom: -3px;
  padding: 0.55rem 0.95rem 0.5rem;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0.35rem 0.35rem 0 0;
  background: transparent;
  font-size: 0.95rem;
}

.year-test-bar .grade-test-tab:hover {
  color: var(--accent);
  background: rgba(15, 106, 91, 0.06);
}

.year-test-bar .grade-test-tab.is-active {
  color: var(--accent);
  font-weight: 700;
  border-bottom-color: var(--accent);
  background: rgba(15, 106, 91, 0.06);
}

.year-test-grades {
  display: grid;
  gap: 1.5rem;
}

.year-test-grade-title {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.year-test-wrap {
  max-width: 100%;
}

.year-test-sheet th,
.year-test-sheet td {
  text-align: center;
  min-width: 2.4rem;
  padding: 0.35rem 0.4rem;
}

.year-test-sheet .sheet-class,
.year-test-sheet .year-test-enrolled {
  min-width: 2.2rem;
}

.year-test-sheet th.sheet-class,
.year-test-sheet td.sheet-class {
  text-align: left;
}

.year-test-link {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.year-test-link:hover {
  text-decoration: underline;
}

.year-test-partial {
  color: #8a2b22;
  font-weight: 700;
}

.year-test-print {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.year-test-print-form {
  max-width: 52rem;
}

.year-test-print-mode,
.year-test-print-classes {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
}

.year-test-print-mode legend,
.year-test-print-classes legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.year-test-print-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
}

.year-test-print-mode legend {
  width: 100%;
}

.year-test-print-class-list {
  display: grid;
  gap: 0.4rem;
}

.year-test-print-class-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.year-test-print-toggle {
  padding: 0.15rem 0.55rem;
  font-size: 0.82rem;
}

.grade-print-panel {
  max-width: 52rem;
}

.grade-print-form {
  margin-top: 0.5rem;
}

.grade-print-terms,
.grade-print-classes {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
}

.grade-print-terms legend,
.grade-print-classes legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.grade-print-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
}

.grade-print-terms legend {
  width: 100%;
}

.grade-print-class-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.grade-print-toggle {
  padding: 0.15rem 0.55rem;
  font-size: 0.82rem;
}

.grade-print-columns {
  margin: 0 0 1rem;
}

.grade-print-options {
  margin: 0 0 0.75rem;
}

.grade-print-primary {
  margin: 0 0 1rem;
}

.grade-print-primary label {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.grade-print-primary span {
  font-weight: 600;
}

.grade-print-primary select {
  min-width: 10rem;
}
