:root{--spring:cubic-bezier(0.16,1,0.3,1);--spring-bounce:cubic-bezier(0.34,1.56,0.64,1);--bg:#F6F5EF;--paper:#fff;--ink:#163B42;--muted:#687A7B;--teal:#2C827A;--mint:#DCEEE8;--coral:#E89C7D;--yellow:#F1CA57;--line:#DCE5E1;--serif:Georgia,serif;--sans:system-ui,-apple-system,sans-serif}*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}html,body{height:100%;overflow:hidden}body{background:#D8E4E1;color:var(--ink);font-family:var(--sans)}button,input{font:inherit}.app{height:100dvh;width:min(100%,560px);margin:auto;background:var(--bg);position:relative;overflow:hidden;box-shadow:0 0 70px #163b4230}.screen{position:absolute;inset:0 0 75px;display:none;opacity:0;transform:translateX(16px)}.screen.active{display:block;animation:enter .4s ease forwards}.scroll{height:100%;overflow-y:auto;padding:calc(13px + env(safe-area-inset-top)) 19px 35px;scrollbar-width:none}.scroll::-webkit-scrollbar{display:none}.top,.page-head{display:flex;align-items:center;justify-content:space-between;min-height:48px;margin-bottom:15px}.brand{font:600 25px var(--serif);letter-spacing:-.05em}.brand span{color:var(--coral);margin-left:2px}.avatar{width:38px;height:38px;background:var(--ink);color:#fff;border:0;border-radius:14px;font-weight:700;font-size:11px}.eyebrow{font-size:10px;letter-spacing:.13em;text-transform:uppercase;font-weight:700;color:var(--teal);margin-bottom:5px}.hero{display:flex;justify-content:space-between;align-items:center;margin:9px 2px 20px}.hero h1,.page-head h1{font:500 33px/1.02 var(--serif);letter-spacing:-.035em}.muted{font-size:13px;color:var(--muted);line-height:1.5;margin-top:8px}.sun{width:137px;height:137px;position:relative;background:linear-gradient(145deg,var(--mint),#F5E8D3);border-radius:43px;overflow:hidden}.sun:before{content:"";position:absolute;width:95px;height:95px;border:1px dashed #2c827a55;border-radius:50%;top:21px;left:21px;animation:orbit 14s linear infinite}.sun i{position:absolute;width:48px;height:48px;border-radius:50%;background:var(--yellow);top:43px;left:44px;box-shadow:0 0 0 10px #f1ca5733;animation:breathe 4s ease-in-out infinite}.sun b,.sun em{position:absolute;width:7px;height:7px;border-radius:50%;background:var(--coral);top:26px;right:22px}.sun em{top:97px;left:23px;background:var(--teal)}.day-card{background:var(--paper);border:1px solid var(--line);border-radius:24px;padding:18px;box-shadow:0 13px 28px #163b420c}.day-head{display:flex;justify-content:space-between;align-items:center}.day-head h2{font:500 24px var(--serif)}.ring{width:52px;height:52px;border-radius:50%;display:grid;place-items:center;position:relative;background:transparent}.ring-svg{position:absolute;inset:0;width:100%;height:100%;transform:rotate(-90deg)}.ring-bg{fill:none;stroke:var(--mint);stroke-width:4.5}.ring-fill{fill:none;stroke:var(--teal);stroke-width:4.5;stroke-linecap:round;stroke-dasharray:131.95;stroke-dashoffset:131.95;transition:stroke-dashoffset .65s var(--spring)}.ring span{position:relative;z-index:1;font-size:11px;font-weight:700;color:var(--teal)}.dose-list{margin-top:14px}.dose{display:flex;align-items:center;gap:12px;border-top:1px solid var(--line);padding:13px 0;animation:row .35s ease both}.dose-time{font-size:12px;color:var(--muted);width:42px}.dose-mark{width:35px;height:35px;border-radius:12px;background:var(--mint);display:grid;place-items:center;color:var(--teal);font-size:17px}.dose-info{flex:1}.dose-info strong{display:block;font:500 16px var(--serif)}.dose-info small{color:var(--muted);font-size:11px}.done{background:var(--teal);color:white;border:0;width:29px;height:29px;border-radius:10px}.done.pending{background:var(--bg);color:var(--muted);border:1px solid var(--line)}.empty{text-align:center;padding:19px 5px;color:var(--muted)}.empty span{display:grid;place-items:center;margin:auto auto 8px;width:34px;height:34px;border-radius:12px;background:var(--mint);color:var(--teal)}.empty p{font-size:12px}.small-action,.cancel{background:transparent;color:var(--teal);font-size:12px;font-weight:700;border:0;margin-top:10px}.next-card,.privacy,.setting-card,.info-card{display:flex;align-items:center;gap:12px;background:var(--mint);border-radius:18px;padding:14px;margin-top:14px}.next-icon{display:grid;place-items:center;width:35px;height:35px;background:var(--teal);color:#fff;border-radius:12px}.next-card h3{font:500 16px var(--serif)}.arrow{margin-left:auto;font-size:20px;color:var(--teal)}.privacy{background:var(--paper);border:1px solid var(--line);align-items:flex-start}.privacy>span{color:var(--teal);font-size:17px}.privacy p,.setting-card p,.info-card p{font-size:11px;line-height:1.45;color:var(--muted)}.back{background:var(--paper);border:1px solid var(--line);border-radius:12px;width:39px;height:39px;font-size:21px}.page-head>div{flex:1;margin-left:11px}.add-round{width:39px;height:39px;border-radius:13px;background:var(--coral);color:#fff;border:0;font-size:23px}.medicine-list{display:grid;gap:10px}.medicine{display:flex;align-items:center;gap:12px;background:#fff;border:1px solid var(--line);border-radius:18px;padding:14px}.pill{display:grid;place-items:center;width:40px;height:40px;border-radius:14px;background:var(--peach-light,#FCE7DE);color:#A85739;font-size:18px}.medicine h3{font:500 17px var(--serif)}.medicine p{font-size:11px;color:var(--muted);margin-top:3px}.medicine small{margin-left:auto;color:var(--teal);font-weight:700}.empty-full{text-align:center;padding:65px 22px}.empty-full h2{font:500 25px var(--serif);margin:15px 0 6px}.empty-full p{color:var(--muted);font-size:13px;line-height:1.5}.pill-art{display:grid;place-items:center;width:75px;height:75px;margin:auto;border-radius:25px;background:var(--mint);color:var(--teal);font-size:30px;animation:breathe 4s infinite}.primary{display:block;width:100%;border:0;border-radius:14px;background:var(--teal);color:#fff;padding:13px;font-weight:700;margin-top:18px;box-shadow:0 8px 19px #2c827a30}.nav{position:absolute;z-index:5;bottom:calc(8px + env(safe-area-inset-bottom));left:12px;right:12px;height:65px;border:1px solid var(--line);border-radius:22px;background:#fffffff2;display:grid;grid-template-columns:1fr 1fr 60px 1fr;align-items:center;box-shadow:0 12px 32px #163b4215}.nav-item{display:grid;place-items:center;gap:2px;background:none;border:0;color:var(--muted);font-size:19px;height:54px}.nav-item small{font-size:9px}.nav-item.active{color:var(--teal)}.nav-add{width:52px;height:52px;margin:-24px auto 0;border:5px solid var(--bg);border-radius:18px;background:var(--coral);color:#fff;font-size:27px;box-shadow:0 8px 18px #e89c7d55}.setting-card{justify-content:space-between;background:var(--paper);border:1px solid var(--line)}.setting-card h2{font:500 17px var(--serif);margin-bottom:3px}.check{display:grid;place-items:center;width:30px;height:30px;background:var(--mint);border-radius:10px;color:var(--teal)}.toggle{color:#bccac5}.toggle.on{color:var(--teal)}.info-card{display:block;background:#FCE7DE;color:#7d4a38}.info-card h2{font:500 20px var(--serif);margin:5px 0}.info-card p{color:#7d655d}.scrim{position:fixed;inset:0;z-index:20;background:#163b4266;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);display:flex;align-items:flex-end;justify-content:center;opacity:0;transition:opacity .3s var(--spring);pointer-events:none}.scrim:not([hidden]){display:flex!important;opacity:1;pointer-events:auto}.sheet{width:min(100%,560px);background:var(--bg);border-radius:28px 28px 0 0;padding:14px 20px calc(24px + env(safe-area-inset-bottom));box-shadow:0 -12px 40px #163b4224;transform:translateY(100%);transition:transform .38s var(--spring);touch-action:none;will-change:transform}.scrim:not([hidden]) .sheet{transform:translateY(0)}.handle{display:block;width:44px;height:5px;border-radius:10px;background:var(--line);margin:0 auto 16px;cursor:grab;transition:background .2s,transform .2s}.handle:active{background:var(--muted);transform:scaleX(1.15)}.sheet h2{font:500 27px var(--serif);margin-bottom:5px}.sheet label{display:block;font-size:12px;font-weight:700;margin-top:15px}.sheet label small{color:var(--muted);font-weight:400}.sheet input{display:block;width:100%;border:1px solid var(--line);background:#fff;border-radius:13px;padding:12px;margin-top:6px;color:var(--ink);font-size:16px}.toast{position:fixed;z-index:30;left:50%;bottom:94px;transform:translate(-50%,15px);opacity:0;background:var(--ink);color:#fff;border-radius:99px;padding:10px 15px;font-size:12px;transition:.2s}.toast.show{opacity:1;transform:translate(-50%,0)}@keyframes enter{to{opacity:1;transform:none}}@keyframes row{from{opacity:0;transform:translateY(8px)}}@keyframes up{from{transform:translateY(40px)}}@keyframes breathe{50%{transform:scale(1.06)}}@keyframes orbit{to{transform:rotate(360deg)}}@media(max-width:390px){.hero h1{font-size:29px}.sun{width:118px;height:118px}.sun:before{width:80px;height:80px;top:19px;left:19px}.sun i{top:37px;left:38px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}


[hidden]{display:none!important}

/* Tactile Mobile Touch Feedback */
button, .nav-item, .nav-add, .avatar, .back, .add-round, .small-action, .primary, .cancel, .done, .dose, .medicine, .next-card, .setting-card, .info-card {
  transition: transform 0.14s var(--spring), opacity 0.14s ease, box-shadow 0.14s ease;
  user-select: none;
  -webkit-user-select: none;
}
button:active, .nav-item:active, .avatar:active, .back:active, .add-round:active, .primary:active, .cancel:active, .done:active, .medicine:active, .next-card:active {
  transform: scale(0.96) !important;
}
.nav-add:active {
  transform: translateY(-20px) scale(0.92) !important;
}
.screen.active {
  display: block;
  animation: enter 0.35s var(--spring) forwards;
}
@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Multi-dose & Dosage Unit Selectors */
.dosage-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  align-items: center;
}
.dosage-row input {
  flex: 1;
  margin-top: 0 !important;
  min-width: 0;
}
.dosage-row select {
  width: 120px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 13px;
  padding: 12px;
  color: var(--ink);
  font-size: 15px;
  font-family: var(--sans);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%232C827A' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 32px;
}
.time-add-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  align-items: center;
}
.time-add-row input {
  flex: 1;
  margin-top: 0 !important;
  min-width: 0;
}
.time-add-row button,
.time-add-row .small-action {
  background: var(--mint);
  color: var(--teal);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 13px;
  margin-top: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.14s var(--spring), background-color 0.15s ease;
}
.time-add-row button:active,
.time-add-row .small-action:active {
  transform: scale(0.96);
}
.time-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  min-height: 28px;
}
.time-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--mint);
  color: var(--teal);
  border: 1px solid #c4ded6;
  border-radius: 99px;
  padding: 6px 10px 6px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  animation: enter 0.2s var(--spring);
}
.time-chip .chip-remove {
  background: transparent;
  border: 0;
  color: var(--teal);
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.time-chip .chip-remove:hover {
  opacity: 1;
}
.time-chip .chip-remove:active {
  transform: scale(0.85);
}

/* 5-item Navigation */
.nav {
  grid-template-columns: 1fr 1fr 52px 1fr 1fr !important;
}

/* 7-Day Calendar Strip */
.calendar-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 15px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 8px;
  box-shadow: 0 4px 14px #163b4208;
}
.cal-strip-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 2px;
  border-radius: 12px;
  cursor: pointer;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 11px;
  transition: background 0.15s ease, color 0.15s ease;
}
.cal-strip-day.active {
  background: var(--mint);
  color: var(--teal);
  font-weight: 700;
}
.cal-strip-day .cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: transparent;
}
.cal-strip-day .cal-dot.done {
  background: var(--teal);
}
.cal-strip-day .cal-dot.partial {
  background: var(--coral);
}

/* Calendar Month View */
.month-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 13px 28px #163b420c;
}
.month-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.month-head h2 {
  font: 500 22px var(--serif);
}
.cal-nav {
  display: flex;
  gap: 6px;
}
.cal-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
}
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 12px;
  cursor: pointer;
  position: relative;
  background: var(--bg);
}
.cal-cell.today {
  border-color: var(--teal);
  font-weight: 700;
}
.cal-cell.selected {
  background: var(--teal);
  color: #fff;
}
.cal-cell .cell-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  margin-top: 2px;
}
.cal-cell .cell-dot.complete {
  background: var(--teal);
}
.cal-cell.selected .cell-dot.complete {
  background: #fff;
}
.cal-cell.empty {
  background: transparent;
  cursor: default;
}
.cal-selected-card {
  margin-top: 15px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
}

/* NHS Affiliate Prescription Card */
.nhs-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #E8F1F8;
  border: 1px solid #D0E1F0;
  border-radius: 18px;
  padding: 14px;
  margin-top: 14px;
}
.nhs-badge {
  background: #005EB8;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.05em;
  padding: 6px 9px;
  border-radius: 8px;
  line-height: 1;
}
.nhs-info {
  flex: 1;
}
.nhs-info h3 {
  font: 500 15px var(--serif);
  color: #0E365C;
  line-height: 1.2;
}
.nhs-info p {
  font-size: 11px;
  color: #4A657D;
  margin: 4px 0 6px;
  line-height: 1.35;
}
.nhs-link {
  font-size: 12px;
  font-weight: 700;
  color: #005EB8;
  text-decoration: none;
}


