/* Telegram family mode · keeps Khan's green and gold in both themes. */
.ktg { max-width:1160px; margin:0 auto; color:var(--ui-ink); }
.ktg-hero { display:flex; align-items:center; justify-content:space-between; gap:36px; padding:36px 42px; border-radius:26px; border:1px solid #6b7552; background:radial-gradient(ellipse at 90% 25%,rgba(201,162,39,.2),transparent 48%),linear-gradient(125deg,#183e2c,#0e271c); color:#f7f3df; margin-bottom:22px; box-shadow:inset 0 1px 0 rgba(237,220,166,.2),0 20px 40px -30px #102e19; }
.ktg-eyebrow { font:600 10px/1.5 var(--mono,monospace); letter-spacing:.17em; color:#d8c27b; margin-bottom:15px; }
html[data-design="signature"] .ktg-hero h1 { font:600 clamp(28px,3.4vw,40px)/1.15 var(--sans) !important; color:#fff8df !important; letter-spacing:-.045em; max-width:22ch; margin:0 0 15px; }
.ktg-hero p { font:400 14px/1.75 var(--sans); color:#c8d7cb; max-width:580px; margin:0 0 20px; }
.ktg-service { display:inline-flex; align-items:center; gap:8px; padding:7px 12px; border-radius:20px; color:#e1d6b5; font-size:11px; border:1px solid rgba(220,204,149,.25); background:rgba(255,255,255,.04); }
.ktg-service i { width:6px; height:6px; border-radius:50%; background:#c6ac5f; }
.ktg-service.is-ready i { background:#acd3af; }
.ktg-emblem { flex:0 0 145px; width:145px; height:145px; border:1px solid rgba(212,200,133,.48); border-radius:35px; display:grid; place-items:center; background:linear-gradient(145deg,#527456,#183b2c); box-shadow:inset 1px 1px 0 #a9af73,14px 20px 30px -16px #031b10; transform:rotate(-8deg); }
.ktg-emblem svg { width:100px; height:100px; fill:rgba(234,212,139,.18); stroke:#e7d18e; stroke-width:2; stroke-linejoin:round; }
.ktg-banner { border:1px solid var(--ui-line); background:var(--ui-soft); border-radius:14px; padding:16px 20px; margin-bottom:20px; font-size:13px; line-height:1.65; color:var(--ui-muted); }
.ktg-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:20px; }
.ktg-card { border:1px solid var(--ui-line); border-radius:22px; padding:26px; background:var(--ui-paper); margin-bottom:20px; min-width:0; box-shadow:inset 0 1px 0 var(--sp-glint),0 12px 30px -25px var(--sp-shadow); }
.ktg-card-head { display:flex; align-items:center; gap:12px; margin-bottom:19px; }
.ktg-card-head>span { width:35px; height:35px; border:1px solid var(--ui-line); border-radius:11px; display:grid; place-items:center; color:var(--ui-brand); background:var(--ui-soft); font-size:20px; }
html[data-design="signature"] .ktg-card h2 { font:600 20px/1.3 var(--sans) !important; color:var(--ui-heading) !important; margin:0; letter-spacing:-.03em; }
.ktg-card p { color:var(--ui-muted); font-size:13px; line-height:1.75; margin:0 0 17px; }
.ktg-connection { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-bottom:17px; border-bottom:1px solid var(--ui-line); }
.ktg-connection>div { display:flex; flex-direction:column; gap:6px; min-width:0; }
.ktg-connection b,.ktg-grant b { color:var(--ui-heading); font-size:13px; overflow-wrap:anywhere; }
.ktg-connection small,.ktg-grant small { color:var(--ui-muted); font-size:10px; line-height:1.6; }
.ktg-pill { flex:0 0 auto; background:var(--ui-soft); color:var(--ui-muted); border:1px solid var(--ui-line); padding:5px 8px; border-radius:7px; font-size:9px; line-height:1.5; }
.ktg-steps { margin:18px 0 21px; padding-left:21px; font-size:12px; color:var(--ui-muted); line-height:1.8; }
.ktg-steps li+li { margin-top:7px; }
.ktg-actions,.ktg-link-actions { display:flex; gap:9px; flex-wrap:wrap; }
.ktg .btn { min-height:42px; font-size:12px; }
.ktg .btn:disabled { opacity:.48; cursor:default; }
.ktg-scope { display:flex; flex-direction:column; gap:6px; padding:15px; border-radius:12px; background:var(--ui-soft); margin-bottom:18px; }
.ktg-scope b { color:var(--ui-heading); font-size:11px; }
.ktg-scope span { color:var(--ui-muted); font-size:11px; line-height:1.7; }
.ktg-linkbox { display:grid; gap:10px; margin:18px 0; padding:16px; background:var(--ui-soft); border:1px solid var(--ui-line); border-radius:14px; }
.ktg-linkbox label { font-size:11px; font-weight:600; color:var(--ui-heading); }
.ktg-linkbox input { width:100%; min-width:0; }
.ktg-linkbox small { color:var(--ui-muted); font-size:10px; line-height:1.6; }
.ktg-check { display:flex; align-items:flex-start; gap:9px; color:var(--ui-muted); font-size:12px; line-height:1.7; margin:17px 0; cursor:pointer; }
.ktg-card .ktg-connected-note { margin:17px 0; }
.ktg-check input { flex:0 0 17px; width:17px; height:17px; margin-top:2px; accent-color:var(--ui-brand); }
.ktg-grants { display:grid; gap:10px; margin-top:20px; }
.ktg-grant { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 0; border-top:1px solid var(--ui-line); }
.ktg-grant>div:first-child { display:flex; flex-direction:column; gap:6px; min-width:0; }
.ktg-grant>div:last-child { display:flex; gap:7px; flex-wrap:wrap; justify-content:flex-end; }
.ktg-grant .btn { font-size:10px; padding:8px 10px; min-height:38px; }
.ktg-note { color:var(--ui-muted); font-size:12px; line-height:1.7; }
.ktg-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:15px; margin:20px 0; }
.ktg-metrics>div { display:flex; flex-direction:column; gap:8px; padding:17px; background:var(--ui-soft); border:1px solid var(--ui-line); border-radius:13px; }
.ktg-metrics strong { color:var(--ui-heading); font:600 29px/1.2 var(--sans); letter-spacing:-.04em; font-variant-numeric:tabular-nums; }
.ktg-metrics span { color:var(--ui-muted); font-size:10px; line-height:1.5; }
.ktg-commands { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px 20px; padding-top:20px; border-top:1px solid var(--ui-line); }
.ktg-commands>span { display:flex; flex-direction:column; gap:7px; font-size:11px; color:var(--ui-muted); }
.ktg-commands code { color:var(--ui-brand); font-size:12px; }
.ktg-form-grid { display:grid; grid-template-columns:1.2fr 1fr; gap:20px; align-items:end; }
.ktg-field { display:flex; flex-direction:column; gap:8px; color:var(--ui-muted); font-size:12px; }
html[data-design="signature"] .ktg :is(input[type="text"],input[type="password"],select) { border:1px solid var(--ui-line) !important; border-radius:10px; background:var(--ui-soft) !important; color:var(--ui-ink) !important; padding:11px 12px; min-height:44px; font:400 14px/1.5 var(--sans); width:100%; box-sizing:border-box; }
.ktg-bot-identity { padding:12px; display:flex; flex-direction:column; gap:8px; color:var(--ui-heading); background:var(--ui-soft); border-radius:10px; }
.ktg-bot-identity small { color:var(--ui-muted); font-size:10px; }
.ktg-bot-identity b { font-size:13px; }
.ktg-advanced { border-top:1px solid var(--ui-line); margin:17px 0; padding-top:15px; }
.ktg-advanced summary { color:var(--ui-muted); font-size:11px; cursor:pointer; }
.ktg-health { display:flex; flex-wrap:wrap; gap:12px 24px; margin-top:20px; color:var(--ui-muted); font-size:10px; }
.ktg-service-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:22px 0 0; }
.ktg-service-metrics>div { padding:13px; background:var(--ui-soft); border:1px solid var(--ui-line); border-radius:11px; min-width:0; }
.ktg-service-metrics dt { color:var(--ui-muted); font-size:10px; line-height:1.6; }
.ktg-service-metrics dd { margin:8px 0 0; color:var(--ui-heading); font:600 18px/1.4 var(--sans); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.ktg-error { color:var(--ui-ink); border-left:3px solid #c47564; padding:12px; margin-top:15px; }
.ktg-status { color:var(--ui-heading); font-size:13px; line-height:1.7; padding:0 3px; }
.ktg :is(button,a,input,select):focus-visible { outline:3px solid var(--ui-gold) !important; outline-offset:3px; }
@media(max-width:760px){ .ktg-grid{grid-template-columns:1fr;gap:0}.ktg-emblem{flex-basis:105px;width:105px;height:105px;border-radius:27px}.ktg-emblem svg{width:76px;height:76px}.ktg-hero{padding:29px;gap:22px}.ktg-form-grid{grid-template-columns:1fr}.ktg-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.ktg-commands{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media(max-width:480px){.ktg-hero{padding:26px 22px;display:block}.ktg-emblem{display:none}.ktg-card{padding:21px}.ktg-connection{flex-direction:column;align-items:flex-start}.ktg-grant{align-items:flex-start;flex-direction:column}.ktg-grant>div:last-child{justify-content:flex-start}.ktg .btn{min-height:44px}.ktg-actions>.btn{flex:1 1 100%}.ktg-card-head{gap:9px}.ktg-steps{font-size:12px}html[data-design="signature"] .ktg :is(input[type="text"],input[type="password"],select){font-size:16px} }

/* Read-only family analytics. Charts remain still so the data stays readable. */
.kf-family-mark { flex:0 0 170px; display:grid; justify-items:center; gap:14px; transform:rotate(-5deg); padding:19px; border:1px solid rgba(231,209,142,.35); border-radius:25px; background:linear-gradient(150deg,rgba(147,182,142,.2),rgba(13,36,24,.6)); box-shadow:inset 1px 1px 0 rgba(255,244,202,.25),12px 20px 35px -20px #06190e; }
.kf-family-mark svg { width:126px; height:126px; stroke:#dec985; stroke-width:2; fill:rgba(217,206,159,.1); stroke-linecap:round; stroke-linejoin:round; }
.kf-family-mark span { font-size:10px; color:#e0d5ac; }
.kf-toolbar { display:flex; align-items:end; gap:22px; flex-wrap:wrap; }
.kf-toolbar>.ktg-field { flex:1 1 220px; }
.kf-period { display:grid; gap:8px; }
.kf-period>span { color:var(--ui-muted); font-size:12px; }
.kf-period>div { display:flex; gap:5px; background:var(--ui-soft); border:1px solid var(--ui-line); border-radius:11px; padding:4px; }
.kf-period button { min-height:38px; min-width:70px; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--ui-muted); font:600 12px var(--sans); cursor:pointer; }
.kf-period button[aria-pressed="true"] { color:var(--ui-heading); background:var(--ui-paper); border-color:var(--ui-line); box-shadow:0 2px 5px rgba(10,33,19,.08); }
.kf-section-title { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:30px 0 0; }
html[data-design="signature"] .kf-section-title h2 { color:var(--ui-heading) !important; font:600 26px/1.3 var(--sans) !important; letter-spacing:-.04em; margin:0; overflow-wrap:anywhere; }
.kf-section-title p { color:var(--ui-muted); font-size:11px; margin:7px 0 0; }
.kf-metrics>div { background:var(--ui-paper); padding:23px 21px; border-radius:17px; }
.kf-metrics strong { font-size:34px; }
.kf-comparison { color:var(--ui-muted); font-size:11px; line-height:1.7; margin:-4px 0 26px; }
.kf-data-grid { grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); }
.kf-chart { height:140px; display:flex; gap:3px; align-items:end; padding-top:8px; border-bottom:1px solid var(--ui-line); background:repeating-linear-gradient(to top,transparent 0,transparent 44px,var(--ui-line) 45px,transparent 46px); }
.kf-chart>span { height:100%; flex:1 1 0; min-width:0; display:flex; align-items:end; }
.kf-chart i { display:block; width:100%; border-radius:4px 4px 0 0; background:linear-gradient(to top,var(--ui-brand),#8aa582); box-shadow:inset 1px 0 rgba(255,255,255,.25); }
.kf-axis { display:flex; align-items:start; justify-content:space-between; gap:12px; margin-top:10px; color:var(--ui-muted); font-size:9px; line-height:1.6; }
.kf-axis>span:nth-child(2) { text-align:center; }
.kf-day-details { margin-top:20px; border-top:1px solid var(--ui-line); padding-top:14px; }
.kf-day-details summary { color:var(--ui-brand); font-size:11px; cursor:pointer; line-height:1.7; min-height:44px; padding:12px 0; box-sizing:border-box; }
.kf-table-scroll { overflow:auto; max-height:260px; margin-top:14px; }
.kf-table-scroll table { width:100%; border-collapse:collapse; color:var(--ui-muted); font-size:11px; text-align:left; font-variant-numeric:tabular-nums; }
.kf-table-scroll th { font-weight:600; color:var(--ui-heading); }
.kf-table-scroll :is(th,td) { padding:9px 7px; border-bottom:1px solid var(--ui-line); white-space:nowrap; }
.kf-subject+.kf-subject { margin-top:21px; }
.kf-subject>div:first-child { display:flex; justify-content:space-between; gap:12px; color:var(--ui-heading); font-size:12px; }
.kf-subject b { font-weight:600; overflow-wrap:anywhere; }
.kf-subject small { color:var(--ui-muted); font-size:10px; line-height:1.7; }
.kf-track { height:5px; border-radius:5px; background:var(--ui-soft); margin:11px 0 7px; overflow:hidden; }
.kf-track i { display:block; height:100%; background:linear-gradient(90deg,var(--ui-brand),#9b9c63); border-radius:inherit; }
.kf-results { list-style:none; padding:0; margin:0; }
.kf-result { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:16px 0; }
.kf-result+.kf-result { border-top:1px solid var(--ui-line); }
.kf-result>div { min-width:0; display:grid; gap:7px; }
.kf-result b { color:var(--ui-heading); font-size:12px; font-weight:600; overflow-wrap:anywhere; }
.kf-result span,.kf-result small { color:var(--ui-muted); font-size:10px; line-height:1.6; }
.kf-result .kf-result-score { flex:0 0 auto; justify-items:end; font-variant-numeric:tabular-nums; }
.kf-result strong { color:var(--ui-brand); font:600 21px/1.3 var(--sans); }
.kf-footnote { color:var(--ui-muted); font-size:11px; line-height:1.8; padding:0 5px; max-width:85ch; }
@media(max-width:760px){.kf-data-grid{grid-template-columns:1fr}.kf-family-mark{flex-basis:120px;padding:12px}.kf-family-mark svg{width:98px;height:98px}.kf-toolbar{gap:17px}.kf-chart{gap:2px}.kf-period button{min-height:44px}.kf-metrics>div{padding:20px 17px}.kf-section-title{margin-top:26px}}
@media(max-width:480px){.kf-family-mark{display:none}.kf-toolbar>.ktg-field{flex-basis:100%}.kf-toolbar>.btn{width:100%}.kf-period,.kf-period>div{width:100%}.kf-period button{flex:1;min-width:0}.kf-metrics strong{font-size:29px}.kf-section-title{align-items:start}.kf-section-title .ktg-pill{font-size:8px}.kf-result{gap:12px}.kf-result strong{font-size:19px}}
@media(max-width:600px){.ktg-service-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
