:root {
  --bg: #f7f1e8; --bg2: #efe6d8; --card: #fffdf9; --ink: #1d2a27; --muted: #6b726d; --line: #d8cbb7;
  --primary: #1f4b43; --primary-ink: #f6efe4; --accent: #c8643b; --gold: #d9a441; --danger: #b23a3a; --ok: #2f7a4f;
  --leaf0: #1f4b43; --leaf1: #c8643b; --leaf2: #d9a441; --leaf3: #7a9a6b;
  --radius: 16px; --shadow: 0 1px 2px rgba(40,30,10,.06), 0 6px 24px -8px rgba(40,30,10,.18);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif; --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .4em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); } h2 { font-size: 1.6rem; } h3 { font-size: 1.2rem; } h4 { font-size: 1rem; margin-top: 1.2em; }
a { color: var(--primary); }
p { margin: 0 0 1em; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .pre { white-space: pre-wrap; } .grow { flex: 1; }
.ic { display: inline-flex; width: 1.15em; height: 1.15em; vertical-align: -.2em; }
.ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; font: 600 .95rem var(--sans); padding: .65em 1.1em; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--primary); transform: translateY(-1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: #173a34; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: #e5bcbc; }
.btn.sm { font-size: .82rem; padding: .45em .85em; }
.btn.block { width: 100%; }
.btn.icon-only { padding: .5em; width: 2.3em; height: 2.3em; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: .5em; text-align: left; }
.linkish:hover { color: var(--primary); text-decoration: underline; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: .65em .85em; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,75,67,.15); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
input[type=file] { border-style: dashed; background: var(--bg); }
label { display: flex; flex-direction: column; gap: .35em; font-weight: 500; font-size: .9rem; }
label.check { flex-direction: row; align-items: center; gap: .5em; }
.lbl { display: block; font-weight: 500; font-size: .9rem; margin-bottom: .35em; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.form-msg { margin-top: .8em; font-weight: 500; } .form-msg.err { color: var(--danger); } .form-msg.ok { color: var(--ok); }

/* layout */
.top { position: sticky; top: 0; z-index: 20; background: rgba(247,241,232,.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; padding: .7rem 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font: 600 1.15rem var(--serif); white-space: nowrap; }
.mark { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font: 600 1.1rem var(--serif); }
.mark.big { width: 3.6rem; height: 3.6rem; font-size: 1.8rem; margin: 0 auto 1rem; }
.nav { display: flex; gap: .2rem; margin: 0 auto; }
.navlink { display: flex; align-items: center; gap: .4rem; padding: .5rem .8rem; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: .92rem; white-space: nowrap; position: relative; }
.navlink:hover { background: var(--bg2); }
.navlink.active { background: var(--primary); color: var(--primary-ink); }
.badge { background: var(--accent); color: #fff; border-radius: 999px; font-size: .7rem; padding: .05rem .4rem; }
.top-right { display: flex; align-items: center; gap: .5rem; }
.lang { display: flex; background: var(--bg2); border-radius: 999px; padding: 3px; }
.lang button { border: 0; background: none; font: 600 .78rem var(--sans); padding: .35rem .6rem; border-radius: 999px; cursor: pointer; color: var(--muted); }
.lang button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.main { max-width: 1240px; margin: 0 auto; padding: 1.5rem 1rem 4rem; min-height: 70vh; }
.foot { max-width: 1240px; margin: 0 auto; padding: 2rem 1rem 6rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .85rem; border-top: 1px solid var(--line); }
.page-head { margin: 1rem 0 1.5rem; } .page-head p { margin: 0; }
.section { margin-top: 3rem; } .section-head { margin-bottom: 1.2rem; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(216,203,183,.6); }
.card.pad { padding: 1.4rem; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.2rem; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: spin 1s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px; background: hsl(var(--hue, 160) 45% 92%); color: hsl(var(--hue, 160) 45% 28%); margin-top: .3rem; }
.tag.st-pending { --hue: 35; } .tag.st-approved { --hue: 140; } .tag.st-rejected { --hue: 0; }

/* avatars */
.avatar { flex: none; display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: #e7dccb; color: #5a4d3a; font: 600 .85rem var(--sans); overflow: hidden; }
.avatar.f { background: #f1d9cc; color: #8a3f22; } .avatar.m { background: #d2e2dc; color: #1f4b43; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 1.8rem; height: 1.8rem; font-size: .7rem; }
.avatar.lg { width: 3.6rem; height: 3.6rem; font-size: 1.1rem; }
.avatar.xl { width: 5.5rem; height: 5.5rem; font-size: 1.6rem; }

/* hero */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: center; padding: 2rem 0 1rem; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 700; color: var(--primary); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: .6rem; }
.lead { font-size: 1.15rem; color: #3c4a46; max-width: 38em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.hero-art { color: var(--primary); } .hero-art svg { width: 100%; max-width: 420px; display: block; margin: 0 auto; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1.5rem; }
.stat { background: var(--card); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat b { font: 700 2.1rem var(--serif); color: var(--primary); }
.stat span { color: var(--muted); font-size: .9rem; }
.branch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem; }
.branch-card { position: relative; text-align: left; display: flex; flex-direction: column; gap: .35rem; padding: 1.1rem; border-radius: var(--radius); cursor: pointer; font: inherit; color: inherit;
  background: var(--card); border: 1px solid rgba(216,203,183,.6); box-shadow: var(--shadow); border-top: 4px solid hsl(var(--hue) 45% 45%); transition: .15s; }
.branch-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px -10px rgba(40,30,10,.3); }
.branch-num { position: absolute; top: .8rem; right: 1rem; font: 600 1.4rem var(--serif); color: hsl(var(--hue) 40% 75%); }
.branch-name { font-weight: 600; font-family: var(--serif); font-size: 1.05rem; }
.branch-count { font-size: .8rem; color: hsl(var(--hue) 45% 30%); font-weight: 600; margin-top: auto; }
.mini-list { list-style: none; padding: 0; margin: 0; } .mini-list li { display: flex; justify-content: space-between; align-items: center; padding: .45rem 0; border-bottom: 1px dashed var(--line); gap: 1rem; }
.news article { padding: .6rem 0; border-bottom: 1px dashed var(--line); } .news h4 { margin: .1rem 0 .3rem; } .news p { margin: 0; color: #3c4a46; }
.news-date { font-size: .78rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }

/* tree */
.tree-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .8rem; }
.tb-search { display: flex; align-items: center; gap: .4rem; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 0 .9rem; min-width: 260px; flex: 1; }
.tb-search .ic { color: var(--muted); } .tb-search input, .tb-search .picker-wrap { border: 0; box-shadow: none !important; background: none; padding: .55rem 0; flex: 1; }
.picker-wrap { display: block; } .tb-search .picker-wrap input { border: 0; padding: .55rem 0; background: none; }
.tb-group { display: flex; gap: .35rem; align-items: center; }
.zoom-label { font-size: .8rem; color: var(--muted); width: 3em; text-align: center; }
.tree-viewport { overflow: auto; background: radial-gradient(circle at 1px 1px, rgba(31,75,67,.12) 1px, transparent 0) 0 0 / 22px 22px, var(--card);
  border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(216,203,183,.6); height: calc(100vh - 260px); min-height: 420px; cursor: grab; touch-action: pan-x pan-y; }
.tree-viewport.dragging { cursor: grabbing; user-select: none; }
.tree-canvas { display: inline-block; min-width: 100%; padding: 2rem 2rem 3rem; }
.tree, .tree ul { display: flex; justify-content: center; margin: 0; padding: 0; position: relative; }
.tree ul { padding-top: 26px; }
.tree li { list-style: none; position: relative; padding: 26px 6px 0; display: flex; flex-direction: column; align-items: center; }
.tree li::before, .tree li::after { content: ''; position: absolute; top: 0; right: 50%; width: 50%; height: 26px; border-top: 2px solid var(--line); }
.tree li::after { right: auto; left: 50%; border-left: 2px solid var(--line); }
.tree li:only-child::before, .tree li:only-child::after { display: none; }
.tree li:only-child { padding-top: 0; }
.tree li:first-child::before, .tree li:last-child::after { border: 0 none; }
.tree li:last-child::before { border-right: 2px solid var(--line); border-radius: 0 10px 0 0; }
.tree li:first-child::after { border-radius: 10px 0 0 0; }
.tree ul ul::before, .tree > li > ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 26px; border-left: 2px solid var(--line); }
.tcard { position: relative; display: flex; align-items: center; gap: .15rem; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: .35rem; box-shadow: 0 2px 8px -4px rgba(40,30,10,.25); }
.tcard.gen1 { border-top: 4px solid hsl(var(--hue) 45% 45%); }
.tcard.hl { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(200,100,59,.2); }
.pchip { display: flex; align-items: center; gap: .5rem; background: none; border: 0; padding: .35rem .55rem .35rem .35rem; border-radius: 10px; cursor: pointer; font: inherit; color: inherit; text-align: left; max-width: 210px; }
.pchip:hover { background: var(--bg); }
.pchip.hl { background: #fbe9df; }
.pchip.dec .avatar { filter: grayscale(.6); }
.pchip-text { display: flex; flex-direction: column; min-width: 0; }
.pname { font-weight: 600; font-size: .86rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pyears { font-size: .74rem; color: var(--muted); }
.amp { color: var(--accent); font: 600 1rem var(--serif); padding: 0 .1rem; } .amp.div { color: var(--muted); }
.toggle { position: absolute; bottom: -13px; left: 50%; transform: translateX(-50%); z-index: 2; min-width: 26px; height: 24px; padding: 0 .45rem; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); font: 700 .72rem var(--sans); color: var(--primary); cursor: pointer; }
.toggle:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.toggle.open { color: var(--muted); }

/* drawer & modal */
.overlay { position: fixed; inset: 0; background: rgba(20,28,26,.35); opacity: 0; transition: opacity .2s; z-index: 40; }
.overlay.in { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--card); z-index: 41; overflow-y: auto; padding: 1.6rem; box-shadow: -10px 0 40px rgba(0,0,0,.15);
  transform: translateX(100%); transition: transform .25s ease; }
.drawer.in { transform: none; }
.drawer-x { position: absolute; top: 1rem; right: 1rem; border: 0; background: var(--bg2); width: 2.2rem; height: 2.2rem; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.drawer-head { display: flex; gap: 1rem; align-items: center; margin: .5rem 2.5rem 1.2rem 0; } .drawer-head h2 { font-size: 1.45rem; margin: 0; }
.kvs { margin: 0; display: grid; gap: .1rem; }
.kv { display: grid; grid-template-columns: 7.5rem 1fr; gap: .8rem; padding: .4rem 0; border-bottom: 1px dashed var(--line); }
.kv dt { color: var(--muted); font-size: .85rem; } .kv dd { margin: 0; }
.notes { background: var(--bg); padding: .8rem 1rem; border-radius: 12px; margin-top: 1rem; font-size: .92rem; }
.note { background: var(--bg); padding: .8rem 1rem; border-radius: 12px; font-size: .9rem; color: var(--muted); }
.rel-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.rel-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .7rem .25rem .25rem; border: 1px solid var(--line); background: #fff; border-radius: 999px; font: 500 .85rem var(--sans); color: var(--ink); cursor: pointer; }
.rel-chip:hover { border-color: var(--primary); }
.drawer-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.drawer-actions.admin { background: #f3ede2; margin: 1rem -1.6rem -1.6rem; padding: 1rem 1.6rem 1.6rem; border-top: 0; }
.modal-ov { display: grid; place-items: start center; overflow-y: auto; padding: 4vh 1rem; }
.modal { background: var(--card); border-radius: 20px; width: min(560px, 100%); padding: 1.6rem; position: relative; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; } .modal-head h2 { margin: 0; font-size: 1.4rem; } .modal-head .drawer-x { position: static; }
.modal-actions { display: flex; justify-content: space-between; gap: .5rem; margin-top: 1.4rem; }
.sp-box { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .5rem; }
.sp-row { display: flex; align-items: center; gap: .5rem; background: var(--bg); padding: .4rem .5rem .4rem .9rem; border-radius: 12px; }
.sp-row span { flex: 1; font-weight: 500; } .sp-row select { width: auto; padding: .35rem .5rem; }

/* forms */
.form h3 { margin-top: 1.6rem; color: var(--primary); } .form h3:first-child { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; }
.form-grid .full, .form .full { grid-column: 1 / -1; }
.form > label, .form > div { margin-top: 1rem; }
.form > label:first-child { margin-top: 0; }
.kids-head { display: flex; align-items: center; justify-content: space-between; }
.kids-box { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.kid-row { display: grid; grid-template-columns: 1fr 1fr 8rem auto; gap: .5rem; }
.thanks { max-width: 520px; margin: 3rem auto; } .big-emoji { font-size: 3.5rem; }
.login-wrap { min-height: 65vh; display: grid; place-items: center; }
.login-card { width: min(400px, 100%); padding: 2.2rem; text-align: center; display: flex; flex-direction: column; gap: .9rem; }
.login-card h1 { font-size: 1.8rem; margin: 0; }

/* directory */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1.2rem; }
.filters select { width: auto; border-radius: 999px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; }
.pcard { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3rem; padding: 1.2rem .8rem; background: var(--card); border: 1px solid rgba(216,203,183,.6);
  border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; font: inherit; color: inherit; transition: .15s; }
.pcard:hover { transform: translateY(-2px); border-color: var(--primary); }
.pcard b { font-family: var(--serif); font-weight: 600; margin-top: .3rem; }

/* relationship */
.rel-form { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: start; }
.rel-form label { gap: .5rem; } .rel-form label .btn { align-self: flex-start; }
.swap { margin-top: 1.9rem; }
.mnav { display: none; }
.rel-result { margin-top: 1.4rem; }
.rel-empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; } .rel-empty .ic { width: 2.5rem; height: 2.5rem; opacity: .5; }
.rel-card { padding: 2rem; text-align: center; }
.rel-pair { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-bottom: 1rem; }
.rel-line { width: 70px; border-top: 2px dashed var(--accent); }
.rel-main { font: 600 clamp(1.3rem, 3vw, 1.9rem)/1.3 var(--serif); color: var(--primary); max-width: 32em; margin: 0 auto .6rem; }
.rel-alt { font-style: italic; }
.rel-card.none .rel-main { color: var(--muted); }
.path { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .35rem; margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px dashed var(--line); }
.arrow { color: var(--muted); font-weight: 700; }

/* admin */
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: 1.5px solid var(--line); margin-bottom: 1.4rem; }
.tabs a { padding: .6rem 1rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
.tabs a.on { color: var(--primary); border-color: var(--primary); }
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--bg2); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sub-list { display: flex; flex-direction: column; gap: 1rem; }
.sub-card.done { opacity: .7; }
.sub-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .6rem; } .sub-head h3 { margin: 0; }
.sub-actions { display: flex; flex-direction: column; gap: .8rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.checks { display: flex; flex-wrap: wrap; gap: 1rem; }
details summary { cursor: pointer; font-weight: 600; margin-bottom: 1rem; }
.mode-list { display: grid; gap: .5rem; }
.mode { flex-direction: row; align-items: flex-start; gap: .8rem; padding: .9rem 1rem; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; background: #fff; }
.mode.on { border-color: var(--primary); background: #eef4f1; }
.mode div { display: flex; flex-direction: column; }
.help code { font-size: .8rem; background: var(--bg); padding: .1rem .35rem; border-radius: 6px; }
.toast { position: fixed; bottom: 5.5rem; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: 999px; opacity: 0; transition: .25s; z-index: 60; font-weight: 500; }
.toast.in { opacity: 1; transform: translate(-50%, 0); }
.empty { text-align: center; }
.alert { background: #fbe4e4; color: var(--danger); padding: .8rem 1rem; border-radius: 12px; margin-bottom: 1rem; }

/* setup page */
body.setup { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.setup-card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 2rem; width: min(680px, 100%); }
.setup-card .form-grid { margin-top: 1rem; }

/* responsive */
@media (max-width: 960px) {
  .navlink span { display: none; } .navlink { padding: .55rem; }
  .navlink.active span { display: inline; }
}
@media (max-width: 720px) {
  .top-inner { flex-wrap: wrap; gap: .5rem; }
  .brand span:last-child { font-size: 1rem; }
  .top .nav { display: none; }
  .mnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; margin: 0; justify-content: space-around; background: rgba(255,253,249,.96); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: .4rem .3rem calc(.4rem + env(safe-area-inset-bottom)); z-index: 30; }
  .navlink { flex-direction: column; gap: .1rem; font-size: .66rem; padding: .35rem .4rem; border-radius: 12px; }
  .navlink span { display: block; } .navlink .ic { width: 1.35rem; height: 1.35rem; }
  .navlink.active { background: transparent; color: var(--accent); }
  .navlink .badge { position: absolute; top: 0; right: 0; }
  .top-right { margin-left: auto; }
  .hero { grid-template-columns: 1fr; padding-top: .5rem; } .hero-art { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .kid-row { grid-template-columns: 1fr 1fr; } .kid-row input:nth-child(3) { grid-column: 1; }
  .rel-form { grid-template-columns: 1fr; } .swap { margin: 0 auto; transform: rotate(90deg); }
  .tree-viewport { height: calc(100vh - 300px); }
  .tb-search { min-width: 100%; }
  .kv { grid-template-columns: 6rem 1fr; }
  .main { padding-top: 1rem; }
}

.checks-list { list-style: none; padding: 0; margin: 0 0 1rem; font-size: .9rem; } .checks-list li { padding: .2rem 0; } .checks-list .ok { color: var(--ok); } .checks-list .bad { color: var(--danger); font-weight: 600; } .checks-list .warn { color: #a06a00; }

/* date field + calendar */
.date-field { position: relative; display: flex; flex-direction: column; gap: .25rem; }
.date-row { display: flex; align-items: stretch; position: relative; }
.date-row input { padding-right: 2.8rem; }
.date-in.bad { border-color: var(--danger); }
.date-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 2.2rem; height: 2.2rem; border: 0; border-radius: 9px; background: var(--bg2); color: var(--primary); cursor: pointer; display: grid; place-items: center; }
.date-btn:hover { background: var(--primary); color: #fff; }
.date-hint { font-size: .78rem; font-weight: 400; color: var(--muted); min-height: 1em; }
.date-hint.err { color: var(--danger); }
.cal { position: absolute; top: calc(100% - 1rem); left: 0; z-index: 70; width: 300px; max-width: calc(100vw - 2rem); background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px -10px rgba(0,0,0,.3); padding: .8rem; font-weight: 400; }
.cal-head { display: flex; gap: .3rem; align-items: center; margin-bottom: .5rem; }
.cal-head select { flex: 1; padding: .4rem .5rem; border-radius: 10px; text-transform: capitalize; }
.cal-year { width: 5.2rem !important; padding: .4rem .5rem !important; border-radius: 10px !important; }
.cal-nav { border: 0; background: var(--bg2); width: 2rem; height: 2rem; border-radius: 50%; cursor: pointer; font-size: 1.2rem; line-height: 1; color: var(--ink); flex: none; }
.cal-nav:hover { background: var(--primary); color: #fff; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { text-align: center; font-size: .72rem; font-weight: 600; color: var(--muted); padding: .2rem 0; text-transform: uppercase; }
.cal-day { aspect-ratio: 1; border: 0; background: none; border-radius: 9px; cursor: pointer; font: 500 .85rem var(--sans); color: var(--ink); }
.cal-day:hover { background: var(--bg2); }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day.sel { background: var(--primary); color: #fff; }
.cal-foot { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.cal-foot .btn { font-size: .74rem; padding: .35em .7em; text-transform: none; }

.nf-table { background: #fff; border-radius: 12px; overflow: hidden; } .nf-table td:first-child { font-weight: 500; } .nf-table select { width: auto; padding: .35rem .5rem; }
.nf-prev td { background: #eef4f1; } .nf-prev b { font-family: var(--serif); color: var(--primary); }
