/* Humanota MVP — shared styles for every screen on this canvas.
   Values mirror the Humanota design system tokens. */
:root {
  --ink: #1F1B18; --cream: #FBF6EC; --kraft: #F2E6D6; --paper-white: #FFFFFF;
  --pencil: #69625D; --rule: #C9BFAE; --ash: #9C948A;
  --sticky: #F7EB91; --lilac: #D2BCEF; --lilac-deep: #643B9A; --memo: #C2DEFD;
  --leaf: #B8DFB4; --leaf-solid: #58A051; --orange: #FAC188; --orange-solid: #EC9845; --peach: #FFD4D1;
  --font-display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --font-sans: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --focus-ring: 0 0 0 4px #F7EB91, 0 0 0 6px #1F1B18;
}
.hn-root, .hn-root * { box-sizing: border-box; }
.hn-root { container-type: inline-size; width: 100%; font-family: var(--font-sans); color: var(--ink); -webkit-font-smoothing: antialiased; }
:where(.hn-root) :where(button, input, textarea) { font-family: inherit; color: inherit; }
.hn-root :focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---------- App frame ---------- */
.hn-app { display: flex; gap: 16px; padding: 12px 10px; background: var(--kraft); min-height: 100vh; align-items: stretch; }
.hn-side { flex: 0 0 240px; background: var(--paper-white); border-radius: 24px; padding: 20px 19px 20px 20px; display: flex; flex-direction: column; gap: 28px; }
.hn-logo { display: block; height: 32px; width: auto; }
.hn-logo-link { display: inline-block; line-height: 0; border-radius: 8px; }
.hn-nav { display: flex; flex-direction: column; gap: 8px; }
.hn-nav-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 17px; border: 2.5px solid transparent; border-radius: 999px; color: var(--pencil); font-size: 16px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.hn-nav-item svg { flex: none; }
.hn-nav-item:hover { color: var(--ink); }
.hn-nav-item.is-active { background: var(--sticky); border-color: var(--ink); color: var(--ink); }
.hn-role { margin-top: auto; align-self: flex-start; display: inline-flex; gap: 4px; padding: 4px; background: var(--kraft); border: 2.5px solid var(--ink); border-radius: 999px; }
.hn-role a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; font-size: 15px; font-weight: 700; color: var(--ink); text-decoration: none; }
.hn-role a.is-on { background: var(--ink); color: var(--cream); }

.hn-main { flex: 1 1 auto; min-width: 0; position: relative; background: var(--cream); border-radius: 24px; padding: 24px 28px 64px; }
.hn-content { max-width: 768px; margin: 0 auto; }
.hn-more { position: absolute; top: 24px; right: 26px; width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; background: var(--paper-white); border: 2.5px solid var(--ink); border-radius: 50%; box-shadow: 3px 3px 0 var(--ink); cursor: pointer; padding: 0; }

/* ---------- Patient picker ---------- */
.hn-picker { position: relative; display: inline-block; }
.hn-pill { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; background: var(--paper-white); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: 4px 4px 0 var(--ink); font-size: 16px; font-weight: 600; cursor: pointer; }
.hn-pop { position: absolute; z-index: 5; top: 54px; left: 0; width: 382px; max-width: calc(100cqw - 32px); background: rgba(251,246,236,.97); border: 2.5px solid var(--ink); border-radius: 22px; padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 4px 4px 0 var(--ink); }
.hn-search { width: 100%; min-height: 48px; padding: 0 20px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--paper-white); font-size: 16px; }
.hn-search::placeholder { color: var(--pencil); }
.hn-pop-row { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; background: var(--sticky); border: 2.5px solid var(--ink); border-radius: 999px; font-size: 15px; color: var(--ink); text-decoration: none; }
.hn-pop-row b { font-weight: 700; }
.hn-pop-help { font-size: 13px; color: var(--pencil); }

/* ---------- Type ---------- */
.hn-eyebrow { margin: 32px 0 0; font-family: var(--font-mono); font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--pencil); }
.hn-display { margin: 0; font-family: var(--font-display); font-size: 64px; line-height: 1; font-weight: 800; letter-spacing: -0.045em; }
.hn-h1 { margin: 0; font-family: var(--font-display); font-size: 42px; line-height: 46px; font-weight: 800; letter-spacing: -0.035em; }
.hn-h2 { margin: 0; font-family: var(--font-display); font-size: 28px; line-height: 32px; font-weight: 700; letter-spacing: -0.02em; }
.hn-h3 { margin: 0; font-family: var(--font-display); font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.01em; }
.hn-lede { margin: 16px 0 0; font-size: 16px; line-height: 24px; color: var(--pencil); max-width: 680px; }
.hn-mono { font-family: var(--font-mono); font-weight: 500; }
.hn-muted { color: var(--pencil); }

/* ---------- Buttons ---------- */
.hn-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border: 2.5px solid var(--ink); border-radius: 999px; font-size: 16px; line-height: 20px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .08s ease, box-shadow .08s ease; }
.hn-btn-primary { background: var(--lilac-deep); color: var(--cream); box-shadow: 4px 4px 0 var(--ink); }
.hn-btn-secondary { background: var(--paper-white); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.hn-btn-outline { background: transparent; color: var(--pencil); font-weight: 600; }
.hn-btn-primary:active, .hn-btn-secondary:active { transform: translate(4px, 4px); box-shadow: none; }
.hn-btn-sm { min-height: 44px; padding: 0 16px; font-size: 15px; box-shadow: 3px 3px 0 var(--ink); }
.hn-btn-block { width: 100%; }
.hn-btn-pending { background: #B09ACB; color: var(--cream); box-shadow: 4px 4px 0 #8F8A86; border-color: #8F8A86; cursor: not-allowed; }
.hn-link { display: inline-flex; align-items: center; gap: 8px; color: var(--lilac-deep); font-size: 16px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.hn-link-sm { font-size: 15px; }

/* ---------- Segmented control ---------- */
.hn-seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--kraft); border: 2.5px solid var(--ink); border-radius: 999px; max-width: 100%; }
.hn-seg button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.hn-seg button.is-on { background: var(--ink); color: var(--cream); }
.hn-seg-block { display: flex; width: 100%; }
.hn-seg-block button { flex: 1 1 0; }

/* ---------- Tags, chips, badges ---------- */
.hn-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hn-tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 11px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper-white); font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.hn-tag-b { font-size: 14px; font-weight: 700; padding: 3px 12px; }
.hn-tag-quiet { background: var(--ink); color: var(--lilac); font-size: 14px; font-weight: 700; padding: 3px 12px; }
.hn-tag-closer { background: var(--ink); color: var(--orange); font-size: 14px; font-weight: 700; padding: 3px 12px; }
.hn-tint-sticky { background: var(--sticky); } .hn-tint-lilac { background: var(--lilac); } .hn-tint-memo { background: var(--memo); }
.hn-tint-leaf { background: var(--leaf); } .hn-tint-orange { background: var(--orange); } .hn-tint-peach { background: var(--peach); }
.hn-chip { display: inline-flex; align-items: center; align-self: flex-start; padding: 3px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper-white); font-family: var(--font-mono); font-size: 13px; line-height: 18px; font-weight: 600; white-space: pre; }
.hn-chip-cream { background: var(--cream); }
.hn-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 8px; border: 2px solid var(--ink); border-radius: 999px; font-size: 15px; line-height: 20px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.hn-badge-sm { font-size: 13px; font-weight: 500; padding: 1px 10px 1px 7px; gap: 4px; }
.hn-badge-success { background: var(--leaf); } .hn-badge-caution { background: var(--orange); }

/* ---------- Today ---------- */
.hn-today-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-top: 72px; }
.hn-today-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-bottom: 6px; }
.hn-sub { margin: 6px 0 0; font-size: 16px; line-height: 24px; color: var(--pencil); }
.hn-sub .hn-mono { color: var(--ink); font-size: 14px; }
.hn-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.hn-note { position: relative; display: flex; flex-direction: column; gap: 0; min-height: 280px; padding: 28px 28px 26px; border: 2.5px solid var(--ink); border-radius: 28px; box-shadow: 6px 6px 0 var(--ink); text-align: left; color: var(--ink); text-decoration: none; cursor: pointer; transition: transform .08s ease, box-shadow .08s ease; }
.hn-note:hover { transform: translate(-1px, -1px); box-shadow: 7px 7px 0 var(--ink); }
.hn-note-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.hn-note-time { font-family: var(--font-mono); font-size: 13px; font-weight: 500; padding-top: 2px; }
.hn-note-title { margin: 14px 0 0; font-family: var(--font-display); font-size: 26px; line-height: 30px; font-weight: 700; letter-spacing: -0.02em; }
.hn-note-text { margin: 10px 0 0; font-size: 16px; line-height: 24px; }
.hn-note .hn-chip { margin-top: 14px; }
.hn-note-foot { margin-top: auto; padding-top: 14px; }
.hn-note-foot div { border-top: 1.5px dashed var(--ink); padding-top: 14px; font-size: 13px; line-height: 18px; color: #4A433E; }
.hn-panel { background: var(--paper-white); border: 2.5px solid var(--ink); border-radius: 28px; padding: 28px; }
.hn-sched { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; }
.hn-sched li { display: flex; align-items: center; gap: 12px; font-size: 16px; line-height: 24px; }
.hn-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: var(--leaf); }
.hn-dot-lilac { background: var(--lilac); } .hn-dot-sticky { background: var(--sticky); }
.hn-dot-m { display: none; }
.hn-next { margin-top: 28px; padding-top: 28px; border-top: 1.5px dashed var(--rule); }

/* ---------- Profile ---------- */
.hn-name-display { margin-top: 26px; }
.hn-disc { margin-top: 16px; }
.hn-meta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 18px; }
.hn-meta-row p { margin: 0; font-size: 15px; color: var(--pencil); }
.hn-meta-row .hn-mono { color: var(--ink); font-size: 14px; }
.hn-chg { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; background: var(--paper-white); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: 4px 4px 0 var(--ink); font-size: 14px; font-weight: 700; cursor: pointer; }
.hn-cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 28px; }
.hn-pcard { display: flex; flex-direction: column; gap: 18px; padding: 28px 26px 24px 28px; border: 2.5px solid var(--ink); border-radius: 28px; color: var(--ink); min-height: 356px; }
.hn-pcard-head { display: flex; align-items: center; gap: 10px; }
.hn-pcard-head svg { flex: none; }
.hn-pcard ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 16px; line-height: 24px; }
.hn-pcard ul li::marker { font-size: 13px; }
.hn-callout { background: var(--paper-white); border: 2.5px solid var(--ink); border-radius: 18px; padding: 18px 20px; }
.hn-callout-name { margin: 0; font-family: var(--font-display); font-size: 28px; line-height: 32px; font-weight: 700; letter-spacing: -0.02em; }
.hn-callout-text { margin: 12px 0 0; font-size: 16px; line-height: 24px; }
.hn-tip { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; line-height: 24px; font-weight: 600; }
.hn-tip svg { flex: none; margin-top: 2px; }
.hn-pcard-foot { margin-top: auto; border-top: 1.5px dashed var(--ink); padding-top: 18px; font-size: 14px; font-weight: 600; }
.hn-legal { margin-top: auto; align-self: center; text-align: center; font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; cursor: pointer; padding: 0 8px; }

/* ---------- Care summary ---------- */
.hn-cards2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 22px; margin-top: 28px; align-items: start; }
.hn-sum { background: var(--paper-white); border: 2.5px solid var(--ink); border-radius: 28px; overflow: hidden; }
.hn-sum-review { box-shadow: 0 0 0 4px var(--orange); }
.hn-sum-head { padding: 24px 28px 20px; border-bottom: 2.5px solid var(--ink); }
.hn-sum-head p { margin: 2px 0 0; font-size: 15px; line-height: 22px; }
.hn-sum-body { padding: 0 28px 28px; }
.hn-sec { padding: 26px 0 22px; border-bottom: 1.5px dashed var(--rule); display: flex; flex-direction: column; gap: 12px; }
.hn-sec-label { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 18px; font-weight: 700; color: var(--pencil); }
.hn-stmt { display: flex; flex-direction: column; gap: 12px; }
.hn-stmt + .hn-stmt { margin-top: 6px; }
.hn-stmt p { margin: 0; font-size: 16px; line-height: 24px; }
.hn-sum-foot { padding-top: 22px; display: flex; flex-direction: column; gap: 8px; }
.hn-approval { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.hn-small { font-size: 13px; line-height: 18px; color: var(--pencil); }
.hn-small b { color: var(--ink); }
.hn-small .hn-mono { color: var(--ink); font-weight: 600; }
.hn-btnrow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* ---------- Timeline ---------- */
.hn-section-title { margin-top: 36px; }
.hn-tl { display: flex; flex-direction: column; gap: 22px; margin-top: 22px; }
.hn-entry { display: flex; align-items: flex-start; gap: 0; }
.hn-entry-date { flex: none; width: 96px; padding-top: 34px; font-family: var(--font-mono); font-size: 13px; line-height: 18px; font-weight: 500; color: var(--pencil); white-space: nowrap; }
.hn-entry-date.is-ink { color: var(--ink); font-weight: 600; }
.hn-entry-rail { flex: none; width: 40px; display: flex; justify-content: center; padding-top: 36px; }
.hn-entry-card { flex: 1 1 auto; min-width: 0; padding: 28px; border: 2.5px solid var(--ink); border-radius: 28px; background: var(--paper-white); display: flex; flex-direction: column; gap: 14px; }
.hn-entry-card.hn-tint-lilac { background: var(--lilac); }
.hn-entry-card p { margin: 0; font-size: 18px; line-height: 27px; }
.hn-entry-card .hn-entry-note { font-size: 13px; line-height: 18px; }
.hn-entry-card .hn-entry-warn { font-size: 14px; line-height: 18px; font-weight: 700; }
.hn-entry-card .hn-link { margin-top: 8px; align-self: flex-start; }
.hn-checkin { margin-top: 30px; padding: 28px; background: var(--paper-white); border: 2.5px solid var(--ink); border-radius: 28px; font-size: 16px; line-height: 24px; }
.hn-checkin .hn-mono { font-size: 14px; font-weight: 600; }

/* ---------- Family portal ---------- */
.hn-portal { display: grid; grid-template-columns: minmax(0, 384fr) minmax(0, 358fr); gap: 26px; margin-top: 28px; align-items: start; }
.hn-banner { padding: 28px 28px 26px; background: var(--sticky); border: 2.5px solid var(--ink); border-radius: 28px; }
.hn-banner .hn-h2 { font-size: 28px; line-height: 32px; }
.hn-banner .hn-btnrow { margin-top: 20px; gap: 12px; }
.hn-portal .hn-section-title { margin-top: 30px; }
.hn-portal .hn-entry-rail { width: 36px; }
.hn-form { padding: 26px 28px 28px; background: var(--paper-white); border: 2.5px solid var(--ink); border-radius: 28px; display: flex; flex-direction: column; }
.hn-label { display: block; font-size: 14px; line-height: 18px; font-weight: 700; margin: 24px 0 10px; }
.hn-input { width: 100%; min-height: 48px; padding: 0 20px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--paper-white); font-family: var(--font-mono); font-size: 15px; font-weight: 500; }
.hn-textarea { width: 100%; min-height: 120px; padding: 16px 20px; border: 2.5px solid var(--ink); border-radius: 18px; background: var(--paper-white); font-size: 16px; line-height: 24px; resize: vertical; }
.hn-textarea::placeholder { color: var(--pencil); }
.hn-form .hn-eyebrow { margin-top: 28px; }
.hn-checks { display: flex; flex-direction: column; margin-top: 8px; }
.hn-check { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0; background: none; border: 0; font-size: 16px; text-align: left; cursor: pointer; border-radius: 12px; }
.hn-box { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--paper-white); display: inline-flex; align-items: center; justify-content: center; color: var(--cream); }
.hn-box.is-on { background: var(--ink); }
.hn-form-div { border-top: 1.5px dashed var(--rule); margin: 8px 0 4px; }
.hn-form .hn-btn-block { margin-top: 14px; }

/* ---------- Mobile (container < 768px) ---------- */
@container (max-width: 767px) {
  .hn-app { flex-direction: column; gap: 8px; padding: 8px; }
  .hn-side { flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 14px 12px; border-radius: 22px; }
  .hn-logo { height: 26px; }
  .hn-role { order: 2; margin: 0 0 0 auto; align-self: center; }
  .hn-role a { min-height: 36px; padding: 0 12px; font-size: 13px; }
  .hn-nav { order: 3; flex-direction: row; width: 100%; overflow-x: auto; gap: 6px; padding: 2px 2px 4px; scrollbar-width: none; }
  .hn-nav-item { min-height: 40px; padding: 0 14px; font-size: 15px; gap: 8px; }
  .hn-main { padding: 16px 16px 48px; border-radius: 22px; }
  .hn-more { top: 16px; right: 16px; width: 44px; height: 44px; }
  .hn-pill { min-height: 44px; }
  .hn-eyebrow { margin-top: 24px; }
  .hn-display { font-size: 44px; }
  .hn-h1 { font-size: 34px; line-height: 38px; }
  .hn-today-head { margin-top: 28px; }
  .hn-today-actions { width: 100%; }
  .hn-today-actions .hn-btn { flex: 1 1 0; padding: 0 12px; }
  .hn-seg { overflow-x: auto; scrollbar-width: none; }
  .hn-seg button { padding: 0 12px; font-size: 14px; }
  .hn-notes, .hn-cards2, .hn-cards3, .hn-portal { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .hn-note { min-height: 0; padding: 22px 22px 20px; }
  .hn-panel, .hn-checkin, .hn-banner, .hn-form { padding: 22px; }
  .hn-pcard { min-height: 0; padding: 24px 22px 20px; }
  .hn-sum-head { padding: 20px 22px 16px; }
  .hn-sum-body { padding: 0 22px 22px; }
  .hn-entry { flex-direction: column; }
  .hn-entry-date { width: auto; display: flex; align-items: center; gap: 10px; padding: 0 0 8px 4px; }
  .hn-entry-rail { display: none; }
  .hn-dot-m { display: inline-block; order: -1; }
  .hn-entry-card { padding: 22px; }
  .hn-entry-card p { font-size: 17px; line-height: 25px; }
  .hn-section-title { margin-top: 30px; }
  .hn-meta-row { flex-direction: column; align-items: flex-start; }
}
