:root {
  color-scheme: light;
  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-soft: #eef6f2;
  --ink: #1d2423;
  --muted: #68706f;
  --line: #dce2de;
  --mint: #58b98f;
  --mint-dark: #2f8a68;
  --rose: #d88375;
  --blue: #6d95ad;
  --gold: #d8b15f;
  --warning: #9a3e2a;
  --shadow: 0 18px 50px rgba(31, 45, 42, 0.09);
  --soft-shadow: 0 24px 80px rgba(42, 58, 54, 0.13);
  --display-font: "Angst Serif", "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 18% 4%, rgba(216, 177, 95, 0.22), transparent 26rem),
    radial-gradient(circle at 86% 10%, rgba(88, 185, 143, 0.16), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 18px;
  line-height: 1.55;
}

body.large-mode {
  font-size: 21px;
}

body.large-mode .entry-form input,
body.large-mode .entry-form select,
body.large-mode .entry-form textarea,
body.large-mode .inline-edit input,
body.large-mode .inline-edit select,
body.large-mode .inline-edit textarea {
  min-height: 62px;
  font-size: 20px;
}

body.large-mode .tab-button,
body.large-mode .primary-button,
body.large-mode .text-button,
body.large-mode .secondary-action {
  min-height: 62px;
  font-size: 20px;
}

body.large-mode .record h3,
body.large-mode .today-card h3 {
  font-size: 26px;
}

body.large-mode .pill,
body.large-mode .pressure-status {
  font-size: 18px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid rgba(220, 226, 222, 0.72);
  background: rgba(246, 244, 238, 0.82);
  backdrop-filter: blur(18px);
}

.brand,
.site-nav,
.top-actions,
.header-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 900;
}

.brand-mark {
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint) 0 50%, #f7d6ce 50% 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72), 0 8px 18px rgba(88, 185, 143, 0.22);
  transform: rotate(-18deg);
}

.site-nav {
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.site-nav a,
.header-button,
.nav-chat-button {
  border-radius: 8px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.site-nav a,
.nav-chat-button {
  padding: 9px 12px;
}

.site-nav a:hover,
.nav-chat-button:hover {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.nav-chat-button {
  border: 1px solid rgba(88, 185, 143, 0.28);
  background: rgba(255, 255, 255, 0.48);
  color: var(--mint-dark);
  font-weight: 900;
}

.header-button {
  background: var(--mint);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(88, 185, 143, 0.24);
}

.header-button {
  padding: 10px 14px;
  font-size: 14px;
}

.top-actions {
  gap: 8px;
}

.top-actions .text-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: 14px;
  line-height: 1.1;
  text-align: center;
}

.header-button:hover,
.primary-button:hover {
  background: var(--mint-dark);
}

.hero {
  position: relative;
  display: grid;
  min-height: min(760px, 82svh);
  overflow: hidden;
  padding: clamp(28px, 4vw, 52px) clamp(18px, 5vw, 64px) clamp(44px, 6vw, 72px);
  isolation: isolate;
}

.hero::after {
  content: "";
  position: absolute;
  right: clamp(16px, 7vw, 96px);
  bottom: 20px;
  width: min(570px, 54vw);
  aspect-ratio: 1.5;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  filter: blur(14px);
  z-index: -2;
}

.hero-bg,
.hero-visual {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.float-pill {
  position: absolute;
  width: 128px;
  height: 48px;
  border-radius: 999px;
  opacity: 0.42;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.58);
}

.float-pill-one {
  top: 16%;
  right: 39%;
  background: linear-gradient(90deg, #ffffff 0 50%, rgba(216, 131, 117, 0.72) 50% 100%);
  transform: rotate(22deg);
}

.float-pill-two {
  right: 8%;
  bottom: 22%;
  background: linear-gradient(90deg, rgba(109, 149, 173, 0.65) 0 50%, #ffffff 50% 100%);
  transform: rotate(-24deg);
}

.float-pill-three {
  bottom: 14%;
  left: 5%;
  width: 86px;
  height: 34px;
  background: linear-gradient(90deg, rgba(88, 185, 143, 0.58) 0 50%, #ffffff 50% 100%);
  transform: rotate(34deg);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
  align-self: start;
}

.hero h1,
.section-heading h2,
.today-panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.hero h1 {
  font-family: var(--display-font);
  max-width: 720px;
  font-size: 76px;
  font-weight: 500;
  line-height: 1;
}

.hero-copy {
  width: min(590px, 100%);
  margin: 24px 0 0;
  color: #4f5b58;
  font-size: 20px;
}

.hero-verse {
  width: min(610px, 100%);
  margin: 30px 0 0;
  padding: 18px 0 0 22px;
  border-left: 3px solid rgba(88, 185, 143, 0.42);
}

.hero-verse blockquote {
  margin: 0;
  color: #36423f;
  font-family: var(--display-font);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.28;
}

.hero-verse figcaption {
  margin-top: 10px;
  color: var(--mint-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-visual {
  left: auto;
  top: 50%;
  right: clamp(-70px, 2vw, 42px);
  width: min(720px, 58vw);
  height: min(560px, 64vw);
  transform: translateY(-43%);
  z-index: 1;
}

.pharmacy-cross {
  position: absolute;
  right: 42%;
  top: 0;
  z-index: 2;
  width: 104px;
  height: 104px;
  border: 1px solid rgba(220, 226, 222, 0.82);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--soft-shadow);
  transform: rotate(-8deg);
}

.pharmacy-cross::before,
.pharmacy-cross::after,
.pharmacy-cross span {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 8px;
  background: var(--mint);
}

.pharmacy-cross::before {
  width: 62px;
  height: 22px;
}

.pharmacy-cross::after {
  width: 22px;
  height: 62px;
}

.pharmacy-cross span {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.28);
}

.pill-sheet {
  position: absolute;
  right: 8%;
  top: 2%;
  display: grid;
  grid-template-columns: repeat(4, 58px);
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(220, 226, 222, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--soft-shadow);
  transform: rotate(8deg);
}

.pill-sheet span {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(220, 226, 222, 0.9);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #ffffff 0 28%, transparent 30%),
    linear-gradient(135deg, rgba(238, 246, 242, 0.96), rgba(255, 255, 255, 0.82));
  box-shadow: inset 0 -8px 20px rgba(104, 112, 111, 0.08);
}

.organizer {
  position: absolute;
  right: 19%;
  bottom: 7%;
  width: min(470px, 86%);
  padding: 20px;
  border-radius: 18px 18px 8px 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--soft-shadow);
  transform: rotate(-5deg);
}

.organizer-lid {
  height: 38px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(88, 185, 143, 0.2), rgba(109, 149, 173, 0.2), rgba(216, 177, 95, 0.18));
}

.organizer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.day-cell {
  display: grid;
  min-height: 110px;
  place-items: start center;
  padding-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  color: rgba(29, 36, 35, 0.68);
  font-size: 12px;
  font-weight: 900;
}

.day-cell.mint {
  background: rgba(223, 246, 236, 0.92);
}

.day-cell.rose {
  background: rgba(249, 219, 213, 0.92);
}

.day-cell.blue {
  background: rgba(221, 235, 243, 0.92);
}

.tablet {
  position: absolute;
  border-radius: 999px;
  box-shadow: 0 16px 32px rgba(31, 45, 42, 0.14), inset 0 0 0 2px rgba(255, 255, 255, 0.74);
}

.tablet-round {
  right: 5%;
  bottom: 34%;
  width: 72px;
  height: 72px;
  background: radial-gradient(circle at 35% 28%, #fff8f4 0 26%, #f3b6aa 27% 100%);
}

.tablet-capsule {
  right: 76%;
  bottom: 52%;
  width: 128px;
  height: 48px;
  background: linear-gradient(90deg, #ffffff 0 50%, var(--mint) 50% 100%);
  transform: rotate(-18deg);
}

.tablet-small {
  right: 26%;
  top: 33%;
  width: 52px;
  height: 52px;
  background: radial-gradient(circle at 34% 30%, #ffffff 0 24%, #ead397 25% 100%);
}

.pharmacist {
  --pharmacist-scale: 1;
  position: absolute;
  right: 50%;
  bottom: 43%;
  z-index: 4;
  width: 178px;
  height: 282px;
  transform: scale(var(--pharmacist-scale));
  transform-origin: 50% 100%;
}

.pharmacist span {
  position: absolute;
  display: block;
}

.pharmacist-shadow {
  left: 24px;
  bottom: 0;
  width: 124px;
  height: 24px;
  border-radius: 50%;
  background: rgba(31, 45, 42, 0.12);
  filter: blur(2px);
}

.pharmacist-head {
  left: 55px;
  top: 48px;
  z-index: 3;
  width: 70px;
  height: 72px;
  border-radius: 48% 48% 46% 46%;
  background:
    radial-gradient(circle at 28% 58%, rgba(216, 131, 117, 0.28) 0 7px, transparent 8px),
    radial-gradient(circle at 72% 58%, rgba(216, 131, 117, 0.24) 0 7px, transparent 8px),
    #f1c3a8;
  box-shadow: inset -8px -7px 0 rgba(187, 104, 88, 0.1);
}

.pharmacist-head::before,
.pharmacist-head::after {
  content: "";
  position: absolute;
  top: 30px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2d2a2a;
}

.pharmacist-head::before {
  left: 21px;
}

.pharmacist-head::after {
  right: 21px;
}

.pharmacist-hair {
  left: 43px;
  top: 27px;
  z-index: 1;
  width: 94px;
  height: 118px;
  border-radius: 46% 46% 42% 42%;
  background:
    radial-gradient(circle at 35% 18%, rgba(255, 255, 255, 0.12) 0 12px, transparent 13px),
    #6a403c;
  box-shadow: inset -14px -9px 0 rgba(63, 37, 34, 0.18);
}

.pharmacist-hair::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 6px;
  width: 62px;
  height: 44px;
  border-radius: 54% 54% 38% 44%;
  background: #7a4944;
  transform: rotate(-8deg);
}

.pharmacist-hair::after {
  content: "";
  position: absolute;
  right: -20px;
  top: 54px;
  width: 36px;
  height: 64px;
  border-radius: 999px;
  background: #6a403c;
  transform: rotate(-13deg);
}

.pharmacist-smile {
  left: 78px;
  top: 95px;
  z-index: 4;
  width: 24px;
  height: 12px;
  border-bottom: 3px solid #a2545d;
  border-radius: 0 0 999px 999px;
}

.pharmacist-neck {
  left: 75px;
  top: 112px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 0 0 12px 12px;
  background: #e5ad96;
}

.pharmacist-body {
  left: 35px;
  top: 126px;
  z-index: 2;
  width: 108px;
  height: 132px;
  border: 1px solid rgba(220, 226, 222, 0.9);
  border-radius: 30px 30px 12px 12px;
  background:
    linear-gradient(110deg, transparent 0 46%, rgba(216, 226, 231, 0.85) 47% 49%, transparent 50% 100%),
    linear-gradient(90deg, #ffffff 0 50%, #f2f7f8 50% 100%);
  box-shadow: 0 22px 42px rgba(31, 45, 42, 0.12);
}

.pharmacist-body::before {
  content: "";
  position: absolute;
  left: 32px;
  top: 0;
  width: 44px;
  height: 28px;
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  background: #dcecf0;
}

.pharmacist-body::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 38px;
  color: var(--mint);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.pharmacist-badge {
  left: 59px;
  top: 180px;
  z-index: 3;
  width: 28px;
  height: 36px;
  border-radius: 5px;
  background: #f7d6ce;
  box-shadow: inset 0 -7px 0 rgba(88, 185, 143, 0.22), 0 8px 14px rgba(31, 45, 42, 0.08);
}

.pharmacist-arm {
  z-index: 2;
  top: 146px;
  width: 28px;
  height: 92px;
  border-radius: 999px;
  background: #f7fbfb;
  box-shadow: inset 0 0 0 1px rgba(220, 226, 222, 0.9);
}

.pharmacist-arm-left {
  left: 22px;
  transform: rotate(11deg);
}

.pharmacist-arm-right {
  right: 18px;
  top: 132px;
  height: 104px;
  transform: rotate(-31deg);
  transform-origin: 50% 14px;
}

.pharmacist-hand {
  right: 6px;
  top: 222px;
  z-index: 3;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1c3a8;
}

.app-shell {
  width: min(1160px, calc(100% - 32px));
  margin: -18px auto 44px;
  scroll-margin-top: 90px;
}

.today-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  min-height: 134px;
  padding: 24px;
  border: 1px solid rgba(220, 226, 222, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.today-panel h2 {
  font-size: 34px;
}

.today-dashboard {
  margin-top: 0;
}

.today-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 12px;
}

.today-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.today-card h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

.task-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.task-list li {
  color: var(--ink);
  font-weight: 800;
}

.taken-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.taken-check input {
  width: 24px;
  height: 24px;
  margin-top: 2px;
  accent-color: var(--mint);
}

.taken-check input:checked + span {
  color: var(--muted);
  text-decoration: line-through;
}

.grouped-task-list {
  display: grid;
  gap: 12px;
}

.task-time-group {
  display: grid;
  gap: 6px;
}

.task-time-group h4 {
  margin: 0;
  color: var(--mint-dark);
  font-size: 18px;
}

.task-time-group p {
  margin: 0;
  color: var(--muted);
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
}

.metrics-row div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(246, 244, 238, 0.66);
}

.metrics-row span {
  display: block;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.metrics-row small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.header-actions {
  flex-wrap: wrap;
  gap: 10px;
}

.text-button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--mint-dark);
  padding: 0 14px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(28, 37, 34, 0.06);
}

.bottom-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.bottom-actions .text-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.icon-button {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(28, 37, 34, 0.06);
}

.icon-button:hover {
  border-color: var(--mint);
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 18px 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.tab-button {
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.tab-button.active {
  background: var(--mint);
  color: #ffffff;
}

.mobile-chat-tab {
  display: none;
}

.tab-section {
  display: none;
  scroll-margin-top: 90px;
}

.tab-section.active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 22px 0 12px;
}

.section-heading h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 30px;
}

.section-count {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid #e4ddd0;
  border-radius: 999px;
  background: #f4efe6;
  color: #74695b;
  padding: 4px 12px;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.compact-heading {
  margin-bottom: 10px;
}

.form-details {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.form-details summary {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  color: var(--mint-dark);
  padding: 0 18px;
  font-weight: 900;
}

.toggle-label {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid rgba(88, 185, 143, 0.28);
  border-radius: 999px;
  background: #f7fffb;
  color: var(--mint-dark);
  padding: 4px 12px;
  font-size: 14px;
  white-space: nowrap;
}

.form-details[open] .toggle-label::before {
  content: "Свернуть";
}

.form-details:not([open]) .toggle-label::before {
  content: "Развернуть";
}

.form-details summary::marker {
  color: var(--mint);
}

.form-details .entry-form {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  box-shadow: none;
}

.entry-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.entry-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
}

.field-hint {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.search-field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
}

.search-field input {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 12px 14px;
  outline: none;
}

.entry-form input,
.entry-form select,
.entry-form textarea {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 12px 14px;
  outline: none;
}

.entry-form textarea {
  resize: vertical;
}

.entry-form input:focus,
.entry-form select:focus,
.entry-form textarea:focus,
.tab-button:focus-visible,
.icon-button:focus-visible,
.header-button:focus-visible {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(88, 185, 143, 0.18);
}

.dose-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.emotion-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.emotion-grid legend {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.emotion-grid label {
  display: block;
}

.emotion-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.emotion-grid span {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--muted);
  padding: 8px 10px;
  text-align: center;
  font-weight: 900;
}

.emotion-grid input:checked + span {
  border-color: var(--mint);
  background: var(--surface-soft);
  color: var(--mint-dark);
  box-shadow: 0 0 0 3px rgba(88, 185, 143, 0.14);
}

.emotion-grid input:focus-visible + span {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(88, 185, 143, 0.18);
}

.full-width,
.dose-grid,
.emotion-grid,
.primary-button {
  grid-column: 1 / -1;
}

.primary-button {
  justify-self: start;
  min-height: 54px;
  padding: 0 22px;
  border: 0;
  border-radius: 6px;
  background: var(--mint);
  color: #ffffff;
  font-weight: 900;
}

.list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

#catalogList {
  gap: 8px;
}

.record {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  min-width: 0;
  padding: 16px 64px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.record-body {
  min-width: 0;
}

.catalog-record {
  --catalog-side-top: 16px;
  min-height: 96px;
  padding: 12px 286px 14px 14px;
}

.catalog-record.expiring-soon {
  border-color: rgba(216, 131, 117, 0.46);
  background: #fff4f6;
  box-shadow: 0 16px 38px rgba(154, 62, 42, 0.1);
}

.catalog-record.expiring-soon .pill {
  background: #fff8f9;
}

.catalog-record.expiring-soon .monthly-badge {
  border-color: rgba(216, 131, 117, 0.38);
  background: linear-gradient(135deg, #fff8f9, #ffe8ed);
}

.catalog-record.expired {
  border-color: rgba(154, 62, 42, 0.42);
  background: #fff0f2;
}

.expired-warning {
  margin-top: 10px;
  border: 2px solid rgba(154, 62, 42, 0.36);
  border-radius: 8px;
  background: #ffe1e5;
  color: var(--warning);
  padding: 10px 12px;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.record h3 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: 0;
}

.record p {
  margin: 0;
  color: var(--muted);
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--mint-dark);
  padding: 3px 10px;
  font-size: 15px;
  font-weight: 900;
}

.amount-pill {
  min-height: 28px;
  cursor: text;
  padding-right: 6px;
}

.amount-pill input {
  width: 86px;
  min-height: 24px;
  border: 1px solid rgba(47, 138, 104, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  padding: 2px 8px;
  outline: none;
  text-align: center;
}

.amount-pill input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(88, 185, 143, 0.16);
}

.days-left-pill {
  background: #fff8e5;
  color: #8a671d;
}

.low-stock-pill {
  border: 1px solid rgba(154, 62, 42, 0.32);
  background: #fff0ec;
  color: var(--warning);
}

.status-row {
  margin-top: 10px;
}

.status-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 900;
}

.complete-button {
  border: 1px solid #efcbc2;
  background: #fff7f5;
  color: var(--warning);
}

.resume-button {
  border: 1px solid rgba(88, 185, 143, 0.3);
  background: #f7fffb;
  color: var(--mint-dark);
}

.monthly-badge {
  position: absolute;
  right: 112px;
  top: var(--catalog-side-top);
  bottom: auto;
  display: grid;
  min-width: 174px;
  gap: 2px;
  padding: 9px 12px;
  border: 1px solid rgba(88, 185, 143, 0.3);
  border-radius: 8px;
  background: linear-gradient(135deg, #f7fffb, #e9f8f1);
  box-shadow: 0 12px 26px rgba(31, 45, 42, 0.09);
}

.monthly-badge span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.monthly-badge strong {
  color: var(--mint-dark);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
}

.pressure-chart {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.pressure-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pressure-summary-item {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 26px rgba(31, 45, 42, 0.06);
}

.pressure-summary-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.pressure-summary-item strong {
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.1;
}

.pressure-summary-item small {
  color: var(--muted);
}

.pressure-chart-body {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.pressure-chart-body svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 180px;
}

.chart-grid {
  stroke: rgba(104, 112, 111, 0.18);
  stroke-width: 1;
}

.normal-zone {
  fill: rgba(88, 185, 143, 0.1);
}

.chart-label {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.end-label,
.normal-label {
  text-anchor: end;
}

.chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.systolic-line {
  stroke: var(--mint-dark);
}

.diastolic-line {
  stroke: #6d95ad;
}

.chart-dot {
  stroke: #ffffff;
  stroke-width: 2;
}

.systolic-dot {
  fill: var(--mint-dark);
}

.diastolic-dot {
  fill: #6d95ad;
}

.pressure-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.pressure-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pressure-legend i {
  width: 24px;
  height: 4px;
  border-radius: 999px;
}

.systolic-key {
  background: var(--mint-dark);
}

.diastolic-key {
  background: #6d95ad;
}

.pressure-table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
}

.pressure-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.pressure-table th,
.pressure-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.pressure-table th {
  color: var(--mint-dark);
  font-weight: 900;
}

.pressure-table td {
  color: var(--ink);
  font-weight: 700;
}

.pressure-status {
  display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 15px;
  font-weight: 900;
}

.normal-pressure {
  border: 1px solid rgba(88, 185, 143, 0.32);
  background: #f0fbf6;
  color: var(--mint-dark);
}

.high-pressure {
  border: 1px solid rgba(216, 177, 95, 0.4);
  background: #fff8e5;
  color: #8a671d;
}

.critical-pressure {
  border: 1px solid rgba(154, 62, 42, 0.32);
  background: #fff0ec;
  color: var(--warning);
}

.low-pressure {
  border: 1px solid rgba(109, 149, 173, 0.38);
  background: #eef7fb;
  color: #426f88;
}

.record-actions {
  position: absolute;
  top: 12px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.catalog-record .record-actions {
  top: var(--catalog-side-top);
}

.catalog-record .record-actions {
  display: grid;
  grid-template-columns: 34px 34px minmax(0, 1fr);
  gap: 6px;
  justify-content: start;
}

.catalog-record .edit-button,
.catalog-record .delete-button {
  justify-self: center;
}

.catalog-record .order-button {
  grid-column: 1 / -1;
  min-width: 0;
  width: 142px;
  justify-self: end;
}

.order-button {
  display: inline-flex;
  min-height: 34px;
  min-width: 92px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.edit-button,
.delete-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  font-size: 0;
  line-height: 1;
}

.edit-button::before,
.delete-button::before {
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
}

.edit-button::before {
  content: "✎";
}

.delete-button::before {
  content: "×";
  font-size: 25px;
}

.order-button {
  border: 1px solid rgba(109, 149, 173, 0.34);
  background: #f4fbff;
  color: #3d7895;
}

.edit-button {
  border: 1px solid rgba(88, 185, 143, 0.28);
  background: #f7fffb;
  color: var(--mint-dark);
}

.delete-button {
  border: 1px solid #efcbc2;
  background: #fff7f5;
  color: var(--warning);
}

.inline-edit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(88, 185, 143, 0.28);
  border-radius: 8px;
  background: #f7fffb;
}

.inline-edit label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
}

.inline-edit input,
.inline-edit select,
.inline-edit textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

.inline-edit .wide-edit,
.inline-edit-actions {
  grid-column: 1 / -1;
}

.inline-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.secondary-action {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  padding: 0 18px;
  font-weight: 900;
}

.empty-state {
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  text-align: center;
  padding: 16px;
}

.pharma-chat {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: end;
  padding: 84px 24px 24px;
  background: rgba(29, 36, 35, 0.18);
  backdrop-filter: blur(6px);
}

.pharma-chat[hidden] {
  display: none;
}

.pharma-chat-panel {
  display: grid;
  width: min(480px, 100%);
  max-height: min(720px, calc(100svh - 108px));
  overflow: hidden;
  border: 1px solid rgba(220, 226, 222, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(31, 45, 42, 0.2);
}

.pharma-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.pharma-chat-header h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0;
}

.chat-close-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.chat-messages {
  display: grid;
  max-height: 390px;
  gap: 10px;
  overflow-y: auto;
  padding: 16px;
  background: linear-gradient(180deg, #f7fffb, #ffffff);
}

.chat-message {
  width: fit-content;
  max-width: 92%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  white-space: pre-line;
}

.assistant-message {
  justify-self: start;
  background: #ffffff;
}

.user-message {
  justify-self: end;
  border-color: rgba(88, 185, 143, 0.32);
  background: var(--surface-soft);
  color: var(--mint-dark);
}

.disclaimer-message {
  color: var(--muted);
  font-size: 14px;
}

.chat-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.chat-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
}

.chat-form textarea {
  width: 100%;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 12px;
  outline: none;
  resize: vertical;
}

.chat-form textarea:focus,
.nav-chat-button:focus-visible,
.chat-close-button:focus-visible {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(88, 185, 143, 0.18);
}

@media (max-width: 980px) {
  .site-nav {
    display: none;
  }

  .hero {
    min-height: 76svh;
  }

  .hero h1 {
    max-width: 620px;
    font-size: 58px;
  }

  .hero-visual {
    width: 78vw;
    opacity: 0.55;
    right: -26vw;
  }

  .pharmacist {
    --pharmacist-scale: 0.86;
    right: 54%;
    bottom: 39%;
  }

  .today-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

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

@media (max-width: 720px) {
  html,
  body {
    overflow-x: hidden;
  }

  body {
    font-size: 17px;
  }

  body.large-mode {
    font-size: 19px;
  }

  .site-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 64px;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
  }

  .site-header::after {
    content: none;
  }

  .brand {
    min-width: 0;
  }

  .brand span:last-child {
    display: none;
  }

  .brand-mark {
    flex: 0 0 auto;
  }

  .header-button {
    min-height: 44px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    gap: 6px;
    min-width: 0;
  }

  .top-actions .text-button {
    min-width: 0;
    min-height: 44px;
    padding: 0 6px;
    font-size: 12px;
    line-height: 1.05;
    white-space: normal;
  }

  .hero {
    min-height: auto;
    overflow: hidden;
    padding: 14px 16px 28px;
  }

  .hero::after {
    display: none;
  }

  .hero-content {
    align-self: start;
    width: 100%;
    padding-top: 0;
  }

  .hero .eyebrow {
    display: none;
  }

  .hero h1 {
    max-width: 100%;
    font-size: 38px;
    line-height: 1.04;
  }

  .hero-copy {
    width: 100%;
    margin-top: 18px;
    font-size: 17px;
  }

  .hero-verse {
    width: 100%;
    margin-top: 20px;
    padding-left: 14px;
  }

  .hero-verse blockquote {
    font-size: 21px;
  }

  .hero-visual {
    display: none;
  }

  .app-shell {
    width: calc(100% - 20px);
    margin: 12px auto 28px;
    scroll-margin-top: 78px;
  }

  .today-panel {
    min-height: auto;
    gap: 8px;
    padding: 10px;
  }

  .today-panel h2 {
    font-size: 22px;
    line-height: 1.08;
  }

  .header-actions {
    display: grid;
    grid-template-columns: minmax(86px, 0.8fr) minmax(174px, 1.2fr);
    justify-content: stretch;
    gap: 8px;
  }

  .header-actions .text-button {
    width: 100%;
  }

  .today-panel .eyebrow {
    margin-bottom: 4px;
  }

  .today-panel .metrics-row {
    gap: 8px;
  }

  .today-panel .metrics-row div {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 9px;
  }

  .today-panel .metrics-row span {
    flex: 0 0 auto;
    font-size: 22px;
  }

  .today-panel .metrics-row small {
    margin-top: 0;
    line-height: 1.1;
  }

  .today-panel .text-button {
    min-height: 38px;
    padding: 0 8px;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
  }

  .bottom-actions {
    gap: 8px;
    margin-top: 18px;
    padding: 10px;
  }

  .bottom-actions .text-button {
    min-height: 50px;
    padding: 0 8px;
    font-size: 15px;
    line-height: 1.1;
    white-space: normal;
  }

  .metrics-row,
  .tabs,
  .entry-form,
  .dose-grid,
  .emotion-grid,
  .inline-edit,
  .pressure-summary {
    grid-template-columns: 1fr;
  }

  .metrics-row,
  .tabs,
  .emotion-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-card {
    min-height: auto;
    padding: 16px;
  }

  .tab-button {
    min-height: 50px;
    padding: 8px;
  }

  .mobile-chat-tab {
    display: block;
    grid-column: 1 / -1;
    border: 1px solid rgba(88, 185, 143, 0.28);
    background: #f4efe6;
    color: var(--mint-dark);
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .form-details summary {
    min-height: auto;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
  }

  .form-details summary > span:first-child {
    min-width: 0;
  }

  .toggle-label {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .entry-form {
    gap: 12px;
    padding: 14px;
  }

  .entry-form input,
  .entry-form select,
  .entry-form textarea {
    min-height: 52px;
  }

  .primary-button,
  .inline-edit-actions .secondary-action {
    width: 100%;
  }

  .primary-button {
    justify-self: stretch;
  }

  .record {
    padding: 14px 56px 14px 12px;
  }

  .record-actions {
    left: auto;
    right: 12px;
    top: 12px;
    align-items: flex-end;
    width: 38px;
  }

  .record-actions .edit-button,
  .record-actions .delete-button {
    width: 36px;
    height: 36px;
  }

  .catalog-record {
    --catalog-side-top: 12px;
    min-height: auto;
    padding: 14px 12px;
  }

  .catalog-record .record-actions {
    left: auto;
    right: 12px;
    width: 166px;
  }

  .catalog-record .record-actions {
    grid-template-columns: 34px 34px minmax(0, 1fr);
    justify-content: start;
  }

  .catalog-record .order-button {
    width: 142px;
    justify-self: end;
    min-height: 44px;
    font-size: 16px;
  }

  .catalog-record h3,
  .catalog-record p {
    max-width: min(172px, calc(100% - 178px));
    margin-right: 0;
  }

  .catalog-record .record-actions {
    top: var(--catalog-side-top);
  }

  .monthly-badge {
    left: auto;
    right: 12px;
    top: 178px;
    bottom: auto;
    display: grid;
    align-items: start;
    justify-content: stretch;
    gap: 6px;
    min-width: 0;
    width: 142px;
    padding: 8px 10px;
  }

  .monthly-badge span {
    font-size: 10px;
    line-height: 1.05;
  }

  .monthly-badge strong {
    font-size: 18px;
  }

  .record-meta {
    gap: 6px;
    margin-top: 6px;
  }

  .catalog-record .record-meta {
    margin-right: 154px;
  }

  .pill {
    max-width: 100%;
    min-height: 28px;
    padding: 2px 8px;
    overflow-wrap: anywhere;
    font-size: 13px;
  }

  .amount-pill input {
    width: 72px;
    min-height: 22px;
    font-size: 12px;
  }

  .catalog-record .edit-button,
  .catalog-record .delete-button {
    width: 34px;
    height: 34px;
  }

  .inline-edit-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .pressure-table-wrap {
    margin-inline: -2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .pressure-table {
    min-width: 620px;
    font-size: 15px;
  }

  .pressure-table th,
  .pressure-table td {
    padding: 10px;
  }

  .pharma-chat {
    place-items: stretch;
    padding: 74px 10px 10px;
  }

  .pharma-chat-panel {
    width: 100%;
    max-height: calc(100svh - 84px);
  }

  .chat-messages {
    max-height: 42svh;
  }
}

@media (max-width: 420px) {
  .brand span:last-child {
    display: none;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero-copy {
    font-size: 16px;
  }

  .pharma-chat-header,
  .chat-form,
  .chat-messages {
    padding: 12px;
  }

  .metrics-row,
  .tabs,
  .emotion-grid {
    grid-template-columns: 1fr;
  }

  .today-panel .metrics-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-panel .header-actions {
    grid-template-columns: minmax(78px, 0.8fr) minmax(154px, 1.2fr);
  }

  .today-panel .text-button {
    font-size: 15px;
  }

  .bottom-actions .text-button {
    font-size: 14px;
  }

  .record {
    padding: 14px 54px 14px 12px;
  }

  .catalog-record {
    padding: 14px 12px;
  }

  .catalog-record .record-actions {
    left: auto;
    right: 12px;
    width: 154px;
  }

  .catalog-record h3,
  .catalog-record p {
    max-width: min(156px, calc(100% - 166px));
  }

  .catalog-record .record-meta {
    margin-right: 144px;
  }

  .monthly-badge {
    right: 12px;
    top: 178px;
    width: 142px;
  }
}

.catalog-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 174px;
  grid-template-areas:
    "body actions"
    "body monthly";
  align-items: start;
  gap: 10px 16px;
  min-height: 0;
  padding: 14px;
}

.catalog-record .record-body {
  grid-area: body;
}

.catalog-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.catalog-title-row h3 {
  min-width: 0;
}

.catalog-record h3,
.catalog-record p,
.catalog-record .record-meta {
  max-width: none;
  margin-right: 0;
}

.catalog-record .record-actions {
  position: static;
  grid-area: auto;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 36px 36px;
  justify-content: start;
  justify-self: start;
  align-items: start;
  gap: 6px;
  width: auto;
}

.catalog-record .order-button {
  grid-area: actions;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  justify-self: stretch;
  font-size: 16px;
}

.catalog-record .order-panel {
  position: relative;
  grid-area: actions;
  justify-self: stretch;
  width: 100%;
}

.catalog-record .order-panel .order-button {
  width: 100%;
}

.pharmacy-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 100%;
  min-width: 174px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(31, 45, 42, 0.14);
}

.pharmacy-menu[hidden] {
  display: none;
}

.pharmacy-menu a {
  min-height: 42px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 900;
}

.pharmacy-menu a:last-child {
  border-bottom: 0;
}

.pharmacy-menu a:hover,
.pharmacy-menu a:focus-visible {
  background: var(--surface-soft);
  color: var(--mint-dark);
  outline: none;
}

.catalog-record .monthly-badge {
  position: static;
  grid-area: monthly;
  justify-self: end;
  width: 174px;
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
}

@media (max-width: 720px) {
  .catalog-record {
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 8px 10px;
    padding: 12px;
  }

  .catalog-record .monthly-badge {
    width: 132px;
  }

  .catalog-record .record-actions {
    grid-template-columns: 34px 34px;
  }

  .catalog-record .order-button {
    width: 132px;
    min-height: 42px;
    font-size: 15px;
  }

  .catalog-record .order-panel,
  .catalog-record .order-panel .order-button {
    width: 132px;
  }

  .pharmacy-menu {
    min-width: 132px;
  }

  .catalog-record .monthly-badge {
    padding: 8px 10px;
  }

  .catalog-record .monthly-badge span {
    font-size: 10px;
    line-height: 1.05;
  }

  .catalog-record .monthly-badge strong {
    font-size: 18px;
  }
}

@media (max-width: 360px) {
  .catalog-record {
    grid-template-columns: minmax(0, 1fr) 124px;
    gap: 8px;
  }

  .catalog-record .monthly-badge {
    width: 124px;
  }

  .catalog-record .order-button {
    width: 124px;
    font-size: 14px;
  }

  .catalog-record .order-panel,
  .catalog-record .order-panel .order-button {
    width: 124px;
  }

  .pharmacy-menu {
    min-width: 124px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .pharmacist {
    animation: pharmacist-float 5.8s ease-in-out infinite;
  }

  .pharmacist-arm-right {
    animation: pharmacist-wave 4.2s ease-in-out infinite;
  }

  .pharmacist-badge {
    animation: badge-sway 4.2s ease-in-out infinite;
  }

  .header-button:hover {
    transform: translateY(-1px);
  }
}

@keyframes pharmacist-float {
  0%,
  100% {
    transform: scale(var(--pharmacist-scale)) translateY(0) rotate(-1deg);
  }

  50% {
    transform: scale(var(--pharmacist-scale)) translateY(-8px) rotate(1deg);
  }
}

@keyframes pharmacist-wave {
  0%,
  100% {
    transform: rotate(-31deg);
  }

  50% {
    transform: rotate(-46deg);
  }
}

@keyframes badge-sway {
  0%,
  100% {
    transform: rotate(-2deg);
  }

  50% {
    transform: rotate(4deg);
  }
}

@media print {
  body {
    background: #ffffff;
    color: #000000;
    font-size: 14pt;
  }

  body::before {
    content: "Отчет о лечении";
    display: block;
    margin-bottom: 18px;
    font-size: 24pt;
    font-weight: 900;
  }

  .site-header,
  .hero,
  .tabs,
  .entry-form,
  .header-actions,
  .bottom-actions,
  .record-actions,
  .edit-button,
  .delete-button,
  .pressure-record,
  .today-panel,
  .today-dashboard,
  #catalog,
  #wellbeing,
  .pressure-chart,
  .pharma-chat {
    display: none !important;
  }

  .app-shell {
    width: 100%;
    margin: 0;
  }

  .tab-section {
    display: none !important;
    break-inside: avoid;
    margin-top: 24px;
  }

  #medicines,
  #pressure {
    display: block !important;
  }

  #pressure {
    break-before: page;
    page-break-before: always;
  }

  #pressure .section-heading h2::after {
    content: " за последние 2 недели";
  }

  .old-pressure-row {
    display: none !important;
  }

  .record,
  .pressure-chart-body,
  .pressure-summary-item {
    box-shadow: none;
    background: #ffffff;
  }

  .record,
  .today-card {
    break-inside: avoid;
  }

  .section-heading {
    margin: 0 0 10px;
  }

  .section-heading .eyebrow {
    display: none;
  }

  .record {
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid #cccccc;
  }

  .record h3 {
    font-size: 16pt;
  }

  .pill {
    border: 1px solid #cccccc;
    background: #ffffff;
    color: #000000;
  }

  .pressure-table-wrap {
    overflow: visible;
    border: 0;
  }

  .pressure-table {
    min-width: 0;
    width: 100%;
    font-size: 9.5pt;
    table-layout: fixed;
  }

  .pressure-table th,
  .pressure-table td {
    padding: 4px 5px;
    line-height: 1.2;
  }

  .pressure-table th:nth-child(1),
  .pressure-table td:nth-child(1) {
    width: 24%;
  }

  .pressure-table th:nth-child(2),
  .pressure-table td:nth-child(2),
  .pressure-table th:nth-child(3),
  .pressure-table td:nth-child(3),
  .pressure-table th:nth-child(4),
  .pressure-table td:nth-child(4) {
    width: 11%;
  }

  .pressure-table th:nth-child(5),
  .pressure-table td:nth-child(5) {
    width: 20%;
  }

  .pressure-table th:nth-child(6),
  .pressure-table td:nth-child(6) {
    width: 23%;
  }
}
