:root {
  color-scheme: light;
  --paper: #f5f1e7;
  --surface: #fffdf7;
  --charcoal: #173b30;
  --highlight: #dfe9ce;
  --highlight-edge: #c1cea9;
  --display: var(--font);
  --ink: #1e3229;
  --muted: #536157;
  --line: #d9dfd0;
  --accent: #23483a;
  --tint: #e9eee1;
  --secondary: #4c5b42;
  --shadow: 0 2px 4px #1a291a08, 0 10px 28px #1a291a08;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --telugu: "Noto Sans Telugu", "Kohinoor Telugu", Gautami, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #5e683b; outline-offset: 3px; }
[hidden] { display: none !important; }
svg { display: block; width: 18px; height: 18px; flex-shrink: 0; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.15; }
h2 { font: 720 22px/1.16 var(--display); letter-spacing: -.035em; }

.site-header {
  color: var(--ink); background: var(--surface); border-bottom: 1px solid var(--line);
}
.header-inner { max-width: 1760px; min-height: 72px; margin: auto; padding: 0 24px; display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); align-items: center; gap: 16px; }
.brand { width: max-content; display: flex; gap: 11px; align-items: center; font: 760 19px/1.15 var(--display); letter-spacing: -.045em; }
.brand-name { white-space: nowrap; }
.brand-names { display: flex; align-items: baseline; gap: 10px; }
.brand .village-telugu { font: 650 14px/1.35 var(--telugu); color: var(--muted); letter-spacing: 0; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: var(--highlight); background: var(--charcoal); }
.brand-icon svg { width: 22px; height: 22px; }
.main-nav { display: flex; align-items: center; gap: 3px; padding: 4px; border-radius: 999px; background: var(--tint); }
.main-nav a { display: flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 640; white-space: nowrap; }
.main-nav a:hover { color: var(--ink); background: #e2e6df; }
.main-nav a.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 5px #25302520; }
.main-nav svg, .button svg { width: 16px; height: 16px; }
.header-actions { display: flex; justify-content: flex-end; align-items: center; justify-self: end; gap: 8px; }
.site-header .account-action { white-space: nowrap; color: var(--muted); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 41px; padding: 8px 14px; border: 1px solid transparent; border-radius: 999px; font-size: 14px; font-weight: 660; white-space: nowrap; }
.button.primary { background: var(--charcoal); color: #ffffff; border-color: var(--charcoal); }
.button.primary:hover { background: #363d34; border-color: #363d34; }
.header-add [data-icon] { color: var(--highlight); }
.button.danger { background: #a32632; color: #fff; }
.button.danger:hover { background: #861e29; }
.button.quiet { background: var(--surface); border-color: var(--line); color: var(--accent); }
.button.quiet:hover, .icon-button:hover { background: var(--tint); }
.text-button { border: 0; background: transparent; color: var(--accent); font-size: 13px; font-weight: 670; padding: 4px; }
.text-button:hover { text-decoration: underline; }

main { max-width: 1760px; margin: auto; padding: 19px 24px 28px; }
.page-intro { margin: 7px 2px 19px; }
.page-intro h1 { font: 760 clamp(27px, 4vw, 42px)/1.1 var(--display); letter-spacing: -.055em; }
.page-intro p { margin-top: 4px; color: var(--muted); font-size: 15px; }
.workspace {
  display: grid; align-items: start; gap: 10px; --sidebar-width: clamp(176px, 15vw, 224px);
  grid-template: "branches tree" auto / var(--sidebar-width) minmax(0, 1fr);
}
.workspace .branches { grid-area: branches; }
.workspace .tree-panel { grid-area: tree; }
.workspace .profile { grid-area: profile; }
.branches, .tree-panel, .profile, .page-panel { min-width: 0; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.branches { padding: 16px 12px 12px; background: #f0f2ee; }
.side-head { padding: 0 4px; }
.side-head h2 { font-size: 19px; }
.search { display: flex; align-items: center; gap: 8px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 10px 12px; margin: 12px 0 10px; }
.search:focus-within { border-color: #788353; box-shadow: 0 0 0 2px #a2af6850; }
.search svg { width: 17px; height: 17px; }
.search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: none; background: none; color: var(--ink); font-size: 14px; }
.search input:focus-visible { outline: none; }
.branch-buttons, .search-results, .relationship-list { display: grid; gap: 3px; }
.branch-buttons { max-height: clamp(210px, 27dvh, 310px); overflow: auto; scrollbar-width: thin; padding: 3px; }
#all-families { margin-bottom: 6px; border-color: var(--line); }
#all-families.active { border-color: var(--highlight-edge); }
#all-families .branch-icon { background: var(--charcoal); color: var(--highlight); }
.search-results { max-height: 350px; overflow: auto; padding: 3px; }
.search-results h3 { margin: 6px 5px 3px; color: var(--muted); font-size: 13px; font-weight: 680; }
.surname-directory-link { display: inline-flex; align-items: center; min-height: 34px; margin: 6px 1px 0; padding-inline: 8px; white-space: normal; border-radius: 8px; }
.surname-directory-link:hover { background: var(--surface); }
.location-browser { margin-top: 10px; padding-top: 11px; border-top: 1px solid var(--line); }
.location-browser h2 { font-size: 17px; }
.location-links { display: grid; gap: 2px; max-height: 135px; overflow: auto; padding: 5px 3px 3px; scrollbar-width: thin; }
.location-links .branch-icon { background: var(--surface); color: var(--secondary); }
.location-links .branch-icon svg { width: 15px; height: 15px; }
.branch-button, .result-button, .relative-button { display: flex; width: 100%; min-width: 0; align-items: center; gap: 8px; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 6px; color: var(--ink); }
.branch-button:hover, .result-button:hover, .relative-button:hover { background: var(--tint); }
.branches .branch-button:hover { background: var(--surface); }
.branch-button { min-height: 43px; gap: 8px; padding: 6px 7px; border-radius: 12px; }
.branch-button.active, .branches .branch-button.active:hover { background: var(--highlight); border-color: var(--highlight-edge); }
.branch-button strong, .result-button strong, .relative-button strong { display: block; font-size: 14px; line-height: 1.27; font-weight: 650; overflow-wrap: anywhere; }
.branches .branch-button strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-button small, .relative-button small { display: block; color: var(--muted); font-size: 13px; line-height: 1.3; margin-top: 2px; }
.branch-button > span:nth-child(2), .result-button > span:nth-child(2), .relative-button > span:nth-child(2) { flex: 1; min-width: 0; }
.branch-count { flex-shrink: 0; min-width: 24px; padding: 2px 5px; border-radius: 999px; background: #e4e8e1; color: var(--muted); text-align: center; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.branch-button.active .branch-count { background: #ffffffb0; color: var(--accent); }
.relative-button > span:last-child { color: var(--muted); }
.relative-button > span:last-child svg { width: 13px; height: 13px; }
.branch-icon, .avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--record-tint, #efe8f2); color: var(--tone, #513650); font-size: 13px; font-weight: 740; border-radius: 9px; width: 31px; height: 31px; }
.branch-icon { width: 28px; height: 28px; border-radius: 50%; font: 710 13px var(--font); }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

.tree-panel { display: flex; flex-direction: column; overflow: hidden; }
.tree-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px 15px; }
.tree-heading h1 { font: 760 29px/1.12 var(--display); letter-spacing: -.055em; }
.tree-heading p, .dialog-head p { margin-top: 4px; color: var(--muted); font-size: 14px; }
.tree-tools { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.tree-tools .button { min-height: 38px; padding: 6px 11px; font-size: 13px; background: var(--tint); border-color: transparent; }
.tree-tools .button:hover { background: #e3e8df; }
.tree-tools .button:is(.compare-button[aria-expanded="true"], .sidebar-toggle[aria-expanded="false"]) { background: var(--highlight); border-color: var(--highlight-edge); }
.comparison { margin: 0 12px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.comparison-heading, .comparison-summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.comparison h3, .comparison h4 { margin: 0; overflow-wrap: anywhere; }
.comparison h3 { font-size: 15px; }
.comparison h4 { font-size: 16px; }
.comparison p { color: var(--muted); font-size: 13px; }
.comparison .search { margin: 8px 0 0; background: var(--surface); }
.comparison-choices { max-height: 200px; overflow: auto; margin: 3px 0; }
#comparison-result { margin-top: 9px; }
.comparison-summary > .chip { flex-shrink: 0; }
.relationship-path { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; margin: 8px 0 0; padding: 0; }
.relationship-path li { display: flex; flex-direction: column; justify-content: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; background: var(--surface); overflow-wrap: anywhere; }
.relationship-path li span { color: var(--muted); font-size: 11px; }
.canvas { position: relative; overflow: hidden; min-height: clamp(510px, calc(100dvh - 180px), 880px); margin: 0 12px; border: 1px solid var(--line); border-radius: 18px; background: #f0f2ee radial-gradient(#c5cdc1 0.9px, transparent 0.9px) 0 0 / 22px 22px; cursor: grab; touch-action: none; isolation: isolate; }
.canvas.grabbing { cursor: grabbing; }
.empty-tree .canvas { display: grid; place-items: center; margin-bottom: 10px; cursor: default; touch-action: auto; }
.empty-tree .tree-tools .button:not(.sidebar-toggle), .empty-tree .canvas-tip, .empty-tree .zoom, .empty-tree .tree-footer { display: none; }
.tree-empty, .panel-empty { text-align: center; }
.tree-empty { width: min(430px, 100%); padding: 19px 20px 25px; }
.empty-symbol { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 15px; border: 1px solid var(--highlight-edge); border-radius: 18px; color: var(--accent); background: var(--highlight); }
.empty-symbol svg { width: 24px; height: 24px; }
.tree-empty h3 { font-size: clamp(23px, 2.3vw, 32px); letter-spacing: -.045em; }
.tree-empty p, .panel-empty p { margin: 8px auto 0; color: var(--muted); }
.tree-empty .button { margin-top: 19px; min-height: 41px; padding-inline: 15px; }
.scene { position: absolute; inset: 0 auto auto 0; transform-origin: 0 0; will-change: transform; }
.connectors { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.edge {
  fill: none; stroke: #687569; stroke-width: 1.35; stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke; opacity: .52; --link-accent: #1f5b97;
}
.edge-spouse { stroke: #657160; stroke-dasharray: 4 3; --link-accent: #a13262; }
.edge-sibling { stroke: #77508a; stroke-dasharray: 8 3; --link-accent: #7041a0; }
.edge-between-families { stroke: #7b8a99; stroke-dasharray: 6 5; }
.edge-birth-link { stroke: #738c89; stroke-dasharray: 7 3 2 3; --link-accent: #13726b; }
.edge-inferred { stroke: #6d708b; stroke-dasharray: 2 5; --link-accent: #565984; }
.edge-conflict { stroke: #903c4e; stroke-dasharray: 3 5; --link-accent: #903c4e; }
.has-highlight .edge:not(.edge-direct, .edge-trace) { opacity: .28; }
.edge-direct, .edge-trace {
  stroke: var(--link-accent); stroke-width: 2.55; opacity: 1;
  filter: drop-shadow(0 0 .8px #fffffff0);
}
.edge-trace { stroke: #53672a; stroke-width: 3.25; }
.node {
  position: absolute; display: flex; align-items: center; gap: 8px; width: 174px; height: 76px; padding: 8px; text-align: left;
  background: var(--family-tint); border: 1px solid var(--line);
  border-color: color-mix(in srgb, var(--family-tone) 33%, var(--family-tint));
  color: var(--ink); border-radius: 15px; box-shadow: 0 3px 8px #27332612;
}
.node::before { content: ""; position: absolute; inset: 12px auto 12px -1px; width: 4px; border-radius: 3px; background: var(--family-tone); pointer-events: none; }
.node .avatar:not(.memorial) { background: var(--family-tone); color: #fff; }
.node:hover { border-color: var(--family-tone); }
.node.active { border-color: var(--family-tone); box-shadow: 0 0 0 2px var(--family-tone), 0 3px 10px #1721172b; }
.node.compared { outline: 2px solid #677641; outline-offset: 2px; }
.node.birth-family-reference {
  border-style: dashed;
  background: color-mix(in srgb, var(--family-tint) 54%, var(--surface));
  box-shadow: none;
}
.node.birth-family-reference:hover, .node.birth-family-reference:focus-visible { border-color: var(--family-tone); }
.node.birth-family-reference.active, .node.birth-family-reference.linked-reference { box-shadow: 0 0 0 2px var(--family-tone); }
.node.birth-family-reference::before, .node.birth-family-reference .avatar { opacity: .62; }
.node.birth-family-reference .node-copy > small:last-child { color: var(--accent); font-weight: 680; }
.node-badges { display: flex; gap: 3px; position: absolute; top: -6px; right: -6px; }
.node-flight, .node-pin, .node-origin { display: grid; place-items: center; border: 1px solid; border-radius: 50%; padding: 3px; }
.node-flight, .chip.abroad { background: #e8f0fa; color: #3d577a; border-color: #b9cce6; }
.node-pin { background: #ecf2e8; color: #4d6148; border-color: #c6d5c2; }
.node-origin { background: #eeeafa; color: #51427e; border-color: #c9bfdf; }
.node-badges svg, .legend .away-legend svg, .legend .origin-legend svg { width: 11px; height: 11px; }
.connection-level { position: absolute; right: 6px; bottom: -7px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 3px; border: 1px solid #cbd3ca; border-radius: 9px; color: var(--accent); background: var(--surface); font-size: 10px; font-weight: 700; }
.connection-level.direct { background: var(--family-tone); color: #fff; border-color: var(--family-tone); }
.node-copy { min-width: 0; }
.node strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: 13px; line-height: 1.15; font-weight: 720; }
.node small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); margin-top: 4px; }
.node .avatar { width: 36px; height: 36px; border-radius: 10px; font-size: 11px; }
.avatar.memorial, .node.active .avatar.memorial {
  position: relative; isolation: isolate; overflow: visible; border: 1px solid var(--flower);
  border-radius: 7px; background: #fcf6eb; color: #253751;
  box-shadow: inset 0 0 0 2px var(--flower-pale), 0 2px 5px #17274520;
}
.profile .avatar.big.memorial { border-radius: 11px; }
.avatar.memorial img { border-radius: inherit; }
.garland {
  position: absolute; inset: 11% -12% -12%; pointer-events: none;
  background: url("/memorial-garland.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 1px 1px #351d1a55);
}
.memorial-status { color: #493941; background: #f1ebeb; }
.graph-section {
  position: absolute; border: 1px solid #d4dbd1; border-radius: 17px; background: #ffffff52; pointer-events: none;
  border-color: color-mix(in srgb, var(--section-tone, #82917f) 24%, #edf0eb);
  background: color-mix(in srgb, var(--section-tint, #ffffff) 27%, transparent);
}
.graph-section span { display: block; margin: 9px 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--section-tone, var(--muted)); font-size: 12px; font-weight: 700; }
.canvas-tip, .zoom { position: absolute; bottom: 12px; display: flex; align-items: center; gap: 6px; background: #fffffff5; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; box-shadow: 0 3px 10px #26322612; }
.canvas-tip { left: 12px; padding: 7px 9px; pointer-events: none; }
.canvas-tip svg { width: 13px; height: 13px; }
.touch-tip { display: none; }
@media (pointer: coarse) {
  .pointer-tip { display: none; }
  .touch-tip { display: inline; }
}
.zoom { right: 12px; gap: 0; }
.zoom button, .icon-button { display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--accent); border: 0; border-radius: 8px; width: 33px; height: 33px; }
.zoom button:hover { background: var(--tint); }
.zoom button { width: 37px; height: 37px; border-radius: 50%; }
.zoom button svg { width: 15px; height: 15px; }
.zoom output { min-width: 48px; border-inline: 1px solid var(--line); text-align: center; font-weight: 660; font-variant-numeric: tabular-nums; }
.tree-footer { display: flex; justify-content: space-between; align-items: center; gap: 5px; padding: 9px 13px; }
.legend { display: flex; gap: 11px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.legend .away-legend { color: var(--secondary); }
.legend .origin-legend { color: #51427e; }
.legend .level-legend { flex-basis: 100%; }
.legend i { width: 14px; border-top: 2px solid #687569; }
.legend span:nth-child(2) i { border-top-style: dashed; border-color: #657160; }
.legend .inferred-legend i { border-top-style: dotted; border-color: #6d708b; }
.legend .conflict-legend i { border-top-style: dotted; border-color: #903c4e; }
.legend .sibling-legend i { border-top-style: dashed; border-color: #77508a; }
.legend .selected-links-legend i { width: 19px; border-color: #1f5b97; border-width: 3px; }
.legend .between-families-legend i { width: 19px; border-top-style: dashed; border-color: #7b8a99; }
.legend .birth-family-legend i { height: 9px; border: 1px dashed #899285; border-radius: 3px; background: #fbfcf9bf; }

.profile { padding: 16px 13px; }
.profile-top { padding: 2px 4px 12px; border-bottom: 1px solid var(--line); }
.profile-kicker { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 710; letter-spacing: .08em; margin-bottom: 12px; }
.profile-kicker svg { width: 13px; height: 13px; }
.profile .avatar.big { width: 64px; height: 64px; font-size: 21px; border-radius: 15px; margin-bottom: 7px; }
.profile h2 { font-size: 25px; overflow-wrap: anywhere; }
.profile-telugu { margin: 5px 0 10px; color: var(--secondary); font: 14px/1.4 var(--telugu); }
.node .birth-surname, .result-button .birth-surname, .relative-button .birth-surname, .profile .birth-surname { color: var(--accent); font-weight: 600; }
.profile .birth-surname { margin-top: 4px; font-size: 14px; overflow-wrap: anywhere; }
.profile .birth-surname a { text-decoration: underline; text-underline-offset: 2px; }
.married-name-preview { display: grid; gap: 2px; padding: 10px 12px; margin: 0 0 12px; background: var(--tint); border-radius: 10px; overflow-wrap: anywhere; }
.married-name-preview p, .married-name-preview small { color: var(--muted); font-size: 14px; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.profile-career { display: grid; gap: 6px; margin: 12px 0 0; }
.profile-career > div { min-width: 0; }
.profile-career dt { color: var(--muted); font-size: 12px; }
.profile-career dd { margin: 0; color: var(--ink); font-size: 14px; font-weight: 620; overflow-wrap: anywhere; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; background: var(--tint); color: var(--accent); font-size: 12px; font-weight: 640; overflow-wrap: anywhere; }
.chip svg { width: 12px; height: 12px; }
.chip.pending, .chip.lives-away { background: #f9edd9; color: #795125; }
.chip.rejected { background: #f5e8e6; color: #783e3b; }
.result-button .person-residence, .relative-button .person-residence { color: var(--secondary); }
.chip.person-origin { background: #eeeafa; color: #51427e; }
.result-button .person-origin, .relative-button .person-origin, .review-card .person-origin { color: #51427e; }
.profile .relationship-wrap { padding-top: 12px; }
.profile h3 { margin: 0 0 6px 4px; color: var(--muted); font-size: 12px; letter-spacing: .06em; }
.relationship-list { max-height: 300px; overflow: auto; padding: 3px; }
.profile-actions { display: grid; gap: 5px; margin-top: 12px; }
.profile-actions .profile-add { width: 100%; white-space: normal; }
.profile-actions .button.delete-profile { color: #a32632; }
.empty { color: var(--muted); font-size: 14px; padding: 4px; }

.page-panel { min-height: 385px; padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-head p { color: var(--muted); margin-top: 4px; font-size: 14px; }
.directory-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.directory-tools .search { margin: 0; }
.directory-tools select { min-height: 41px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 14px; }
.directory-nav { display: flex; flex-wrap: wrap; gap: 7px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.directory-nav a {
  display: inline-flex; align-items: center; gap: 7px; min-height: 41px; padding: 7px 13px;
  border: 1px solid transparent; border-radius: 999px; color: var(--accent); font-size: 14px; font-weight: 650;
  background: var(--tint);
}
.directory-nav a svg { order: -1; color: var(--secondary); width: 16px; height: 16px; }
.directory-nav a:hover, .directory-group:hover { background: #e3e8df; }
.directory-nav a[aria-current="page"] { background: var(--charcoal); border-color: var(--charcoal); color: #ffffff; }
.directory-nav a[aria-current="page"] svg { color: var(--highlight); }
.directory-stats { display: grid; grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr)); gap: 12px; margin: 17px 0 0; }
.directory-stat {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "value icon" "label label";
  align-items: center; align-content: center; gap: 8px; min-width: 0; min-height: 122px; padding: 15px 18px;
  border: 1px solid transparent; border-radius: 20px; background: var(--tint); color: var(--muted); font-size: 14px; font-weight: 610;
}
.directory-stat:first-child { background: var(--charcoal); color: #e1e7de; }
.directory-stat:last-child { background: var(--highlight); color: #414b30; }
.directory-stat:hover { border-color: #819075; }
.directory-stat .directory-link-label { grid-area: label; }
.directory-stat-value { grid-area: value; color: var(--ink); font: 760 38px/1 var(--display); letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.directory-stat:first-child .directory-stat-value { color: #ffffff; }
.directory-stat-icon { grid-area: icon; display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; background: #ffffffae; color: var(--accent); }
.directory-stat:first-child .directory-stat-icon { background: #ffffff16; color: var(--highlight); }
.directory-stat-icon svg { width: 17px; height: 17px; }
.directory-layout { margin-top: 19px; }
.directory-layout.has-breakdown { display: grid; grid-template-columns: minmax(218px, 285px) minmax(0, 1fr); align-items: start; gap: 15px; }
.directory-breakdown { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 19px; background: #f4f6f2; }
.directory-breakdown h2 { margin: 2px 4px 8px; }
.directory-breakdown > p { margin: 0 4px 7px; font-size: 13px; color: var(--muted); }
.directory-groups { display: grid; gap: 4px; max-height: min(52vh, 440px); overflow-y: auto; scrollbar-width: thin; padding: 4px; }
.directory-group {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 8px; min-height: 42px; padding: 6px 8px;
  border: 1px solid transparent; border-radius: 11px; font-size: 14px;
}
.directory-group[aria-current="page"] { border-color: var(--highlight-edge); background: var(--highlight); color: var(--accent); font-weight: 700; }
.directory-link-label { overflow-wrap: anywhere; }
.directory-group-count { color: var(--muted); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.directory-group-track { grid-column: 1 / -1; display: block; height: 3px; border-radius: 9px; background: #dfe5dc; }
.directory-group-track > span { display: block; height: 100%; border-radius: inherit; background: #718054; }
.directory-results { min-width: 0; }
.directory-results .panel-head { margin-bottom: 8px; }
.directory-results .directory-tools { justify-content: space-between; margin-bottom: 10px; }
.directory-results .search { flex: 1 1 245px; }
.directory-sort { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.directory-grid .result-button { min-height: 67px; padding: 11px; border-color: var(--line); border-radius: 15px; background: #fafbf9; }
.directory-grid .result-button:hover { background: var(--tint); border-color: #b9c6b6; }
.directory-grid .directory-detail { margin-top: 5px; color: var(--accent); font-weight: 650; }
.review-grid { display: grid; gap: 9px; }
.review-card { padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: #fafbf9; }
.review-card-head { display: flex; align-items: center; gap: 9px; }
.review-card-head > div { flex: 1; }
.review-card h3 { font-size: 16px; }
.review-card p { color: var(--muted); font-size: 14px; margin: 6px 0; }
.review-card .match-list { margin: 8px 0; }
.review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.review-actions .field { margin: 0; }
.panel-empty { grid-column: 1 / -1; padding: 57px 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.panel-empty h3 { font-size: 19px; letter-spacing: -.02em; }
.panel-empty .button { margin-top: 12px; }
.local-backup { margin: 0 0 12px; }
.local-backup .button { margin-top: 6px; }
.sign-in-dialog { max-width: 425px; }

.record-dialog { width: min(605px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 21px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); color: var(--ink); box-shadow: 0 18px 75px #19211945; }
.record-dialog::backdrop { background: #171d1980; backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.dialog-head h2 { font-size: 27px; }
.icon-button { flex-shrink: 0; }
.fields, .link-fields { display: grid; grid-template-columns: 1fr; gap: 9px; }
#record-dialog {
  width: min(640px, calc(100% - 24px)); height: min(840px, calc(100dvh - 28px)); padding: 0; overflow: hidden;
}
#record-dialog[open], #record-form { display: grid; grid-template-rows: auto minmax(0, 1fr); }
#record-dialog .dialog-head { margin: 0; padding: 19px 23px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
#record-dialog .dialog-head h2 { font-size: 29px; }
#record-dialog .dialog-head .icon-button { width: 42px; height: 42px; border-radius: 50%; background: var(--tint); }
#record-dialog .dialog-head .icon-button:hover { background: #e2e8df; }
#record-form { grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
.record-body { display: grid; align-content: start; gap: 14px; padding: 15px 22px 18px; overflow-y: auto; overscroll-behavior-y: contain; }
.record-body > .profile-section {
  --section-tone: #454f41; --section-edge: #dfe4dd; --section-fill: #f5f7f3;
  min-width: 0; margin: 0; padding: 10px 15px 15px; border: 1px solid var(--section-edge); border-radius: 17px;
  background: var(--section-fill);
}
.record-body > .location-section { --section-tone: #315d56; --section-edge: #c9e0d9; --section-fill: #f0f8f5; }
.record-body > .work-section { --section-tone: #395746; --section-edge: #d4ded0; --section-fill: #f0f4ea; }
.record-body > .family-section { --section-tone: #765635; --section-edge: #e7dbca; --section-fill: #f8f2e6; }
.record-body > .photo-section { --section-tone: #615646; --section-edge: #e9e1d3; --section-fill: #f8f6f1; }
.profile-section > legend { padding-inline: 5px 7px; color: var(--section-tone); font-size: 16px; font-weight: 750; }
.profile-section > legend [data-icon] {
  width: 29px; height: 29px; margin-right: 5px; border: 1px solid var(--section-edge); border-radius: 8px;
  background: var(--section-fill); color: var(--section-tone); vertical-align: middle;
}
.profile-section > legend svg { width: 15px; height: 15px; }
.profile-section > legend span:not([data-icon]) { font-size: 13px; }
.record-body .field { margin: 0; }
.record-body .field input, .record-body .field select, .record-body .field textarea {
  min-height: 44px; padding-inline: 11px; border-radius: 11px; background-color: var(--surface); border-color: var(--line);
}
.record-body .field select {
  appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2366544d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.record-body .check-field input { width: 16px; height: 16px; margin: 0; flex-shrink: 0; }
.name-fields { margin-top: 3px; padding-top: 11px; border-top: 1px solid var(--section-edge); }
.gender-choice { margin: 0; padding: 0; border: 0; }
.gender-choice legend { padding: 0; margin-bottom: 4px; }
.gender-options { display: flex; flex-wrap: wrap; gap: 8px; }
.gender-options label {
  display: flex; align-items: center; gap: 8px; min-width: 106px; min-height: 43px; padding: 7px 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: 999px; font-size: 15px; cursor: pointer;
}
.gender-options input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.gender-options label:has(input:checked) { background: var(--highlight); border-color: #87945d; font-weight: 700; }
.gender-options label:hover { border-color: #87945d; }
.record-body .matches, .record-body .married-name-preview { margin: 0; }
.record-footer { padding: 11px 22px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.record-footer .dialog-actions { margin: 0; gap: 9px; }
.record-footer .button { min-height: 43px; }
.record-footer .error { margin: 0 0 8px; }
.field-hint { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; font-weight: 450; }
.field > .field-hint { margin-top: 4px; }
.family-link-row { margin: 0; padding: 10px 12px; background: var(--surface); }
.link-help { color: var(--muted); font-size: 14px; margin: 8px 0 10px; }
.link-preview:has(> :not([hidden])) { padding: 9px 11px; border-radius: 9px; color: var(--ink); background: var(--tint); }
.link-preview > [data-link-preview] { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.link-preview .link-help { margin: 4px 0 0; }
.link-preview:not(:has(> :not([hidden]))) { display: none; }
.remove-link-row { justify-self: start; min-height: 32px; padding-inline: 0; }
#family-link-fields > button { margin-top: 10px; }
.picker-results { display: grid; gap: 2px; margin-bottom: 8px; padding: 4px; max-height: 225px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.field { display: block; min-width: 0; margin: 0 0 5px; color: var(--ink); font-size: 14px; font-weight: 650; }
.field span, legend span { color: var(--muted); font-weight: 440; }
.field input, .field select, .field textarea { display: block; width: 100%; margin-top: 4px; min-height: 38px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); font-size: 15px; font-weight: 440; }
.field textarea { resize: vertical; min-height: 64px; }
.check-field { display: flex; align-items: center; align-self: center; gap: 7px; color: var(--muted); font-size: 14px; }
.check-field input { accent-color: var(--accent); }
.photo-field { margin: 14px 0; background: var(--paper); }
#photo-hint { margin: 0 0 9px; color: var(--muted); font-size: 14px; }
.photo-upload {
  position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--accent);
  font-size: 14px; font-weight: 650; cursor: pointer;
}
.photo-upload:hover { background: var(--tint); }
.photo-upload:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.photo-upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.photo-preview { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.photo-preview img { width: 54px; height: 69px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
#photo-preview-status { font-size: 14px; font-weight: 650; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.photo-actions .text-button { padding-inline: 0; }
.photo-crop-dialog { width: min(490px, calc(100% - 24px)); }
.photo-crop-stage { display: grid; place-items: center; padding: 10px; border-radius: 15px; background: var(--tint); }
#photo-crop-canvas {
  display: block; width: min(100%, 232px, 40vh); height: auto; max-width: 100%; box-shadow: 0 0 0 1px #768272;
  border-radius: 3px; cursor: grab; touch-action: none;
}
#photo-crop-canvas:active { cursor: grabbing; }
.photo-crop-controls { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.photo-crop-controls label { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 14px; }
.photo-crop-controls input { flex: 1; min-width: 0; accent-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: 11px; margin: 11px 0; padding: 8px 10px; min-width: 0; }
legend { padding: 0 4px; color: var(--ink); font-size: 14px; font-weight: 650; }
.matches, .error { padding: 8px 10px; border-radius: 8px; margin-top: 8px; font-size: 14px; overflow-wrap: anywhere; }
.matches { background: #fbf1e2; border: 1px solid #ecdbc3; color: #664625; }
.matches p { margin-top: 4px; }
.match-list { padding-left: 18px; margin: 5px 0; }
.error { background: #faecea; color: #8d302a; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 13px; }
.toast { position: fixed; z-index: 3; right: 15px; bottom: 15px; max-width: calc(100% - 30px); padding: 10px 13px; border-radius: 10px; background: var(--accent); color: #fff; box-shadow: 0 5px 24px #2b172d36; font-size: 14px; }

@media (max-width: 1120px) {
  .header-inner, main { padding-inline: 18px; }
  .workspace { --sidebar-width: 180px; }
  .branches, .profile { padding-inline: 9px; }
}

@media (max-width: 1050px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding-block: 7px; }
  .header-actions { grid-column: 2; grid-row: 1; }
  .main-nav { grid-column: 1 / -1; justify-self: center; }
}

@media (max-width: 900px) {
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory-layout.has-breakdown { grid-template-columns: minmax(184px, 235px) minmax(0, 1fr); }
}

@media (max-width: 650px) {
  .header-inner, main { padding-inline: 12px; }
  .header-inner { grid-template-columns: 1fr auto; min-height: auto; gap: 0 6px; padding-top: 9px; }
  .brand { gap: 6px; font-size: 15px; }
  .brand-icon { width: 35px; height: 35px; border-radius: 9px; }
  .brand-icon svg { width: 18px; height: 18px; }
  .brand-names { flex-direction: column; gap: 2px; }
  .brand .village-telugu { font-size: 12px; }
  .header-actions { grid-column: 2; grid-row: 1; gap: 4px; }
  .header-add, .header-modify { min-height: 36px; padding: 6px 8px; font-size: 13px; }
  .header-add [data-icon] { display: none; }
  .account-action { padding: 3px; font-size: 12px; }
  .main-nav { grid-column: 1 / -1; justify-content: center; justify-self: center; margin: 7px 0 8px; }
  .main-nav a { padding: 7px 8px; font-size: 13px; }
  .main-nav svg { width: 14px; height: 14px; }

  .workspace { display: flex; flex-direction: column; gap: 8px; }
  .workspace > * { width: 100%; }
  .branches, .tree-panel, .profile, .page-panel { border-radius: 17px; }
  .branches { padding: 9px; }
  .side-head h2 { font-size: 15px; }
  .branches .search { margin: 6px 0 3px; }
  .family-picker { display: flex; max-width: 100%; gap: 5px; overflow-x: auto; padding: 3px; scrollbar-width: thin; }
  .branch-buttons { display: contents; }
  .location-links { display: flex; max-height: none; gap: 4px; }
  .location-links .branch-button { flex: 0 0 auto; width: auto; border-color: var(--line); }
  .family-picker .branch-button { flex: 0 0 auto; width: auto; min-height: 39px; padding: 4px 7px; gap: 5px; border-color: var(--line); }
  #all-families { margin-bottom: 0; }
  .branch-icon { width: 22px; height: 22px; border-radius: 6px; font-size: 13px; }
  .branch-button strong { font-size: 13px; }
  .family-picker .branch-count { display: none; }
  .search-results { max-height: 179px; }
  .tree-heading { flex-wrap: wrap; padding: 11px 12px; }
  .tree-heading h1 { font-size: 20px; }
  .tree-heading p { font-size: 13px; }
  .tree-tools { justify-content: flex-start; gap: 4px; }
  .tree-tools .button { font-size: 12px; padding-inline: 6px; }
  .tree-tools .button svg { width: 13px; height: 13px; }
  .comparison { margin-inline: 6px; }
  .canvas, .empty-tree .canvas { min-height: clamp(380px, 58svh, 650px); margin-inline: 6px; }
  .empty-tree .canvas { margin-bottom: 6px; }
  .canvas-tip { left: 5px; }
  .zoom { right: 5px; }
  .zoom button { width: 40px; height: 40px; }
  .canvas-tip, .zoom { bottom: 6px; font-size: 11px; }
  .tree-footer { padding-inline: 6px; }
  .legend { gap: 4px; }
  .legend span, .tree-footer .text-button { font-size: 11px; }
  .profile { display: block; padding: 9px; }
  .profile-top { border-bottom: 1px solid var(--line); }
  .profile-actions { grid-template-columns: 1fr 1fr; }
  .profile .avatar.big { width: 40px; height: 40px; font-size: 17px; border-radius: 10px; }
  .page-panel { min-height: 320px; padding: 10px; }
  .panel-head { flex-wrap: wrap; gap: 8px; margin-bottom: 9px; }
  .panel-empty { padding: 38px 10px; }
  .directory-grid { gap: 4px; }
  .directory-layout.has-breakdown { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .directory-nav { gap: 5px; padding-bottom: 10px; }
  .directory-nav a { padding-inline: 8px; min-height: 38px; font-size: 13px; }
  .directory-nav a svg { width: 14px; height: 14px; }
  .directory-breakdown { padding: 8px; }
  .directory-groups { max-height: 220px; }
  .directory-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
  .directory-stat { gap: 5px; min-height: 83px; padding: 9px 8px; border-radius: 13px; font-size: 12px; }
  .directory-stat-value { font-size: 24px; }
  .directory-stat-icon { width: 24px; height: 24px; }
  .directory-stat-icon svg { width: 13px; height: 13px; }
  .directory-grid .result-button { padding: 5px; gap: 5px; }
  .directory-grid .avatar { width: 23px; height: 23px; border-radius: 6px; font-size: 10px; }
  .record-dialog { padding: 13px; }
  #record-dialog { width: calc(100% - 16px); height: calc(100dvh - 16px); border-radius: 16px; }
  #record-dialog .dialog-head { padding: 13px 15px 11px; }
  #record-dialog .dialog-head h2 { font-size: 24px; }
  .record-body { padding: 11px 13px 14px; gap: 11px; }
  .record-body > .profile-section { padding-inline: 11px; }
  .record-footer { padding-inline: 13px; }
  .field input, .field select, .field textarea, .search input, .directory-tools select { font-size: 16px; }
}

@media (max-width: 490px) {
  .header-inner { grid-template-columns: 1fr; gap: 5px; }
  .brand { justify-self: center; }
  .brand-names { flex-direction: row; align-items: baseline; gap: 8px; }
  .header-actions { grid-column: 1; grid-row: 2; justify-self: center; }
  .main-nav { grid-row: 3; margin: 1px 0 0; }
}

@media (max-width: 380px) {
  .fields, .link-fields { grid-template-columns: 1fr; }
  .header-add [data-icon] { display: none; }
  .header-inner { padding-inline: 8px; }
  .brand-icon { width: 28px; height: 28px; }
  .brand { font-size: 13px; }
  .header-add { font-size: 12px; }
  .account-action { font-size: 11px; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .node, .branch-button, .result-button, .relative-button, .main-nav a { transition: background-color .15s, border-color .15s, color .15s; }
}

/* Village pages share the archive's type and controls, with a warmer palette. */
body { min-height: 100dvh; display: flex; flex-direction: column; }
main { width: 100%; flex: 1; }
main:focus { outline: none; }
.skip-link { position: fixed; z-index: 10; top: 8px; left: 12px; transform: translateY(-160%); background: #fff; padding: 8px 16px; border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }
.site-header .header-inner { max-width: 1320px; grid-template-columns: 1fr auto; min-height: 76px; }
.site-header .brand-icon { color: #ffe3b2; background: #35252d; }
.site-header .main-nav { grid-column: auto; justify-self: end; background: #f2eee8; }
.site-header .main-nav a:hover { background: #ebe2d8; }
.site-header .main-nav a.active { background: #fff; }

.village-page {
  --village-ink: #173b30;
  --village-muted: #526054;
  --village-wine: #765635;
  --village-line: #d9dfd0;
  max-width: 1240px;
  margin: 8px auto 38px;
  color: var(--village-ink);
}
main:has(.village-page:not([hidden])) { max-width: none; background: #f9f6f0; }
.village-hero {
  position: relative; isolation: isolate; overflow: hidden; min-height: clamp(460px, 65vw, 630px);
  display: grid; align-content: end; border-radius: 18px; background: #173b30; color: #fffaf0;
}
.hero-slides, .hero-slide, .village-hero::before { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-slides { z-index: -2; }
.hero-slide { object-fit: cover; object-position: center 55%; opacity: 0; transform: scale(1.035); transition: opacity .65s ease, transform 3.65s ease-out; }
.hero-slide.active { opacity: 1; transform: scale(1); }
.village-hero::before { content: ""; z-index: -1; background: linear-gradient(90deg, #11291ee8, #11291e66 75%), linear-gradient(0deg, #0e2119dd, transparent 50%); }
.village-hero-copy { padding: clamp(22px, 6vw, 74px); padding-bottom: clamp(35px, 6vw, 72px); }
.village-label { font-weight: 680; color: #e9dfc1; margin-bottom: 16px; }
.hero-title-group { display: flex; align-items: center; gap: clamp(10px, 2vw, 22px); }
.brand-logo, .hero-logo { flex: 0 0 auto; border-radius: 50%; object-fit: cover; }
.hero-logo { width: clamp(48px, 9vw, 94px); height: auto; }
.village-hero h1 { color: inherit; font: 500 clamp(31px, 6.65vw, 100px)/.98 Georgia, serif; letter-spacing: -.055em; }
.village-hero-telugu { color: #f0e6c9; font: 650 clamp(14px, 2vw, 22px)/1.5 var(--telugu); }
.village-description { margin: 18px 0 22px; font-size: clamp(16px, 2vw, 20px); }
.hero-actions, .hero-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.village-button {
  display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px;
  border: 1px solid transparent; border-radius: 9px; background: var(--accent); color: #fffdf7; font-size: 15px; font-weight: 720;
}
.village-button:hover { background: #37634e; }
.hero-actions .village-button { background: #fffaf0; color: #173b30; }
.hero-actions .hero-secondary { color: #fffaf0; border-color: #fffaf08c; background: #1831258c; }
.hero-controls { flex-wrap: nowrap; margin: 0 clamp(16px, 6vw, 74px); padding: 12px 0 17px; border-top: 1px solid #fffaf070; }
.hero-controls p { flex: 1; color: #fffaf0; font-size: 14px; }
.hero-controls button { background: #173b30c7; color: inherit; border: 1px solid #fffaf08c; border-radius: 7px; min-width: 40px; min-height: 40px; padding: 5px 10px; }
.hero-controls button:hover { background: #37634e; }

.village-sections, .village-services { margin-top: clamp(28px, 4vw, 48px); }
.village-sections > h2, .village-services > h2 { margin-bottom: 14px; font-size: clamp(22px, 2.8vw, 30px); }
.village-card-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.village-card, .civic-card {
  display: flex; flex-direction: column; align-items: flex-start; padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--village-line); border-radius: 22px; background: #fffdf8; min-width: 0;
}
.village-card:hover { border-color: #8da385; box-shadow: 0 8px 28px #46263212; }
.village-card-icon {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none;
  margin-bottom: 16px; border-radius: 15px; background: #f1e0d5; color: #813f3d;
}
.village-card-icon svg { width: 22px; height: 22px; }
.card-tree { background: #fff7ee; }
.card-panchayat { background: #fcf2df; }
.card-panchayat .village-card-icon, .civic-office .village-card-icon { color: #755320; background: #efdfb9; }
.card-gallery { background: #e6eee5; }
.card-gallery .village-card-icon { color: #28513f; background: #d5e3d2; }
.village-card h3 { font-size: clamp(20px, 2.1vw, 25px); letter-spacing: -.035em; }
.village-card p, .civic-card p { margin: 8px 0 12px; color: var(--village-muted); }
.village-card-action { margin-top: auto; color: var(--village-wine); font-size: 14px; font-weight: 750; }
.village-card:hover .village-card-action { text-decoration: underline; text-underline-offset: 3px; }

.village-page-heading { margin: 0 0 20px; padding: clamp(24px, 4vw, 46px); border: 1px solid var(--village-line); border-radius: 24px; background: #f6ebdf; }
.village-home-link { display: inline-block; min-height: 28px; color: var(--village-wine); font-size: 14px; font-weight: 730; text-decoration: underline; text-underline-offset: 3px; }
.village-page-heading h1 { margin: 8px 0 4px; font: 500 clamp(36px, 5.7vw, 72px)/1 Georgia, "Times New Roman", serif; letter-spacing: -.055em; }
.village-page-heading > p { max-width: 58ch; margin-top: 12px; color: var(--village-muted); }
.village-page-heading .village-page-telugu { margin-top: 4px; color: var(--village-wine); font: 700 clamp(17px, 2.1vw, 23px)/1.45 var(--telugu); }
.panchayat-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.civic-card h2 { font-size: clamp(22px, 2.8vw, 30px); }
.civic-card address { margin: 9px 0 12px; font-style: normal; color: var(--village-muted); }
.civic-email { color: #715132; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.civic-card .civic-note { font-size: 14px; margin-bottom: 0; }
.village-codes, .civic-roles { margin: 15px 0 0; width: 100%; }
.village-codes > div, .civic-roles > div { display: grid; gap: 4px; padding: 9px 0; border-top: 1px solid var(--village-line); }
.village-codes > div { grid-template-columns: 1fr auto; }
.village-codes dt, .civic-roles dt { font-weight: 690; }
.village-codes dd, .civic-roles dd { margin: 0; color: var(--village-muted); }
.source-link { margin-top: 8px; color: var(--village-wine); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.government-helpline { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-top: 15px; color: var(--village-muted); }
.government-helpline a[href^="tel:"] { font-weight: 750; color: var(--village-wine); text-decoration: underline; text-underline-offset: 3px; }
.government-helpline .source-link { margin-top: 0; }
.gallery-heading { margin-bottom: 14px; }
.gallery-jump {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px;
}
.gallery-jump a {
  padding: 8px 14px; border: 1px solid var(--village-line); border-radius: 999px;
  color: var(--village-wine); background: #fffdf9; font-size: 14px; font-weight: 700;
}
.gallery-jump a:hover { background: #f2e6db; }
.gallery-section { margin-top: clamp(26px, 4vw, 46px); scroll-margin-top: 16px; }
.gallery-section h2 { margin-bottom: 14px; font-size: clamp(23px, 3vw, 32px); }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.5vw, 18px); }
.gallery-photo {
  display: block; overflow: hidden; border: 1px solid var(--village-line);
  border-radius: 17px; background: #fffdf9; cursor: zoom-in;
}
.gallery-photo:hover { border-color: #8da385; box-shadow: 0 6px 23px #46263216; }
.gallery-photo figure, .gallery-viewer figure { margin: 0; }
.gallery-photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: #eddccb; }
.gallery-photo figcaption { padding: 12px 14px; font-size: 15px; font-weight: 660; color: var(--village-ink); }
.gallery-featured { display: grid; grid-template-columns: minmax(0, 2fr) minmax(190px, 1fr); background: #173b30; color: #fff6ec; }
.gallery-featured img { height: 100%; min-height: 220px; max-height: 420px; aspect-ratio: 16 / 9; }
.gallery-featured figcaption {
  display: flex; align-items: center; padding: clamp(18px, 4vw, 42px);
  color: #fff6ec; font: 500 clamp(26px, 4.2vw, 56px)/1.07 Georgia, "Times New Roman", serif; letter-spacing: -.045em;
}
.gallery-social { margin-top: 28px; }
.gallery-viewer {
  padding: 12px; width: min(96vw, 1220px); max-width: none; max-height: 94dvh;
  border: 1px solid #839681; border-radius: 16px; background: #173b30; color: #fff6ec;
}
.gallery-viewer::backdrop { background: #122c23db; }
.gallery-viewer form { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.gallery-viewer figure img { display: block; width: 100%; max-height: 68dvh; object-fit: contain; border-radius: 8px; background: #112e25; }
.gallery-viewer figcaption { padding: 8px 4px; text-align: center; font-weight: 650; }
.gallery-viewer-controls { display: flex; justify-content: center; gap: 12px; }
.gallery-viewer-button {
  min-height: 40px; padding: 6px 13px; border: 1px solid #839681; border-radius: 9px;
  background: #28513f; color: #fff6ec; font-size: 14px; font-weight: 680;
}
.gallery-viewer-button:hover { background: #37634e; }
.gallery-viewer-button:focus-visible { outline-color: #f7d5ae; }

.archive-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 13px; }
.archive-toolbar .header-actions { margin-left: auto; }
.archive-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.archive-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 9px; font-size: 14px; font-weight: 650; }
.archive-nav a.active { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.archive-nav svg { width: 16px; height: 16px; }

.village-footer { background: #173b30; color: #f8edde; }
.village-footer-inner {
  max-width: 1320px; margin: 0 auto; padding: 22px clamp(12px, 4vw, 36px);
  display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.footer-brand { font-weight: 720; }
.footer-brand span { display: block; margin-top: 2px; color: #e7d5b3; font: 600 14px/1.5 var(--telugu); }
.village-footer nav { display: flex; flex-wrap: wrap; gap: 5px 18px; font-size: 14px; }
.village-footer nav a { padding: 4px 0; }
.village-footer nav a:hover { text-decoration: underline; }

@media (max-width: 850px) {
  .village-card-list { gap: 10px; }
  .site-header .brand-names { flex-direction: column; gap: 3px; }
}
@media (max-width: 620px) {
  .site-header .header-inner { grid-template-columns: 1fr; justify-items: center; gap: 4px; min-height: 0; padding-top: 10px; }
  .site-header .main-nav { justify-self: center; justify-content: flex-start; max-width: 100%; overflow-x: auto; margin: 0 0 4px; }
  .site-header .main-nav a { padding-inline: 9px; }
  .site-header .brand-names { flex-direction: row; gap: 6px; }
  .village-page { margin-top: 0; margin-bottom: 18px; }
  .village-hero, .village-page-heading { border-radius: 20px; }
  .village-hero { grid-template-columns: 1fr; }
  .village-hero-copy { padding: 26px 21px; }
  .village-hero h1 { font-size: clamp(26px, 6.8vw, 50px); }
  .village-card-list, .panchayat-layout { grid-template-columns: 1fr; }
  .village-card, .civic-card { border-radius: 17px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-featured { grid-template-columns: 1fr; }
  .gallery-featured img { min-height: 0; }
  .gallery-photo figcaption { padding: 10px; }
  .archive-toolbar .header-actions { margin-left: 0; flex-wrap: wrap; }
}

.site-header .main-nav { background: var(--tint); }
.site-header .main-nav a:hover { background: #dbe6d2; }
.site-header .main-nav a.active { color: var(--accent); background: var(--surface); }
#home-view .village-card-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card-connect, .card-tree { background: #e9eee1; }
.card-connect .village-card-icon, .card-tree .village-card-icon { background: #d5e1cd; color: #28513f; }
.village-card { transition: transform .2s ease, box-shadow .2s ease; }
.village-card:hover { transform: translateY(-2px); }
.village-page-heading { background: #edf0e4; }
.village-sections > h2, .ideas-section h2, .connect-grid h2 { font: 500 clamp(24px, 3.35vw, 44px)/1.07 Georgia, serif; }
.ideas-section { margin-top: clamp(32px, 6vw, 78px); display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(18px, 4vw, 60px); padding: clamp(18px, 4vw, 48px); background: #e5ebdc; border-radius: 17px; }
.ideas-section > div p { margin-top: 12px; color: var(--muted); }
.community-form { display: grid; gap: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(15px, 3vw, 27px); }
.community-form button { justify-self: start; }
.community-columns, .connect-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.community-form .field input, .community-form .field textarea, .community-form .field select { width: 100%; min-width: 0; }
.community-form textarea { resize: vertical; }
.community-status { padding: 9px 12px; background: var(--tint); border-radius: 8px; }
.standalone-form { max-width: 740px; }
.dialog-form { margin-top: 16px; }
.community-check { display: flex; align-items: baseline; gap: 6px; }
.community-check input { accent-color: var(--accent); }
.community-heading { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.connect-grid :is(a,button) { align-self: start; }
#official-status { color: var(--muted); }
.community-review { margin-block: 16px; }
#community-review-list { display: grid; gap: 10px; }
#community-review-list dl { margin: 10px 0; overflow-wrap: anywhere; }
#community-review-list dt { font-weight: 700; }
#community-review-list dd { margin: 0 0 8px; white-space: pre-wrap; }
.review-photo { width: min(100%, 320px); max-height: 260px; object-fit: contain; }
.family-side-head { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 5px; }
.family-side-head .sidebar-toggle { font-size: 13px; min-height: 34px; padding: 4px 7px; }
.workspace.sidebar-collapsed { grid-template: "branches" auto "tree" auto / minmax(0, 1fr); }
.workspace.sidebar-collapsed .branches { padding: 5px 10px; }
.workspace.sidebar-collapsed .family-side-head { justify-content: start; gap: 12px; }
.tree-region { position: relative; display: grid; grid-template-columns: minmax(0,1fr); }
.tree-region:has(.comparison:not([hidden])) { grid-template-columns: minmax(0,1fr) clamp(244px, 26%, 330px); }
.tree-region .comparison { margin: 0 10px 10px 0; max-height: min(68vh, 650px); overflow: auto; animation: bring-in .2s ease-out both; }
@keyframes bring-in { from { transform: translateX(10px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.village-page:not([hidden]) { animation: page-in .24s ease-out both; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 900px) {
  #home-view .village-card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tree-region:has(.comparison:not([hidden])) { grid-template-columns: minmax(0,1fr); }
  .tree-region .comparison { position: absolute; z-index: 2; top: 0; right: 0; width: min(320px, calc(100% - 18px)); max-height: calc(100% - 12px); box-shadow: 0 8px 34px #173b3045; }
}
@media (max-width: 650px) {
  .ideas-section, .community-columns, .connect-grid { grid-template-columns: 1fr; }
  .brand-logo { height: 38px; width: 38px; }
  .site-header .main-nav { width: 100%; gap: 0; flex-wrap: wrap; }
  .site-header .main-nav a { padding-inline: 7px; }
  .village-hero { min-height: 470px; }
  .hero-slide { object-position: center; }
}
@media (prefers-reduced-motion: reduce) {
  .village-page:not([hidden]), .tree-region .comparison, .hero-slide, .village-card { animation: none; transition: none; }
}

.workspace:has(> .profile:not([hidden])):not(:has(.comparison:not([hidden]))) {
  grid-template: "branches tree profile" auto / var(--sidebar-width) minmax(0, 1fr) clamp(255px, 24vw, 350px);
}
.workspace.sidebar-collapsed:has(> .profile:not([hidden])):not(:has(.comparison:not([hidden]))) {
  grid-template: "branches branches" auto "tree profile" auto / minmax(0, 1fr) clamp(255px, 24vw, 350px);
}
.workspace:has(.comparison:not([hidden])) > .profile { display: none; }
.profile { max-height: clamp(550px, calc(100dvh - 105px), 955px); overflow: auto; }
.profile-kicker { margin-bottom: 5px; }
.profile-close { margin-left: auto; }
.profile-career { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.village-page-heading:has(.page-submission) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  padding: clamp(16px, 2.8vw, 34px);
}
.village-page-heading:has(.page-submission) > :not(.page-submission) { grid-column: 1; }
.village-page-heading .page-submission { grid-column: 2; grid-row: 1 / span 2; justify-self: end; align-self: start; }
@media (max-width: 760px) {
  .workspace:has(> .profile:not([hidden])):not(:has(.comparison:not([hidden]))),
  .workspace.sidebar-collapsed:has(> .profile:not([hidden])):not(:has(.comparison:not([hidden]))) {
    display: flex; flex-direction: column;
  }
  .workspace > * { width: 100%; }
  .profile { max-height: none; }
}
@media (max-width: 520px) {
  .archive-toolbar .header-actions { margin-left: auto; justify-content: flex-end; }
  .village-page-heading:has(.page-submission) { grid-template-columns: minmax(0, 1fr); }
  .village-page-heading .page-submission { grid-column: 1; grid-row: auto; }
}

.card-maps { background: #e9eee1; }
.card-maps .village-card-icon { background: #d5e1cd; color: #28513f; }
#home-view .village-card-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.village-map-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 310px); gap: 16px; }
.village-map-panel, .village-map-places {
  min-width: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface);
}
.village-map-panel iframe { width: 100%; height: clamp(350px, 56vh, 580px); display: block; border: 0; background: var(--tint); }
.village-map-links { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 13px 15px; }
.village-map-links a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.village-map-places { padding: 18px; align-self: start; }
.village-map-options { display: grid; gap: 8px; margin: 14px 0 20px; }
.village-map-options button {
  min-height: 60px; display: grid; justify-items: start; gap: 3px; text-align: left;
  border: 1px solid var(--line); border-radius: 9px; white-space: normal;
}
.village-map-options button[aria-pressed="true"] { background: var(--tint); border-color: var(--accent); }
.village-map-options span, .map-coordinates { color: var(--muted); font-variant-numeric: tabular-nums; }
.village-panorama { padding: 14px; border-radius: 10px; background: var(--tint); }
.village-panorama p { margin-block: 7px 13px; }
@media (max-width: 1050px) {
  #home-view .village-card-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #home-view .village-card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .village-map-layout { grid-template-columns: minmax(0, 1fr); }
  .village-map-panel iframe { height: 360px; }
}

.street-tour { margin-top: 2rem; }
.street-tour-heading, .street-tour-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.street-tour-heading { justify-content: space-between; }
.street-tour-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 1rem; }
.street-stop { display: flex; flex-direction: column; overflow: hidden; border: 1px solid #d8d7c9; border-radius: 14px; background: #fffaf0; }
.street-stop.selected { border-color: #376349; box-shadow: 0 0 0 1px #376349; }
.street-stop figure { margin: 0; }
.street-stop img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.street-stop figcaption { padding: .45rem .85rem; background: #e9eddf; color: #294637; font-size: .875rem; }
.street-stop-info { display: grid; align-content: start; gap: .65rem; padding: .85rem; }
.street-stop-info :is(h3, p) { margin: 0; }
.street-stop-info .village-button { justify-content: center; text-align: center; }
.site-copy-toolbar { position: fixed; inset: auto 1rem 1rem auto; z-index: 55; padding: .45rem; border-radius: .65rem; background: #fffaf0; box-shadow: 0 4px 22px #253e3333; }
.site-copy-toolbar p { margin: 0; }
.site-copy-editor { width: min(92vw, 34rem); padding: 1.4rem; }
.site-copy-editor .field { margin-block: .85rem; }
.editing-site-copy [data-copy-key] { outline: 2px dashed #4d8257; outline-offset: 3px; cursor: pointer; }
