@charset "UTF-8";

:root {
  color-scheme: light;
  --paper: #f2eee4;
  --paper-deep: #e8e0d2;
  --surface: #fffdf8;
  --surface-soft: #f8f4eb;
  --surface-green: #edf5ef;
  --ink: #17342f;
  --ink-soft: #47615b;
  --muted: #526761;
  --line: #d9d5c9;
  --line-strong: #c6c1b3;
  --green: #1f5b4f;
  --green-strong: #15463d;
  --green-soft: #dcebe3;
  --green-faint: #f0f7f3;
  --gold: #c38b2b;
  --gold-soft: #f3e2b5;
  --amber: #a95f16;
  --amber-soft: #fae5c9;
  --rose: #a9453f;
  --rose-strong: #852f2a;
  --rose-soft: #f5d8d4;
  --blue: #3d667d;
  --blue-soft: #dce9ef;
  --shadow-sm: 0 2px 10px rgb(37 53 46 / 0.07);
  --shadow-md: 0 14px 40px rgb(37 53 46 / 0.11);
  --shadow-lg: 0 22px 70px rgb(18 45 39 / 0.2);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --sidebar-width: 252px;
  --content-max: 1420px;
  --font-body: "BIZ UDPGothic", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-display: "Yu Mincho", "Hiragino Mincho ProN", serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  background:
    radial-gradient(circle at 91% 3%, rgb(243 200 107 / 0.14), transparent 22rem),
    linear-gradient(90deg, rgb(31 91 79 / 0.028) 1px, transparent 1px),
    linear-gradient(rgb(31 91 79 / 0.022) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 28px 28px, 28px 28px, auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.3;
}

svg.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  color: white;
  background: var(--green-strong);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid #f2b742;
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noscript {
  max-width: 680px;
  margin: 3rem auto;
  padding: 1rem;
  border: 1px solid var(--rose);
  border-radius: 12px;
  background: var(--surface);
}

/* App shell */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 26px 18px 20px;
  color: #eff7f2;
  background:
    radial-gradient(circle at 110% 7%, rgb(243 200 107 / 0.18), transparent 15rem),
    linear-gradient(165deg, #204f46, #173c35 68%, #12332d);
  box-shadow: inset -1px 0 rgb(255 255 255 / 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 8px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 13px;
  color: var(--gold-soft);
  background: rgb(255 255 255 / 0.08);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-copy strong {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.04em;
}

.brand-copy small {
  margin-top: 4px;
  color: rgb(239 247 242 / 0.66);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.demo-stamp {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  margin: 22px 8px 8px;
  padding: 5px 9px;
  border: 1px solid rgb(243 200 107 / 0.34);
  border-radius: 999px;
  color: #f9dfa5;
  background: rgb(243 200 107 / 0.08);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.side-nav {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.side-nav-button {
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border: 0;
  border-radius: 13px;
  color: rgb(239 247 242 / 0.72);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  transition: 160ms ease;
}

.side-nav-button:hover {
  color: white;
  background: rgb(255 255 255 / 0.07);
}

.side-nav-button[aria-current="page"] {
  color: #fff8e7;
  background: rgb(255 255 255 / 0.12);
  box-shadow: inset 3px 0 var(--gold-soft);
}

.nav-count {
  display: grid;
  min-width: 24px;
  height: 24px;
  margin-left: auto;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--rose);
  font-size: 11px;
}

.sidebar-spacer {
  flex: 1;
}

.shift-card {
  margin: 18px 4px 12px;
  padding: 16px;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 15px;
  background: rgb(255 255 255 / 0.06);
}

.shift-card-label {
  color: rgb(239 247 242 / 0.58);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.shift-card strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
}

.shift-card p {
  margin: 2px 0 0;
  color: rgb(239 247 242 / 0.7);
  font-size: 12px;
}

.staff-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 8px 4px;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  color: var(--green-strong);
  background: var(--gold-soft);
  font-family: var(--font-display);
  font-weight: 700;
}

.avatar.small {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.avatar.sage { background: #d9e8da; }
.avatar.amber { background: #f2ddb0; }
.avatar.rose { background: #efd4d2; }
.avatar.blue { background: #d5e3e9; }

.staff-copy {
  min-width: 0;
  line-height: 1.25;
}

.staff-copy strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-copy small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: rgb(239 247 242 / 0.6);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-column {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 58px);
  border-bottom: 1px solid rgb(198 193 179 / 0.65);
  background: rgb(242 238 228 / 0.88);
  backdrop-filter: blur(16px);
}

.topbar-context {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.topbar-context strong {
  font-family: var(--font-display);
  font-size: 17px;
}

.topbar-context span {
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  background: var(--surface);
  transition: 150ms ease;
}

.icon-button:hover {
  border-color: var(--green);
  color: var(--green);
  transform: translateY(-1px);
}

.icon-button.has-alert {
  position: relative;
}

.icon-button.has-alert::after {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--rose);
  content: "";
}

.topbar-profile {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.topbar-profile span {
  font-size: 13px;
  font-weight: 700;
}

.main-content {
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: 34px clamp(24px, 4vw, 58px) 70px;
}

.view-enter {
  animation: view-in 360ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-header,
.bottom-nav {
  display: none;
}

/* Shared components */
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-heading h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.page-heading p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.heading-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button-primary {
  color: white;
  background: var(--green);
  box-shadow: 0 7px 18px rgb(31 91 79 / 0.2);
}

.button-primary:hover:not(:disabled) {
  background: var(--green-strong);
  box-shadow: 0 10px 22px rgb(31 91 79 / 0.24);
}

.button-secondary {
  border-color: var(--green);
  color: var(--green);
  background: var(--surface);
}

.button-ghost {
  border-color: var(--line);
  color: var(--ink-soft);
  background: var(--surface);
}

.button-ghost:hover:not(:disabled) {
  border-color: var(--green);
  color: var(--green);
}

.button-danger {
  color: white;
  background: var(--rose);
}

.button-danger:hover:not(:disabled) {
  background: var(--rose-strong);
}

.button-small {
  min-height: 44px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 12px;
}

.button-block {
  width: 100%;
}

.card {
  border: 1px solid rgb(198 193 179 / 0.72);
  border-radius: var(--radius-lg);
  background: rgb(255 253 248 / 0.9);
  box-shadow: var(--shadow-sm);
}

.section-card {
  padding: 22px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}

.section-header h2,
.section-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.015em;
}

.section-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.text-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 3px;
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.badge,
.status-pill {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
}

.badge.positive,
.status-pill.stable { color: var(--green-strong); background: var(--green-soft); }
.badge.notice,
.status-pill.watch { color: #795515; background: var(--gold-soft); }
.badge.warning,
.status-pill.action { color: #83460f; background: var(--amber-soft); }
.badge.danger,
.status-pill.urgent { color: #7d2824; background: var(--rose-soft); }
.badge.info { color: #345c72; background: var(--blue-soft); }

.divider {
  height: 1px;
  border: 0;
  background: var(--line);
}

.empty-state {
  padding: 34px 22px;
  color: var(--muted);
  text-align: center;
}

.empty-state .empty-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  place-items: center;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-soft);
}

.empty-state h3 {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 16px;
}

.empty-state p {
  margin: 0;
  font-size: 13px;
}

/* Home */
.greeting-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  min-height: 204px;
  margin-bottom: 22px;
  padding: clamp(24px, 4vw, 38px);
  overflow: hidden;
  border-radius: var(--radius-xl);
  color: white;
  background:
    radial-gradient(circle at 93% 10%, rgb(243 200 107 / 0.26), transparent 13rem),
    linear-gradient(125deg, #1d5b4e, #16483e 65%, #123a33);
  box-shadow: var(--shadow-md);
}

.greeting-panel::after {
  position: absolute;
  right: -38px;
  bottom: -80px;
  width: 250px;
  height: 250px;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 30px rgb(255 255 255 / 0.025), 0 0 0 62px rgb(255 255 255 / 0.018);
  content: "";
}

.greeting-copy {
  position: relative;
  z-index: 1;
  align-self: center;
}

.greeting-copy .eyebrow {
  color: #f3d58e;
}

.greeting-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(27px, 3.2vw, 42px);
  font-weight: 700;
  letter-spacing: 0.025em;
}

.greeting-copy p {
  max-width: 620px;
  margin: 10px 0 21px;
  color: rgb(255 255 255 / 0.78);
  font-size: 14px;
}

.greeting-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.greeting-actions .button-primary {
  color: var(--green-strong);
  background: #f4d788;
  box-shadow: none;
}

.greeting-actions .button-primary:hover {
  background: #ffe4a2;
}

.greeting-actions .button-ghost {
  border-color: rgb(255 255 255 / 0.24);
  color: white;
  background: rgb(255 255 255 / 0.07);
}

.greeting-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 260px;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-self: center;
}

.hero-metric {
  min-height: 100px;
  padding: 15px;
  border: 1px solid rgb(255 255 255 / 0.13);
  border-radius: 16px;
  background: rgb(255 255 255 / 0.08);
  backdrop-filter: blur(6px);
}

.hero-metric strong {
  display: block;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.2;
}

.hero-metric span {
  display: block;
  margin-top: 8px;
  color: rgb(255 255 255 / 0.68);
  font-size: 11px;
}

.hero-metric.alert strong {
  color: #ffd9c3;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(300px, 0.78fr);
  gap: 22px;
  align-items: start;
}

.home-column {
  display: grid;
  gap: 22px;
}

.attention-strip {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding: 10px 16px;
  border: 1px solid #e4c990;
  border-radius: 15px;
  color: #684b15;
  background: #fff7df;
  font-size: 12px;
}

.attention-strip .icon {
  color: var(--gold);
}

.attention-strip strong {
  color: #59400f;
}

.attention-strip span:last-child {
  margin-left: auto;
  color: #80682f;
}

.resident-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.resident-mini {
  display: flex;
  min-width: 0;
  min-height: 92px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: inherit;
  background: var(--surface);
  text-align: left;
  transition: 150ms ease;
}

.resident-mini:hover {
  border-color: #9db6ab;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.resident-mini-copy {
  min-width: 0;
  flex: 1;
}

.resident-mini-copy strong {
  display: block;
  font-size: 14px;
}

.resident-mini-copy small {
  display: block;
  margin: 3px 0 7px;
  color: var(--muted);
  font-size: 11px;
}

.resident-mini .icon {
  width: 16px;
  color: var(--muted);
}

.timeline {
  position: relative;
  display: grid;
  gap: 0;
}

.timeline::before {
  position: absolute;
  top: 8px;
  bottom: 12px;
  left: 56px;
  width: 1px;
  background: var(--line);
  content: "";
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 45px 1fr;
  gap: 22px;
  padding: 4px 0 20px;
}

.timeline-time {
  padding-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.timeline-content {
  position: relative;
  min-width: 0;
}

.timeline-content::before {
  position: absolute;
  top: 5px;
  left: -17px;
  width: 9px;
  height: 9px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 1px var(--green);
  content: "";
}

.timeline-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-head strong {
  font-size: 13px;
}

.timeline-content p {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.timeline-meta {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

/* Handover */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-chip {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
}

.filter-chip[aria-pressed="true"] {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.filter-chip .filter-count {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.08);
  font-size: 10px;
}

.handover-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}

.handover-list {
  display: grid;
  gap: 13px;
}

.handover-card {
  position: relative;
  padding: 19px 19px 17px 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.handover-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--gold);
  content: "";
}

.handover-card.level-action::before { background: var(--amber); }
.handover-card.level-urgent::before { background: var(--rose); }
.handover-card.is-complete { opacity: 0.66; }

.handover-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.handover-person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.handover-person strong {
  display: block;
  font-size: 15px;
}

.handover-person small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.handover-message {
  margin: 14px 0 8px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
}

.handover-context {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-size: 12px;
}

.handover-completion {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-soft);
  background: var(--green-faint);
  font-size: 11px;
}

.handover-completion strong {
  color: var(--green-strong);
}

.handover-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 10px;
}

.handover-meta-grid span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.handover-meta-grid .icon {
  width: 14px;
  height: 14px;
}

.handover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.shift-summary {
  position: sticky;
  top: 94px;
  padding: 20px;
}

.shift-summary h2 {
  margin-bottom: 5px;
  font-family: var(--font-display);
  font-size: 18px;
}

.shift-summary > p {
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 11px;
}

.summary-number {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.summary-number span {
  color: var(--ink-soft);
  font-size: 12px;
}

.summary-number strong {
  font-family: var(--font-display);
  font-size: 22px;
}

.safety-note {
  display: flex;
  gap: 9px;
  margin-top: 15px;
  padding: 11px;
  border-radius: 11px;
  color: #734137;
  background: #fbebe5;
  font-size: 10px;
}

.safety-note .icon {
  width: 17px;
  flex: none;
}

/* Residents */
.search-field {
  position: relative;
  width: min(100%, 360px);
}

.search-field .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 15px 0 43px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  font-size: 14px;
}

.search-field input:focus {
  border-color: var(--green);
  outline: 3px solid rgb(31 91 79 / 0.12);
}

.resident-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.resident-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 15px;
  min-height: 178px;
  align-items: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: inherit;
  background: var(--surface);
  text-align: left;
  transition: 160ms ease;
}

.resident-card:hover {
  border-color: #a9bdb4;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.resident-card .avatar {
  width: 50px;
  height: 50px;
}

.resident-card-main {
  min-width: 0;
}

.resident-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.resident-card-title strong {
  font-family: var(--font-display);
  font-size: 18px;
}

.resident-card-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.resident-card-focus {
  display: -webkit-box;
  margin: 13px 0 12px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.resident-card > .icon {
  width: 18px;
  color: var(--muted);
}

/* Resident detail */
.back-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.resident-hero {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-bottom: 22px;
  padding: 24px;
}

.resident-hero .avatar {
  width: 66px;
  height: 66px;
  font-size: 21px;
}

.resident-hero-copy {
  min-width: 0;
  flex: 1;
}

.resident-hero-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
}

.resident-hero-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.care-profile {
  padding: 21px;
}

.profile-block + .profile-block {
  margin-top: 17px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.profile-block label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.profile-block p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.record-feed {
  display: grid;
  gap: 12px;
}

.record-card {
  padding: 19px;
}

.record-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.record-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.record-card-time {
  color: var(--muted);
  font-size: 10px;
}

.record-card-body {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.record-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

/* Manager */
.manager-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 15px;
  border: 1px solid #c9d9d1;
  border-radius: 13px;
  color: var(--ink-soft);
  background: var(--green-faint);
  font-size: 11px;
}

.manager-note .icon {
  color: var(--green);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric-card {
  min-height: 135px;
  padding: 19px;
}

.metric-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.metric-card-head .icon {
  width: 18px;
}

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 10px;
}

.metric-value strong {
  font-family: var(--font-display);
  font-size: 35px;
  line-height: 1.1;
}

.metric-value span {
  color: var(--muted);
  font-size: 11px;
}

.metric-caption {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.manager-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 22px;
  align-items: start;
}

.bar-chart {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: center;
  font-size: 11px;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #6ca08b);
}

.bar-row strong {
  text-align: right;
}

.audit-list {
  display: grid;
}

.audit-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 11px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.audit-item:first-child {
  border-top: 0;
}

.audit-time {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.audit-copy strong {
  display: block;
  font-size: 11px;
}

.audit-copy p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.settings-list {
  display: grid;
  gap: 10px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.setting-row:first-child { border-top: 0; }
.setting-copy strong { display: block; font-size: 12px; }
.setting-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

/* Record wizard */
dialog {
  color: var(--ink);
}

.record-dialog {
  width: min(920px, calc(100vw - 32px));
  max-width: none;
  height: min(820px, calc(100dvh - 32px));
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.record-dialog::backdrop,
.confirm-dialog::backdrop {
  background: rgb(14 36 31 / 0.64);
  backdrop-filter: blur(5px);
}

.wizard-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
}

.wizard-header {
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 253 248 / 0.96);
}

.wizard-title-wrap {
  min-width: 0;
}

.wizard-title-wrap h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
}

.wizard-title-wrap p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.wizard-progress {
  display: flex;
  align-items: center;
  gap: 5px;
}

.progress-dot {
  width: 28px;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
}

.progress-dot.is-current,
.progress-dot.is-complete {
  background: var(--green);
}

.progress-dot.is-current {
  width: 40px;
}

.wizard-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 27px clamp(22px, 4vw, 46px) 40px;
  background:
    radial-gradient(circle at 100% 0, rgb(243 200 107 / 0.11), transparent 18rem),
    var(--surface);
}

.wizard-question {
  max-width: 760px;
  margin: 0 auto;
}

.question-number {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  color: var(--green-strong);
  background: var(--green-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.wizard-question h2 {
  margin: 10px 0 7px;
  font-family: var(--font-display);
  font-size: clamp(23px, 3vw, 31px);
  letter-spacing: 0.01em;
}

.question-help {
  margin-bottom: 22px;
  color: var(--ink-soft);
  font-size: 13px;
}

.form-section {
  margin-top: 22px;
}

.form-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.form-section-title label,
.form-section-title span:first-child {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.optional-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.required-label {
  color: var(--rose);
  font-size: 10px;
}

.field-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.field-error {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 7px 0 0;
  color: var(--rose-strong);
  font-size: 11px;
  font-weight: 700;
}

.field-error .icon {
  width: 15px;
  height: 15px;
}

.resident-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.resident-choice,
.topic-choice,
.choice-tile,
.handover-choice {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 66px;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  transition: 140ms ease;
}

.resident-choice:hover,
.topic-choice:hover,
.choice-tile:hover,
.handover-choice:hover {
  border-color: #8ea99e;
  background: var(--green-faint);
}

.resident-choice.is-selected,
.topic-choice.is-selected,
.choice-tile.is-selected,
.handover-choice.is-selected {
  border-color: var(--green);
  background: var(--green-faint);
  box-shadow: 0 0 0 2px rgb(31 91 79 / 0.09);
}

.resident-choice.is-selected::after,
.topic-choice.is-selected::after,
.choice-tile.is-selected::after,
.handover-choice.is-selected::after {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--green);
  content: "✓";
  font-size: 11px;
  font-weight: 900;
}

.resident-choice-copy strong {
  display: block;
  font-size: 13px;
}

.resident-choice-copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.topic-choice {
  min-height: 70px;
}

.topic-symbol {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  color: var(--green-strong);
  background: var(--green-soft);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
}

.topic-choice span:last-child {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.date-row,
.measurement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
}

.input,
.select {
  min-height: 48px;
  padding: 0 13px;
}

.textarea {
  min-height: 92px;
  padding: 12px 58px 12px 13px;
  line-height: 1.65;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--green);
  outline: 3px solid rgb(31 91 79 / 0.11);
}

.textarea-wrap {
  position: relative;
}

.voice-button {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-soft);
}

.voice-button.is-listening {
  color: white;
  background: var(--rose);
  animation: listening 1.1s ease infinite;
}

@keyframes listening {
  50% { box-shadow: 0 0 0 7px rgb(169 69 63 / 0.14); }
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.choice-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-tile {
  min-height: 56px;
  justify-content: center;
  padding-right: 28px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.choice-tile.outcome-choice {
  min-height: 68px;
  justify-content: flex-start;
}

.context-panel {
  margin: 13px 0 2px;
  padding: 13px 15px;
  border-left: 4px solid var(--gold);
  border-radius: 0 12px 12px 0;
  color: var(--ink-soft);
  background: #fff7df;
  font-size: 11px;
}

.context-panel strong {
  color: var(--ink);
}

.handover-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.handover-choice {
  min-height: 78px;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.handover-choice strong {
  font-size: 12px;
}

.handover-choice small {
  padding-right: 10px;
  color: var(--muted);
  font-size: 10px;
}

.urgent-panel {
  margin-top: 15px;
  padding: 15px;
  border: 1px solid #dfaaa5;
  border-radius: 14px;
  color: #722e29;
  background: #fff0ed;
}

.urgent-panel-head {
  display: flex;
  gap: 9px;
  font-size: 12px;
  font-weight: 900;
}

.urgent-panel p {
  margin: 6px 0 11px;
  font-size: 11px;
}

.check-row {
  display: flex;
  min-height: 44px;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
}

.check-row input {
  width: 20px;
  height: 20px;
  flex: none;
  margin: 0;
  accent-color: var(--green);
}

.review-banner {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 16px;
  padding: 13px 15px;
  border: 1px solid #c8dcd2;
  border-radius: 13px;
  color: var(--ink-soft);
  background: var(--green-faint);
  font-size: 11px;
}

.review-banner .icon {
  color: var(--green);
}

.review-person {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 15px;
  padding: 14px;
  border: 2px solid var(--green);
  border-radius: 15px;
  background: var(--surface);
}

.review-person strong {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
}

.review-person small {
  color: var(--muted);
  font-size: 10px;
}

.generated-record {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.generated-record-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.generated-record-head strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}

.generated-record-body {
  padding: 17px;
}

.generated-narrative {
  margin: 0 0 16px;
  padding: 14px;
  border-radius: 12px;
  color: var(--ink);
  background: #fffaf0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.8;
}

.fsoaip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fsoaip-row {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.fsoaip-row dt {
  color: var(--green);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.fsoaip-row dd {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.review-check {
  margin-top: 14px;
}

.wizard-footer {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 -8px 24px rgb(30 52 44 / 0.05);
}

.wizard-footer-actions {
  display: flex;
  gap: 9px;
}

.draft-note {
  color: var(--muted);
  font-size: 10px;
}

/* Dialog, toast */
.confirm-dialog {
  width: min(430px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  box-shadow: var(--shadow-lg);
}

.confirm-card {
  padding: 26px;
  border-radius: 22px;
  background: var(--surface);
  text-align: center;
}

.confirm-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 13px;
  place-items: center;
  border-radius: 50%;
  color: var(--rose-strong);
  background: var(--rose-soft);
  font-family: var(--font-display);
  font-weight: 800;
}

.confirm-card h2 {
  margin-bottom: 7px;
  font-family: var(--font-display);
}

.confirm-card p {
  margin-bottom: 20px;
  color: var(--ink-soft);
  font-size: 12px;
}

.confirm-comment-field {
  margin: 18px 0;
  text-align: left;
}

.confirm-comment-field[hidden],
.confirm-comment-field .field-error[hidden] {
  display: none;
}

.confirm-comment-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 800;
}

.confirm-comment-field .textarea {
  width: 100%;
  min-height: 96px;
  padding-right: 13px;
}

.confirm-comment-field .field-error {
  margin: 7px 0 0;
  color: var(--rose-strong);
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.toast-region {
  position: fixed;
  z-index: 1000;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(380px, calc(100vw - 32px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 13px;
  color: white;
  background: #183f37;
  box-shadow: var(--shadow-md);
  font-size: 12px;
  font-weight: 700;
  animation: toast-in 220ms ease both;
}

.toast.is-error { background: var(--rose-strong); }
.toast.is-leaving { animation: toast-out 180ms ease both; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(5px); }
}

/* Tablet */
@media (max-width: 1120px) {
  :root { --sidebar-width: 218px; }
  .brand-copy small { display: none; }
  .home-grid,
  .manager-grid { grid-template-columns: 1fr; }
  .handover-layout { grid-template-columns: minmax(0, 1fr) 260px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resident-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 300px minmax(0, 1fr); }
}

/* Mobile */
@media (max-width: 760px) {
  body {
    background:
      radial-gradient(circle at 105% 0, rgb(243 200 107 / 0.15), transparent 18rem),
      var(--paper);
  }

  .app-shell {
    display: block;
  }

  .sidebar,
  .topbar {
    display: none;
  }

  .app-column {
    display: block;
  }

  .mobile-header {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid rgb(198 193 179 / 0.62);
    background: rgb(242 238 228 / 0.92);
    backdrop-filter: blur(16px);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 9px;
  }

  .mobile-brand .brand-mark {
    width: 36px;
    height: 36px;
    border-color: rgb(31 91 79 / 0.18);
    color: var(--green);
    background: var(--surface);
    font-size: 18px;
  }

  .mobile-brand strong {
    font-family: var(--font-display);
    font-size: 17px;
  }

  .mobile-brand small {
    display: inline-block;
    margin-left: 5px;
    padding: 2px 5px;
    border-radius: 4px;
    color: #765313;
    background: var(--gold-soft);
    font-size: 8px;
    vertical-align: middle;
  }

  .mobile-header-actions {
    display: flex;
    gap: 6px;
  }

  .mobile-header .icon-button {
    width: 44px;
    height: 44px;
    background: transparent;
  }

  .main-content {
    padding: 22px 15px calc(102px + var(--safe-bottom));
  }

  .bottom-nav {
    position: fixed;
    z-index: 50;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: calc(72px + var(--safe-bottom));
    padding: 5px 6px var(--safe-bottom);
    border-top: 1px solid var(--line);
    background: rgb(255 253 248 / 0.96);
    box-shadow: 0 -10px 30px rgb(34 54 47 / 0.09);
    backdrop-filter: blur(16px);
  }

  .bottom-nav-button {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 62px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    border: 0;
    border-radius: 12px;
    color: var(--muted);
    background: transparent;
    font-size: 9px;
    font-weight: 800;
  }

  .bottom-nav-button[aria-current="page"] {
    color: var(--green);
  }

  .bottom-nav-button .icon {
    width: 22px;
    height: 22px;
  }

  .bottom-nav-record {
    width: 56px;
    min-width: 56px;
    height: 56px;
    min-height: 56px;
    margin: -20px auto 0;
    border: 5px solid var(--surface);
    border-radius: 50%;
    color: white;
    background: var(--green);
    box-shadow: 0 8px 20px rgb(31 91 79 / 0.29);
  }

  .bottom-nav-record .icon {
    width: 25px;
    height: 25px;
  }

  .bottom-nav-record span {
    position: absolute;
    top: 58px;
    color: var(--green);
    font-size: 9px;
    white-space: nowrap;
  }

  .page-heading {
    display: block;
    margin-bottom: 18px;
  }

  .page-heading h1 {
    font-size: 27px;
  }

  .page-heading p {
    margin-top: 6px;
    font-size: 12px;
  }

  .page-heading .heading-actions {
    margin-top: 13px;
  }

  .page-heading .heading-actions .button {
    flex: 1;
  }

  .greeting-panel {
    display: block;
    min-height: 0;
    margin: -2px -2px 15px;
    padding: 23px 20px 20px;
    border-radius: 24px;
  }

  .greeting-copy h1 {
    font-size: 25px;
  }

  .greeting-copy p {
    margin: 8px 0 17px;
    font-size: 12px;
  }

  .greeting-actions .button {
    flex: 1;
    min-height: 48px;
  }

  .greeting-metrics {
    min-width: 0;
    margin-top: 18px;
  }

  .hero-metric {
    min-height: 80px;
    padding: 12px;
  }

  .hero-metric strong { font-size: 23px; }
  .hero-metric span { margin-top: 5px; font-size: 9px; }

  .attention-strip {
    align-items: flex-start;
    margin-bottom: 15px;
    font-size: 10px;
  }

  .attention-strip span:last-child { display: none; }
  .home-grid { display: grid; gap: 15px; }
  .home-column { gap: 15px; }
  .section-card { padding: 17px; }
  .section-header { margin-bottom: 13px; }
  .section-header h2,
  .section-header h3 { font-size: 17px; }

  .resident-mini-grid { grid-template-columns: 1fr; }
  .resident-mini { min-height: 78px; }
  .timeline-item { grid-template-columns: 39px 1fr; gap: 20px; }
  .timeline::before { left: 49px; }
  .timeline-content::before { left: -15px; }

  .filter-row {
    margin-right: -15px;
    padding-right: 15px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .filter-row::-webkit-scrollbar { display: none; }
  .filter-chip { flex: none; }
  .handover-layout { display: block; }
  .shift-summary { position: static; margin-top: 15px; }
  .handover-card { padding: 17px 15px 15px 20px; }
  .handover-card-head { display: block; }
  .handover-card-head > .badge { margin: 9px 0 0 44px; }
  .handover-message { font-size: 14px; }
  .handover-actions .button { flex: 1; }

  .search-field { width: 100%; }
  .resident-grid { grid-template-columns: 1fr; gap: 11px; }
  .resident-card { min-height: 0; padding: 16px; }
  .resident-card .avatar { width: 45px; height: 45px; }
  .resident-card-title strong { font-size: 16px; }
  .resident-card-focus { margin: 9px 0; }

  .resident-hero {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 18px;
  }

  .resident-hero .avatar { width: 54px; height: 54px; }
  .resident-hero-copy h1 { font-size: 23px; }
  .resident-hero .button { width: 100%; }
  .detail-grid { display: block; }
  .care-profile { margin-bottom: 15px; }

  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card { min-height: 120px; padding: 15px; }
  .metric-value strong { font-size: 29px; }
  .manager-grid { display: block; }
  .manager-grid > * + * { margin-top: 15px; }

  .toast-region {
    right: 16px;
    bottom: calc(86px + var(--safe-bottom));
  }

  .record-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    inset: 0;
    border-radius: 0;
  }

  .wizard-header {
    min-height: 68px;
    padding: 10px 14px;
  }

  .wizard-title-wrap h1 { font-size: 17px; }
  .wizard-progress { gap: 3px; }
  .progress-dot { width: 15px; }
  .progress-dot.is-current { width: 25px; }
  .wizard-body { padding: 22px 15px 30px; }
  .wizard-question h2 { font-size: 24px; }
  .question-help { font-size: 12px; }
  .resident-choice-grid { grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice-grid.two { grid-template-columns: 1fr; }
  .date-row,
  .measurement-grid { grid-template-columns: 1fr; }
  .handover-grid { grid-template-columns: 1fr; }
  .fsoaip-grid { grid-template-columns: 1fr; }

  .wizard-footer {
    min-height: calc(72px + var(--safe-bottom));
    padding: 10px 14px calc(10px + var(--safe-bottom));
  }

  .draft-note { display: none; }
  .wizard-footer-actions { width: 100%; }
  .wizard-footer-actions .button { flex: 1; }
}

@media (max-width: 390px) {
  .metric-grid { grid-template-columns: 1fr; }
  .greeting-actions { display: grid; grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: 1fr 1fr; }
  .topic-choice { padding: 9px; }
  .topic-symbol { width: 30px; height: 30px; }
  .topic-choice span:last-child { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: #89877f;
    --ink-soft: #29443e;
    --muted: #455a55;
  }

  .card,
  .resident-card,
  .handover-card { border-width: 2px; }
}
