:root {
  --bg: #0a1418;
  --panel: rgba(9, 24, 31, 0.88);
  --panel-2: rgba(15, 34, 43, 0.92);
  --line: rgba(189, 223, 214, 0.15);
  --text: #ecf5f0;
  --muted: #8fa9a1;
  --success: #29c27f;
  --warn: #f0a542;
  --danger: #e45f5f;
  --amber: linear-gradient(135deg, rgba(235, 164, 79, 0.16), rgba(14, 33, 40, 0.3));
  --teal: linear-gradient(135deg, rgba(73, 178, 170, 0.18), rgba(14, 33, 40, 0.3));
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(205, 148, 70, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(64, 173, 170, 0.16), transparent 30%),
    linear-gradient(180deg, #081015, #0f1f26 45%, #0b171d 100%);
}

.login-shell {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel,
.server-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.login-panel {
  width: min(440px, 100%);
  padding: 32px;
  border-radius: 28px;
}

.login-panel-wide {
  width: min(1040px, 100%);
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.auth-card {
  border: 1px solid rgba(189, 223, 214, 0.12);
  border-radius: 24px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(5, 12, 16, 0.08)),
    rgba(8, 18, 24, 0.62);
  display: grid;
  gap: 10px;
}

.auth-card.active {
  border-color: rgba(231, 162, 83, 0.32);
  box-shadow: inset 0 0 0 1px rgba(231, 162, 83, 0.12);
}

.topbar {
  display: grid;
  gap: 16px;
  padding: 28px 28px 8px;
}

.topbar-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.calendar-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px 16px;
  background: var(--panel-2);
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}

.calendar-label {
  display: block;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #9ec2b7;
}

.calendar-time {
  margin: 0;
  font-family: "IBM Plex Mono", "Cascadia Code", monospace;
  font-size: 1.3rem;
  line-height: 1.15;
}

.calendar-date {
  color: var(--muted);
}

.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px 28px 0;
}

.section-tab {
  border-radius: 999px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.04);
}

.section-tab.active {
  border-color: rgba(126, 224, 211, 0.34);
  background: linear-gradient(135deg, rgba(73, 178, 170, 0.24), rgba(10, 20, 24, 0.18));
  color: #dffaf2;
}

.section-panels {
  padding-bottom: 24px;
}

.tab-panel[hidden] {
  display: none !important;
}

.content-shell {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  padding: 16px 28px 32px;
}

.content-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(5, 12, 16, 0.1)),
    var(--panel);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.content-card-wide {
  grid-column: 1 / -1;
}

.content-kicker {
  display: block;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #9ec2b7;
}

.content-card p {
  margin: 0;
  line-height: 1.65;
  color: var(--muted);
}

.card-head,
.summary-grid,
.form-grid,
.form-actions,
.two-col,
.exercise-meta,
.info-row {
  display: flex;
  gap: 12px;
}

.card-head,
.info-row {
  justify-content: space-between;
  align-items: flex-start;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.summary-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.summary-tile {
  border: 1px solid rgba(189, 223, 214, 0.12);
  border-radius: 18px;
  padding: 14px;
  background: rgba(7, 16, 20, 0.34);
}

.summary-tile strong,
.exercise-row strong {
  display: block;
  margin-top: 8px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.summary-tile small,
.exercise-row small,
.info-row small,
.muted-row {
  color: var(--muted);
}

.two-col {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(260px, 1.05fr);
  align-items: start;
}

.info-list,
.exercise-list {
  display: grid;
  gap: 10px;
}

.gym-shell .exercise-list {
  grid-template-columns: 1fr;
  align-items: start;
}

.info-row,
.exercise-row {
  border: 1px solid rgba(189, 223, 214, 0.12);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
}

.exercise-row {
  display: grid;
  gap: 10px;
}

.exercise-form {
  grid-template-columns: 1fr;
  align-items: start;
}

.exercise-save {
  display: grid;
  grid-template-columns: minmax(170px, 230px) auto;
  gap: 8px;
  align-items: center;
  justify-content: start;
}

.exercise-save input {
  font-family: "IBM Plex Mono", "Cascadia Code", monospace;
  text-align: center;
  min-width: 110px;
  min-height: 52px;
  padding: 14px 16px;
  font-size: 1.04rem;
}

.exercise-action-buttons {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 8px;
}

.save-tick,
.saved-tick,
.skip-tick {
  min-width: 44px;
  padding-left: 0;
  padding-right: 0;
}

.saved-tick {
  background: linear-gradient(135deg, #58c993, #2d7b61);
  color: #06110d;
  border: none;
}

.skip-tick {
  min-width: 68px;
}

.skip-tick.is-active {
  background: rgba(240, 165, 66, 0.16);
  border-color: rgba(240, 165, 66, 0.45);
  color: #ffd7a6;
}

.exercise-save-done input {
  border-color: rgba(41, 194, 127, 0.35);
}

.exercise-save-skipped input {
  border-color: rgba(240, 165, 66, 0.35);
}

.exercise-status-label {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.exercise-trend-card {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.exercise-trend-head small {
  color: var(--muted);
}

.exercise-trend-stage {
  position: relative;
}

.exercise-trend-svg {
  width: 100%;
  height: 92px;
  display: block;
}

.exercise-trend-frame {
  fill: rgba(7, 16, 20, 0.4);
  stroke: rgba(189, 223, 214, 0.12);
}

.exercise-trend-guide {
  stroke: rgba(189, 223, 214, 0.1);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.exercise-trend-area {
  fill: rgba(73, 178, 170, 0.14);
}

.exercise-trend-line {
  fill: none;
  stroke: #7fe1d4;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.exercise-trend-dot {
  fill: #ecf5f0;
  stroke: #0d2027;
  stroke-width: 1.4;
  cursor: pointer;
  transition: fill 140ms ease, stroke 140ms ease, stroke-width 140ms ease;
}

.exercise-trend-dot:hover,
.exercise-trend-dot:focus-visible {
  fill: #7fe1d4;
  stroke: #1f7f79;
  stroke-width: 2;
  outline: none;
}

.exercise-trend-tooltip {
  position: absolute;
  transform: translate(-50%, -100%);
  border: 1px solid rgba(189, 223, 214, 0.18);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(9, 24, 31, 0.94);
  color: #ecf5f0;
  font-size: 0.78rem;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow);
}

.exercise-trend-empty {
  fill: #8fa9a1;
  font-size: 13px;
}

.exercise-copy {
  display: grid;
  gap: 6px;
}

.exercise-name-button {
  border: none;
  padding: 0;
  background: transparent;
  color: #ecf5f0;
  text-align: left;
  font: inherit;
  font-family: "IBM Plex Mono", "Cascadia Code", monospace;
}

.exercise-name-button:hover,
.exercise-name-button:focus-visible {
  color: #c7f1e4;
  text-decoration: underline;
}

.exercise-meta {
  display: grid;
  gap: 4px;
}

.strong-row strong {
  margin: 0;
}

.muted-row {
  padding-top: 0;
  border: none;
  background: transparent;
}

.dashboard-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.form-grid.tight {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.form-span-2 {
  grid-column: 1 / -1;
}

.form-actions {
  justify-content: flex-end;
}

.profile-settings {
  border-top: 1px solid rgba(189, 223, 214, 0.12);
  padding-top: 14px;
}

.profile-settings summary {
  cursor: pointer;
  list-style: none;
  font-family: "IBM Plex Mono", "Cascadia Code", monospace;
}

.profile-settings summary::-webkit-details-marker {
  display: none;
}

.profile-form {
  margin-top: 14px;
}

.checkin-card .profile-form {
  margin-top: 0;
}

.checkin-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: start;
  column-gap: 12px;
  row-gap: 14px;
}

.checkin-grid > label {
  min-width: 0;
  align-content: start;
}

.checkin-grid > label > span {
  min-height: 2.35rem;
  display: flex;
  align-items: flex-end;
  line-height: 1.25;
}

.checkin-grid label.form-span-2 {
  grid-column: 1 / -1;
}

.measurement-list {
  display: grid;
  gap: 10px;
}

.measurement-row {
  border: 1px solid rgba(189, 223, 214, 0.12);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 8px;
}

.measurement-head,
.measurement-values {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.measurement-values span {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(7, 16, 20, 0.5);
  color: var(--muted);
  font-size: 0.92rem;
}

.diet-shell {
  align-items: start;
}

.diet-hero {
  gap: 16px;
}

.diet-message-card {
  background:
    linear-gradient(140deg, rgba(73, 178, 170, 0.12), rgba(235, 164, 79, 0.08)),
    var(--panel);
}

.diet-message {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #e8fbf4;
}

.agent-note-card {
  display: grid;
  gap: 14px;
  background:
    linear-gradient(160deg, rgba(105, 214, 202, 0.08), rgba(255, 255, 255, 0.01)),
    var(--panel);
}

.inline-agent-card {
  margin: 6px 0 4px;
  border: 1px solid rgba(189, 223, 214, 0.12);
  border-radius: 22px;
  padding: 18px;
}

.agent-note-body {
  display: grid;
  gap: 10px;
}

.agent-bullet-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.agent-note-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.agent-run-form {
  display: flex;
  justify-content: flex-end;
}

.agent-run-form button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.coach-chat-card {
  gap: 16px;
}

.coach-feedback {
  padding: 0;
}

.diet-feedback {
  padding: 0;
}

.gym-feedback {
  padding: 0;
}

.gym-session-nav {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(185, 222, 214, 0.12);
  border-radius: 22px;
  background: rgba(10, 27, 35, 0.55);
}

.gym-session-nav-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.gym-session-nav-head > div {
  display: grid;
  gap: 4px;
}

.gym-session-nav-head small {
  color: var(--muted);
}

.gym-session-chip-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 12px;
}

.gym-session-chip {
  min-width: 0;
  text-decoration: none;
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(185, 222, 214, 0.12);
  background: rgba(11, 30, 39, 0.78);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.gym-session-chip:link,
.gym-session-chip:visited {
  color: #dff5ee;
}

.gym-session-chip:hover {
  border-color: rgba(105, 214, 202, 0.34);
  background: rgba(15, 39, 49, 0.92);
  transform: translateY(-1px);
}

.gym-session-chip strong {
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.gym-session-chip-kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8fc6bc;
}

.gym-session-chip-planner {
  background: linear-gradient(180deg, rgba(30, 91, 89, 0.28), rgba(11, 30, 39, 0.86));
  border-color: rgba(105, 214, 202, 0.22);
}

.gym-session-chip small {
  color: var(--muted);
}

.gym-session-chip.is-active {
  background: rgba(101, 214, 202, 0.18);
  border-color: rgba(101, 214, 202, 0.36);
  color: #dcfff8;
}

.gym-session-chip.is-active:link,
.gym-session-chip.is-active:visited {
  color: #dcfff8;
}

.gym-session-chip.is-active .gym-session-chip-kicker,
.gym-session-chip.is-active small {
  color: #dcfff8;
}

.coach-thread {
  display: grid;
  gap: 14px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 6px;
}

.coach-chat-form {
  display: grid;
  gap: 12px;
}

.coach-chat-input {
  margin: 0;
}

.coach-examples {
  display: grid;
  gap: 10px;
}

.coach-examples > span {
  color: #9ec2b7;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.coach-example-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.coach-example-list small {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(189, 223, 214, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.coach-message {
  border: 1px solid rgba(189, 223, 214, 0.12);
  border-radius: 20px;
  padding: 16px;
  display: grid;
  gap: 10px;
  max-width: min(100%, 46rem);
}

.coach-message-user {
  background: rgba(255, 255, 255, 0.03);
  justify-self: end;
  border-bottom-right-radius: 8px;
}

.coach-message-assistant {
  background: linear-gradient(150deg, rgba(105, 214, 202, 0.08), rgba(255, 255, 255, 0.02));
  justify-self: start;
  border-bottom-left-radius: 8px;
}

.coach-message-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.coach-message-head small {
  color: var(--muted);
}

.coach-message-body {
  white-space: pre-wrap;
  line-height: 1.55;
}

.coach-attachment-list {
  display: grid;
  gap: 10px;
}

.coach-attachment-chip {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(189, 223, 214, 0.12);
  background: rgba(7, 16, 20, 0.28);
  text-decoration: none;
  color: inherit;
}

.coach-attachment-thumb-wrap {
  display: block;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(7, 16, 20, 0.62);
  border: 1px solid rgba(189, 223, 214, 0.08);
}

.coach-attachment-thumb {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  display: block;
}

.coach-attachment-chip:hover {
  border-color: rgba(105, 214, 202, 0.3);
  background: rgba(11, 27, 34, 0.46);
}

.coach-attachment-kind {
  color: #8fc6bc;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.coach-attachment-chip small,
.coach-attachment-chip em {
  color: var(--muted);
}

.coach-attachment-chip em {
  font-style: normal;
}

.coach-action-list {
  display: grid;
  gap: 10px;
}

.coach-action-card {
  border: 1px solid rgba(189, 223, 214, 0.12);
  border-radius: 16px;
  padding: 14px;
  background: rgba(7, 16, 20, 0.34);
  display: grid;
  gap: 8px;
}

.coach-action-applied {
  border-color: rgba(41, 194, 127, 0.28);
}

.coach-action-cancelled {
  border-color: rgba(240, 165, 66, 0.28);
}

.coach-action-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.coach-action-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.coach-chat-form textarea {
  min-height: 128px;
  resize: none;
}

.coach-file-field {
  display: grid;
  gap: 8px;
}

.coach-selected-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.coach-selected-file {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(189, 223, 214, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: #d8ece6;
}

.coach-selected-file small {
  color: var(--muted);
}

.coach-chat-form button[disabled],
.coach-action-form button[disabled] {
  opacity: 0.68;
  cursor: wait;
}

.diet-meal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

.diet-meal-card {
  align-content: start;
}

.diet-meal-time {
  margin: -6px 0 2px;
  color: #d7ece6;
  font-family: "IBM Plex Mono", "Cascadia Code", monospace;
  font-size: 0.9rem;
}

.diet-meal-head-meta {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.diet-calorie-pill {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(7, 16, 20, 0.5);
  color: #d9f8ef;
  font-family: "IBM Plex Mono", "Cascadia Code", monospace;
  font-size: 0.92rem;
}

.diet-status-pill {
  border-radius: 999px;
  padding: 7px 10px;
  border: 1px solid rgba(189, 223, 214, 0.12);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.diet-status-done {
  color: var(--success);
  border-color: rgba(41, 194, 127, 0.35);
}

.diet-status-skipped {
  color: var(--warn);
  border-color: rgba(240, 165, 66, 0.35);
}

.diet-status-partial {
  color: #90d7ff;
  border-color: rgba(102, 209, 255, 0.35);
}

.diet-status-pending {
  color: #b9cdc7;
  border-color: rgba(189, 223, 214, 0.16);
}

.diet-macro-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.diet-macro-row span {
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(7, 16, 20, 0.46);
  color: #cbe7df;
  font-size: 0.9rem;
}

.diet-meal-block {
  display: grid;
  gap: 8px;
}

.diet-meal-block strong {
  font-size: 0.95rem;
}

.diet-ingredient-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.diet-meal-block p {
  color: var(--muted);
}

.diet-meal-actions {
  display: grid;
  gap: 8px;
  padding: 2px 0 4px;
}

.diet-item-list {
  display: grid;
  gap: 10px;
}

.diet-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(189, 223, 214, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.diet-item-row-done {
  border-color: rgba(41, 194, 127, 0.28);
}

.diet-item-row-skipped {
  border-color: rgba(240, 165, 66, 0.28);
}

.diet-item-row-partial {
  border-color: rgba(102, 209, 255, 0.24);
}

.diet-item-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.diet-item-copy span {
  color: #dff6ef;
}

.diet-item-copy small {
  color: var(--muted);
}

.diet-item-actions {
  grid-template-columns: auto;
  justify-self: end;
}

.diet-item-actions .save-tick,
.diet-item-actions .saved-tick {
  min-width: 48px;
}

.diet-item-actions .is-busy {
  opacity: 0.68;
  cursor: wait;
}

.diet-intake-chart {
  margin-top: 14px;
}

.diet-analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.diet-nutrient-card,
.diet-history-card {
  display: grid;
  gap: 16px;
}

.diet-nutrient-list {
  display: grid;
  gap: 14px;
}

.diet-nutrient-row {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(189, 223, 214, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.diet-nutrient-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.diet-nutrient-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.diet-nutrient-values {
  text-align: right;
  display: grid;
  gap: 2px;
}

.diet-nutrient-values span {
  color: var(--muted);
  font-size: 0.88rem;
}

.diet-nutrient-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(7, 16, 20, 0.52);
}

.diet-nutrient-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #66d4c8, #f3d36d);
}

.diet-history-range-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.diet-history-range-group .ghost {
  min-width: 72px;
}

.diet-history-range-group .ghost.is-active {
  background: rgba(101, 214, 202, 0.18);
  border-color: rgba(101, 214, 202, 0.36);
  color: #dcfff8;
}

.diet-history-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.diet-history-chart {
  margin-top: 0;
}

.health-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.health-chart-card {
  border: 1px solid rgba(189, 223, 214, 0.12);
  border-radius: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 12px;
}

.health-chart-card .card-head {
  align-items: center;
}

.health-chart-card .card-head strong {
  display: block;
  margin-bottom: 4px;
}

.health-chart-latest {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(7, 16, 20, 0.5);
  color: #d9f8ef;
  font-family: "IBM Plex Mono", "Cascadia Code", monospace;
  font-size: 0.9rem;
}

.health-chart-stage {
  position: relative;
}

.health-chart-svg {
  width: 100%;
  height: 170px;
  display: block;
}

.health-chart-frame {
  fill: rgba(7, 16, 20, 0.45);
  stroke: rgba(189, 223, 214, 0.14);
}

.health-chart-guide {
  stroke: rgba(189, 223, 214, 0.12);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.health-chart-area {
  fill: rgba(73, 178, 170, 0.15);
}

.health-chart-line {
  fill: none;
  stroke: #69d6ca;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.health-chart-dot {
  fill: #ecf5f0;
  stroke: #0d2027;
  stroke-width: 1.5;
  cursor: pointer;
  transition: fill 140ms ease, stroke 140ms ease, stroke-width 140ms ease;
}

.health-chart-dot:hover,
.health-chart-dot:focus-visible {
  fill: #69d6ca;
  stroke: #1f7f79;
  stroke-width: 2.1;
  outline: none;
}

.health-chart-tooltip {
  position: absolute;
  transform: translate(-50%, -100%);
  border: 1px solid rgba(189, 223, 214, 0.18);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(9, 24, 31, 0.94);
  color: #ecf5f0;
  font-size: 0.82rem;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow);
}

.health-chart-empty {
  fill: #8fa9a1;
  font-size: 14px;
}

.exercise-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.exercise-modal[hidden] {
  display: none !important;
}

.exercise-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 14, 0.76);
  backdrop-filter: blur(6px);
}

.exercise-modal-card {
  position: relative;
  width: min(900px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(5, 12, 16, 0.1)), var(--panel);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.exercise-modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.exercise-modal-gallery img {
  width: 100%;
  border-radius: 20px;
  border: 1px solid rgba(189, 223, 214, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.exercise-modal-instructions {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(189, 223, 214, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.exercise-modal-instructions h3 {
  margin: 0;
  font-size: 1rem;
}

.exercise-modal-instructions ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.board {
  display: grid;
  gap: 22px;
  padding: 16px 28px 32px;
}

.server-card {
  padding: 24px;
  border-radius: 28px;
}

.server-card.amber {
  background-image: var(--amber);
}

.server-card.teal {
  background-image: var(--teal);
}

.server-head,
.service-top,
.host-actions,
.action-row,
.link-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.link-row {
  margin: 14px 0 18px;
}

.link-row a,
.service-link {
  color: #c7f1e4;
  text-decoration: none;
}

.metric-grid,
.service-grid,
.container-list,
.price-box-grid {
  display: grid;
  gap: 12px;
}

.server-tools,
.host-action-stack,
.price-box-head,
.price-box-meta,
.threshold-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.service-symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 18px;
}

.service-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.server-tools {
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.server-tools.single-action-center {
  justify-content: center;
}

.server-tools.price-above-actions {
  display: grid;
  justify-content: stretch;
}

.server-tools.price-above-actions .price-box-slot,
.server-tools.price-above-actions .host-action-stack {
  width: 100%;
  flex: none;
}

.server-tools.price-above-actions .host-actions {
  width: 100%;
  justify-content: stretch;
}

.server-tools.price-above-actions .host-actions form {
  flex: 1 1 0;
}

.server-tools.price-above-actions .host-actions button {
  width: 100%;
}

.host-action-stack {
  flex: 1 1 260px;
  align-content: flex-start;
}

.host-action-stack.centered {
  width: min(100%, 280px);
  flex: 0 1 280px;
  align-items: center;
  justify-content: center;
}

.host-action-stack.centered .host-actions {
  width: 100%;
  justify-content: center;
}

.host-action-stack.centered .host-actions form {
  width: 100%;
}

.host-action-stack.centered .host-actions button {
  width: 100%;
}

.centered-note {
  text-align: center;
}

.price-box-slot {
  flex: 1 1 320px;
}

.metric-tile,
.service-card,
.container-chip,
.flash,
.price-box {
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.metric-tile,
.service-card,
.price-box {
  border-radius: 22px;
  padding: 16px;
}

.metric-tile {
  display: grid;
  gap: 8px;
  --graph-line: #7ee0d3;
  --graph-fill: rgba(126, 224, 211, 0.18);
}

.metric-tile.cpu {
  --graph-line: #f0a542;
  --graph-fill: rgba(240, 165, 66, 0.2);
}

.metric-tile.memory {
  --graph-line: #66d1ff;
  --graph-fill: rgba(102, 209, 255, 0.2);
}

.metric-tile.disk {
  --graph-line: #7ccf74;
  --graph-fill: rgba(124, 207, 116, 0.18);
}

.metric-tile.temperature {
  --graph-line: #ff8f6b;
  --graph-fill: rgba(255, 143, 107, 0.2);
}

.metric-tile span,
label span,
.server-kicker,
.eyebrow {
  display: block;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #9ec2b7;
}

.metric-tile strong,
h1,
h2,
h3 {
  margin: 6px 0 0;
  font-family: "IBM Plex Mono", "Cascadia Code", monospace;
}

h1 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

h2 {
  font-size: clamp(1.4rem, 2vw, 2rem);
}

h3 {
  font-size: 1.1rem;
}

.service-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.service-title h3 {
  margin-top: 0;
}

.service-title .muted {
  margin-top: 4px;
}

.service-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 14px;
  border: 1px solid rgba(189, 223, 214, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(7, 15, 19, 0.25));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.service-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #c7f1e4;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.muted,
.metric-tile small,
.service-summary,
.container-chip small,
.price-box small,
.price-box-subtitle {
  color: var(--muted);
}

.price-box {
  display: grid;
  gap: 12px;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(5, 12, 16, 0.1)),
    var(--panel-2);
}

.price-box.live {
  border-color: rgba(126, 224, 211, 0.26);
}

.price-box.stale {
  border-color: rgba(240, 165, 66, 0.32);
}

.price-box.error {
  border-color: rgba(228, 95, 95, 0.3);
}

.price-box-head {
  justify-content: space-between;
  align-items: flex-start;
}

.price-box-kicker,
.price-box-stat span {
  display: block;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #9ec2b7;
}

.price-box-subtitle {
  margin: 6px 0 0;
  max-width: 26rem;
  line-height: 1.45;
}

.price-box-link {
  color: #c7f1e4;
  text-decoration: none;
  font-size: 0.88rem;
}

.price-box-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.price-box-stat {
  border: 1px solid rgba(189, 223, 214, 0.12);
  border-radius: 18px;
  padding: 14px;
  background: rgba(7, 16, 20, 0.34);
}

.price-box-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.18rem;
  line-height: 1.25;
  font-family: "IBM Plex Mono", "Cascadia Code", monospace;
}

.threshold-inline-form {
  align-items: flex-end;
}

.threshold-inline-form button {
  width: 100%;
}

.threshold-inline-label {
  flex: 1 1 100%;
  min-width: 0;
  margin: 0;
}

.threshold-inline-label input {
  font-family: "IBM Plex Mono", "Cascadia Code", monospace;
}

.price-box-meta {
  justify-content: space-between;
}

.sparkline-wrap {
  display: grid;
  gap: 8px;
  margin: 2px 0 2px;
}

.sparkline-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.sparkline {
  display: block;
  width: 100%;
  height: 58px;
}

.sparkline-frame,
.sparkline-guide {
  fill: none;
  stroke: rgba(189, 223, 214, 0.14);
}

.sparkline-frame {
  stroke-width: 1;
}

.sparkline-guide {
  stroke-width: 1;
  stroke-dasharray: 4 6;
}

.sparkline-area {
  fill: var(--graph-fill);
}

.sparkline-line {
  fill: none;
  stroke: var(--graph-line);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline-dot {
  fill: var(--graph-line);
  stroke: rgba(9, 24, 31, 0.9);
  stroke-width: 1.2;
}

.tiny {
  font-size: 0.84rem;
}

.flash-stack {
  display: grid;
  gap: 10px;
  padding: 0 28px 12px;
}

.flash-stack.compact {
  padding: 0;
  margin: 18px 0;
}

.flash {
  padding: 12px 14px;
  border-radius: 16px;
}

.flash-success {
  border-color: rgba(41, 194, 127, 0.35);
}

.flash-error {
  border-color: rgba(228, 95, 95, 0.35);
}

.status-pill {
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-pill.online,
.status-pill.running {
  color: var(--success);
  border-color: rgba(41, 194, 127, 0.35);
}

.status-pill.offline,
.status-pill.stopped {
  color: var(--danger);
  border-color: rgba(228, 95, 95, 0.35);
}

.status-pill.partial,
.status-pill.restarting {
  color: var(--warn);
  border-color: rgba(240, 165, 66, 0.35);
}

.container-list {
  margin: 14px 0 16px;
}

.service-details {
  display: grid;
  gap: 8px;
  margin: 10px 0 14px;
}

.service-detail {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(189, 223, 214, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.service-detail span {
  display: block;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: #9ec2b7;
}

.service-detail code {
  overflow-wrap: anywhere;
  font-family: "IBM Plex Mono", "Cascadia Code", monospace;
  font-size: 0.88rem;
  color: #ecf5f0;
}

.service-detail-value {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.copy-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(189, 223, 214, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.copy-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #c7f1e4;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.copy-button.copied {
  border-color: rgba(41, 194, 127, 0.35);
  color: #bdf2d6;
}

.copy-button.copied span {
  font-size: 0.76rem;
}

.container-chip {
  border-radius: 14px;
  padding: 10px 12px;
}

.container-chip.running {
  border-color: rgba(41, 194, 127, 0.25);
}

.container-chip.stopped,
.container-chip.missing {
  border-color: rgba(228, 95, 95, 0.22);
}

form {
  margin: 0;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 8px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

textarea {
  resize: vertical;
}

select option {
  color: #000;
}

button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 10px 16px;
  font: inherit;
}

button.primary {
  background: linear-gradient(135deg, #e7a253, #b96f35);
  color: #140d08;
  border: none;
}

button.warn {
  border-color: rgba(240, 165, 66, 0.35);
}

button.danger {
  border-color: rgba(228, 95, 95, 0.35);
  color: #ffb6b6;
}

.offline-panel,
.error-text {
  border: 1px solid rgba(228, 95, 95, 0.22);
  border-radius: 18px;
  padding: 16px;
  background: rgba(228, 95, 95, 0.06);
}

.offline-panel .price-box-slot {
  margin-bottom: 14px;
}

@media (max-width: 820px) {
  .topbar {
    padding: 20px 18px 8px;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .section-tabs {
    padding-left: 18px;
    padding-right: 18px;
  }

  .board,
  .content-shell,
  .flash-stack {
    padding-left: 18px;
    padding-right: 18px;
  }

  .gym-session-chip-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(148px, 1fr);
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .server-card {
    padding: 18px;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .exercise-form {
    grid-template-columns: 1fr;
  }

  .exercise-save {
    grid-template-columns: 1fr;
  }

  .diet-item-row {
    grid-template-columns: 1fr;
  }

  .diet-item-actions {
    justify-self: start;
  }

  .checkin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .diet-analytics-grid,
  .diet-history-summary {
    grid-template-columns: 1fr;
  }

  .coach-chat-card {
    padding-bottom: 12px;
  }

  .coach-thread {
    max-height: min(56vh, 560px);
    padding-right: 2px;
    padding-bottom: 6px;
  }

  .coach-message {
    max-width: calc(100% - 44px);
    padding: 14px;
  }

  .coach-message-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .coach-examples {
    gap: 8px;
  }

  .coach-example-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .coach-example-list::-webkit-scrollbar {
    display: none;
  }

  .coach-example-list small {
    white-space: nowrap;
  }

  .coach-chat-form {
    position: sticky;
    bottom: 0;
    z-index: 4;
    margin: 0 -2px;
    padding: 12px;
    border: 1px solid rgba(189, 223, 214, 0.12);
    border-radius: 20px;
    background: rgba(6, 13, 16, 0.92);
    backdrop-filter: blur(10px);
  }

  .coach-chat-input span {
    margin-bottom: 8px;
  }

  .coach-chat-form textarea {
    min-height: 56px;
    max-height: 180px;
    border-radius: 18px;
  }

  .coach-chat-form .form-actions {
    margin-top: 0;
    justify-content: flex-end;
  }

  .coach-chat-form .form-actions button {
    width: 100%;
    min-height: 48px;
  }
}

@media (max-width: 1180px) {
  .gym-shell .exercise-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .checkin-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

  .coach-chat-card {
    gap: 12px;
  }

  .coach-thread {
    max-height: 52vh;
    gap: 10px;
  }

  .coach-message {
    max-width: calc(100% - 18px);
    border-radius: 18px;
  }

  .coach-action-form {
    grid-template-columns: 1fr 1fr;
    display: grid;
  }

  .coach-chat-form {
    padding: 10px;
    border-radius: 18px;
  }

  .coach-chat-input span {
    display: none;
  }

  .coach-chat-form textarea {
    min-height: 52px;
    font-size: 16px;
  }
}
