* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #fff;
  color: #000;
  overscroll-behavior: none;
}

.hidden { display: none !important; }

/* ── Views ── */
.view { min-height: 100dvh; }

/* ── Sign-in ── */
.view-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.signin-wrap {
  text-align: center;
  padding: 32px 24px;
  max-width: 360px;
}

.signin-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
}

.signin-sub {
  font-size: 15px;
  color: #555;
  line-height: 1.5;
  margin-bottom: 32px;
}

.signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 28px;
  cursor: pointer;
  margin-bottom: 16px;
}

.signin-btn:active { background: #333; }

.signin-note {
  font-size: 12px;
  color: #bbb;
}

/* ── Reconnect banner ── */
.reconnect-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #c00;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 8px;
  z-index: 100;
}

.reconnect-banner button {
  background: #fff;
  color: #c00;
  border: none;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  cursor: pointer;
  margin-left: 8px;
}

/* ── Loading overlay ── */
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
}
.loading-overlay.hidden { display: none; }

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #ddd;
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Offline banner ── */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #555;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 6px 8px;
  z-index: 100;
}

/* ── Day nav ── */
.day-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 2px solid #000;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
  height: 48px;
}

.day-nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
  background: #ddd;
}

.sync-dot.ok     { background: #090; }
.sync-dot.saving { background: #f90; }
.sync-dot.fail   { background: #c00; }
.sync-dot.offline { background: #999; }

.day-nav button {
  background: none;
  border: 1.5px solid #000;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 700;
  width: 36px;
  height: 30px;
  cursor: pointer;
}

.day-nav button:active  { background: #000; color: #fff; }
.day-nav button:disabled { border-color: #ddd; color: #ddd; }

.gear-btn {
  font-size: 18px !important;
  border: none !important;
  background: none !important;
  width: auto !important;
  padding: 0 4px;
  color: #555;
}

.gear-btn:active { background: none !important; color: #000 !important; }

.day-label {
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  flex: 1;
}

.day-label .sub { font-size: 11px; font-weight: 400; color: #999; }

.past-badge {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: #999;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
}

/* ── Desktop 3-col grid ── */
/* Row 1: Meds | Fluids  | Urine          */
/* Row 2: Meds | Notes   | Labs           */
/* Meds column spans both rows            */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-areas:
    "meds water urine"
    "meds notes labs";
  min-height: calc(100dvh - 48px);
  align-items: start;
}

#colMeds  { grid-area: meds;  border-right: 1px solid #ddd; }
#colWater { grid-area: water; }
#colUrine { grid-area: urine; }
#colNotes { grid-area: notes; border-top: 2px solid #000; border-right: 1px solid #ddd; }
#colLabs  { grid-area: labs;  border-top: 2px solid #000; }

.col {
  padding: 8px;
  border-right: 1px solid #ddd;
  overflow-y: auto;
}
.col:last-child { border-right: none; }

/* ── Mobile tabs ── */
.mob-tabs { display: none; }

@media (max-width: 700px) {
  .mob-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 48px;
    background: #fff;
    z-index: 9;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .mob-tabs::-webkit-scrollbar { display: none; }

  .mob-tab {
    flex-shrink: 0;
    text-align: center;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    border-bottom: 2px solid transparent;
  }
  .mob-tab.active { color: #000; border-bottom-color: #000; }

  .grid { display: block; min-height: auto; }
  .col { border-right: none; display: none; padding: 8px 12px; }
  .col.active { display: block; }

  #colNotes { display: none; border-top: none; }
  #colNotes.active { display: block; }

  #colLabs { display: none; border-top: none; }
  #colLabs.active { display: block; }
}

/* ── Column titles ── */
.col-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 6px;
  border-bottom: 2px solid #000;
  margin-bottom: 6px;
}
.col-title-meds {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px solid #000;
}
@media (max-width: 700px) { .col-title { font-size: 13px; } }

/* ── Vitals block ── */
.vitals-box { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid #ddd; }

.vital-row { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.vital-label { font-size: 11px; font-weight: 700; min-width: 80px; flex-shrink: 0; }

.vital-input {
  width: 44px;
  border: 1.5px solid #000;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  padding: 3px 1px;
  font-family: inherit;
}
.vital-input.wide { width: 56px; }
.vital-input:disabled { background: #f5f5f5; border-color: #ddd; color: #000; }

.vital-slash { font-weight: 700; font-size: 13px; }

.vital-ok-btn {
  background: #000;
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 6px;
  cursor: pointer;
  margin-left: 2px;
}

.vital-locked { font-size: 11px; color: #999; }
.vital-locked.alert { color: #c00; font-weight: 700; }

.log-del {
  background: none;
  border: none;
  color: #ddd;
  font-size: 16px;
  cursor: pointer;
  padding: 6px 8px;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.log-del:active { color: #c00; }

/* ── Notes ── */
.notes-box { margin-bottom: 8px; }
.notes-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #999; margin-bottom: 4px; }
.notes-input {
  width: 100%;
  border: 1.5px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  padding: 6px 8px;
  resize: none;
  color: #000;
  min-height: 52px;
}
.notes-input:focus { outline: none; border-color: #000; }

/* ── Meds ── */
.time-group { margin-bottom: 4px; border-radius: 4px; overflow: hidden; }
.time-label {
  font-size: 11px;
  font-weight: 700;
  color: #000;
  padding: 3px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-radius: 4px;
  user-select: none;
  -webkit-user-select: none;
}
.time-label:active { background: #f0f0f0; }
.time-group.current > .time-label { background: #f5f5f5; text-decoration: underline; }
.time-group.all-done > .time-label { color: #bbb; }
.time-group.collapsed > .time-label { opacity: 0.65; }
.time-group-body { padding: 0 2px; }
.time-group.collapsed .time-group-body { display: none; }
.time-progress { font-size: 10px; font-weight: 600; color: #bbb; }
.time-progress.done { color: #090; }

/* Time-of-day accent */
.time-morning  > .time-label { border-left: 2px solid #e8900a; padding-left: 6px; }
.time-afternoon > .time-label { border-left: 2px solid #1a6cc8; padding-left: 6px; }
.time-evening  > .time-label { border-left: 2px solid #7c3fb5; padding-left: 6px; }

.med {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 1px 0;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.3;
}
.med .box {
  width: 14px;
  height: 14px;
  border: 1.5px solid #999;
  border-radius: 2px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  position: relative;
  top: 1px;
}
.med .box.on { background: #000; border-color: #000; color: #fff; }
.med .box.on::after { content: '\2713'; }
.med.done { color: #bbb; text-decoration: line-through; }
.med-note { font-size: 10px; color: #999; font-style: italic; }
.med.conditional .box { border-color: #ddd; }
.med.conditional .med-note { color: #ddd; }
.med.conditional-active .med-note { color: #c00; }

.reset-btn {
  display: block;
  margin: 8px auto;
  background: none;
  border: 1px solid #eee;
  color: #ccc;
  font-size: 10px;
  padding: 4px 12px;
  border-radius: 3px;
  cursor: pointer;
}

.expand-all-btn {
  background: none;
  border: none;
  color: #bbb;
  font-size: 10px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.expand-all-btn:hover { color: #666; }

/* ── Fluid / Urine ── */
.fluid-total { text-align: center; padding: 8px 0; font-size: 28px; font-weight: 800; }
.fluid-sub { font-size: 11px; color: #999; font-weight: 400; }

.water-pace {
  text-align: center;
  font-size: 12px;
  padding: 4px 8px;
  margin-bottom: 8px;
  border-radius: 4px;
  font-weight: 600;
}
.water-pace.relaxed { color: #090; background: #e8f5e9; }
.water-pace.normal  { color: #666; background: #f5f5f5; }
.water-pace.push    { color: #c60; background: #fff3e0; }
.water-pace.urgent  { color: #c00; background: #fce4ec; }
.water-pace.done    { color: #090; background: #e8f5e9; }

.fluid-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 8px;
}
.fluid-btn {
  background: #fff;
  border: 1.5px solid #000;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 2px;
  border-radius: 4px;
  cursor: pointer;
}
.fluid-btn:active { background: #000; color: #fff; }
.fluid-btn.misc { border-color: #999; color: #666; }

.log-scroll {
  max-height: 200px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.log-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  padding: 2px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}
.log-entry:active { background: #f5f5f5; }
.pulse-display { color: #e07020; font-weight: 600; }
.log-time   { color: #999; }
.log-label  { color: #888; font-style: italic; flex: 1; padding: 0 6px; }
.log-amount { font-weight: 600; }

/* ── Fluid edit dialog ── */
.edit-fluid-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.edit-fluid-dialog {
  background: #fff; border-radius: 12px; padding: 20px;
  width: 90%; max-width: 320px; box-shadow: 0 4px 24px rgba(0,0,0,.2);
}
.edit-fluid-header {
  font-weight: 700; font-size: 15px; margin-bottom: 12px; text-align: center;
}
.edit-fluid-types {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; justify-content: center;
}
.edit-fluid-amount-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px; justify-content: center;
}
.edit-fluid-input {
  width: 80px; text-align: center; font-size: 18px; font-weight: 700;
  border: 1px solid #ccc; border-radius: 8px; padding: 8px;
}
.edit-fluid-actions {
  display: flex; gap: 8px; justify-content: center;
}
.edit-fluid-cancel, .edit-fluid-save {
  padding: 8px 24px; border-radius: 8px; border: 1px solid #ccc;
  font-size: 14px; cursor: pointer;
}
.edit-fluid-save {
  background: #000; color: #fff; border-color: #000;
}

/* ── Drink type selector ── */
.fluid-type-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.fluid-type-btn {
  background: #fff;
  border: 1.5px solid #ddd;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  color: #666;
  white-space: nowrap;
}
.fluid-type-btn.active {
  background: #000;
  border-color: #000;
  color: #fff;
}

/* ── Labs ── */
.labs-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ddd;
}

.labs-form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.labs-input-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.labs-label { font-size: 11px; font-weight: 700; color: #999; flex-shrink: 0; }

.labs-input {
  border: 1.5px solid #000;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  padding: 3px 4px;
  font-family: inherit;
  width: 72px;
}

.labs-input.date-input { width: 120px; text-align: left; }

.labs-add-btn {
  background: #000;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  align-self: flex-end;
}
.labs-add-btn:active { background: #333; }

.labs-entry {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px solid #f0f0f0;
}
.labs-entry-date  { font-weight: 700; min-width: 80px; }
.labs-entry-vals  { color: #444; flex: 1; padding: 0 8px; }
.labs-entry-notes { font-size: 10px; color: #999; font-style: italic; }

.labs-trend {
  margin-top: 12px;
  font-size: 11px;
  color: #999;
}

/* ── Editor overlay ── */
.view-editor {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view-editor.hidden { display: none !important; }

.editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 2px solid #000;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
  flex-shrink: 0;
}

.editor-back {
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

.editor-title { font-size: 15px; font-weight: 700; }

.editor-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-save {
  background: #000;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  cursor: pointer;
}
.editor-save:active { background: #333; }

.editor-body {
  overflow-y: auto;
  flex: 1;
  padding: 0 0 60px;
}

.editor-section {
  padding: 12px 14px 0;
}

.editor-time-group {
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.editor-time-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 4px;
}

.editor-time-label {
  font-size: 13px;
  font-weight: 700;
}

.editor-add-med-btn {
  background: none;
  border: 1.5px solid #000;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  cursor: pointer;
}

.editor-med-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.editor-med-name {
  font-size: 13px;
  flex: 1;
}
.editor-med-dose { font-size: 12px; color: #666; }
.editor-med-cond { font-size: 11px; color: #c00; font-style: italic; }
.editor-med-alt  { font-size: 11px; color: #666; font-style: italic; }

.editor-med-menu-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  color: #999;
  line-height: 1;
}

.editor-inline {
  background: #f8f8f8;
  border-radius: 6px;
  padding: 10px 12px;
  margin: 4px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #999;
  width: 76px;
  flex-shrink: 0;
}

.editor-field input,
.editor-field select {
  flex: 1;
  border: 1.5px solid #ddd;
  border-radius: 3px;
  font-size: 13px;
  font-family: inherit;
  padding: 5px 8px;
  background: #fff;
}
.editor-field input:focus,
.editor-field select:focus {
  outline: none;
  border-color: #000;
}

.editor-delete-btn {
  background: none;
  border: 1px solid #c00;
  color: #c00;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
  align-self: flex-start;
}

.editor-add-slot-btn {
  display: block;
  width: calc(100% - 28px);
  margin: 12px 14px;
  background: none;
  border: 1.5px dashed #999;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  padding: 10px;
  cursor: pointer;
  text-align: center;
}

.editor-settings {
  padding: 12px 14px;
  border-top: 2px solid #000;
  margin-top: 8px;
}

.editor-settings h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  color: #999;
}

/* Settings fields: label natural width, input stays compact */
.editor-settings .editor-field label {
  width: auto;
  flex-shrink: 0;
  white-space: nowrap;
}
.editor-settings .editor-field input {
  flex: none;
  width: 80px;
}

/* ── Info tooltip icon + popup ── */
.tip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ccc;
  color: #666;
  font-size: 9px;
  font-weight: 800;
  font-style: italic;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 3px;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}
.tip-icon:hover, .tip-icon:active { background: #888; color: #fff; }

.tip-popup {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.88);
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  padding: 10px 16px;
  border-radius: 8px;
  width: 300px;
  max-width: calc(100vw - 32px);
  text-align: center;
  z-index: 9999;
  cursor: pointer;
}

/* ── Error toast ── */
.error-toast {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: #c00;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  padding: 10px 16px;
  border-radius: 8px;
  max-width: calc(100vw - 32px);
  text-align: center;
  z-index: 9999;
  cursor: pointer;
}

/* ── Language select ── */
.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2px 20px 2px 6px;
  font-size: 11px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%23999' d='M0 0l4 5 4-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5px center;
  outline: none;
}

.lang-select:hover { border-color: #aaa; color: #000; }

.signin-lang {
  margin-top: 20px;
  text-align: center;
}

/* ── Overlay views (Charts + Reports) ── */
.view-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.view-overlay.hidden { display: none !important; }

.overlay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 2px solid #000;
  flex-shrink: 0;
  background: #fff;
}

.overlay-back {
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

.overlay-title {
  font-size: 15px;
  font-weight: 700;
}

.overlay-action {
  background: #000;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
}
.overlay-action:active { background: #333; }

/* ── Charts ── */
.charts-range-bar {
  display: flex;
  gap: 4px;
  padding: 8px 14px;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.charts-range-bar::-webkit-scrollbar { display: none; }

.range-btn {
  background: #fff;
  border: 1.5px solid #ddd;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
  color: #666;
  white-space: nowrap;
  flex-shrink: 0;
}
.range-btn.active {
  background: #000;
  border-color: #000;
  color: #fff;
}

.charts-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 32px;
}

.charts-empty {
  padding: 32px 16px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

.chart-section {
  padding: 16px 14px 8px;
  border-bottom: 1px solid #f0f0f0;
}
.chart-section:last-child { border-bottom: none; }

.chart-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  margin-bottom: 8px;
}

.chart-wrap {
  position: relative;
  height: 180px;
}
@media (max-width: 700px) { .chart-wrap { height: 200px; } }

/* ── Reports ── */
.reports-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
}

.reports-controls select {
  border: 1.5px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  padding: 6px 8px;
  background: #fff;
}

.reports-date-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.reports-date-range input[type="date"] {
  border: 1.5px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  padding: 5px 6px;
}

.reports-controls button {
  background: #000;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px;
  cursor: pointer;
}
.reports-controls button:active { background: #333; }

.report-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 48px;
}

/* Report document */
.report { max-width: 720px; margin: 0 auto; padding: 16px 14px; font-size: 13px; }

.report-header { padding-bottom: 12px; border-bottom: 2px solid #000; margin-bottom: 16px; }
.report-title  { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.report-meta   { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #444; }

.report-section { margin-bottom: 20px; }
.report-section h2 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
  margin-bottom: 8px;
}
.report-sub-title { font-size: 11px; font-weight: 700; color: #888; margin: 10px 0 6px; }

.report-table { border-collapse: collapse; width: 100%; margin-bottom: 4px; font-size: 12px; }
.report-table td, .report-table th { padding: 4px 8px; border: 1px solid #eee; }
.report-table th { background: #f5f5f5; font-weight: 700; font-size: 11px; }
.report-table td:first-child { color: #555; }
.report-table-full { width: 100%; }

.report-flag-row td { color: #c00; font-weight: 700; }

.report-alerts { list-style: none; padding: 0; }
.report-alerts li { padding: 4px 0; font-size: 12px; color: #c00; border-bottom: 1px solid #fce4ec; }
.report-alerts li:last-child { border-bottom: none; }

.report-ok { font-size: 13px; color: #090; font-weight: 600; }

/* ── Fluid ring ── */
.fluid-ring-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0 6px;
}
.fluid-ring {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}
.fluid-ring-label {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}
.fluid-ring-num { font-size: 22px; font-weight: 800; line-height: 1; }
.fluid-ring-sub { font-size: 10px; color: #999; margin-top: 3px; }

/* Improve fluid type selector active state */
.fluid-type-btn.active {
  background: #000;
  border-color: #000;
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
}

/* ── Responsive mobile tweaks ── */
@media (max-width: 700px) {
  .fluid-total { font-size: 36px; }
  .fluid-btns { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .fluid-btn  { padding: 12px 4px; font-size: 14px; min-height: 44px; }
  .med        { padding: 6px 0; font-size: 14px; min-height: 36px; align-items: center; }
  .med .box   { width: 22px; height: 22px; font-size: 14px; }
  .time-label { font-size: 13px; padding: 5px 4px; }
  .fluid-ring { width: 140px; height: 140px; }
  .fluid-ring-num { font-size: 26px; }
  .vital-input { width: 44px; font-size: 15px; padding: 6px 2px; min-height: 36px; }
  .vital-label { font-size: 13px; }
  .vital-input.wide { width: 56px; }
  .vital-ok-btn { min-width: 36px; min-height: 36px; font-size: 12px; }
  .log-entry  { font-size: 13px; padding: 6px 0; min-height: 36px; }
  .log-del    { font-size: 18px; padding: 8px 10px; min-width: 36px; min-height: 36px; }
  .fluid-type-btn { font-size: 13px; padding: 6px 12px; }
  .labs-input { font-size: 15px; padding: 6px 6px; }
  .labs-add-btn { padding: 10px 18px; font-size: 14px; min-height: 40px; }
}

/* ── Analytics consent banner ── */
.consent-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: #111; color: #fff;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 13px; line-height: 1.4;
}
.consent-banner.hidden { display: none; }
.consent-btns { display: flex; gap: 8px; margin-left: auto; }
.consent-btn { border: none; border-radius: 4px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.consent-btn.accept { background: #fff; color: #111; }
.consent-btn.decline { background: transparent; color: #aaa; text-decoration: underline; }
