@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  --navy:      #0F3460;
  --navy-2:    #1C4B87;
  --gold:      #C9A84C;
  --gold-l:    #D4B86A;
  --bg:        #F6F7FA;
  --white:     #FFFFFF;
  --text:      #161823;
  --text-2:    #5F6476;
  --border:    #E2E5EF;
  --green:     #2EB85C;
  --green-bg:  #EAF8EE;
  --amber:     #F5A51E;
  --amber-bg:  #FFF7E0;
  --red:       #DC3232;
  --red-bg:    #FFECEC;
  --blue:      #1950B9;
  --blue-bg:   #E8F2FF;
  --radius:    12px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: linear-gradient(180deg, #dde5f5 0%, var(--bg) 38%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: 80px;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.header {
  background: var(--navy);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.3px; line-height: 1; }
.logo .vita { color: var(--gold); }
.logo .dose { color: #fff; }
.logo .sub  { display: block; font-size: 0.6rem; font-weight: 400; color: rgba(255,255,255,0.5); letter-spacing: 0.08em; margin-top: 1px; }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color .2s;
}
.avatar[style*="background-image"] {
  border-color: var(--gold);
}

.date-bar {
  background: var(--navy-2);
  color: rgba(255,255,255,0.65);
  font-size: 0.78rem;
  padding: 7px 20px;
}

/* ── Summary ── */
.summary {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 1px;
  background: var(--border);
  margin: 14px 16px 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.sum-item { background: var(--white); padding: 13px 6px; text-align: center; background: linear-gradient(180deg, #f5f7fc 0%, var(--white) 100%); }
.sum-num  { font-size: 1.55rem; font-weight: 700; line-height: 1; color: var(--navy); }
.sum-num.green { color: var(--green); }
.sum-num.amber { color: var(--amber); }
.sum-num.red   { color: var(--red); }
.sum-label { font-size: 0.65rem; color: var(--text-2); margin-top: 3px; }

/* ── Progress ── */
.progress-wrap { margin: 12px 16px 0; }
.progress-bar  { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(to right, var(--navy), var(--gold)); border-radius: 99px; transition: width .4s ease; }
.progress-lbl  { font-size: 0.7rem; color: var(--text-2); margin-top: 5px; }

/* ── Next dose ── */
.next-dose {
  margin: 14px 16px 0;
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 16px;
  border-left: 4px solid var(--blue);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.nd-eyebrow { font-size: 0.62rem; font-weight: 600; color: var(--blue); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 3px; }
.nd-name    { font-size: 0.98rem; font-weight: 600; color: var(--navy); }
.nd-time    { font-size: 0.82rem; color: var(--text-2); margin-top: 1px; }

/* ── Section header ── */
.sec-header { padding: 14px 20px 8px; font-size: 0.67rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--navy); opacity: 0.6; }

/* ── Med card ── */
.med-card   { background: var(--white); margin: 0 16px 10px; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.med-inner  { display: flex; }
.med-stripe { width: 5px; flex-shrink: 0; }
.med-stripe.green { background: var(--green); }
.med-stripe.amber { background: var(--amber); }
.med-stripe.red   { background: var(--red); }
.med-stripe.gray  { background: var(--border); }
.med-body   { flex: 1; padding: 13px 13px 11px; min-width: 0; }
.med-top    { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.med-name   { font-size: 0.97rem; font-weight: 600; color: var(--navy); }
.med-ind    { font-size: 0.75rem; color: var(--text-2); margin-bottom: 7px; }

/* Stock mini */
.stock-mini { text-align: right; flex-shrink: 0; }
.stock-num  { font-size: 0.72rem; font-weight: 600; color: var(--text); font-family: 'DM Mono', monospace; }
.stock-lbl  { font-size: 0.62rem; color: var(--text-2); }
.stock-bar  { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; width: 58px; margin-top: 4px; }
.stock-fill { height: 100%; border-radius: 99px; }
.stock-fill.green { background: var(--green); }
.stock-fill.amber { background: var(--amber); }
.stock-fill.red   { background: var(--red); }
.stock-pct  { font-size: 0.62rem; color: var(--text-2); margin-top: 2px; text-align: right; }

/* Badge */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 0.7rem; font-weight: 600; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red   { background: var(--red-bg);   color: var(--red); }
.badge-gray  { background: #f0f0f0; color: var(--text-2); }
.bdot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.bdot.green { background: var(--green); }
.bdot.amber { background: var(--amber); }
.bdot.gray  { background: var(--text-2); }

/* Horário pills */
.horarios { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 0; }
.h-pill { background: #d8e2f4; color: var(--navy); font-size: 0.7rem; font-weight: 700; padding: 3px 9px; border-radius: 6px; font-family: 'DM Mono', monospace; border: 1px solid rgba(15,52,96,0.15); }
.h-pill.tomado { background: var(--green-bg); color: var(--green); text-decoration: line-through; border-color: rgba(46,184,92,0.2); }

/* Alert inline */
.alert-inline { display: flex; align-items: center; gap: 8px; padding: 8px 13px; font-size: 0.76rem; font-weight: 500; }
.alert-inline.amber { background: var(--amber-bg); color: #7A4F00; }
.alert-inline.red   { background: var(--red-bg);   color: #7A0000; }
.alert-inline button { margin-left: auto; background: none; border: none; font-size: 1rem; cursor: pointer; color: inherit; opacity: 0.6; }

/* Alertas clínicos */
.alertas-sec { margin: 4px 16px 16px; }
.al-card { border-radius: var(--radius-sm); padding: 11px 13px; margin-bottom: 8px; display: flex; gap: 10px; align-items: flex-start; }
.al-card.interacao  { background: var(--red-bg);   border-left: 3px solid var(--red); }
.al-card.alimentacao { background: var(--amber-bg); border-left: 3px solid var(--amber); }
.al-icon  { font-size: 1rem; flex-shrink: 0; line-height: 1.5; }
.al-title { font-size: 0.8rem; font-weight: 700; margin-bottom: 2px; }
.al-card.interacao  .al-title { color: var(--red); }
.al-card.alimentacao .al-title { color: #7A4F00; }
.al-desc  { font-size: 0.76rem; color: var(--text-2); }

/* ── Bottom nav ── */
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; background: var(--white); border-top: 2px solid var(--navy); display: flex; z-index: 100; box-shadow: 0 -4px 16px rgba(15,52,96,0.10); }
.nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 9px 4px 7px; gap: 3px; text-decoration: none; color: var(--text-2); font-size: 0.6rem; font-weight: 500; cursor: pointer; background: none; border: none; font-family: inherit; transition: color .15s; -webkit-tap-highlight-color: transparent; }
.nav-btn.active { color: var(--navy); }
.nav-btn svg { width: 21px; height: 21px; }
.nav-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--navy); margin-top: 1px; }

/* ── Buttons ── */
.btn { border: none; border-radius: var(--radius-sm); padding: 11px 20px; font-family: inherit; font-weight: 600; cursor: pointer; font-size: 0.88rem; transition: opacity .15s; white-space: nowrap; }
.btn:active { opacity: .75; }
.btn-primary { background: var(--navy);  color: var(--white); }
.btn-gold    { background: var(--gold);  color: var(--navy); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-danger  { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }
.btn-sm  { padding: 7px 14px; font-size: 0.78rem; }
.btn-full { width: 100%; text-align: center; display: block; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-lbl { display: block; font-size: 0.8rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.form-input, .form-select {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.95rem; color: var(--text);
  background: #F0F4FB; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-input:focus, .form-select:focus {
  border-color: var(--navy);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15,52,96,0.10);
}
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 0.71rem; color: var(--text-2); margin-top: 4px; }

/* ── Cards (form) ── */
.card { background: var(--white); border-radius: var(--radius); padding: 18px; margin: 14px 16px; box-shadow: 0 3px 12px rgba(15,52,96,0.10); border-top: 3px solid var(--navy); }
.card-title { font-size: 0.97rem; font-weight: 700; color: var(--navy); margin-bottom: 14px; padding-bottom: 11px; padding-left: 12px; border-bottom: 1px solid var(--border); border-left: 3px solid var(--gold); display: flex; align-items: center; justify-content: space-between; }

/* Horário builder */
.h-builder { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.h-tag { display: inline-flex; align-items: center; gap: 4px; background: #d8e2f4; color: var(--navy); padding: 5px 10px; border-radius: 6px; font-size: 0.78rem; font-weight: 600; font-family: 'DM Mono', monospace; border: 1px solid rgba(15,52,96,0.15); }
.h-tag button { background: none; border: none; color: var(--text-2); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 0 0 2px; }
.h-input-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.h-input-row input { width: 110px; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: 'DM Mono', monospace; font-size: 0.9rem; }

/* Grade de horários pré-definidos */
.h-preset-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.h-preset { padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 9px; background: var(--bg); color: var(--text); font-family: 'DM Mono', monospace; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: background .13s, border-color .13s, color .13s; min-width: 66px; text-align: center; -webkit-tap-highlight-color: transparent; }
.h-preset.ativo { background: rgba(201,168,76,.18); border-color: var(--gold); color: var(--navy); }
.h-custom-toggle { font-size: .76rem; color: var(--text-2); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; display: inline-block; margin-top: 4px; }

/* Medicamento manipulado */
.manip-toggle-btn { display: flex; align-items: center; gap: 10px; background: none; border: 1.5px dashed var(--border); border-radius: 10px; padding: 11px 14px; cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--text-2); transition: all .15s; width: 100%; margin-bottom: 14px; text-align: left; -webkit-tap-highlight-color: transparent; }
.manip-toggle-btn.ativo { background: rgba(201,168,76,.1); border-color: var(--gold); border-style: solid; color: var(--navy); }
.manip-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s, border-color .15s; }
.manip-toggle-btn.ativo .manip-dot { background: var(--gold); border-color: var(--gold); }
.manip-dot::after { content: ''; display: block; width: 8px; height: 8px; border-radius: 50%; background: transparent; transition: background .15s; }
.manip-toggle-btn.ativo .manip-dot::after { background: var(--navy); }
.comp-grid { display: flex; flex-direction: column; gap: 7px; }
.comp-row { display: grid; grid-template-columns: 1fr 72px 68px; gap: 6px; align-items: center; }
.comp-row .form-input { padding: 8px 10px; font-size: .85rem; }
.comp-row .form-select { padding: 8px 4px; font-size: .8rem; }
.manip-badge { display: inline-flex; align-items: center; background: rgba(201,168,76,.15); border: 1px solid rgba(201,168,76,.35); border-radius: 6px; padding: 2px 8px; font-size: .68rem; font-weight: 700; color: #7a5e10; vertical-align: middle; margin-left: 5px; letter-spacing: .3px; }
.nebul-badge { display: inline-flex; align-items: center; background: rgba(14,116,144,.12); border: 1px solid rgba(14,116,144,.3); border-radius: 6px; padding: 2px 8px; font-size: .68rem; font-weight: 700; color: #0e7490; vertical-align: middle; margin-left: 5px; letter-spacing: .3px; }

/* Med list item (cadastro) */
.med-list-item { display: flex; align-items: center; gap: 12px; padding: 10px 10px; margin: 0 -4px; border-radius: var(--radius-sm); border-bottom: 1px solid var(--border); border-left: 3px solid var(--gold); background: linear-gradient(90deg, rgba(201,168,76,0.06) 0%, transparent 60%); }
.med-list-item:last-child { border-bottom: none; }
.med-list-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex-shrink: 0; box-shadow: 0 0 0 3px rgba(201,168,76,0.2); }
.med-list-info { flex: 1; min-width: 0; }
.med-list-name { font-size: 0.9rem; font-weight: 600; color: var(--navy); }
.med-list-detail { font-size: 0.75rem; color: var(--text-2); margin-top: 2px; }

/* ── Toast ── */
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: var(--navy); color: var(--white); padding: 9px 20px; border-radius: 99px; font-size: 0.83rem; font-weight: 500; z-index: 500; opacity: 0; transition: opacity .2s; white-space: nowrap; pointer-events: none; }
.toast.show { opacity: 1; }

/* ── Modal / bottom sheet ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,52,96,.5); backdrop-filter: blur(4px); z-index: 400; display: flex; align-items: flex-end; justify-content: center; }
.modal-overlay.hidden { display: none; }
.modal-sheet { background: var(--white); border-radius: var(--radius) var(--radius) 0 0; padding: 24px 20px 32px; width: 100%; max-width: 430px; }
.modal-handle { width: 36px; height: 4px; background: var(--border); border-radius: 99px; margin: 0 auto 20px; }
.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.modal-desc  { font-size: 0.85rem; color: var(--text-2); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; }

/* ── LGPD Banner ── */
.lgpd { position: fixed; bottom: 0; left: 0; right: 0; z-index: 600; background: var(--navy); color: rgba(255,255,255,.9); padding: 16px 20px; font-size: 0.8rem; }
.lgpd p { margin-bottom: 12px; line-height: 1.5; }
.lgpd strong { color: var(--gold); }
.lgpd .lgpd-actions { display: flex; gap: 10px; }

/* ── Empty state ── */
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty .icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty p  { font-size: 0.88rem; margin-bottom: 16px; }

/* ── Perfil page ── */
.perfil-header { background: var(--navy); padding: 28px 20px 20px; text-align: center; }
.perfil-avatar-lg { width: 64px; height: 64px; border-radius: 50%; background: var(--gold); color: var(--navy); font-size: 1.4rem; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.perfil-name { font-size: 1.1rem; font-weight: 700; color: var(--white); }
.perfil-tag  { font-size: 0.75rem; color: rgba(255,255,255,.6); margin-top: 3px; }

/* ── Modo noturno ── */
[data-theme="dark"] {
  --bg:       #0D1117;
  --white:    #161B22;
  --text:     #E6EDF3;
  --text-2:   #8B949E;
  --border:   #30363D;
  --green-bg: #0D2B1A;
  --amber-bg: #2B1E00;
  --red-bg:   #2B0D0D;
  --blue-bg:  #0D1A2D;
}
[data-theme="dark"] body { background: linear-gradient(180deg, #0a1020 0%, var(--bg) 40%); }
[data-theme="dark"] .card { border-top-color: var(--gold); box-shadow: 0 3px 12px rgba(0,0,0,0.3); }
[data-theme="dark"] .h-pill  { background: #1E2a3d; color: var(--gold); border-color: rgba(201,168,76,0.2); }
[data-theme="dark"] .h-tag   { background: #1E2a3d; color: var(--gold-l); border-color: rgba(201,168,76,0.2); }
[data-theme="dark"] .h-preset { background: #1a2236; border-color: rgba(201,168,76,0.2); color: var(--cream); }
[data-theme="dark"] .h-preset.ativo { background: rgba(201,168,76,.2); border-color: var(--gold); color: var(--gold-l); }
[data-theme="dark"] .manip-toggle-btn { color: var(--text-2); border-color: var(--border); }
[data-theme="dark"] .manip-toggle-btn.ativo { color: var(--gold-l); background: rgba(201,168,76,.12); }
[data-theme="dark"] .manip-badge { color: var(--gold-l); background: rgba(201,168,76,.12); border-color: rgba(201,168,76,.3); }
[data-theme="dark"] .nebul-badge { color: #67e8f9; background: rgba(14,116,144,.15); border-color: rgba(14,116,144,.35); }
[data-theme="dark"] .badge-gray { background: #1E2530; }
[data-theme="dark"] .btn-outline { border-color: var(--border); color: var(--text); }
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select {
  background: #1a2236;
  color: var(--text);
  border-color: var(--border);
}
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus {
  background: #1E2a3d;
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}
[data-theme="dark"] .form-input::placeholder { color: var(--text-2); }
[data-theme="dark"] .med-list-item { background: linear-gradient(90deg, rgba(201,168,76,0.08) 0%, transparent 60%); border-color: var(--border); border-left-color: var(--gold); }
[data-theme="dark"] .bottom-nav { border-top-color: var(--gold); box-shadow: 0 -4px 16px rgba(0,0,0,0.4); }

/* ── Diário Clínico ── */
.diario-nav { display: flex; align-items: center; justify-content: space-between; background: var(--navy-2); padding: 9px 20px; }
.diario-nav-btn { background: none; border: none; color: rgba(255,255,255,.75); font-size: 1.3rem; cursor: pointer; padding: 2px 12px; border-radius: 6px; transition: background .15s; line-height: 1; }
.diario-nav-btn:active { background: rgba(255,255,255,.12); }
.diario-nav-btn:disabled { opacity: .3; cursor: default; }
.diario-nav-data { font-size: .88rem; font-weight: 600; color: #fff; letter-spacing: .01em; }

.periodo-tabs { display: flex; gap: 4px; }
.periodo-btn  { background: none; border: 1px solid var(--border); color: var(--text-2); font-size: .7rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; cursor: pointer; font-family: inherit; transition: all .15s; }
.periodo-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.diario-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); gap: 8px; }
.diario-row:last-child { border-bottom: none; }
.diario-data-lbl { font-size: .75rem; font-weight: 600; color: var(--text-2); min-width: 56px; flex-shrink: 0; font-family: 'DM Mono', monospace; }
.diario-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }

.chart-grid  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 4px; }
.chart-cell  { background: #F2F5FB; border-radius: var(--radius-sm); padding: 9px 10px 7px; border: 1px solid var(--border); }
.chart-lbl   { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin-bottom: 1px; }
.chart-val   { font-size: .85rem; font-weight: 700; color: var(--navy); font-family: 'DM Mono', monospace; margin-bottom: 5px; line-height: 1.2; }
.chart-canvas { display: block; width: 100%; }

[data-theme="dark"] .chart-cell  { background: #1a2236; }
[data-theme="dark"] .periodo-btn.active { background: var(--gold); color: var(--navy); border-color: var(--gold); }
[data-theme="dark"] .badge-gray  { background: #1E2530; }

/* ── Utility ── */
.hidden  { display: none !important; }
.mono    { font-family: 'DM Mono', monospace; }
.mt-1    { margin-top: 4px; }
.mt-2    { margin-top: 8px; }
.mt-3    { margin-top: 16px; }
.gap-1   { gap: 8px; }
.flex    { display: flex; }
.flex-center { display: flex; align-items: center; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.73rem; }
.text-2  { color: var(--text-2); }
.w-full  { width: 100%; }

/* ── Alerta Visual de Dose (in-app) ── */
#vd-dose-alert {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: vd-fadein 0.2s ease;
}
#vd-dose-alert.vd-alert-saindo { animation: vd-fadeout 0.25s ease forwards; }

@keyframes vd-fadein  { from { opacity: 0; } to { opacity: 1; } }
@keyframes vd-fadeout { from { opacity: 1; } to { opacity: 0; } }

.vd-alert-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 52, 96, 0.55);
  backdrop-filter: blur(3px);
}

.vd-alert-sheet {
  position: relative;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding: 28px 24px 40px;
  width: 100%;
  max-width: 430px;
  text-align: center;
  animation: vd-slideup 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}
#vd-dose-alert.vd-alert-saindo .vd-alert-sheet {
  animation: vd-slidedown 0.25s ease forwards;
}

@keyframes vd-slideup   { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes vd-slidedown { from { transform: translateY(0);    } to { transform: translateY(110%); } }

.vd-alert-pulse {
  font-size: 3rem;
  margin-bottom: 6px;
  display: inline-block;
  animation: vd-pulse 1s ease-in-out infinite;
}
@keyframes vd-pulse {
  0%, 100% { transform: scale(1);    }
  50%       { transform: scale(1.2); }
}

.vd-alert-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-2);
  margin-bottom: 10px;
}

.vd-alert-med {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
  line-height: 1.3;
}

.vd-alert-info {
  font-size: 0.9rem;
  color: var(--text-2);
  font-family: 'DM Mono', monospace;
  margin-bottom: 20px;
}

.vd-alert-mais {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 16px;
}

.vd-alert-actions {
  display: flex;
  gap: 10px;
}
.vd-alert-actions .btn { flex: 1; }

[data-theme="dark"] .vd-alert-sheet { background: #1a2236; }
[data-theme="dark"] .vd-alert-med   { color: var(--gold-l); }

/* ── Fotos do medicamento (cadastro) ── */
.foto-med-row { display:flex; gap:12px; margin-bottom:16px; }
.foto-med-item { flex:1; }
.foto-med-preview {
  position:relative; width:100%; aspect-ratio:1/1;
  background:var(--bg); border:2px dashed rgba(201,168,76,.4);
  border-radius:10px; display:flex; align-items:center; justify-content:center;
  overflow:hidden; cursor:pointer; flex-direction:column; gap:4px;
  transition:border-color .2s;
}
.foto-med-preview:active { border-color:var(--gold); }
.foto-med-preview img { width:100%; height:100%; object-fit:cover; }
.foto-med-del {
  position:absolute; top:4px; right:4px; width:22px; height:22px;
  border-radius:50%; background:rgba(220,50,50,.85); color:#fff;
  border:none; font-size:.85rem; cursor:pointer; line-height:1; padding:0;
  display:flex; align-items:center; justify-content:center;
}
.foto-med-lbl { font-size:.7rem; font-weight:600; color:var(--text-2); text-align:center; margin-top:5px; }

/* ── Thumbnail na home ── */
.med-thumb {
  width:44px; height:44px; border-radius:8px; object-fit:cover;
  flex-shrink:0; cursor:pointer; border:1.5px solid var(--border);
}
.med-receita-btn {
  background:none; border:1px solid var(--border); border-radius:6px;
  font-size:.72rem; cursor:pointer; color:var(--text-2);
  padding:2px 7px; display:inline-flex; align-items:center; gap:3px;
}

/* ── Lightbox ── */
#vd-lightbox {
  position:fixed; inset:0; z-index:600;
  background:rgba(0,0,0,.92); display:none;
  align-items:center; justify-content:center;
}
#vd-lb-img { max-width:96vw; max-height:90vh; object-fit:contain; border-radius:8px; }
#vd-lightbox button {
  position:absolute; top:16px; right:16px;
  background:rgba(255,255,255,.15); border:none; color:#fff;
  width:38px; height:38px; border-radius:50%; font-size:1.3rem;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
}
