@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:wght@400;600;700&display=swap');

:root {
  --c-navy: #0e2233;
  --c-blue: #0e4a82;
  --c-gray: #3a3a3a;
  --c-bg:   #f7f8fa;
  --c-red:  #b03030;
  --c-line: #d8dde3;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--c-bg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--c-navy);
  font-size: 15px;
  line-height: 1.5;
}

header {
  background: white;
  border-bottom: 1px solid var(--c-line);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
header img { height: 34px; }
header h1 {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 20px;
  margin: 0;
  font-weight: 700;
}
header .sub {
  font-size: 12.5px;
  color: var(--c-gray);
  margin-left: auto;
}

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.disclaimer {
  background: #fff8e1;
  border: 1px solid #e5c64c;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: #4a3a00;
  margin-bottom: 24px;
}

fieldset {
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 0 0 18px 0;
  background: white;
}
legend {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-blue);
  padding: 0 6px;
}

.radio-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.radio-card {
  flex: 1 1 180px;
  border: 1.5px solid var(--c-line);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.12s;
  background: white;
}
.radio-card:hover { border-color: var(--c-blue); }
.radio-card.selected {
  border-color: var(--c-blue);
  background: #eef4fb;
}
.radio-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.radio-card input { display: none; }
.radio-card .label {
  font-weight: 600;
  font-size: 14px;
}
.radio-card .hint {
  font-size: 12px;
  color: var(--c-gray);
  margin-top: 2px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
}
label.field input, label.field select {
  font-family: inherit;
  font-size: 15px;
  padding: 7px 9px;
  border: 1px solid var(--c-line);
  border-radius: 5px;
  background: white;
  color: var(--c-navy);
}
label.field input:focus, label.field select:focus {
  outline: 2px solid var(--c-blue);
  outline-offset: -1px;
  border-color: var(--c-blue);
}

/* Date / time quick-pick chips */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 4px 0;
}
.chip-row-compact { gap: 5px; }
.chip-time { padding: 4px 8px; font-size: 12.5px; min-width: 48px; text-align: center; }

/* Mini calendar */
.mini-cal {
  margin-top: 6px;
  background: white;
  border: 1px solid var(--c-line);
  border-radius: 6px;
  padding: 8px 10px;
  max-width: 420px;
}
.mini-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.mini-cal-head .month {
  font-weight: 700;
  font-size: 14px;
  color: var(--c-navy);
}
.mini-cal-head button {
  background: none;
  border: 1px solid var(--c-line);
  border-radius: 4px;
  width: 28px;
  height: 26px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  color: var(--c-navy);
  padding: 0;
}
.mini-cal-head button:hover { border-color: var(--c-blue); color: var(--c-blue); }
.mini-cal-head button:disabled { opacity: 0.3; cursor: not-allowed; }
.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.mini-cal-grid .dow {
  text-align: center;
  font-size: 10.5px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 0;
}
.mini-cal-day {
  text-align: center;
  font-size: 13px;
  padding: 6px 0;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  background: none;
  border: 1px solid transparent;
  color: var(--c-navy);
}
.mini-cal-day:hover { background: #eef4fb; border-color: var(--c-blue); }
.mini-cal-day.weekend, .mini-cal-day.past { color: #c8ccd1; cursor: not-allowed; }
.mini-cal-day.weekend:hover, .mini-cal-day.past:hover { background: none; border-color: transparent; }
.mini-cal-day.other-month { color: #d0d4da; cursor: not-allowed; }
.mini-cal-day.today { font-weight: 700; color: var(--c-blue); }
.mini-cal-day.selected {
  background: var(--c-blue);
  color: white;
  border-color: var(--c-blue);
  font-weight: 700;
}
.mini-cal-day.selected:hover { background: var(--c-navy); }

/* Time picker (hour + minute dropdowns) */
.time-picker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: white;
  border: 1px solid var(--c-line);
  border-radius: 5px;
  padding: 4px 8px;
  width: fit-content;
}
.time-picker select {
  font-family: inherit;
  font-size: 15px;
  border: none;
  background: none;
  padding: 4px 2px;
  color: var(--c-navy);
  font-weight: 600;
  cursor: pointer;
}
.time-picker select:focus { outline: none; }
.time-picker .time-sep { font-weight: 700; color: var(--c-navy); }
.time-picker .time-ampm {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
}
.chip {
  background: white;
  border: 1.5px solid var(--c-line);
  border-radius: 14px;
  padding: 4px 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-navy);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.1s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--c-blue); color: var(--c-blue); }
.chip.active {
  background: var(--c-blue);
  color: white;
  border-color: var(--c-blue);
}
.chip-weekday {
  font-size: 12px;
  color: var(--c-gray);
  display: block;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.chip.active .chip-weekday { color: rgba(255,255,255,0.85); }

/* Med picker */
.med-search-wrap { position: relative; }
.med-search-wrap input {
  width: 100%;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--c-line);
  border-radius: 5px;
}
.med-suggestions {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--c-line);
  border-radius: 5px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  display: none;
}
.med-suggestions.open { display: block; }
.med-suggestion {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #eef0f3;
  font-size: 14px;
}
.med-suggestion:hover, .med-suggestion.active { background: #eef4fb; }
.med-suggestion .name { font-weight: 600; }
.med-suggestion .hold { color: var(--c-gray); font-size: 12.5px; }
.med-suggestion .alias { color: #888; font-size: 12px; font-style: italic; }

.med-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  min-height: 24px;
}
.med-chip {
  display: inline-flex;
  align-items: center;
  background: #eef4fb;
  border: 1px solid var(--c-blue);
  color: var(--c-blue);
  border-radius: 14px;
  padding: 3px 8px 3px 12px;
  font-size: 13px;
  font-weight: 600;
}
.med-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--c-blue);
  font-size: 16px;
  margin-left: 4px;
  padding: 0 4px;
  font-weight: 700;
}
.med-chip button:hover { color: var(--c-red); }

.cheat-sheet {
  margin-top: 22px;
  border-top: 1px solid var(--c-line);
  padding-top: 16px;
}
.cheat-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.cheat-sheet h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-gray);
  margin: 0;
}
.cheat-tabs {
  display: flex;
  gap: 4px;
  background: #eef0f3;
  padding: 3px;
  border-radius: 6px;
}
.cheat-tab {
  background: none;
  border: none;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  color: var(--c-gray);
  font-family: inherit;
}
.cheat-tab:hover { color: var(--c-navy); }
.cheat-tab.active {
  background: white;
  color: var(--c-navy);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.cheat-pane.hidden { display: none; }
.cheat-category {
  margin-bottom: 14px;
}
.cheat-category h4 {
  font-size: 13px;
  margin: 0 0 4px 0;
  color: var(--c-blue);
}
.cheat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cheat-table tr {
  cursor: pointer;
  border-bottom: 1px solid #eef0f3;
}
.cheat-table tr:hover { background: #f6faff; }
.cheat-table tr.selected { background: #eef4fb; }
.cheat-table td {
  padding: 6px 8px;
  vertical-align: top;
}
.cheat-table td.col-generic { font-weight: 600; width: 26%; color: var(--c-navy); }
.cheat-table td.col-brands  { width: 44%; color: var(--c-navy); font-size: 13px; }
.cheat-table td.col-hold    { color: var(--c-gray); width: 30%; text-align: right; font-size: 12.5px; }

/* Brand-first table */
.cheat-table.by-brand td.col-brand   { font-weight: 700; width: 30%; color: var(--c-navy); font-size: 14px; }
.cheat-table.by-brand td.col-generic-small { color: #888; font-size: 12.5px; width: 30%; font-style: italic; }
.cheat-table.by-brand .letter-row td {
  background: #f7f8fa;
  color: var(--c-blue);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 8px;
  cursor: default;
}
.cheat-table.by-brand .letter-row { cursor: default; }
.cheat-table.by-brand .letter-row:hover { background: #f7f8fa; }

.submit-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}
button.primary {
  background: var(--c-blue);
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
button.primary:hover { background: var(--c-navy); }
button.primary:disabled { background: #aaa; cursor: not-allowed; }

.status {
  font-size: 13px;
  color: var(--c-gray);
}
.status.err { color: var(--c-red); }
.status.ok { color: #1a7a34; }

.hidden { display: none !important; }
