* {
  box-sizing: border-box;
}

:root {
  --bg: #f2f4f8;
  --panel: #ffffff;
  --line: #d5deea;
  --muted: #5f6f85;
  --text: #112031;
  --accent: #1f6feb;
  --accent-2: #00a991;
  --bad: #dc2626;
  --ok: #1f9d55;
  --warn: #c27803;
  --hour-h: 58px;
  --radius: 14px;
  --shadow: 0 14px 38px rgba(17, 32, 49, 0.09);
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font: 'Manrope', 'Segoe UI', sans-serif;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1100px 520px at -14% -8%, rgba(31, 111, 235, 0.2), transparent 72%),
    radial-gradient(900px 420px at 110% 105%, rgba(0, 169, 145, 0.14), transparent 76%),
    linear-gradient(145deg, #f8fbff 0%, #eff4fb 43%, #f4f8fd 100%);
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 290px 1fr 430px;
  gap: 16px;
  height: 100dvh;
  padding: 14px;
}

.sidebar,
.workspace,
.inspector {
  min-height: 0;
}

.sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head h1 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-head h1 svg {
  flex-shrink: 0;
}

.panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.sidebar-tab {
  flex: 1;
  padding: 11px 10px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  transition: color 0.15s, border-color 0.15s;
}

.sidebar-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.sidebar-tab:hover:not(.active) {
  color: var(--text);
  background: rgba(0, 0, 0, 0.03);
}

#optimizer-sidebar-panel,
#history-sidebar-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.sidebar-controls {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.sidebar-controls label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.sidebar-controls input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.18s ease;
}

.sidebar-controls input:focus {
  border-color: var(--accent);
}

.group-list {
  overflow: auto;
  padding: 10px;
}

.history-panel-head {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.history-panel-head button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font-family: var(--font);
  font-size: 0.74rem;
  font-weight: 700;
  background: #f6f9ff;
  cursor: pointer;
}

.history-list {
  overflow: auto;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.history-row {
  border: 1px solid #d2deed;
  border-radius: 10px;
  background: #f8fbff;
  padding: 8px;
  cursor: pointer;
}

.history-row.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.16);
}

.history-row.is-favorite {
  border-left: 4px solid #f1c40f;
  background: rgba(241, 196, 15, 0.05);
}

.history-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.favorite-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.3;
  transition: opacity 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.favorite-toggle:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

.is-favorite .favorite-toggle {
  opacity: 1;
  color: #f1c40f;
}

.history-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #1a3e61;
  line-height: 1.25;
}

.history-meta {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: #4c627c;
}

.history-depth-control {
  margin-top: 6px;
  display: grid;
  gap: 4px;
}

.history-depth-range {
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
}

.history-depth-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.64rem;
  color: #4c627c;
}

.history-actions {
  margin-top: 7px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.history-actions button {
  border: 1px solid #c8d7eb;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 700;
  color: #20486f;
  cursor: pointer;
}

.history-actions button[data-history-delete] {
  border-color: #efc2c2;
  color: #9d1f1f;
  background: #fff5f5;
}

.history-actions button[data-history-delete].confirm-armed {
  border-color: #dc2626;
  color: #fff;
  background: #dc2626;
}

.history-actions button[data-history-delete].confirm-armed:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.resource-section {
  margin-bottom: 10px;
}

.resource-section-title {
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6f7f94;
  margin: 2px 2px 7px;
}

.resource-items {
  display: block;
}

.group-item {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
  margin-bottom: 7px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  background: #f7faff;
}

.group-item:hover {
  transform: translateY(-1px);
  border-color: #bfd4f4;
}

.group-item.active {
  border-color: var(--accent);
  background: #eaf2ff;
}

.group-name {
  font-size: 0.93rem;
  font-weight: 700;
}

.group-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toolbar,
.calendar-shell,
.inspector .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toolbar {
  padding: 14px;
}

.toolbar-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.title-wrap h2 {
  margin: 0;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.week-nav {
  display: flex;
  gap: 8px;
}

.week-nav button {
  border: 1px solid var(--line);
  background: #f7faff;
  border-radius: 8px;
  font-family: var(--font);
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  color: #1f3550;
}

.week-nav button:hover {
  border-color: var(--accent);
}

.score-strip {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.score-chip {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: white;
}

.score-chip-btn {
  border: 1px solid rgba(255, 255, 255, 0.36);
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.score-chip-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.score-chip-btn.active {
  box-shadow: 0 0 0 2px rgba(17, 32, 49, 0.2);
}

.score-chip-btn:focus-visible {
  outline: 2px solid #123a62;
  outline-offset: 2px;
}

.score-detail {
  margin-top: 10px;
  border: 1px solid #d2deed;
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px 11px;
}

.score-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.score-detail-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: #1a3e61;
}

.score-detail-close {
  border: 1px solid #c8d7eb;
  border-radius: 8px;
  padding: 5px 8px;
  background: #ffffff;
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 700;
  color: #1f4b76;
  cursor: pointer;
}

.score-detail-sub {
  margin-top: 5px;
  font-size: 0.7rem;
  color: #4b6280;
}

.score-detail-meta {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: #3f5d7c;
}

.score-penalty-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.score-penalty-item {
  border: 1px solid #dde7f4;
  border-radius: 8px;
  background: #ffffff;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.74rem;
  color: #173655;
}

.score-penalty-item strong {
  font-family: var(--mono);
  color: #9d1f1f;
}

.score-detail-empty {
  margin-top: 8px;
  font-size: 0.74rem;
  color: #4b6280;
}

.calendar-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.calendar-head {
  display: grid;
  grid-template-columns: 62px repeat(5, 1fr);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f9fcff 0%, #f2f7ff 100%);
}

.corner {
  border-right: 1px solid var(--line);
}

.day-head {
  min-width: 0;
  padding: 10px 9px;
  border-right: 1px solid var(--line);
}

.day-head:last-child {
  border-right: 0;
}

.day-label {
  font-size: 0.73rem;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.day-date {
  margin-top: 3px;
  font-size: 0.92rem;
  font-weight: 700;
}

.calendar-scroll {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
}

.calendar-grid {
  display: grid;
  grid-template-columns: 62px repeat(5, 1fr);
  min-height: 0;
  height: 100%;
  width: 100%;
}

.time-col,
.day-col {
  position: relative;
}

.time-col {
  border-right: 1px solid var(--line);
  background: #fbfdff;
}

.time-mark {
  height: var(--hour-h);
  border-bottom: 1px dashed #e1e8f3;
  font-size: 0.68rem;
  color: var(--muted);
  padding: 3px 5px;
  font-weight: 700;
}

.day-col {
  border-right: 1px solid var(--line);
}

.day-col:last-child {
  border-right: 0;
}

.hour-line {
  height: var(--hour-h);
  border-bottom: 1px dashed #e6edf8;
}

.event {
  position: absolute;
  left: 7px;
  right: 7px;
  border-radius: 10px;
  border: 1px solid #bfd3f2;
  background: linear-gradient(180deg, #f4f8ff 0%, #e9f1ff 100%);
  padding: 7px 8px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.event:hover {
  transform: translateY(-1px);
  border-color: #8eb4f1;
}

.event.selected {
  border-color: #0f67f4;
  box-shadow: 0 0 0 2px rgba(15, 103, 244, 0.2);
}

.event.moved {
  border-color: var(--accent-2);
  background: linear-gradient(180deg, #e9fff7 0%, #ddfcef 100%);
}

.event.moved-over-old {
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.38), 0 8px 20px rgba(220, 38, 38, 0.18);
}

.event.moved-over-old:hover {
  opacity: 0;
  transform: none;
  border-color: transparent;
  box-shadow: none;
}

.event-old-ghost {
  pointer-events: none;
  border-color: rgba(220, 38, 38, 0.55);
  border-style: dashed;
  background: rgba(220, 38, 38, 0.16);
  color: #7f1d1d;
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.14);
}

.event-old-ghost .ev-time,
.event-old-ghost .ev-room {
  color: rgba(127, 29, 29, 0.88);
}

.ev-title {
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.2;
}

.ev-time {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 0.67rem;
  color: #3a5c7e;
}

.ev-room {
  margin-top: 4px;
  color: #4c627c;
  font-size: 0.65rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inspector {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  min-height: 0;
}

.inspector .card {
  padding: 14px;
}

.inspector h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.selected-event {
  font-size: 0.83rem;
  line-height: 1.45;
  color: #173655;
}

.selected-event.empty {
  color: var(--muted);
}

.selected-event .uid {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #486682;
}

.hidden {
  display: none !important;
}

.new-simulation-card {
  display: flex;
  align-items: center;
  justify-content: center;
}

.new-simulation-btn {
  width: 100%;
  border: 1px solid #b6cbe9;
  border-radius: 10px;
  padding: 11px 10px;
  background: #f3f8ff;
  color: #194772;
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.new-simulation-btn:hover {
  border-color: var(--accent);
}

#params-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.params-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.params-card.results-mode {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.results-section {
  margin-top: 4px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ── Footer temps de run final ── */
.results-footer {
  flex-shrink: 0;
  padding: 7px 0 2px;
  border-top: 1px solid var(--line);
  font-size: 0.74rem;
  color: var(--muted);
  text-align: center;
}

/* ── Barre de progression dans l'onglet résultats ── */
.results-progress-bar {
  flex-shrink: 0;
  padding: 8px 0 4px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}

.results-progress-track {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.results-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

.results-progress-label {
  margin-top: 5px;
  font-size: 0.74rem;
  color: var(--muted);
  text-align: center;
}

/* ── Accordion tabs (Paramètres / Résultats) ── */
.accordion-tabs {
  display: flex;
  margin: -14px -14px 10px -14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.accordion-tab {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  text-align: center;
}

.accordion-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.accordion-tab:hover:not(.active) {
  color: var(--text);
  background: rgba(0, 0, 0, 0.03);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  align-items: center;
}

.form-grid label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

.form-grid input,
.form-grid select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font-family: var(--font);
  font-size: 0.82rem;
}

.run-btn {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 10px;
  background: linear-gradient(135deg, #1f6feb 0%, #0e56c9 100%);
  color: white;
  font-family: var(--font);
  font-weight: 800;
  cursor: pointer;
}

.run-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.algo-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 108px;
  gap: 8px;
}

.stop-btn {
  border: 1px solid #efb5b5;
  border-radius: 10px;
  padding: 10px;
  background: #fff1f1;
  color: #9d1f1f;
  font-family: var(--font);
  font-weight: 800;
  cursor: pointer;
}

.stop-btn:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.run-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.75rem;
}

.progress-panel {
  margin-top: 12px;
  border: 1px solid #d8e3f3;
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.progress-panel.hidden {
  display: none;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.progress-head strong {
  font-size: 0.79rem;
}

.progress-head span {
  font-size: 0.7rem;
  color: var(--muted);
}

.progress-track {
  height: 9px;
  border-radius: 999px;
  background: #dce7f6;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #1f6feb 0%, #00a991 100%);
  transition: width 0.2s ease;
}

.progress-line {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: #1f4166;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workers-list {
  margin-top: 8px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-top: 1px dashed #d3deed;
  padding-top: 6px;
}

.worker-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 7px;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.67rem;
  padding: 4px 0;
  border-bottom: 1px dotted #e3ebf6;
}

.worker-row:last-child {
  border-bottom: 0;
}

.worker-id {
  color: #2f4f73;
  font-weight: 700;
}

.worker-slot {
  color: #32587f;
}

.worker-evals {
  color: #173f69;
  font-weight: 700;
}

.results-head {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
}

#results-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

.results-list {
  margin-top: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-gutter: stable;
}

.result-empty {
  color: var(--muted);
  font-size: 0.82rem;
  padding-top: 6px;
}

.solution {
  border: 1px solid #cfdae9;
  border-radius: 12px;
  padding: 8px;
  background: #f8fbff;
  min-width: 0;
  overflow: hidden;
  flex: 0 0 auto;
}

.solution.active {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(0, 169, 145, 0.15);
}

.solution.expanded {
  border-color: #b9cce7;
}

.solution-line {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.solution-line-main {
  min-width: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.sol-move-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1c3f63;
}

.solution-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1c3f63;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.solution-line-side {
  flex: 0 0 auto;
}

.solution-body {
  margin-top: 8px;
  border-top: 1px dashed #cfdae9;
  padding-top: 8px;
}

.solution-tail {
  margin-top: 8px;
  display: block;
}

.details-btn {
  border: 1px solid #b7cbe7;
  border-radius: 8px;
  padding: 5px 9px;
  width: 100%;
  background: #edf4ff;
  cursor: pointer;
  font-size: 0.74rem;
  font-family: var(--font);
  font-weight: 700;
  color: #214b76;
}

.detail-moves {
  margin-top: 8px;
}

.sol-delta {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.sol-rank {
  font-weight: 800;
  font-size: 0.88rem;
}

.sol-delta.good {
  color: var(--ok);
}

.sol-delta.bad {
  color: var(--bad);
}

.moves {
  margin-top: 8px;
  display: grid;
  gap: 7px;
}

.move {
  font-size: 0.75rem;
  background: #fff;
  border: 1px solid #deebff;
  border-radius: 8px;
  padding: 7px;
}

.move-time {
  margin-top: 4px;
  color: #365879;
  font-family: var(--mono);
  font-size: 0.68rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.impact {
  margin-top: 2px;
  border-top: 1px dashed #cfdae9;
  padding-top: 8px;
}

.impact-headline {
  font-size: 0.74rem;
  font-weight: 800;
  color: #244568;
}

.impact-list {
  margin-top: 8px;
  display: grid;
  gap: 7px;
}

.impact-row {
  border: 1px solid #d4dfed;
  border-radius: 8px;
  padding: 6px;
  background: #fff;
}

.impact-row-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.impact-row-clickable:hover {
  border-color: #8bb3e8;
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.12);
  transform: translateY(-1px);
}

.impact-row-active {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(0, 169, 145, 0.16);
}

.impact-hint {
  margin-top: 4px;
  font-size: 0.66rem;
  color: #3d6389;
}

.impact-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.73rem;
}

.impact-title > div {
  min-width: 0;
}

.tag {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 800;
}

.week-score-delta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
}

.days-mini {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.day-mini {
  border: 1px solid #e0e7f1;
  border-radius: 6px;
  padding: 4px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.62rem;
}

@media (max-width: 1480px) {
  .app-shell {
    grid-template-columns: 255px 1fr 380px;
  }
}

@media (max-width: 1220px) {
  .app-shell {
    grid-template-columns: 255px 1fr;
    grid-template-rows: auto auto;
  }

  .inspector {
    grid-column: 1 / -1;
    grid-template-columns: minmax(220px, 320px) 1fr;
    grid-template-rows: auto;
  }
}

@media (max-width: 880px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100dvh;
    grid-template-columns: 1fr;
  }

  .sidebar,
  .workspace,
  .inspector {
    min-height: unset;
  }

  .inspector {
    grid-template-columns: 1fr;
  }

  .calendar-head,
  .calendar-grid {
    min-width: 0;
  }
}
