@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../vendor/atkinson/AtkinsonHyperlegibleNext-wght.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans";
  src: url("../vendor/noto/NotoSans-wdth-wght.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62.5% 100%;
  font-display: swap;
  unicode-range: U+0370-03FF, U+0400-052F, U+1C80-1C8A, U+1F00-1FFF, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--k-white); }
body {
  margin: 0;
  background: var(--k-white);
  color: var(--k-text);
  font-family: var(--k-font-ui);
  font-size: var(--k-body-size);
  line-height: var(--k-line-height);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--k-focus) 45%, transparent); outline-offset: 3px; }
::selection { background: #DCEBFF; color: var(--k-text); }

.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;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 200;
  transform: translateY(-160%);
  background: var(--k-text);
  color: var(--k-white);
  padding: 12px 16px;
  border-radius: var(--k-radius-control);
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }
.page-width { width: min(1240px, calc(100% - 64px)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--k-border);
  backdrop-filter: blur(12px);
}
.header-inner {
  width: min(1360px, calc(100% - 48px));
  min-height: 76px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 160px minmax(260px, 460px) 1fr;
  gap: 30px;
  align-items: center;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; width: 126px; min-height: 48px; }
.brand img { width: 126px; height: auto; }
.header-search input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--k-border);
  border-radius: 9px;
  background: var(--k-white);
  color: var(--k-text);
  padding: 0 15px;
  font-size: 16px;
}
.header-search input::placeholder { color: var(--k-muted); }
.site-nav { justify-self: end; display: flex; gap: 22px; align-items: center; font-size: 16px; font-weight: 500; }
.site-nav a, .nav-link-button { text-decoration: none; color: var(--k-text-2); min-height: 48px; display: inline-flex; align-items: center; }
.site-nav a:hover, .nav-link-button:hover { color: var(--k-text); }
.nav-inline-form { margin: 0; }
.nav-link-button { border: 0; background: transparent; padding: 0; cursor: pointer; }

.site-footer { border-top: 1px solid var(--k-border); margin-top: 96px; padding: 42px 0; background: var(--k-white); }
.footer-inner { width: min(1240px, calc(100% - 64px)); margin-inline: auto; display: grid; grid-template-columns: 160px 1fr auto; gap: 32px; align-items: center; }
.footer-logo { width: 112px; }
.site-footer p { margin: 0; color: var(--k-muted); font-size: 15px; }
.footer-meta { text-align: right; }

.eyebrow, .memory-label {
  margin: 0;
  color: var(--k-muted);
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: .08em;
}
h1, h2, h3, p { text-wrap: pretty; }
h1, h2, h3 { color: var(--k-text); letter-spacing: -.035em; }
h1 { font-size: clamp(42px, 5vw, 64px); line-height: 1.02; font-weight: 700; }
h2 { font-size: clamp(28px, 3vw, 36px); line-height: 1.08; font-weight: 650; }
h3 { font-size: 22px; line-height: 1.15; font-weight: 650; }
.lead { max-width: 760px; color: var(--k-text-2); font-size: 20px; line-height: 1.55; }

.button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 22px;
  border: 1px solid var(--k-text);
  border-radius: var(--k-radius-control);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, color .12s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--k-text); color: var(--k-white); }
.button.primary:hover { background: #000; }
.button.secondary { background: var(--k-white); color: var(--k-text); border-color: #C7C7CC; }
.button.secondary:hover { background: var(--k-surface); }
.button.compact { min-height: 46px; padding-inline: 18px; }

.home-hero { min-height: 630px; padding: 74px 0 56px; display: grid; grid-template-columns: 1.02fr .98fr; gap: 72px; align-items: center; }
.home-hero h1 { margin: 16px 0 24px; max-width: 690px; }
.home-hero .lead { max-width: 640px; margin-bottom: 30px; }
.hero-search { margin-top: 34px; max-width: 650px; }
.hero-search > label, .search-panel > label { display: block; margin-bottom: 9px; font-size: 16px; font-weight: 600; }
.search-row { display: flex; gap: 10px; }
.search-row input {
  flex: 1;
  min-width: 0;
  height: 54px;
  border: 1px solid #C7C7CC;
  border-radius: var(--k-radius-control);
  padding: 0 16px;
  color: var(--k-text);
  background: var(--k-white);
}
.search-row input::placeholder { color: var(--k-muted); }
.hero-links { margin-top: 32px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--k-border); padding-top: 20px; gap: 18px; }
.hero-links span { display: grid; gap: 2px; }
.hero-links strong { font-size: 15px; font-weight: 600; }
.hero-links small { color: var(--k-muted); font-size: 14px; line-height: 1.35; }

.featured-wrap { display: flex; justify-content: center; }
.featured-card { width: min(100%, 570px); border: 1px solid var(--k-border); border-radius: 16px; background: var(--k-white); overflow: hidden; box-shadow: 0 18px 50px rgba(17, 17, 17, .06); display: grid; grid-template-columns: 48% 52%; }
.featured-content { padding: 34px 30px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.featured-content h2 { margin: 10px 0 6px; font-size: 34px; }
.life-years { margin: 0; color: var(--k-text-2); font-size: 19px; font-weight: 500; }
.life-years span { margin: 0 5px; }
.featured-epitaph { margin: 22px 0 28px; color: var(--k-text-2); font-size: 17px; line-height: 1.5; }
.featured-empty { min-height: 410px; }
.portrait-placeholder { background: var(--k-surface-2); color: #545458; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid #ECECEF; }
.portrait-placeholder span { font-size: 46px; font-weight: 650; letter-spacing: -.06em; }
.portrait-large { min-height: 410px; border: 0; border-right: 1px solid var(--k-border); border-radius: 0; }

.product-strip { border: 1px solid var(--k-border); border-radius: var(--k-radius-card); display: grid; grid-template-columns: repeat(6, 1fr); overflow: hidden; }
.product-strip article { min-height: 190px; padding: 24px 20px; display: flex; gap: 14px; border-right: 1px solid var(--k-border); background: var(--k-white); }
.product-strip article:last-child { border-right: 0; }
.feature-mark { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; font-size: 22px; }
.product-strip h2 { margin: 0 0 8px; font-size: 19px; letter-spacing: -.02em; }
.product-strip p { margin: 0 0 14px; color: var(--k-muted); font-size: 15px; line-height: 1.45; }
.state { display: inline-flex; width: fit-content; padding: 4px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--k-surface-2); color: var(--k-text-2); }
.state.live { color: var(--k-success); background: #EEF8F1; }
.state.next { color: #4A4A4E; background: #F1F1F3; }
.state.future { color: var(--k-muted); background: var(--k-surface); }

.home-section { padding: 112px 0 38px; }
.two-column-section { display: grid; grid-template-columns: .9fr 1.1fr; gap: 88px; align-items: start; }
.two-column-section h2 { margin: 14px 0 20px; max-width: 520px; }
.two-column-section > div > p:last-child { max-width: 570px; color: var(--k-text-2); }
.step-list { border-top: 1px solid var(--k-border); }
.step-list article { display: grid; grid-template-columns: 54px 1fr; gap: 20px; padding: 26px 0; border-bottom: 1px solid var(--k-border); }
.step-list article > strong { font-size: 15px; color: var(--k-muted); }
.step-list h3 { margin: 0 0 6px; }
.step-list p { margin: 0; color: var(--k-muted); }

.trust-row { margin-top: 72px; border-top: 1px solid var(--k-border); border-bottom: 1px solid var(--k-border); display: grid; grid-template-columns: repeat(5, 1fr); }
.trust-row div { padding: 25px 18px; border-right: 1px solid var(--k-border); display: grid; gap: 3px; }
.trust-row div:last-child { border-right: 0; }
.trust-row strong { font-size: 16px; }
.trust-row span { color: var(--k-muted); font-size: 14px; line-height: 1.4; }

.page-heading { padding: 78px 0 30px; }
.page-heading h1 { margin: 12px 0 15px; }
.page-heading > p:last-child { max-width: 740px; color: var(--k-text-2); }
.search-page { min-height: 620px; }
.search-panel { padding: 24px; border: 1px solid var(--k-border); border-radius: var(--k-radius-card); background: var(--k-surface); }
.results-heading { margin-top: 38px; padding-bottom: 14px; display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--k-border); }
.results-heading h2 { margin: 0; font-size: 28px; }
.results-heading span { color: var(--k-muted); font-size: 15px; }
.result-list { display: grid; gap: 12px; margin-top: 14px; }
.result-card { display: grid; grid-template-columns: 120px 1fr auto; gap: 24px; align-items: center; border: 1px solid var(--k-border); border-radius: var(--k-radius-card); padding: 14px; }
.portrait-result { width: 120px; aspect-ratio: 1 / 1; border-radius: 9px; }
.result-main h3 { margin: 5px 0 2px; }
.result-main p { margin: 5px 0; color: var(--k-text-2); }
.result-main small { color: var(--k-muted); }
.result-years { font-weight: 500; }
.empty-state { margin: 34px 0; border: 1px solid var(--k-border); border-radius: var(--k-radius-card); padding: 44px; text-align: center; background: var(--k-white); }
.empty-state.quiet { background: var(--k-surface); }
.empty-state h2 { margin-top: 0; }
.empty-state p { color: var(--k-muted); }

.account-heading, .edit-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; }
.owner-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.owner-card { border: 1px solid var(--k-border); border-radius: var(--k-radius-card); padding: 24px; }
.owner-card-top { display: grid; grid-template-columns: 112px 1fr; gap: 20px; align-items: center; }
.portrait-owner { width: 112px; aspect-ratio: 4 / 5; border-radius: 10px; }
.owner-card h2 { margin: 7px 0 3px; font-size: 29px; }
.owner-card p { margin: 0; color: var(--k-muted); }
.status-pill { display: inline-flex; border: 1px solid var(--k-border); border-radius: 999px; padding: 4px 9px; font-size: 13px; font-weight: 600; }
.public-address { margin: 22px 0; padding: 15px 16px; background: var(--k-surface); border-radius: 10px; display: grid; gap: 2px; }
.public-address span { color: var(--k-muted); font-size: 14px; }
.public-address strong { font-size: 17px; overflow-wrap: anywhere; }
.public-address.large { margin: 24px 0 0; }
.owner-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.edit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
.edit-preview-card { position: sticky; top: 104px; border: 1px solid var(--k-border); border-radius: var(--k-radius-card); padding: 18px; }
.portrait-edit { width: 100%; aspect-ratio: 4 / 5; border-radius: 10px; margin-bottom: 20px; }
.edit-preview-card h2 { margin: 8px 0 4px; font-size: 28px; }
.preview-address { margin: 0; color: var(--k-text-2); font-weight: 600; }
.preview-note { margin: 22px 0 0; padding-top: 20px; border-top: 1px solid var(--k-border); color: var(--k-muted); font-size: 15px; }

.kinelio-form { border: 1px solid var(--k-border); border-radius: var(--k-radius-card); padding: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; background: var(--k-white); }
.field { display: grid; gap: 8px; align-content: start; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: 16px; font-weight: 600; }
.field input, .field textarea, .field select, .single-column-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid #C7C7CC;
  border-radius: var(--k-radius-control);
  background: var(--k-white);
  color: var(--k-text);
  padding: 12px 14px;
}
.field textarea { min-height: 210px; resize: vertical; line-height: 1.55; }
.help-text { color: var(--k-muted); font-size: 14px; }
.error, .errorlist { color: var(--k-danger); font-size: 14px; margin: 0; padding: 0; list-style: none; }
.form-error-summary { grid-column: 1 / -1; background: #FFF5F3; color: var(--k-danger); border: 1px solid #F1C6C0; border-radius: 10px; padding: 14px; }
.form-actions { display: flex; gap: 10px; padding-top: 8px; }

.activation-page { padding: 76px 0 28px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 70px; align-items: start; }
.activation-intro { position: sticky; top: 112px; }
.activation-intro h1 { margin: 14px 0 20px; font-size: clamp(40px, 4.5vw, 58px); }
.address-card { margin: 30px 0; border: 1px solid var(--k-border); border-radius: var(--k-radius-card); padding: 18px; display: grid; gap: 2px; background: var(--k-surface); }
.address-card span { color: var(--k-muted); font-size: 14px; }
.address-card strong { font-size: 18px; overflow-wrap: anywhere; }
.activation-actions { padding-top: 8px; }
.activation-actions p { margin: 12px 0 0; color: var(--k-muted); font-size: 14px; }

.owner-bar { margin-top: 26px; min-height: 58px; border: 1px solid var(--k-border); border-radius: var(--k-radius-card); padding: 8px 12px 8px 18px; display: flex; justify-content: space-between; gap: 16px; align-items: center; background: var(--k-surface); font-size: 15px; }
.owner-bar > div { display: flex; align-items: center; gap: 18px; }
.owner-bar a:not(.button) { font-weight: 600; }
.memorial-hero { padding: 54px 0 46px; display: grid; grid-template-columns: minmax(280px, 430px) 1fr; gap: 56px; align-items: center; }
.portrait-hero { width: 100%; aspect-ratio: 4 / 5; border-radius: 12px; }
.portrait-hero span { font-size: clamp(64px, 9vw, 118px); }
.memorial-identity h1 { margin: 10px 0 8px; }
.hero-years { font-size: 24px; }
.memorial-epitaph { margin: 24px 0; max-width: 680px; color: var(--k-text-2); font-size: 20px; line-height: 1.55; }
.place-line { margin: 18px 0; display: grid; gap: 2px; color: var(--k-text-2); }
.place-line strong { font-size: 14px; color: var(--k-muted); }
.memorial-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.profile-nav { min-height: 58px; display: flex; gap: 28px; align-items: center; border-top: 1px solid var(--k-border); border-bottom: 1px solid var(--k-border); overflow-x: auto; white-space: nowrap; }
.profile-nav a { min-height: 48px; display: inline-flex; align-items: center; text-decoration: none; font-size: 15px; font-weight: 600; }
.profile-nav span { color: #8A8A8E; font-size: 15px; }
.memorial-grid { padding: 30px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.module-card { border: 1px solid var(--k-border); border-radius: var(--k-radius-card); padding: 22px; min-height: 260px; }
.story-card { grid-column: span 2; min-height: 380px; }
.qr-card { min-height: 380px; background: var(--k-surface); }
.module-heading { display: flex; gap: 12px; align-items: flex-start; }
.module-heading h2 { margin: 5px 0 0; font-size: 25px; }
.module-icon { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; font-size: 22px; }
.story-copy { margin-top: 26px; max-width: 760px; font-size: 18px; color: var(--k-text-2); }
.story-copy p { margin: 0 0 18px; }
.module-card > p { color: var(--k-text-2); }
.module-empty { margin-top: 28px; color: var(--k-muted); }
.future-module { display: flex; flex-direction: column; }
.future-module .state { margin-top: auto; }
.memorial-trust { margin-top: 24px; }

/* Owner Studio R2 */
.status-published { color: var(--k-success); border-color: #B8D8C2; background: #F4FBF6; }
.status-draft { color: var(--k-warning); border-color: #E4D3AA; background: #FFFBF1; }
.status-suspended, .status-archived { color: var(--k-muted); background: var(--k-surface); }
.owner-card-readiness { margin: 0 0 20px; padding: 0 2px; display: grid; gap: 8px; }
.owner-card-readiness > div:first-child { display: flex; justify-content: space-between; gap: 16px; color: var(--k-muted); font-size: 15px; }
.owner-card-readiness strong { color: var(--k-text); }
.studio-heading { display: flex; justify-content: space-between; gap: 28px; align-items: end; }
.studio-heading-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.studio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; padding-bottom: 70px; }
.studio-main { display: grid; gap: 18px; }
.studio-side { position: sticky; top: 96px; display: grid; gap: 16px; }
.studio-panel { border: 1px solid var(--k-border); border-radius: var(--k-radius-card); padding: 24px; background: var(--k-white); }
.studio-panel h2 { margin: 6px 0 10px; font-size: 28px; }
.studio-panel > p:not(.eyebrow) { color: var(--k-text-2); }
.studio-panel-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.studio-panel-heading > a { min-height: 48px; display: inline-flex; align-items: center; font-weight: 600; }
.setup-percent { font-size: 24px; }
.setup-progress { width: 100%; height: 8px; margin: 18px 0 22px; border: 0; border-radius: 999px; overflow: hidden; background: var(--k-surface-2); appearance: none; }
.setup-progress::-webkit-progress-bar { background: var(--k-surface-2); border-radius: 999px; }
.setup-progress::-webkit-progress-value { background: var(--k-text); border-radius: 999px; }
.setup-progress::-moz-progress-bar { background: var(--k-text); border-radius: 999px; }
.setup-progress.compact { height: 6px; margin: 0; }
.setup-list { display: grid; border-top: 1px solid var(--k-border); }
.setup-item { min-height: 68px; display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: center; border-bottom: 1px solid var(--k-border); }
.setup-item:last-child { border-bottom: 0; }
.setup-mark { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--k-border); border-radius: 50%; color: var(--k-muted); font-weight: 700; }
.setup-item.complete .setup-mark { color: var(--k-success); border-color: #B8D8C2; background: #F4FBF6; }
.setup-item div { display: grid; gap: 2px; }
.setup-item span:not(.setup-mark) { color: var(--k-muted); font-size: 15px; }
.content-facts { display: grid; margin-top: 18px; border-top: 1px solid var(--k-border); }
.content-facts > div { min-height: 70px; display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: center; border-bottom: 1px solid var(--k-border); }
.content-facts > div:last-child { border-bottom: 0; }
.content-facts span { color: var(--k-muted); font-size: 15px; }
.content-facts strong { font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.safe-next-panel { background: var(--k-surface); }
.publication-status { display: grid; gap: 14px; }
.publication-status .status-pill { justify-self: start; }
.publication-status h2 { margin: 0; }
.publication-status p { margin: 0 0 4px; color: var(--k-text-2); }
.full-width { width: 100%; }
.studio-address { display: block; margin: 10px 0 12px; font-size: 20px; overflow-wrap: anywhere; }
.address-panel p { margin-bottom: 0; color: var(--k-muted); font-size: 15px; }
.studio-back { min-height: 48px; display: inline-flex; align-items: center; font-weight: 600; }
.owner-bar.preview-mode { border-color: #E4D3AA; background: #FFFBF1; }

.state-page { min-height: 620px; padding: 92px 0; max-width: 880px; }
.state-page h1 { max-width: 800px; margin: 14px 0 20px; }
.state-symbol { width: 84px; height: 84px; display: grid; place-items: center; margin-bottom: 28px; border: 1px solid var(--k-border); background: var(--k-surface); font-size: 38px; font-weight: 700; }
.state-page .address-card { max-width: 520px; }

.login-page { min-height: 650px; padding: 84px 0; display: grid; place-items: start center; }
.login-card { width: min(100%, 560px); }
.login-card h1 { margin: 14px 0 14px; font-size: 46px; }
.login-card > p:not(.eyebrow) { color: var(--k-text-2); }
.single-column-form { grid-template-columns: 1fr; margin-top: 28px; }

@media (max-width: 1120px) {
  .header-inner { grid-template-columns: 140px 1fr; }
  .header-search { display: none; }
  .product-strip { grid-template-columns: repeat(3, 1fr); }
  .product-strip article { border-bottom: 1px solid var(--k-border); }
  .product-strip article:nth-child(3n) { border-right: 0; }
  .product-strip article:nth-last-child(-n+3) { border-bottom: 0; }
  .memorial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-card { grid-column: span 2; }
  .qr-card { min-height: 280px; }
}

@media (max-width: 860px) {
  body { font-size: var(--k-body-size-mobile); }
  .page-width { width: min(100% - 36px, 760px); }
  .header-inner { width: calc(100% - 32px); min-height: 70px; grid-template-columns: 120px 1fr; gap: 14px; }
  .brand, .brand img { width: 108px; }
  .site-nav { gap: 14px; font-size: 15px; overflow-x: auto; max-width: 100%; }
  .site-nav a[href="/#what-is-kinelio"], .site-nav a[href="/#how-it-works"] { display: none; }
  .home-hero { padding: 50px 0 36px; grid-template-columns: 1fr; gap: 42px; }
  .hero-links { grid-template-columns: 1fr; }
  .featured-card { max-width: 650px; }
  .product-strip { grid-template-columns: repeat(2, 1fr); }
  .product-strip article:nth-child(3n) { border-right: 1px solid var(--k-border); }
  .product-strip article:nth-child(2n) { border-right: 0; }
  .product-strip article:nth-last-child(-n+3) { border-bottom: 1px solid var(--k-border); }
  .product-strip article:nth-last-child(-n+2) { border-bottom: 0; }
  .two-column-section { grid-template-columns: 1fr; gap: 38px; }
  .trust-row { grid-template-columns: 1fr 1fr; }
  .trust-row div { border-bottom: 1px solid var(--k-border); }
  .trust-row div:nth-child(2n) { border-right: 0; }
  .trust-row div:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .footer-inner { width: calc(100% - 36px); grid-template-columns: 1fr; gap: 12px; }
  .footer-meta { text-align: left; }
  .owner-grid { grid-template-columns: 1fr; }
  .account-heading, .edit-heading { align-items: flex-start; flex-direction: column; }
  .edit-layout { grid-template-columns: 1fr; }
  .edit-preview-card { position: static; }
  .studio-heading { align-items: flex-start; flex-direction: column; }
  .studio-layout { grid-template-columns: 1fr; }
  .studio-side { position: static; }
  .activation-page { grid-template-columns: 1fr; gap: 36px; }
  .activation-intro { position: static; }
  .memorial-hero { grid-template-columns: minmax(220px, 340px) 1fr; gap: 34px; }
}

@media (max-width: 620px) {
  .page-width { width: calc(100% - 28px); }
  .header-inner { width: calc(100% - 24px); grid-template-columns: 96px 1fr; }
  .brand, .brand img { width: 92px; }
  .site-nav { justify-self: stretch; justify-content: flex-end; gap: 10px; }
  .site-nav a, .nav-link-button { min-height: 44px; font-size: 14px; }
  .site-nav a[href="/admin/"] { display: none; }
  .home-hero h1, h1 { font-size: 39px; }
  .home-hero .lead, .lead { font-size: 18px; }
  .search-row { flex-direction: column; }
  .search-row .button { width: 100%; }
  .featured-card { grid-template-columns: 1fr; }
  .portrait-large { min-height: 300px; border-right: 0; border-bottom: 1px solid var(--k-border); }
  .featured-content { padding: 26px 22px; }
  .product-strip { grid-template-columns: 1fr; }
  .product-strip article, .product-strip article:nth-child(2n), .product-strip article:nth-child(3n) { border-right: 0; border-bottom: 1px solid var(--k-border); }
  .product-strip article:last-child { border-bottom: 0; }
  .trust-row { grid-template-columns: 1fr; }
  .trust-row div, .trust-row div:nth-child(2n) { border-right: 0; border-bottom: 1px solid var(--k-border); }
  .trust-row div:last-child { grid-column: auto; }
  .result-card { grid-template-columns: 90px 1fr; gap: 14px; }
  .portrait-result { width: 90px; }
  .result-card > .button { grid-column: 1 / -1; width: 100%; }
  .owner-card-top { grid-template-columns: 88px 1fr; }
  .portrait-owner { width: 88px; }
  .owner-actions .button { width: 100%; }
  .studio-heading-actions, .studio-heading-actions .button { width: 100%; }
  .content-facts > div { grid-template-columns: 1fr; gap: 4px; align-content: center; padding: 12px 0; }
  .studio-panel { padding: 20px; }
  .kinelio-form { grid-template-columns: 1fr; padding: 20px; }
  .field-wide { grid-column: auto; }
  .form-actions { flex-direction: column; }
  .form-actions .button { width: 100%; }
  .owner-bar { align-items: flex-start; flex-direction: column; }
  .owner-bar > div { width: 100%; justify-content: space-between; }
  .memorial-hero { grid-template-columns: 1fr; padding-top: 32px; }
  .portrait-hero { max-width: 390px; }
  .profile-nav { gap: 20px; }
  .memorial-grid { grid-template-columns: 1fr; }
  .story-card { grid-column: auto; }
  .story-card, .qr-card { min-height: auto; }
  .footer-inner { width: calc(100% - 28px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
/* Family Foundation R3 */
.family-page, .family-detail-page, .family-form-page { padding: 72px 0 78px; }
.family-heading { display: flex; justify-content: space-between; gap: 30px; align-items: end; }
.family-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 30px 0 26px; }
.family-card, .family-entry-panel { border: 1px solid var(--k-border); border-radius: var(--k-radius-card); background: var(--k-white); padding: 24px; }
.family-card { display: grid; gap: 14px; }
.family-card h2, .family-entry-panel h2 { margin: 0; font-size: 28px; }
.family-card p, .family-entry-panel p { margin: 0; color: var(--k-text-2); }
.family-card-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.family-count { color: var(--k-muted); font-size: 15px; }
.family-relationship { font-size: 15px; font-weight: 600; }
.family-entry-panel { margin-top: 30px; display: flex; justify-content: space-between; gap: 30px; align-items: center; }
.family-entry-panel > div { max-width: 720px; display: grid; gap: 9px; }
.family-empty { grid-column: 1 / -1; }
.single-column-family-form { max-width: 780px; }
.family-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 22px; align-items: start; }
.family-main { display: grid; gap: 18px; }
.family-side { position: sticky; top: 96px; display: grid; gap: 16px; }
.family-memorial-list, .family-member-list, .family-invite-list { display: grid; margin-top: 18px; border-top: 1px solid var(--k-border); }
.family-memorial-row { min-height: 94px; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; border-bottom: 1px solid var(--k-border); padding: 12px 0; }
.family-memorial-row:last-child, .family-member-row:last-child, .family-invite-row:last-child { border-bottom: 0; }
.family-portrait { width: 64px; height: 64px; min-height: 64px; border-radius: 10px; font-size: 20px; }
.family-memorial-copy { display: grid; gap: 2px; min-width: 0; }
.family-memorial-copy strong { font-size: 17px; }
.family-memorial-copy span { color: var(--k-muted); font-size: 15px; }
.family-memorial-copy a { overflow-wrap: anywhere; font-size: 15px; font-weight: 600; }
.family-member-row { min-height: 74px; display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: center; border-bottom: 1px solid var(--k-border); }
.family-member-row > div:last-child { display: grid; gap: 2px; }
.family-member-row span { color: var(--k-muted); font-size: 15px; }
.family-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--k-surface); border: 1px solid var(--k-border); display: grid; place-items: center; font-weight: 700; }
.family-inline-empty { padding: 24px 0 4px; display: grid; gap: 3px; color: var(--k-muted); }
.family-inline-empty strong { color: var(--k-text); }
.family-mini-form { display: grid; gap: 14px; margin-top: 14px; }
.family-mini-form .field input, .family-mini-form .field select { min-height: 48px; }
.family-help { color: var(--k-muted); font-size: 15px; line-height: 1.5; }
.family-invite-row { display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--k-border); }
.family-invite-row > div { display: grid; gap: 2px; }
.family-invite-row span { color: var(--k-muted); font-size: 14px; }
.invite-link { width: 100%; min-height: 44px; border: 1px solid var(--k-border); border-radius: var(--k-radius-control); background: var(--k-surface); color: var(--k-text-2); padding: 9px 11px; font-size: 14px; }
.text-button { min-height: 44px; padding: 8px 0; background: transparent; color: var(--k-muted); border: 0; text-decoration: underline; justify-self: start; }
.invite-accept-page { min-height: 660px; padding: 92px 0; display: grid; place-items: start center; }
.invite-accept-card { width: min(100%, 650px); border: 1px solid var(--k-border); border-radius: var(--k-radius-card); padding: 32px; background: var(--k-white); }
.invite-accept-card h1 { margin: 12px 0 16px; }
.invite-accept-card form { margin-top: 24px; }

@media (max-width: 860px) {
  .family-heading, .family-entry-panel { align-items: flex-start; flex-direction: column; }
  .family-grid { grid-template-columns: 1fr; }
  .family-layout { grid-template-columns: 1fr; }
  .family-side { position: static; }
}

@media (max-width: 620px) {
  .family-page, .family-detail-page, .family-form-page { padding-top: 48px; }
  .family-card, .family-entry-panel, .invite-accept-card { padding: 20px; }
  .family-memorial-row { grid-template-columns: 54px 1fr; }
  .family-memorial-row > form { grid-column: 2; }
  .family-portrait { width: 54px; height: 54px; min-height: 54px; }
}

.family-avatar-image {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  object-fit: cover;
  object-position: center 34%;
  border-radius: 12px;
  border: 1px solid var(--kinelio-border);
  background: var(--kinelio-grouped);
}
.family-member-copy {
  display: grid;
  gap: 2px;
}
.family-member-copy span {
  color: var(--kinelio-muted);
}


/* R4.5 — living people + administrator visibility */
.admin-visibility-note {
  margin: 18px 0 0;
  max-width: 760px;
  color: var(--k-muted);
  font-size: 15px;
  font-weight: 600;
}

.admin-visible-card {
  background: var(--k-surface);
}

.people-page,
.person-profile-page {
  min-height: 680px;
}

.people-heading {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 8px 0 48px;
}

.person-card {
  overflow: hidden;
  border: 1px solid var(--k-border);
  border-radius: var(--k-radius-card);
  background: var(--k-white);
}

.person-card-image {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--k-surface);
}

.person-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 34%;
}

.person-card-copy {
  padding: 20px;
}

.person-card-copy h2 {
  margin: 5px 0 6px;
  font-size: 25px;
}

.person-card-copy h2 a {
  color: inherit;
  text-decoration: none;
}

.person-card-copy > p {
  margin: 7px 0;
  color: var(--k-text-2);
}

.person-meta {
  font-weight: 600;
}

.person-card-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--k-border);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--k-muted);
  font-size: 14px;
}

.person-card-footer a {
  color: var(--k-text);
  font-weight: 600;
  text-decoration: none;
}

.person-profile-hero {
  padding: 56px 0 42px;
  display: grid;
  grid-template-columns: minmax(300px, 430px) minmax(0, 1fr);
  gap: 58px;
  align-items: center;
}

.person-portrait-wrap {
  overflow: hidden;
  border: 1px solid var(--k-border);
  border-radius: 14px;
  background: var(--k-surface);
}

.person-portrait {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.person-profile-copy h1 {
  margin: 10px 0 8px;
}

.person-profile-meta {
  margin: 0;
  color: var(--k-text-2);
  font-size: 20px;
  font-weight: 600;
}

.person-occupation {
  margin: 18px 0 0;
  font-size: 19px;
  font-weight: 600;
}

.person-bio {
  margin: 22px 0 0;
  max-width: 720px;
  color: var(--k-text-2);
  font-size: 18px;
  line-height: 1.65;
}

.person-profile-actions {
  margin-top: 28px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-inspection-strip {
  margin: 6px 0 24px;
  padding: 18px 20px;
  border: 1px solid var(--k-border);
  border-radius: var(--k-radius-card);
  background: var(--k-surface);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.admin-inspection-strip > div {
  display: grid;
  gap: 3px;
}

.admin-inspection-strip span {
  color: var(--k-muted);
  font-size: 14px;
}

.person-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 6px 0 48px;
}

.person-family-list,
.person-memorial-list {
  display: grid;
  gap: 10px;
}

.person-family-row {
  padding: 14px 0;
  border-top: 1px solid var(--k-border);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: inherit;
  text-decoration: none;
}

.person-family-row:first-child {
  border-top: 0;
}

.person-family-row div {
  display: grid;
  gap: 3px;
}

.person-family-row span,
.person-memorial-row span {
  color: var(--k-muted);
  font-size: 14px;
}

.person-memorial-row {
  padding: 12px 0;
  border-top: 1px solid var(--k-border);
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: center;
}

.person-memorial-row:first-child {
  border-top: 0;
}

.person-memorial-row > div:last-child {
  display: grid;
  gap: 3px;
}

.person-memorial-avatar {
  width: 56px;
  height: 56px;
  border-radius: 10px;
}

.person-memorial-avatar span {
  color: var(--k-muted);
  font-size: 18px;
  font-weight: 700;
}

.family-person-link {
  min-width: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.family-person-link:hover strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.admin-inspection-panel {
  background: var(--k-surface);
}

.account-surface-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.account-surface-grid .family-entry-panel {
  margin-top: 0;
}

@media (max-width: 980px) {
  .people-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .person-profile-hero {
    grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
    gap: 34px;
  }

  .person-profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .people-heading,
  .admin-inspection-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .people-grid,
  .account-surface-grid {
    grid-template-columns: 1fr;
  }

  .person-profile-hero {
    grid-template-columns: 1fr;
  }

  .person-portrait-wrap {
    max-width: 420px;
  }

  .person-card-footer {
    flex-direction: column;
  }
}


/* R5.1 — privacy, discovery and large-scale People directory */
.people-directory-page { min-height: 680px; }
.directory-heading { display: flex; justify-content: space-between; gap: 28px; align-items: end; }

.directory-toolbar {
  margin: 6px 0 18px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(4, minmax(140px, .7fr)) auto;
  gap: 12px;
  align-items: end;
  border: 1px solid var(--k-border);
  border-radius: var(--k-radius-card);
  background: var(--k-surface);
}
.directory-toolbar label,
.settings-field > label {
  display: block;
  margin-bottom: 7px;
  color: var(--k-text-2);
  font-size: 14px;
  font-weight: 650;
}
.directory-toolbar input,
.directory-toolbar select,
.profile-settings-form input,
.profile-settings-form select,
.profile-settings-form textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #C7C7CC;
  border-radius: var(--k-radius-control);
  padding: 0 13px;
  background: var(--k-white);
  color: var(--k-text);
  font: inherit;
}
.profile-settings-form textarea {
  min-height: 260px;
  padding: 13px;
  resize: vertical;
  line-height: 1.55;
}
.directory-toolbar-actions { display: flex; gap: 8px; }

.alphabet-index {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 8px 0 16px;
  scrollbar-width: thin;
}
.alphabet-index a {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--k-border);
  border-radius: 9px;
  color: var(--k-text-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}
.alphabet-index a.active {
  background: var(--k-text);
  border-color: var(--k-text);
  color: var(--k-white);
}

.directory-results-meta {
  padding: 12px 0;
  display: flex;
  gap: 5px;
  align-items: baseline;
  color: var(--k-muted);
  font-size: 14px;
}
.directory-results-meta strong { color: var(--k-text); font-size: 16px; }

.people-directory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}
.person-directory-row {
  min-height: 86px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--k-border);
  border-radius: 12px;
  background: var(--k-white);
}
.directory-avatar {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: var(--k-surface-2);
  color: var(--k-text-2);
  text-decoration: none;
}
.directory-avatar img { width: 64px; height: 64px; object-fit: cover; }
.directory-avatar span { font-size: 20px; font-weight: 700; }
.directory-avatar svg,
.my-profile-avatar svg,
.living-profile-fallback svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.directory-person-copy { min-width: 0; }
.directory-person-copy h2 { margin: 0 0 3px; font-size: 18px; line-height: 1.2; }
.directory-person-copy h2 a { color: inherit; text-decoration: none; }
.directory-person-copy p {
  margin: 2px 0;
  overflow: hidden;
  color: var(--k-muted);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.directory-person-meta { color: var(--k-text-2) !important; font-weight: 600; }
.directory-person-side {
  min-width: 82px;
  display: grid;
  gap: 5px;
  justify-items: end;
  color: var(--k-muted);
  font-size: 13px;
}
.directory-person-side a { color: var(--k-text); font-weight: 650; text-decoration: none; }
.directory-empty { grid-column: 1 / -1; }
.directory-pagination {
  padding: 26px 0 48px;
  display: flex;
  justify-content: center;
  gap: 14px;
  align-items: center;
  color: var(--k-muted);
  font-size: 14px;
}

.living-profile-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--k-surface-2);
  color: var(--k-muted);
}
.living-profile-fallback span { font-size: 64px; font-weight: 700; }
.living-profile-fallback-large { aspect-ratio: 4 / 5; }

.profile-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
  padding-bottom: 54px;
}
.profile-settings-form { display: grid; gap: 18px; }
.settings-form-grid,
.privacy-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.settings-field-wide { grid-column: 1 / -1; }
.settings-check {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--k-text-2);
  font-weight: 600;
}
.settings-check input { width: 20px; min-height: 20px; height: 20px; }
.settings-help { color: var(--k-muted); font-size: 14px; line-height: 1.5; }
.profile-settings-actions { display: flex; justify-content: flex-end; }
.profile-readiness-card {
  position: sticky;
  top: 100px;
  padding: 22px;
  border: 1px solid var(--k-border);
  border-radius: var(--k-radius-card);
  background: var(--k-surface);
}
.profile-readiness-card h2 { margin: 8px 0 18px; }
.readiness-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
  list-style: none;
}
.readiness-list li { position: relative; padding-left: 24px; color: var(--k-muted); }
.readiness-list li::before { content: "○"; position: absolute; left: 0; }
.readiness-list li.done { color: var(--k-text); font-weight: 600; }
.readiness-list li.done::before { content: "✓"; }
.bio-meter { margin: 20px 0; display: grid; gap: 7px; }
.bio-meter span { color: var(--k-muted); font-size: 13px; }
.bio-meter progress { width: 100%; }
.readiness-good { font-weight: 650; }
.settings-success {
  margin: 0 0 18px;
  padding: 12px 15px;
  border: 1px solid #CDE8D5;
  border-radius: 10px;
  background: #F1FAF4;
  color: #155D2D;
  font-weight: 650;
}

.my-profile-summary {
  margin-bottom: 34px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--k-border);
  border-radius: var(--k-radius-card);
}
.my-profile-avatar {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: var(--k-surface-2);
  color: var(--k-muted);
}
.my-profile-avatar img { width: 72px; height: 72px; object-fit: cover; }
.my-profile-avatar span { font-size: 22px; font-weight: 700; }
.my-profile-summary-copy h2 { margin: 4px 0; font-size: 24px; }
.my-profile-summary-copy p:last-child { margin: 0; color: var(--k-muted); }
.my-profile-summary-actions { display: flex; gap: 8px; }
.account-section-heading { margin: 26px 0 14px; }
.account-section-heading h2 { margin: 5px 0 0; }

.language-switcher { flex: 0 0 auto; }
.language-switcher select {
  height: 40px;
  min-width: 58px;
  border: 1px solid var(--k-border);
  border-radius: 9px;
  padding: 0 8px;
  background: var(--k-white);
  color: var(--k-text);
  font-size: 13px;
  font-weight: 700;
}
.field-error { margin-top: 5px; color: var(--k-danger); font-size: 13px; }

@media (max-width: 1180px) {
  .directory-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .directory-search-field { grid-column: span 2; }
  .directory-toolbar-actions { align-self: end; }
  .language-switcher { display: none; }
}
@media (max-width: 820px) {
  .people-directory-grid { grid-template-columns: 1fr; }
  .directory-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory-search-field { grid-column: 1 / -1; }
  .profile-settings-layout { grid-template-columns: 1fr; }
  .profile-readiness-card { position: static; }
  .settings-form-grid,
  .privacy-field-grid { grid-template-columns: 1fr; }
  .my-profile-summary { grid-template-columns: 64px 1fr; }
  .my-profile-summary-actions { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .directory-heading { align-items: stretch; flex-direction: column; }
  .directory-toolbar { grid-template-columns: 1fr; }
  .directory-search-field { grid-column: auto; }
  .directory-toolbar-actions { flex-wrap: wrap; }
  .person-directory-row { grid-template-columns: 56px minmax(0, 1fr); }
  .directory-avatar,
  .directory-avatar img { width: 56px; height: 56px; }
  .directory-person-side {
    grid-column: 2;
    grid-row: 2;
    justify-items: start;
    grid-auto-flow: column;
    justify-content: start;
  }
  .my-profile-summary { grid-template-columns: 56px 1fr; }
  .my-profile-avatar,
  .my-profile-avatar img { width: 56px; height: 56px; }
}
