:root {
  --bg: #f2efe8;
  --bg-deep: #e6e0d4;
  --surface: #fffcf7;
  --ink: #1c2420;
  --ink-muted: #5a635c;
  --line: #c9c2b4;
  --accent: #0f5c4c;
  --accent-hover: #0a4338;
  --accent-soft: #d6ebe4;
  --danger: #9b2c2c;
  --danger-soft: #f5d6d6;
  --radius: 6px;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --status-none: #d8d3c8;
  --status-not_achieved: #c43c3c;
  --status-attention: #d97816;
  --status-achieved: #2f8f5b;
  --status-above: #2a6fbf;
  --shadow: 0 1px 2px rgba(28, 36, 32, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #dff0ea 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #efe6d4 0%, transparent 50%),
    var(--bg);
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.workspace-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 1rem 1.5rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.workspace-banner.is-warning {
  background: color-mix(in srgb, var(--status-attention) 12%, var(--surface));
}

.workspace-banner.is-ready {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.workspace-banner-text {
  flex: 1 1 16rem;
  min-width: 0;
}

.workspace-banner-text p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
}

.workspace-status {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.workspace-status.is-ok {
  color: var(--accent);
}

.workspace-status.is-error {
  color: var(--danger);
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.nav-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-btn:hover {
  color: var(--ink);
  background: var(--bg-deep);
}

.nav-btn.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
  font-weight: 600;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.view[hidden],
.view:not(.is-visible) {
  display: none;
}

.view.is-visible {
  display: block;
  animation: fade-in 0.25s ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.view-intro {
  margin-bottom: 1.25rem;
}

.view-intro h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}

.view-intro p {
  margin: 0;
  color: var(--ink-muted);
  max-width: 42rem;
  line-height: 1.45;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.panel-grow {
  flex: 1;
  min-width: 0;
}

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

.panel-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-family: var(--font-display);
}

.split {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1rem;
}

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

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-deep);
}

.btn-outline {
  background: transparent;
  border-color: var(--line-strong, var(--line));
  color: var(--ink-muted);
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--ink-muted);
  color: var(--ink);
  background: transparent;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  padding: 0.3rem 0.5rem;
}

.btn-ghost:hover {
  color: var(--ink);
  background: var(--bg-deep);
}

.btn-danger {
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-soft);
}

.file-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.field-grow {
  flex: 1;
  min-width: 10rem;
}

.field input,
.field select,
.modal-fields input {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.field input:focus,
.field select:focus,
.modal-fields input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
}

.filters .field {
  min-width: 10rem;
}

.progress-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.progress-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-bottom: 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.progress-summary strong {
  color: var(--ink);
  font-weight: 600;
}

.progress-meta-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-left: auto;
}

#btn-class-report[hidden] {
  display: none;
}

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

.item-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.item-list li:last-child {
  border-bottom: none;
}

.item-list .item-main {
  flex: 1;
  min-width: 0;
}

.item-list .item-title {
  font-weight: 500;
  word-break: break-word;
}

.item-list .item-meta {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: 0.15rem;
}

.item-list .item-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.15rem;
}

.item-list button.select-row {
  appearance: none;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
  width: 100%;
}

.item-list li.is-selected {
  background: var(--accent-soft);
  border-radius: var(--radius);
}

.item-list li.list-tree-item.depth-1 {
  padding-left: 1.25rem;
}

.item-list li.list-tree-item.depth-2 {
  padding-left: 2rem;
}

.item-list li.list-tree-item.depth-3 {
  padding-left: 2.75rem;
}

.item-list li.list-tree-item.is-folder .item-title {
  font-weight: 650;
}

.empty-hint {
  margin: 0.5rem 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.inline-form .btn {
  align-self: flex-end;
}

.progress-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.progress-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.progress-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.progress-toolbar[hidden] {
  display: none;
}

.progress-toolbar-label {
  flex: 0 0 auto;
  font-size: 0.9rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.progress-toolbar .field {
  margin: 0;
}

.progress-search-field {
  max-width: 18rem;
}

.progress-search-field input {
  width: 100%;
}

.progress-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  width: 100%;
  margin: 0;
  padding: 0.7rem 1rem;
  font: inherit;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  color: inherit;
  background: var(--bg-deep);
  border: none;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.progress-group.is-collapsed .progress-group-head {
  border-bottom: none;
}

.progress-group-head-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.progress-group-chevron {
  flex-shrink: 0;
  width: 0.65rem;
  height: 0.65rem;
  border-right: 2px solid var(--ink-muted);
  border-bottom: 2px solid var(--ink-muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  margin-top: -0.2rem;
}

.progress-group.is-collapsed .progress-group-chevron {
  transform: rotate(-45deg);
  margin-top: 0;
}

.progress-group-title-text {
  min-width: 0;
  word-break: break-word;
}

.progress-group-pcts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.pct-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  padding: 0.22rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.pct-chip.status-none {
  background: #9a9488;
}

.pct-chip.status-achieved {
  background: var(--status-achieved);
}

.pct-chip.status-not_achieved {
  background: var(--status-not_achieved);
}

.pct-chip.status-above {
  background: var(--status-above);
}

.pct-chip.status-attention {
  background: var(--status-attention);
}

.pct-chip.is-zero {
  opacity: 0.45;
  font-weight: 600;
}

.progress-group-body {
  background: var(--surface);
}

.progress-group.is-collapsed .progress-group-body {
  display: none;
}

.goal-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.goal-row:last-child {
  border-bottom: none;
}

.goal-row-text {
  flex: 1;
  min-width: 12rem;
  font-weight: 500;
  line-height: 1.35;
}

.count-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.count-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--ink);
  background: #fff;
  min-width: 2.5rem;
  justify-content: center;
}

.count-chip .chip-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.count-chip.is-zero {
  opacity: 0.4;
  font-weight: 500;
}

.goal-row .status-btn {
  flex-shrink: 0;
  align-self: center;
}

.progress-student-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 0 0 0.35rem;
}

.progress-student-bar[hidden] {
  display: none;
}

.progress-student-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

.report-view {
  background: #fff;
}

.report-chrome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.report-sheet {
  max-width: 52rem;
  margin: 0 auto;
  color: #111;
}

.report-sheet h1 {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
}

.report-project-suffix {
  font-weight: 500;
  color: #555;
}

.report-chart {
  margin: 0 0 1.5rem;
  padding: 0.85rem 0.5rem 0.5rem;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fff;
}

.report-chart-scroll {
  overflow-x: auto;
  padding: 0 0.35rem;
}

.report-chart-plot,
.report-chart-labels {
  display: flex;
  justify-content: flex-start;
  gap: 0.65rem;
  min-width: min-content;
  width: 100%;
}

.report-chart-plot {
  align-items: flex-end;
  min-height: 9rem;
}

.report-chart-col {
  flex: 1 1 0;
  min-width: 3.25rem;
  max-width: 5.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.report-chart-bar-wrap {
  width: 100%;
  height: 9rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.report-chart-bar {
  width: 70%;
  max-width: 2.75rem;
  min-height: 0;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  background: transparent;
}

.report-chart-bar.is-percent {
  height: 100%;
}

.report-chart-seg {
  width: 100%;
  min-height: 0;
  flex-shrink: 1;
  flex-basis: 0;
}

.report-chart-seg.status-none {
  background: var(--status-none) !important;
}

.report-chart-seg.status-not_achieved {
  background: var(--status-not_achieved) !important;
}

.report-chart-seg.status-attention {
  background: var(--status-attention) !important;
}

.report-chart-seg.status-achieved {
  background: var(--status-achieved) !important;
}

.report-chart-seg.status-above {
  background: var(--status-above) !important;
}

.report-chart-axis {
  height: 0;
  border-top: 1px solid #bbb;
}

.report-chart-labels {
  align-items: flex-start;
  padding-top: 0.4rem;
}

.report-chart-label {
  flex: 1 1 0;
  min-width: 3.25rem;
  max-width: 5.5rem;
  height: calc(0.72rem * 1.25 * 2);
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.25;
  color: #444;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  word-break: break-word;
}

.report-pcts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
}

.report-pcts > li {
  margin: 0;
}

.report-pct-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.4rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  color: #222;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
}

.report-pct-item:hover {
  border-color: #bbb;
}

.report-pct-item.is-off {
  opacity: 0.4;
  text-decoration: line-through;
}

.report-pct-item strong {
  font-weight: 600;
}

.report-status-section {
  margin: 0 0 1.75rem;
}

.report-status-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-family: var(--font-display);
  font-weight: 600;
}

.report-goal-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.report-goal-card {
  width: 100%;
  background: #fff !important;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  box-shadow: none;
  color: #111;
}

.report-goal-card.status-above {
  border-color: var(--status-above);
}

.report-goal-card.status-achieved {
  border-color: var(--status-achieved);
}

.report-goal-card.status-attention {
  border-color: var(--status-attention);
}

.report-goal-card.status-not_achieved {
  border-color: var(--status-not_achieved);
}

.report-goal-card.status-none {
  border-color: var(--status-none);
}

.report-goal-card-text {
  font-size: 0.95rem;
  line-height: 1.4;
  color: #111;
}

.report-intro {
  margin: -0.5rem 0 1.25rem;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.4;
}

.report-goal-card-meta {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #666;
  line-height: 1.35;
}

.report-goal-card-students {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid #eee;
  font-size: 0.88rem;
  line-height: 1.4;
  color: #222;
  font-weight: 500;
}

body.report-mode {
  background: #fff;
}

body.report-mode .app-header {
  display: none;
}

body.report-mode main {
  max-width: none;
  padding: 0;
  margin: 0;
}

.report-view.is-visible {
  display: block;
  background: #fff;
  min-height: 100vh;
  margin: 0;
  padding: 1.25rem 1.5rem 2.5rem;
}

@media print {
  body.report-mode {
    background: #fff;
  }

  body.report-mode .app-header,
  .no-print {
    display: none !important;
  }

  .report-view.is-visible {
    min-height: 0;
    padding: 0;
  }

  .report-sheet {
    max-width: none;
  }

  .report-pct-item {
    cursor: default;
  }

  .report-pct-item.is-off {
    display: none;
  }

  .report-goal-card {
    break-inside: avoid;
    box-shadow: none;
  }
}

.student-progress-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.student-progress-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.student-progress-head .meta {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.student-goal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
}

.student-goal-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.student-goal-list > li:last-child {
  border-bottom: none;
}

.student-goal-list .list-section {
  width: 100%;
  margin: 0;
  padding: 0.55rem 0 0.15rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  border-bottom: none;
}

.student-goal-list .goal-text {
  flex: 1;
  min-width: 10rem;
  font-weight: 500;
  line-height: 1.35;
}

.status-btn {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  min-width: 9.5rem;
  text-align: center;
  color: var(--ink);
}

.status-btn:hover,
.status-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.status-btn.status-none {
  background: var(--status-none);
  color: var(--ink);
}

.status-btn.status-not_achieved,
.status-btn.status-attention,
.status-btn.status-achieved,
.status-btn.status-above {
  color: #fff;
}

.status-none { background: var(--status-none); }
.status-not_achieved { background: var(--status-not_achieved); }
.status-attention { background: var(--status-attention); }
.status-achieved { background: var(--status-achieved); }
.status-above { background: var(--status-above); }

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

.backup-status {
  width: 100%;
  margin: 0.5rem 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.backup-status.is-ok {
  color: var(--status-achieved);
}

.backup-status.is-error {
  color: var(--danger);
}

.modal {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 0;
  max-width: min(420px, calc(100vw - 2rem));
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(28, 36, 32, 0.18);
}

.modal::backdrop {
  background: rgba(28, 36, 32, 0.35);
}

.modal form {
  padding: 1.25rem;
}

.modal h3 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
}

.modal-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.modal-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.modal-wide {
  max-width: min(960px, calc(100vw - 1.5rem));
  width: 100%;
  max-height: calc(100vh - 2rem);
}

.modal-wide form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
  padding: 1.1rem 1.25rem 1.25rem;
  overflow: hidden;
}

.modal-wide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.modal-wide-head h3 {
  margin: 0;
}

.modal-wide-head .btn-ghost {
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.15rem 0.45rem;
}

.project-week-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.project-week-meta .field {
  min-width: 9rem;
}

.project-week-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  margin-bottom: 1rem;
}

.project-week-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: var(--radius);
  padding: 0.75rem;
  background: color-mix(in srgb, var(--bg) 55%, var(--surface));
}

.project-week-col h4 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
}

.project-week-col .field {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
}

.project-week-col .empty-hint {
  margin: 0.35rem 0;
  flex: 0 0 auto;
}

.project-goal-list {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 8rem;
  max-height: min(42vh, 360px);
  margin-top: 0.25rem;
}

.project-goal-list .item-title {
  font-size: 0.9rem;
}

.pw-result-row {
  align-items: center;
}

.pw-result-row .btn {
  flex-shrink: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .project-week-body {
    grid-template-columns: 1fr;
  }

  .project-goal-list {
    max-height: 28vh;
  }
}

.status-popover {
  position: fixed;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(28, 36, 32, 0.16);
  min-width: 11rem;
}

.status-popover[hidden] {
  display: none;
}

.status-option {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  color: var(--ink);
}

.status-option.status-none { color: var(--ink); }
.status-option.status-not_achieved,
.status-option.status-attention,
.status-option.status-achieved,
.status-option.status-above {
  color: #fff;
}

.status-option:hover {
  filter: brightness(1.05);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.theme-coverage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0;
}

.projects-layout {
  display: grid;
  grid-template-columns: minmax(0, 33%) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
}

.projects-coverage-col,
.projects-weeks-col {
  min-width: 0;
}

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

  .theme-coverage {
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  }
}

.theme-coverage-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 0.65rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  text-align: center;
}

.theme-coverage-name {
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  font-variant-caps: all-small-caps;
  font-feature-settings: "smcp", "c2sc";
  text-transform: lowercase;
  color: var(--ink-muted);
  line-height: 1.25;
  max-width: 100%;
  word-break: break-word;
}

.theme-coverage-ring {
  position: relative;
  width: 4.25rem;
  height: 4.25rem;
}

.theme-coverage-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.theme-coverage-ring .ring-bg,
.theme-coverage-ring .ring-fg {
  fill: none;
  stroke-width: 3.2;
}

.theme-coverage-ring .ring-bg {
  stroke: color-mix(in srgb, var(--line) 85%, #fff);
}

.theme-coverage-ring .ring-fg {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dasharray 0.35s ease;
}

.theme-coverage-ring .ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
}

.project-week-pct {
  font-size: 0.78em;
  font-weight: 500;
  color: var(--ink-muted);
}
