:root {
  --blue: #3155d9;
  --blue-dark: #213d9e;
  --blue-soft: #e9edff;
  --mint: #58cdb6;
  --mint-soft: #dff8f2;
  --ink: #15213d;
  --muted: #69738d;
  --line: #dfe4f2;
  --bg: #f5f7ff;
  --card: #ffffff;
  --shadow: 0 12px 35px rgba(45, 65, 130, .10);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 80% -5%, #dff8f2 0, transparent 26rem), var(--bg); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #9bb0ff; outline-offset: 2px; }
.hidden { display: none !important; }

.prototype-note { position: fixed; z-index: 50; top: 8px; left: 50%; transform: translateX(-50%); background: #172449; color: white; padding: 7px 13px; border-radius: 99px; font-size: 12px; box-shadow: 0 6px 20px #17244933; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 850; font-size: 23px; color: var(--blue-dark); }
.brand-large { justify-content: center; font-size: 32px; }
.brand-mark { position: relative; display: inline-block; width: 40px; height: 40px; background: url("mark.svg") center / contain no-repeat; }
.brand-mark i, .brand-mark b { display: none; }

/* Public entry page */
.landing-shell { min-height: 100vh; overflow: hidden; background: #f8faff; }
.landing-header { width: min(1180px, calc(100% - 48px)); min-height: 92px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.landing-header .brand { color: #16275d; text-decoration: none; }
.landing-header nav { display: flex; align-items: center; gap: 30px; }
.landing-header nav a, .landing-login-link { color: #52607d; font-weight: 750; text-decoration: none; }
.landing-header nav a:hover { color: var(--blue); }
.landing-login-link { min-height: 43px; padding: 0 18px; border: 1px solid #cbd5ef; border-radius: 13px; background: white; color: var(--blue); cursor: pointer; }
.landing-hero { position: relative; width: min(1180px, calc(100% - 48px)); min-height: 650px; margin: 0 auto; padding: 72px 0 96px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); align-items: center; gap: 70px; }
.landing-hero::before { content: ""; position: absolute; z-index: 0; width: 650px; height: 650px; right: -300px; top: -120px; border: 1px solid #dfe5f8; border-radius: 50%; box-shadow: 0 0 0 80px #f0f4ff, 0 0 0 81px #dfe5f8; }
.hero-copy, .circle-preview { position: relative; z-index: 1; }
.landing-eyebrow { display: inline-block; color: #186c62; font-size: 13px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.hero-copy h1 { max-width: 710px; margin: 18px 0 23px; color: #111d42; font-size: clamp(45px, 6vw, 76px); line-height: .98; letter-spacing: -.055em; }
.hero-copy h1 em { position: relative; color: var(--blue); font-style: normal; white-space: nowrap; }
.hero-copy h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px; border-radius: 50%; background: var(--mint); transform: rotate(-2deg); }
.hero-copy > p { max-width: 625px; margin: 0; color: #5a657e; font-size: 19px; line-height: 1.65; }
.hero-actions { display: flex; align-items: center; gap: 13px; margin-top: 32px; }
.landing-primary, .landing-secondary { min-height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: 13px; border-radius: 16px; padding: 0 22px; font-weight: 850; text-decoration: none; cursor: pointer; }
.landing-primary { border: 0; background: var(--blue); color: white; box-shadow: 0 13px 27px #3155d933; }
.landing-primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.landing-primary span { font-size: 22px; }
.landing-secondary { border: 1px solid #cbd5ef; background: white; color: var(--blue-dark); }
.hero-trust { display: flex; flex-wrap: wrap; gap: 17px; margin-top: 25px; color: #66708a; font-size: 13px; font-weight: 700; }
.hero-trust span::first-letter { color: #188578; }
.circle-preview { min-height: 510px; display: grid; place-items: center; }
.preview-glow { position: absolute; width: 410px; height: 410px; border-radius: 50%; background: radial-gradient(circle, #d7fff2 0 25%, #dfe7ff 68%, transparent 69%); filter: blur(2px); }
.preview-card { position: absolute; background: rgba(255,255,255,.94); border: 1px solid #e6eaf5; box-shadow: 0 24px 65px #243b7c20; }
.main-preview-card { z-index: 2; width: min(410px, 94%); min-height: 350px; padding: 25px; border-radius: 32px; text-align: center; transform: rotate(1deg); }
.main-preview-card header { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; text-align: left; }
.main-preview-card header strong { font-size: 19px; }
.main-preview-card header small { color: var(--muted); }
.mini-brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-size: 23px; }
.preview-people { height: 160px; display: flex; align-items: center; justify-content: center; margin: 12px 0 0; }
.preview-person { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 -4px; border: 5px solid white; border-radius: 50%; color: white; font-weight: 900; box-shadow: 0 8px 20px #243b7c25; }
.preview-person.person-main { width: 84px; height: 84px; z-index: 3; background: #684cd0; font-size: 27px; }
.person-one { background: #ea668c; } .person-two { background: #16a39a; } .person-three { background: #f09c3e; } .person-four { background: #4b83d8; }
.main-preview-card > p { margin: 0 auto 20px; max-width: 260px; color: #687189; line-height: 1.5; }
.preview-status { display: inline-flex; align-items: center; gap: 8px; border-radius: 99px; background: var(--mint-soft); color: #176b61; padding: 9px 14px; font-size: 13px; font-weight: 800; }
.preview-status span { width: 8px; height: 8px; border-radius: 50%; background: #21a794; }
.floating-message { z-index: 3; left: -22px; bottom: 38px; width: 280px; min-height: 78px; border-radius: 20px; padding: 12px; display: flex; align-items: center; gap: 10px; transform: rotate(-2deg); }
.floating-message .preview-person { flex: 0 0 48px; width: 48px; height: 48px; border-width: 3px; }
.floating-message strong, .floating-message small, .floating-shield strong, .floating-shield small { display: block; }
.floating-message small, .floating-shield small { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.floating-shield { z-index: 3; right: -18px; top: 40px; width: 220px; min-height: 83px; border-radius: 20px; padding: 13px; display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 9px; transform: rotate(2deg); }
.floating-shield > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--mint-soft); font-size: 24px; }
.landing-section { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 104px 0 115px; }
.section-intro { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 45px; }
.section-intro .landing-eyebrow { align-self: start; margin-top: 12px; }
.section-intro h2 { margin: 0; max-width: 760px; color: #16244c; font-size: clamp(34px, 4.7vw, 58px); line-height: 1.08; letter-spacing: -.045em; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.landing-feature { min-height: 315px; padding: 30px; border: 1px solid #e2e7f4; border-radius: 26px; background: white; }
.landing-feature:nth-child(2) { transform: translateY(24px); }
.feature-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; font-size: 28px; font-weight: 900; }
.feature-circle .feature-icon { background: #e7ecff; color: var(--blue); }
.feature-chat .feature-icon { background: #ddf8f1; color: #178374; }
.feature-mail .feature-icon { background: #fff0cf; color: #a66b00; }
.landing-feature h3 { margin: 58px 0 12px; font-size: 25px; color: #18264d; }
.landing-feature p { margin: 0; color: #677189; font-size: 16px; line-height: 1.65; }
.safety-story { width: min(1180px, calc(100% - 48px)); margin: 0 auto 96px; padding: 60px; display: grid; grid-template-columns: 180px 1fr 1fr; align-items: center; gap: 55px; border-radius: 34px; background: #142554; color: white; overflow: hidden; }
.safety-symbol { position: relative; width: 170px; height: 170px; display: grid; place-items: center; border-radius: 50%; background: #223a78; box-shadow: 0 0 0 24px #1b316b; }
.safety-symbol > span { font-size: 92px; color: #7be1cd; line-height: 1; }
.safety-symbol b { position: absolute; right: 22px; bottom: 20px; width: 44px; height: 44px; display: grid; place-items: center; border: 4px solid #142554; border-radius: 50%; background: #ffc850; color: #4b3600; }
.safety-story .landing-eyebrow { color: #79dac8; }
.safety-story h2 { margin: 13px 0 17px; font-size: clamp(32px, 4vw, 50px); line-height: 1.05; letter-spacing: -.04em; }
.safety-story p { margin: 0; color: #c8d2ee; font-size: 16px; line-height: 1.7; }
.safety-story ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 17px; }
.safety-story li { display: grid; grid-template-columns: 42px 1fr; gap: 14px; align-items: start; }
.safety-story li > span { color: #7be1cd; font-size: 13px; font-weight: 900; }
.safety-story li strong, .safety-story li small { display: block; }
.safety-story li strong { margin-bottom: 5px; }
.safety-story li small { color: #b7c3e1; font-size: 14px; line-height: 1.45; }
.landing-footer { width: min(1180px, calc(100% - 48px)); min-height: 120px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; gap: 30px; align-items: center; border-top: 1px solid #dde3f1; }
.landing-footer p { color: var(--muted); }
.landing-footer > button { border: 0; background: none; color: var(--blue); font-weight: 850; cursor: pointer; }
.back-to-landing { display: block; margin: -3px 0 2px; border: 0; background: none; color: var(--blue); font-weight: 800; cursor: pointer; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 48px 20px 24px; }
.login-card { width: min(100%, 560px); background: rgba(255,255,255,.94); border: 1px solid #fff; box-shadow: var(--shadow); border-radius: 32px; padding: 30px; text-align: center; }
.login-card h1 { margin: 18px 0 7px; font-size: clamp(27px, 6vw, 38px); letter-spacing: -.03em; }
.login-card > p { color: var(--muted); line-height: 1.55; max-width: 440px; margin: 0 auto 22px; }
.welcome-art { position: relative; width: 230px; height: 120px; margin: 20px auto 0; }
.orbit { position: absolute; border: 2px dashed #b8c5ef; border-radius: 50%; inset: 7px 28px; transform: rotate(-8deg); }
.orbit-two { inset: 25px 12px 2px; transform: rotate(10deg); border-color: #9ee1d3; }
.face { position: absolute; display: grid; place-items: center; width: 60px; height: 60px; border: 5px solid white; border-radius: 50%; color: white; font-weight: 850; box-shadow: 0 8px 18px #23397633; }
.face-a { left: 25px; top: 38px; background: #7558cf; }
.face-b { left: 86px; top: 7px; background: #ea6e91; width: 72px; height: 72px; }
.face-c { right: 22px; top: 45px; background: #2da7a0; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0 16px; }
.role { border: 2px solid var(--line); border-radius: 18px; padding: 16px 12px; background: white; display: grid; gap: 4px; cursor: pointer; }
.role:hover, .role.active { border-color: var(--blue); background: var(--blue-soft); }
.role span { font-size: 28px; }
.role strong { font-size: 16px; }
.role small { font-size: 13px; color: var(--muted); }
.login-detail { min-height: 64px; margin: -2px 0 14px; padding: 9px 11px; display: flex; align-items: center; gap: 10px; background: #f7f8fd; border: 1px solid var(--line); border-radius: 16px; text-align: left; }
.login-detail div { flex: 1; }
.login-detail strong, .login-detail small { display: block; }
.login-detail small { color: var(--muted); margin-top: 2px; }
.login-detail input { width: 84px; min-height: 42px; border: 1px solid #cbd3e8; border-radius: 11px; background: white; padding: 0 10px; text-align: center; font-size: 20px; letter-spacing: 5px; }
.login-credentials { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: -2px 0 14px; text-align: left; }
.login-credentials label { display: grid; gap: 6px; color: #53607b; font-size: 13px; font-weight: 800; }
.login-credentials input { width: 100%; min-height: 48px; border: 1px solid #cbd3e8; border-radius: 13px; background: #fbfcff; padding: 0 13px; color: var(--ink); font-size: 16px; }
.login-error { margin: 0 0 12px !important; padding: 10px 12px; border: 1px solid #f0b8c5; border-radius: 12px; background: #fff0f3; color: #8c1d38 !important; font-size: 14px; text-align: left; }
.sync-indicator { margin-left: 6px; color: #197c70; font-size: 10px; font-weight: 850; letter-spacing: 0; text-transform: none; }
.sync-indicator.offline { color: #a13a52; }
.conversation-loading { padding: 12px 10px; color: var(--muted); font-size: 13px; }
.message-image { display: block; width: min(320px, 100%); max-height: 280px; margin: 2px 0 7px; border-radius: 12px; object-fit: contain; background: #eef2fb; }
.message-uploading { opacity: .7; }
.parent-avatar { background: #29457f; font-size: 12px; }
.verified-badge { color: #176b61; background: var(--mint-soft); border-radius: 99px; padding: 7px 10px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.login-links { display: flex; justify-content: center; flex-wrap: wrap; }
.primary { border: 0; background: var(--blue); color: white; min-height: 46px; border-radius: 14px; padding: 0 20px; font-weight: 750; cursor: pointer; box-shadow: 0 7px 16px #3155d933; }
.primary:hover { background: var(--blue-dark); }
.wide { width: 100%; }
.text-button { border: 0; background: none; color: var(--blue); font-weight: 700; padding: 14px; cursor: pointer; }
.trust-line { font-size: 13px; margin: 2px auto 0 !important; color: #59647d !important; }
.trust-line span { color: var(--mint); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; background: rgba(255,255,255,.9); backdrop-filter: blur(16px); border-right: 1px solid var(--line); padding: 30px 20px 20px; display: flex; flex-direction: column; }
.sidebar > .brand { margin: 12px 10px 35px; }
.nav-list { display: grid; gap: 8px; }
.nav-item { position: relative; border: 0; background: transparent; border-radius: 15px; min-height: 49px; padding: 0 16px; display: flex; gap: 13px; align-items: center; color: var(--muted); font-weight: 700; cursor: pointer; }
.nav-item span { width: 22px; font-size: 23px; text-align: center; }
.nav-item:hover { background: #f1f4ff; color: var(--blue); }
.nav-item.active { background: var(--blue-soft); color: var(--blue-dark); }
.nav-item em { margin-left: auto; min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 11px; background: #ee5c7d; color: white; font-style: normal; font-size: 12px; }
.safe-card { margin-top: auto; background: var(--mint-soft); border: 1px solid #b8eadf; border-radius: 18px; padding: 15px; display: grid; grid-template-columns: 32px 1fr; gap: 8px; }
.safe-card > span { font-size: 24px; }
.safe-card strong, .safe-card small { display: block; }
.safe-card small { color: #4e6d69; margin-top: 3px; line-height: 1.35; }
.safe-card button { grid-column: 1 / -1; border: 0; background: white; color: #166c62; font-weight: 750; border-radius: 11px; padding: 9px; cursor: pointer; }
.sos-trigger { cursor: pointer; }
.icon-button.sos-compact { color: #9b2440; background: #fff0f3; border-color: #f2bdca; }
.icon-button.sos-compact:hover { background: #fbdbe3; }
.profile-mini { border: 0; background: none; display: flex; align-items: center; gap: 10px; text-align: left; padding: 20px 6px 2px; cursor: pointer; }
.profile-mini strong, .profile-mini small { display: block; }
.profile-mini small { color: var(--muted); }
.main-area { min-width: 0; }
.topbar { height: 108px; padding: 26px clamp(24px, 5vw, 64px) 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-heading h1 { font-size: clamp(24px, 3vw, 31px); letter-spacing: -.025em; margin: 0 0 3px; }
.page-heading p { margin: 0; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { position: relative; width: 44px; height: 44px; border: 1px solid var(--line); background: white; border-radius: 14px; cursor: pointer; }
.icon-button .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; background: #ee5c7d; border: 2px solid white; border-radius: 50%; }
.mobile-brand { display: none; }
.content { width: min(100% - 48px, 980px); margin: 0 auto; padding: 10px 0 90px; }
.view { display: none; animation: fade .22s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: .45; transform: translateY(5px); } }
.card { background: var(--card); border: 1px solid #e7ebf5; border-radius: var(--radius); box-shadow: 0 8px 25px rgba(52,72,135,.06); }
.avatar { flex: 0 0 auto; width: 44px; height: 44px; border: 3px solid white; border-radius: 50%; display: inline-grid; place-items: center; color: white; font-weight: 850; box-shadow: 0 3px 10px #20356b25; }
button.avatar { border: 3px solid white; cursor: pointer; }
.avatar.big { width: 74px; height: 74px; font-size: 24px; }
.avatar-klara { background: #684cd0; } .avatar-emka { background: #ea668c; } .avatar-miska { background: #16a39a; } .avatar-ondrej { background: #f09c3e; } .avatar-viki { background: #4b83d8; } .avatar-jurko { background: #56a860; } .avatar-karol { background: #bd61b8; }
.story-row { display: flex; gap: 19px; overflow-x: auto; padding: 5px 3px 17px; scrollbar-width: none; }
.story { min-width: 61px; border: 0; background: none; display: grid; justify-items: center; gap: 6px; color: var(--ink); cursor: pointer; }
.story .avatar { outline: 3px solid var(--mint); outline-offset: 3px; }
.story small { font-size: 13px; }
.story.add > span { width: 44px; height: 44px; border: 2px dashed #aab5d4; border-radius: 50%; display: grid; place-items: center; color: var(--blue); font-size: 23px; }
.composer { padding: 14px 16px; display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.composer > button:nth-of-type(1) { flex: 1; min-height: 44px; border: 0; background: #f3f5fb; border-radius: 13px; text-align: left; padding: 0 15px; color: var(--muted); cursor: text; }
.composer .media-button { border: 0; color: var(--blue); background: var(--blue-soft); width: 44px; height: 44px; border-radius: 13px; font-size: 22px; cursor: pointer; }
.post { padding: 19px; margin-bottom: 17px; }
.post header { display: flex; align-items: center; gap: 11px; }
.post header div { flex: 1; }
.post header strong, .post header small { display: block; }
.post header small { color: var(--muted); margin-top: 3px; }
.post header > button { border: 0; background: none; color: var(--muted); cursor: pointer; }
.post > p { font-size: 17px; line-height: 1.55; }
.paper-art { position: relative; height: 250px; border-radius: 17px; overflow: hidden; background: linear-gradient(145deg, #ecf9f5, #cfe8ff); display: grid; place-items: center; }
.paper-art span { position: relative; z-index: 2; font-size: 108px; filter: drop-shadow(0 15px 8px #3d5d7b22); }
.paper-art i, .paper-art b { position: absolute; width: 120px; height: 120px; border-radius: 50%; background: #fff8; }
.paper-art i { left: -30px; top: -32px; } .paper-art b { right: 20px; bottom: -64px; width: 180px; height: 180px; }
.post footer { display: flex; gap: 8px; margin-top: 13px; border-top: 1px solid var(--line); padding-top: 12px; }
.post footer button { border: 0; background: none; min-height: 36px; padding: 0 9px; color: var(--muted); border-radius: 10px; cursor: pointer; }
.post footer button:hover { background: var(--blue-soft); color: var(--blue); }
.post footer small { background: #eef1f7; padding: 2px 6px; border-radius: 8px; }
.post footer .report-link { margin-left: auto; font-size: 13px; }
.reaction.liked { color: #d94268; background: #fff0f4; }
.compact-post > p { margin-left: 55px; }
.comment-section { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 12px; }
.comment-list { display: grid; gap: 9px; }
.comment { display: flex; gap: 8px; align-items: flex-start; }
.comment .avatar, .comment-form .avatar { width: 36px; height: 36px; font-size: 12px; }
.comment > div { background: #f3f5fa; border-radius: 13px; padding: 8px 11px; }
.comment strong { font-size: 13px; }
.comment p { margin: 2px 0 0; font-size: 14px; line-height: 1.4; }
.comment-form { display: flex; gap: 7px; margin-top: 10px; }
.comment-form input { flex: 1; min-width: 0; min-height: 39px; border: 1px solid var(--line); background: #f8f9fc; border-radius: 12px; padding: 0 11px; }
.comment-form button { width: 39px; border: 0; border-radius: 12px; background: var(--blue); color: white; cursor: pointer; }
.user-post-media { width: 100%; max-height: 470px; object-fit: contain; border-radius: 17px; background: #eef2fb; }

.section-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.status-pill { background: var(--mint-soft); color: #176b61; border-radius: 99px; padding: 9px 13px; font-weight: 700; }
.child-family-card { margin-bottom: 18px; padding: 20px; background: linear-gradient(135deg, #ffffff, #f0fbf8); border-color: #cfece5; }
.child-family-heading { display: flex; justify-content: space-between; align-items: start; gap: 14px; margin-bottom: 14px; }
.child-family-heading h2 { margin: 0 0 3px; font-size: 21px; }
.child-family-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.child-family-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.family-person { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 9px; min-width: 0; padding: 10px; border: 1px solid #d7eee8; border-radius: 15px; background: white; text-align: left; cursor: pointer; }
.family-person:hover { border-color: var(--mint); background: var(--mint-soft); }
.family-person strong, .family-person small { display: block; }
.family-person small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.family-person em { color: var(--blue); font-size: 12px; font-style: normal; font-weight: 800; }
.friend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.friend-card { text-align: center; padding: 22px 16px 17px; }
.friend-card h2 { margin: 10px 0 3px; font-size: 19px; }
.friend-card p { color: var(--muted); font-size: 13px; margin: 0 0 15px; }
.secondary { border: 1px solid #cbd4ef; color: var(--blue); background: white; min-height: 40px; border-radius: 12px; padding: 0 14px; font-weight: 700; cursor: pointer; }
.secondary:hover { background: var(--blue-soft); }

.chat-layout.active { display: grid; grid-template-columns: 300px 1fr; gap: 16px; height: calc(100vh - 150px); min-height: 550px; }
.conversation-list { padding: 12px; overflow: auto; }
.conversation-section-label { margin: 14px 9px 5px; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.search { height: 43px; background: #f2f4fa; border-radius: 12px; display: flex; align-items: center; padding: 0 12px; gap: 7px; margin-bottom: 10px; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; min-width: 0; }
.conversation { width: 100%; border: 0; background: none; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 9px; padding: 10px; border-radius: 14px; text-align: left; cursor: pointer; }
.conversation:hover, .conversation.active { background: var(--blue-soft); }
.conversation.family-conversation { border: 1px solid #bce8df; background: #f0fbf8; }
.conversation.family-conversation.active { border-color: var(--mint); background: var(--mint-soft); }
.conversation.group-conversation { border: 1px solid #d8ddf7; background: #fafaff; }
.group-avatar { background: #6756c7; color: white; font-size: 12px; }
.create-chat-group { width: calc(100% - 12px); min-height: 39px; margin: 3px 6px 5px; border: 1px dashed #9ba9d5; border-radius: 12px; background: white; color: var(--blue); font-weight: 800; cursor: pointer; }
.conversation strong, .conversation small { display: block; }
.conversation small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 145px; margin-top: 3px; }
.conversation time { font-size: 12px; color: var(--muted); }
.chat-panel { min-width: 0; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }
.chat-panel > header { padding: 13px 17px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.chat-panel > header div { flex: 1; }
.chat-panel > header strong, .chat-panel > header small { display: block; }
.chat-panel > header small { color: #218174; margin-top: 2px; }
.chat-panel > header button { border: 0; background: var(--blue-soft); width: 40px; height: 40px; border-radius: 12px; color: var(--blue); cursor: pointer; }
.messages { overflow: auto; padding: 20px; background: linear-gradient(#fbfcff, #f7faff); display: flex; flex-direction: column; gap: 9px; }
.day-label { align-self: center; color: var(--muted); font-size: 12px; background: white; padding: 5px 10px; border-radius: 99px; }
.bubble { max-width: 75%; border-radius: 16px; padding: 10px 12px 6px; line-height: 1.45; cursor: pointer; }
.bubble time { display: block; font-size: 10px; opacity: .65; text-align: right; margin-top: 3px; }
.bubble.other { align-self: flex-start; background: white; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bubble.mine { align-self: flex-end; background: var(--blue); color: white; border-bottom-right-radius: 5px; }
.bubble.speaking { outline: 4px solid #ffc94f; outline-offset: 2px; }
.bubble-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 7px; }
.bubble-controls time { margin: 0; }
.bubble-tts { width: 40px; height: 40px; display: inline-grid; place-items: center; flex: 0 0 40px; border: 1px solid #cbd4ef; border-radius: 12px; background: #f3f6ff; color: var(--blue-dark); font-size: 18px; cursor: pointer; }
.bubble.mine .bubble-tts { border-color: #ffffff88; background: #ffffff24; color: white; }
.bubble-tts:focus-visible { outline: 3px solid #ffc94f; outline-offset: 2px; }
.message-box { border-top: 1px solid var(--line); padding: 10px 12px 12px; display: grid; gap: 9px; }
.message-compose-row { display: flex; gap: 7px; }
.message-box input { flex: 1; min-width: 0; border: 0; background: #f2f4fa; border-radius: 12px; padding: 0 13px; font-size: 16px; }
.message-compose-row > button { width: 42px; height: 42px; flex: 0 0 42px; border: 0; background: transparent; border-radius: 12px; color: var(--blue); cursor: pointer; }
.message-box .send { background: var(--blue); color: white; }
.chat-accessibility-tools { display: flex; align-items: center; gap: 8px; }
.voice-hint { flex: 1; color: var(--muted); font-size: 13px; line-height: 1.35; }
.voice-action { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 2px solid #cbd4ef; border-radius: 14px; background: white; color: var(--blue-dark); cursor: pointer; }
.voice-action span { font-size: 21px; }
.voice-action strong { font-size: 14px; }
.voice-action:hover, .voice-action.active { border-color: var(--blue); background: var(--blue-soft); }
.dictate-action.active { color: #9d1735; border-color: #e95f7d; background: #fff0f3; box-shadow: 0 0 0 4px #f7c8d2; }
.voice-status { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; text-align: right; }

.mail-tabs { display: flex; gap: 7px; margin-bottom: 17px; overflow-x: auto; }
.mail-tabs button { border: 0; background: white; color: var(--muted); padding: 11px 16px; border-radius: 12px; white-space: nowrap; cursor: pointer; }
.mail-tabs button.active { background: var(--blue); color: white; }
.mail-tabs button small { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px; border-radius: 10px; background: #ee5c7d; color: white; }
.mail-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 17px; }
.mail-mode-switch button { display: grid; grid-template-columns: 42px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 12px 15px; border: 2px solid transparent; border-radius: 17px; background: white; color: var(--ink); text-align: left; cursor: pointer; }
.mail-mode-switch button > span { grid-row: 1 / 3; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--blue-soft); color: var(--blue); font-size: 20px; font-weight: 900; }
.mail-mode-switch button strong, .mail-mode-switch button small { display: block; }
.mail-mode-switch button small { margin-top: 2px; color: var(--muted); }
.mail-mode-switch button.active { border-color: var(--blue); box-shadow: 0 8px 22px #334faa17; }
.mail-mode-panel { display: none; }
.mail-mode-panel.active { display: block; animation: fade .2s ease; }
.mail-panel { display: none; }
.mail-panel.active { display: block; animation: fade .2s ease; }
.mail-panel.mail-layout.active { display: grid; }
.mail-layout { display: grid; grid-template-columns: .85fr 1.15fr; gap: 22px; }
.mail-panel.mail-layout:not(.active) { display: none; }
.circlemail-security { display: grid; grid-template-columns: 42px 1fr auto; gap: 11px; align-items: center; margin-bottom: 14px; padding: 13px 15px; border: 1px solid #bce8df; border-radius: 17px; background: var(--mint-soft); }
.circlemail-security > span:first-child { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: white; font-size: 21px; }
.circlemail-security strong, .circlemail-security small { display: block; }
.circlemail-security small { margin-top: 3px; color: #31766d; line-height: 1.35; }
.circlemail-address { padding: 8px 11px; border-radius: 99px; background: white; color: #176b61; font-size: 13px; font-weight: 800; }
.circlemail-layout { display: grid; grid-template-columns: 235px 1fr; gap: 14px; min-height: 570px; }
.circlemail-folders { padding: 12px; }
.circlemail-new { width: 100%; margin-bottom: 10px; }
.email-folder { width: 100%; min-height: 45px; display: grid; grid-template-columns: 25px 1fr auto; align-items: center; gap: 8px; padding: 0 11px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); text-align: left; font-weight: 750; cursor: pointer; }
.email-folder:hover, .email-folder.active { background: var(--blue-soft); color: var(--blue-dark); }
.email-folder em { min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 11px; background: #e8496e; color: white; font-size: 11px; font-style: normal; }
.email-folder em:empty { display: none; }
.circlemail-lesson { margin-top: 18px; padding: 12px; border-radius: 14px; background: #fff8df; color: #705b19; }
.circlemail-lesson > span { font-size: 22px; }
.circlemail-lesson strong { display: block; margin: 5px 0 3px; }
.circlemail-lesson p { margin: 0; font-size: 12px; line-height: 1.4; }
.circlemail-content { min-width: 0; padding: 0; overflow: hidden; }
.email-panel { display: none; }
.email-panel.active { display: block; }
.email-panel > header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.email-panel > header h2 { margin: 0; }
.mailbox-toolbar { display: grid !important; grid-template-columns: auto minmax(180px, 1fr) auto; }
.email-search { max-width: 360px; justify-self: center; width: 100%; display: flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid #cbd3e8; border-radius: 12px; background: #fbfcff; }
.email-search span { color: var(--muted); font-size: 18px; }
.email-search input { width: 100%; min-height: 40px; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; }
.safe-mail-badge { padding: 7px 10px; border-radius: 99px; background: var(--mint-soft); color: #176b61; font-size: 12px; font-weight: 800; }
.email-list { display: grid; }
.email-row { width: 100%; display: grid; grid-template-columns: 45px 1fr auto; gap: 11px; align-items: center; padding: 14px 18px; border: 0; border-bottom: 1px solid var(--line); background: white; color: var(--ink); text-align: left; cursor: pointer; }
.email-row:hover { background: #f8faff; }
.email-row.unread { background: #f3f6ff; }
.email-row.unread strong, .email-row.unread b { font-weight: 900; }
.email-avatar { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 14px; background: #dde4f9; color: var(--blue-dark); font-size: 13px; font-weight: 850; }
.email-avatar.teacher { background: #fff1c5; color: #795d08; }
.email-row strong, .email-row b, .email-row small { display: block; }
.email-row b { margin: 2px 0; font-size: 14px; }
.email-row small, .email-row time { color: var(--muted); }
.email-row time { font-size: 12px; }
.circlemail-form { display: grid; gap: 14px; padding: 18px; }
.circlemail-form label { display: grid; gap: 6px; font-weight: 800; }
.circlemail-form input, .circlemail-form select, .circlemail-form textarea { width: 100%; border: 1px solid #cbd3e8; border-radius: 12px; background: #fbfcff; padding: 11px 12px; color: var(--ink); font: inherit; }
.circlemail-form textarea { min-height: 180px; resize: vertical; line-height: 1.5; }
.circlemail-form label > small { color: var(--muted); text-align: right; font-weight: 500; }
.circlemail-form .field-help { display: inline; margin-left: 6px; text-align: left; font-weight: 500; }
.circlemail-assistive { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 14px; background: #f5f7ff; }
.circlemail-assistive .voice-action { min-height: 42px; }
.circlemail-assistive > span { margin-left: auto; color: var(--muted); font-size: 12px; }
.circlemail-form-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.attachment-button { min-height: 42px; display: inline-flex !important; align-items: center; padding: 0 13px; border: 1px solid #cbd4ef; border-radius: 12px; background: white; color: var(--blue); cursor: pointer; }
.attachment-button input { display: none; }
.attachment-name { padding: 9px 11px; border-radius: 11px; background: #f1f4fb; color: var(--muted); font-size: 13px; }
.mail-safety-note { padding: 10px 12px; border-radius: 12px; background: var(--mint-soft); color: #176b61; font-size: 12px; line-height: 1.4; }
.opened-email { display: grid; gap: 10px; text-align: left; }
.opened-email header { display: grid; grid-template-columns: 45px 1fr; gap: 10px; align-items: center; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.opened-email strong, .opened-email small { display: block; }
.opened-email small { margin-top: 3px; color: var(--muted); }
.opened-email p { margin: 0; color: var(--ink); white-space: pre-wrap; }
.opened-email-attachment { padding: 10px 12px; border-radius: 12px; background: #f1f4fb; color: var(--blue-dark); font-size: 13px; font-weight: 700; }
.opened-email-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.opened-email-actions button { min-height: 40px; }
.danger-soft { color: #a31c3a !important; border-color: #efb8c4 !important; }
.email-empty { margin: 28px; color: var(--muted); text-align: center; }
.letter-form { padding: 20px; display: grid; gap: 18px; }
.letter-form label { display: grid; gap: 7px; font-weight: 750; }
.letter-form select, .letter-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 13px; background: #fbfcff; padding: 12px; color: var(--ink); }
.letter-form textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.letter-form label small { text-align: right; color: var(--muted); font-weight: 500; }
.letter-form fieldset { border: 0; padding: 0; margin: 0; }
.letter-form legend { font-weight: 750; margin-bottom: 9px; }
.stamp-row { display: flex; gap: 9px; }
.stamp { width: 52px; height: 60px; border: 2px dashed #b5bfd8; background: white; border-radius: 6px; font-size: 25px; cursor: pointer; }
.stamp.selected { border: 3px solid var(--blue); background: var(--blue-soft); }
.stamp.locked { opacity: .45; cursor: not-allowed; }
.letter-preview-wrap { min-width: 0; padding: 0 10px; }
.preview-label { color: var(--muted); font-size: 13px; text-align: center; }
.envelope { position: relative; height: 370px; max-width: 510px; margin: 0 auto; perspective: 900px; }
.envelope-back { position: absolute; inset: 65px 0 20px; background: #e7bb79; border-radius: 7px 7px 16px 16px; box-shadow: 0 20px 35px #5c4a2e2e; }
.letter-paper { position: absolute; z-index: 2; inset: 15px 42px 75px; background: #fffefa; border: 1px solid #ece3d2; padding: 26px; transform: rotate(-1.2deg); box-shadow: 0 8px 16px #66543a1a; overflow: hidden; }
.letter-paper .to { display: block; color: #735c40; border-bottom: 1px solid #e8dcc9; padding-bottom: 9px; }
.letter-paper p { color: #39405a; line-height: 1.65; white-space: pre-wrap; }
.letter-paper.handwritten p { font-family: "Segoe Print", "Bradley Hand", cursive; font-size: 18px; color: #304c83; }
.signature { position: absolute; right: 25px; bottom: 20px; color: #735c40; font-style: italic; }
.envelope-front { position: absolute; z-index: 3; left: 0; right: 0; bottom: 20px; height: 190px; background: linear-gradient(145deg, #f0c989, #ddb06d); clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%); border-radius: 0 0 16px 16px; }
.preview-stamp { position: absolute; z-index: 4; right: 20px; bottom: 40px; width: 55px; height: 64px; display: grid; place-items: center; background: #fff8e8; border: 3px dashed #a88458; font-size: 29px; transform: rotate(4deg); }
.handwriting-toggle { max-width: 510px; margin: 5px auto 0; padding: 13px 15px; display: flex; align-items: center; gap: 11px; background: white; border: 1px solid var(--line); border-radius: 15px; }
.handwriting-toggle > span { font-size: 25px; color: var(--blue); }
.handwriting-toggle div { flex: 1; }
.handwriting-toggle strong, .handwriting-toggle small { display: block; }
.handwriting-toggle small { color: var(--muted); margin-top: 2px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { position: relative; display: block; width: 46px; height: 27px; background: #bec6da; border-radius: 20px; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 21px; height: 21px; left: 3px; top: 3px; border-radius: 50%; background: white; transition: .2s; }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(19px); }
.mailbox-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 10px 0 18px; }
.mailbox-heading h2 { margin: 0 0 4px; }
.mailbox-heading p { margin: 0; color: var(--muted); }
.letter-grid { display: grid; gap: 12px; }
.letter-card { position: relative; width: 100%; display: grid; grid-template-columns: 65px 1fr auto; gap: 13px; align-items: center; text-align: left; border: 1px solid var(--line); background: white; border-radius: 18px; padding: 15px; box-shadow: 0 7px 20px #263f7a12; cursor: pointer; }
.letter-card.unread { border-left: 5px solid var(--blue); }
.mail-stamp { width: 58px; height: 65px; display: grid; place-items: center; background: #fff8e8; border: 3px dashed #b18d5e; border-radius: 6px; font-size: 28px; }
.letter-card strong, .letter-card small, .letter-card b { display: block; }
.letter-card strong { font-size: 18px; }
.letter-card small { color: var(--muted); margin: 3px 0 7px; }
.letter-card b { font-size: 13px; color: #70593c; }
.letter-card em { color: white; background: #ee5c7d; border-radius: 99px; padding: 5px 8px; font-size: 12px; font-style: normal; }
.sent-letter-card { display: grid; grid-template-columns: 65px 1fr auto; gap: 13px; align-items: center; background: white; border: 1px solid var(--line); border-radius: 18px; padding: 15px; }
.sent-letter-card strong, .sent-letter-card small { display: block; }
.sent-letter-card small { color: var(--muted); margin-top: 3px; }
.sent-letter-card p { margin: 8px 0 0; }
.delivered { color: #176b61; background: var(--mint-soft); border-radius: 99px; padding: 6px 9px; font-size: 12px; font-weight: 750; }
.stamp-album { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.stamp-album article { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 17px 10px; text-align: center; box-shadow: 0 7px 20px #263f7a0d; }
.stamp-album article > span { width: 65px; height: 74px; display: grid; place-items: center; margin: 0 auto 10px; background: #fff8e8; border: 3px dashed #b18d5e; border-radius: 7px; font-size: 31px; }
.stamp-album strong, .stamp-album small { display: block; }
.stamp-album small { color: var(--muted); margin-top: 3px; }
.stamp-album .locked-stamp { opacity: .48; filter: grayscale(1); }

.bottom-nav { display: none; }
.modal-backdrop { position: fixed; z-index: 100; inset: 0; background: #14204488; backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; }
.modal { position: relative; width: min(100%, 420px); background: white; border-radius: 25px; padding: 27px; text-align: center; box-shadow: 0 24px 70px #10182d55; }
.modal-close { position: absolute; right: 13px; top: 10px; border: 0; background: none; font-size: 26px; color: var(--muted); cursor: pointer; }
.modal-icon { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; background: var(--mint-soft); color: #167b6c; font-size: 28px; }
.modal h2 { margin: 8px 0; }
.modal p { color: var(--muted); line-height: 1.5; }
.modal #modal-extra { margin: 12px 0; }
.code-box { background: var(--blue-soft); color: var(--blue-dark); font-size: 25px; font-weight: 850; letter-spacing: 4px; border-radius: 14px; padding: 13px; }
.invite-input-wrap { padding: 4px 0 8px; }
.invite-input { width: 100%; min-height: 50px; border: 2px solid #cbd3e8; border-radius: 13px; text-align: center; color: var(--blue-dark); font-size: 22px; font-weight: 800; letter-spacing: 4px; text-transform: uppercase; }
.safety-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.danger-button { border: 0; min-height: 42px; border-radius: 12px; background: #d62f55; color: white; font-weight: 800; cursor: pointer; }
.opened-letter { background: #fffefa; border: 1px solid #eadfcf; border-radius: 13px; padding: 18px; text-align: left; transform: rotate(-.5deg); }
.opened-letter p { font-family: "Segoe Print", "Bradley Hand", cursive; color: #304c83; line-height: 1.65; }
.opened-letter span { display: block; text-align: right; color: #735c40; font-style: italic; }

.parent-shell { min-height: 100vh; background: radial-gradient(circle at 90% -10%, #dff8f2 0, transparent 30rem), var(--bg); }
.parent-topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; padding: 16px clamp(20px, 6vw, 80px); background: #ffffffdd; backdrop-filter: blur(15px); }
.parent-topbar .brand small { font-size: 12px; color: #176b61; background: var(--mint-soft); border-radius: 99px; padding: 5px 8px; }
.parent-top-actions { display: flex; align-items: center; gap: 10px; }
.parent-nav { height: 54px; display: flex; align-items: stretch; gap: 6px; padding: 0 clamp(20px, 6vw, 80px); background: #ffffffdd; border-bottom: 1px solid var(--line); }
.parent-nav-item { display: flex; align-items: center; gap: 7px; min-width: 112px; padding: 0 17px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-weight: 800; cursor: pointer; }
.parent-nav-item.active { color: var(--blue); border-bottom-color: var(--blue); }
.parent-nav-item em { min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 6px; border-radius: 11px; background: #e8496e; color: white; font-size: 11px; font-style: normal; }
.parent-nav-item em:empty, .parent-nav-item em[data-count="0"] { display: none; }
.parent-view { display: none; }
.parent-view.active { display: block; }
.parent-content { width: min(1100px, 100% - 40px); margin: 0 auto; padding: 42px 0 80px; }
.parent-welcome { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; }
.eyebrow { display: block; color: #267b70; font-size: 12px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 5px; }
.parent-welcome h1 { margin: 0 0 7px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.035em; }
.parent-welcome p { margin: 0; color: var(--muted); }
.parent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.parent-emergency-alert { margin-bottom: 18px; display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 14px; padding: 18px; color: #5f1022; background: #fff0f3; border: 2px solid #ee6d88; border-radius: 22px; box-shadow: 0 12px 30px #9b254031; }
.emergency-pulse { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: #d62f55; color: white; font-size: 30px; font-weight: 900; box-shadow: 0 0 0 8px #f8c4d0; }
.parent-emergency-alert h2 { margin: 2px 0 4px; }
.parent-emergency-alert p { margin: 2px 0; font-size: 14px; }
.emergency-actions { display: grid; gap: 7px; }
.emergency-call { border: 0; min-height: 43px; border-radius: 12px; padding: 0 15px; background: #d62f55; color: white; font-weight: 800; cursor: pointer; }
.parent-card { background: white; border: 1px solid #e5eaf4; border-radius: 23px; box-shadow: var(--shadow); padding: 22px; }
.parent-card h2 { margin: 3px 0 5px; font-size: 21px; }
.child-overview > header { display: flex; align-items: center; gap: 12px; }
.child-overview header div { flex: 1; }
.child-overview header p { color: var(--muted); margin: 0; }
.safe-status { color: #176b61; background: var(--mint-soft); border-radius: 99px; padding: 7px 9px; font-size: 12px; font-weight: 750; }
.parent-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 20px 0; }
.parent-stats div { background: #f5f7fc; border-radius: 14px; padding: 13px 8px; text-align: center; }
.parent-stats strong, .parent-stats span { display: block; }
.parent-stats strong { font-size: 20px; color: var(--blue-dark); }
.parent-stats span { font-size: 12px; color: var(--muted); margin-top: 3px; }
.card-title { display: flex; justify-content: space-between; align-items: center; }
.count-badge { width: 28px; height: 28px; display: grid; place-items: center; color: white; background: #ee5c7d; border-radius: 50%; font-weight: 800; }
.friend-request { text-align: center; }
.request-children { display: flex; align-items: center; justify-content: center; margin: 12px 0 6px; }
.connection-line { width: 50px; color: #9aa6c8; font-size: 24px; }
.friend-request h3 { margin: 8px 0 4px; }
.friend-request > p { color: var(--muted); line-height: 1.45; font-size: 14px; margin: 0 auto 14px; max-width: 420px; }
.request-parent { display: flex; align-items: center; gap: 9px; text-align: left; background: #f5f7fc; border-radius: 14px; padding: 11px; }
.request-parent > span:first-child { font-size: 22px; }
.request-parent strong, .request-parent small { display: block; }
.request-parent small { color: var(--muted); }
.request-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 9px; margin-top: 14px; }
.approved-state { text-align: center; padding: 25px 10px; }
.approved-state > span { display: grid; place-items: center; margin: 0 auto 10px; width: 58px; height: 58px; border-radius: 50%; background: var(--mint-soft); color: #167b6c; font-size: 28px; }
.approved-state p { color: var(--muted); }
.parent-contact-list { display: grid; gap: 8px; margin-top: 14px; }
.parent-contact-list > div { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; background: #f7f8fc; border-radius: 14px; padding: 10px; }
.parent-contact-list strong, .parent-contact-list small { display: block; }
.parent-contact-list small { color: var(--muted); margin-top: 2px; }
.parent-contact-list button { border: 0; background: none; color: var(--muted); }
.safety-settings label { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding: 14px 0; }
.safety-settings label > span:first-child { flex: 1; }
.safety-settings strong, .safety-settings small { display: block; }
.safety-settings small { color: var(--muted); margin-top: 3px; line-height: 1.35; }
.setting-on { color: #176b61; background: var(--mint-soft); padding: 7px 9px; border-radius: 99px; font-size: 12px; font-weight: 750; }
.assistive-card { background: linear-gradient(145deg, #ffffff, #f6fffc); }
.euaid-badge { color: #176b61; background: var(--mint-soft); border: 1px solid #bce8df; border-radius: 99px; padding: 7px 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.assistive-child-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 11px; margin: 17px 0 13px; padding: 12px; background: #f5f7fc; border-radius: 15px; }
.assistive-child-row strong, .assistive-child-row small { display: block; }
.assistive-child-row small { margin-top: 3px; color: var(--muted); }
.access-switch { position: relative; width: 58px; height: 34px; border: 0; border-radius: 18px; background: #b9c0d0; cursor: pointer; transition: background .2s ease; }
.access-switch span { position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: white; box-shadow: 0 2px 6px #24325244; transition: transform .2s ease; }
.access-switch.active { background: var(--mint); }
.access-switch.active span { transform: translateX(24px); }
.access-switch:focus-visible { outline: 3px solid #ffc94f; outline-offset: 3px; }
.entitlement-note { display: grid; grid-template-columns: 34px 1fr; gap: 9px; align-items: start; margin-bottom: 13px; padding: 11px; border: 1px solid #d7eee8; border-radius: 14px; background: #f2fbf8; }
.entitlement-note > span { font-size: 22px; }
.entitlement-note p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.entitlement-note strong { color: #176b61; }
.app-shell.assistive-disabled .chat-accessibility-tools, .app-shell.assistive-disabled .bubble-tts { display: none; }
.mail-control-card { grid-column: 1 / -1; }
.mail-permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 16px 0 13px; }
.mail-permission-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; min-height: 74px; padding: 11px; border-radius: 14px; background: #f6f8fc; }
.mail-permission-row > span:first-child { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: white; font-size: 19px; }
.mail-permission-row strong, .mail-permission-row small { display: block; }
.mail-permission-row small { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.mail-privacy-note { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; margin-bottom: 13px; padding: 12px; border: 1px solid #dce3f4; border-radius: 14px; background: #f8faff; }
.mail-privacy-note > span { font-size: 22px; }
.mail-privacy-note p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.mail-privacy-note strong { color: var(--blue-dark); }
.moderation-steps { display: grid; gap: 8px; text-align: left; }
.moderation-steps p { margin: 0; padding: 9px 11px; border-radius: 11px; background: #f5f7fc; font-size: 13px; line-height: 1.4; }
.moderation-steps b { color: var(--blue-dark); }
.app-shell.mail-teachers-disabled .email-row[data-email-address$="@skola.circle"] { display: none; }
.app-shell.mail-attachments-disabled .attachment-button, .app-shell.mail-attachments-disabled .attachment-name { display: none !important; }
.family-page-heading { align-items: center; }
.family-heading-actions { display: flex; gap: 8px; }
.family-code-card { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 16px; margin-bottom: 18px; background: linear-gradient(135deg, #f9fbff, #f0fbf8); border-color: #cbdcf0; }
.family-code-card p { margin: 3px 0 0; color: var(--muted); line-height: 1.45; }
.family-code-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 18px; background: var(--blue); color: white; font-size: 27px; font-weight: 900; }
.family-members-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.family-member-card { position: relative; overflow: hidden; }
.family-member-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: #8291b8; }
.family-member-card.owner-member::before { background: var(--blue); }
.family-member-card.child-member::before { background: #e65487; }
.family-member-card.trusted-member::before { background: var(--mint); }
.family-member-card > header { display: grid; grid-template-columns: 60px 1fr auto; gap: 12px; align-items: center; }
.family-member-card header p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.member-role { padding: 7px 9px; border-radius: 99px; background: #edf1f8; color: #52617e; font-size: 12px; font-weight: 800; white-space: nowrap; }
.member-role.owner { background: var(--blue-soft); color: var(--blue); }
.member-role.parent { background: #eef6ff; color: #2870ad; }
.member-role.child { background: #fff0f5; color: #b82f61; }
.member-role.trusted { background: var(--mint-soft); color: #176b61; }
.permission-list { display: grid; gap: 7px; margin: 18px 0; padding: 0; list-style: none; color: #4e5d79; font-size: 14px; }
.family-rules { margin-top: 18px; }
.family-role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 15px; }
.family-role-grid > div { display: grid; grid-template-columns: 38px 1fr; gap: 2px 9px; align-items: center; padding: 13px; border-radius: 15px; background: #f6f8fc; }
.family-role-grid > div > span { grid-row: 1 / 3; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: white; font-size: 20px; }
.family-role-grid strong, .family-role-grid small { display: block; }
.family-role-grid small { color: var(--muted); line-height: 1.35; }
.family-permission-editor { display: grid; gap: 8px; margin-top: 14px; text-align: left; }
.family-permission-editor label { display: flex; align-items: center; gap: 9px; padding: 10px; border-radius: 11px; background: #f5f7fc; font-size: 14px; font-weight: 650; }
.family-permission-editor input { width: 19px; height: 19px; accent-color: var(--blue); }
.child-settings-heading { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; margin-bottom: 22px; }
.child-settings-heading h1 { margin: 0 0 5px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.035em; }
.child-settings-heading p { margin: 0; color: var(--muted); }
.child-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.child-settings-grid > .parent-card { min-width: 0; }
.settings-profile-row { display: grid; grid-template-columns: 62px 1fr 1fr; align-items: end; gap: 11px; margin: 16px 0; }
.settings-profile-row label, .time-setting-row label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 750; }
.settings-profile-row input, .settings-profile-row select, .time-setting-row select { width: 100%; min-height: 44px; border: 1px solid #d5dcec; border-radius: 12px; background: #f8f9fc; padding: 0 11px; color: var(--text); font: inherit; }
.settings-choice { display: grid; grid-template-columns: 24px 1fr; gap: 9px; align-items: start; margin-top: 10px; padding: 12px; border: 1px solid #e1e6f1; border-radius: 14px; background: #f8f9fc; cursor: pointer; }
.settings-choice:has(input:checked) { border-color: #8fa6ee; background: var(--blue-soft); }
.settings-choice input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--blue); }
.settings-choice strong, .settings-choice small { display: block; }
.settings-choice small { margin-top: 3px; color: var(--muted); line-height: 1.4; }
.settings-lock-note { margin-top: 12px; padding: 11px 12px; border-radius: 13px; background: var(--mint-soft); color: #176b61; font-size: 13px; line-height: 1.4; }
.settings-switch-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-top: 15px; padding: 13px; border-radius: 14px; background: #f6f8fc; }
.settings-switch-row strong, .settings-switch-row small { display: block; }
.settings-switch-row small { margin-top: 3px; color: var(--muted); line-height: 1.4; }
.time-setting-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.settings-help { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.recipient-setting { display: grid; grid-template-columns: 44px 1fr 24px; gap: 10px; align-items: center; margin-top: 9px; padding: 10px; border-radius: 14px; background: #f7f9fc; }
.recipient-setting strong, .recipient-setting small { display: block; }
.recipient-setting small { margin-top: 2px; color: var(--muted); }
.recipient-setting input { width: 20px; height: 20px; accent-color: var(--blue); }
.notification-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.notification-heading h1 { margin: 0 0 6px; font-size: clamp(28px, 4vw, 40px); }
.notification-heading p { margin: 0; color: var(--muted); }
.notification-filters { display: flex; gap: 7px; margin-bottom: 14px; overflow-x: auto; }
.notification-filters button { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--muted); font-weight: 750; white-space: nowrap; cursor: pointer; }
.notification-filters button.active { border-color: var(--blue); background: var(--blue); color: white; }
.notification-list { display: grid; gap: 11px; }
.notification-item { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; padding: 17px; border: 1px solid #e2e7f2; border-radius: 18px; background: white; box-shadow: 0 7px 20px #29375c0b; }
.notification-item.unread { border-left: 5px solid var(--blue); }
.notification-item.emergency-notification { border: 2px solid #e95f7d; background: #fff0f3; color: #671327; box-shadow: 0 12px 30px #9b254026; }
.notification-item.resolved { opacity: .68; }
.notification-item.filtered-out { display: none; }
.notification-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; background: var(--blue-soft); color: var(--blue-dark); font-size: 18px; font-weight: 900; }
.emergency-notification .notification-icon { border-radius: 50%; background: #d62f55; color: white; font-size: 28px; }
.notification-meta { color: var(--muted); font-size: 12px; font-weight: 750; }
.notification-item h2 { margin: 3px 0 4px; font-size: 18px; }
.notification-item p { margin: 0; color: var(--muted); line-height: 1.42; }
.notification-actions { display: flex; gap: 7px; align-items: center; }
.notification-done { color: #176b61; background: var(--mint-soft); border-radius: 99px; padding: 7px 10px; font-size: 12px; font-weight: 800; }
.family-private { color: #176b61; background: var(--mint-soft); border-radius: 99px; padding: 7px 9px; font-size: 12px; font-weight: 750; }
.parent-family-messages { min-height: 180px; max-height: 260px; overflow: auto; margin: 14px 0; padding: 15px; background: #f7f9fd; border-radius: 16px; display: flex; flex-direction: column; gap: 8px; }
.family-message { max-width: 72%; padding: 9px 11px; border-radius: 14px; line-height: 1.4; }
.family-message small { display: block; margin-top: 3px; font-size: 10px; opacity: .65; }
.family-message.child { align-self: flex-start; background: white; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.family-message.parent { align-self: flex-end; background: var(--blue); color: white; border-bottom-right-radius: 4px; }
.parent-family-form { display: flex; gap: 8px; }
.parent-family-form input { flex: 1; min-width: 0; min-height: 46px; border: 1px solid var(--line); border-radius: 13px; padding: 0 13px; }
.parent-chat-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.parent-chat-heading h1 { margin: 0 0 6px; font-size: clamp(28px, 4vw, 40px); }
.parent-chat-heading p { margin: 0; color: var(--muted); }
.parent-chat-layout { display: grid; grid-template-columns: 330px 1fr; gap: 18px; min-height: 610px; }
.parent-chat-list { padding: 13px; overflow: auto; }
.parent-chat-section + .parent-chat-section { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.parent-chat-section h2 { margin: 5px 9px 7px; color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.parent-chat-contact { width: 100%; display: grid; grid-template-columns: 43px 1fr; gap: 10px; align-items: center; padding: 9px; border: 0; border-radius: 14px; background: transparent; text-align: left; cursor: pointer; }
.parent-chat-contact:hover, .parent-chat-contact.active { background: var(--blue-soft); }
.parent-chat-contact strong, .parent-chat-contact small { display: block; }
.parent-chat-contact small { margin-top: 2px; color: var(--muted); }
.parent-chat-panel { min-width: 0; display: grid; grid-template-rows: auto 1fr auto; padding: 0; overflow: hidden; }
.parent-chat-panel > header { display: flex; align-items: center; gap: 11px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.parent-chat-panel > header > div { flex: 1; }
.parent-chat-panel h2 { margin: 0 0 2px; }
.parent-chat-panel header small { color: var(--muted); }
.parent-chat-panel .parent-family-messages { min-height: 0; max-height: none; margin: 0; border-radius: 0; padding: 20px; }
.parent-chat-panel .parent-family-form { padding: 13px; border-top: 1px solid var(--line); }
.group-builder { display: grid; gap: 8px; text-align: left; }
.group-builder label { display: flex; align-items: center; gap: 9px; padding: 9px; background: #f5f7fc; border-radius: 11px; }
.group-builder input[type="text"] { width: 100%; min-height: 44px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; }
.group-note { color: #176b61; background: var(--mint-soft); border-radius: 11px; padding: 10px; font-size: 12px; line-height: 1.4; }

.sos-overlay { position: fixed; z-index: 150; inset: 0; display: grid; place-items: center; padding: 16px; background: #4c0716e6; }
.sos-panel { width: min(100%, 560px); max-height: calc(100vh - 24px); overflow: auto; background: white; border-radius: 28px; padding: 27px; text-align: center; box-shadow: 0 28px 80px #18010977; }
.sos-shield { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 8px; background: #fff0f3; border-radius: 22px; font-size: 35px; }
.sos-demo-label { display: inline-block; color: #a13a52; background: #fff0f3; padding: 5px 9px; border-radius: 99px; font-size: 12px; font-weight: 800; }
.sos-panel h2 { margin: 10px 0 5px; font-size: 30px; }
.sos-panel > p { color: var(--muted); line-height: 1.45; }
.sos-status { display: flex; align-items: center; gap: 11px; text-align: left; background: #f7f8fc; border-radius: 15px; padding: 12px; margin-top: 8px; }
.sos-status > span { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: var(--mint-soft); color: #176b61; font-weight: 850; }
.sos-status > div { flex: 1; }
.sos-status strong, .sos-status small { display: block; }
.sos-status small { color: var(--muted); margin-top: 2px; }
.sos-call-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; }
.sos-call { min-height: 74px; border: 0; border-radius: 16px; color: white; font-weight: 800; cursor: pointer; display: grid; place-items: center; align-content: center; gap: 3px; }
.sos-call span { font-size: 23px; }
.parent-call { background: var(--blue); }
.emergency-number { background: #d62f55; }
.sos-panel .sos-note { font-size: 13px; color: #83233a; background: #fff0f3; border-radius: 12px; padding: 9px; }

.onboarding-backdrop { position: fixed; z-index: 110; inset: 0; display: grid; place-items: center; padding: 20px; background: #14204488; backdrop-filter: blur(5px); }
.onboarding-card { position: relative; width: min(100%, 570px); max-height: calc(100vh - 30px); overflow: auto; background: white; border-radius: 27px; padding: 26px; box-shadow: 0 24px 70px #10182d55; }
.onboarding-head { display: flex; align-items: center; justify-content: space-between; padding-right: 30px; }
.onboarding-head > span { color: var(--muted); font-size: 13px; font-weight: 700; }
.progress-track { height: 7px; background: #e8ecf5; border-radius: 8px; margin: 20px 0 24px; overflow: hidden; }
.progress-track span { display: block; width: 33.333%; height: 100%; background: linear-gradient(90deg, var(--blue), var(--mint)); border-radius: inherit; transition: width .25s ease; }
.onboarding-step { display: none; }
.onboarding-step.active { display: block; animation: fade .2s ease; }
.onboarding-icon { width: 54px; height: 54px; display: grid; place-items: center; background: var(--blue-soft); border-radius: 17px; font-size: 27px; }
.onboarding-icon.success { background: var(--mint-soft); color: #167b6c; }
.onboarding-step h2 { margin: 14px 0 5px; font-size: 27px; }
.onboarding-step > p { color: var(--muted); line-height: 1.45; margin: 0 0 19px; }
.onboarding-step > label, .setup-grid label { display: grid; gap: 6px; margin-bottom: 13px; font-weight: 750; }
.onboarding-step input, .onboarding-step select { width: 100%; min-height: 46px; border: 1px solid #cbd3e8; border-radius: 12px; padding: 0 12px; background: #fbfcff; }
.setup-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 12px; }
.onboarding-step .consent-check { display: flex; align-items: start; gap: 9px; font-weight: 500; color: var(--muted); line-height: 1.4; }
.consent-check input { width: 20px; min-height: 20px; margin-top: 1px; accent-color: var(--blue); }
.avatar-pick { border: 0; padding: 0; margin: 0 0 14px; }
.avatar-pick legend { font-weight: 750; margin-bottom: 7px; }
.avatar-pick button { width: 50px; height: 50px; margin-right: 7px; border: 2px solid var(--line); border-radius: 50%; background: white; font-weight: 800; cursor: pointer; }
.avatar-pick button.selected { color: white; background: #684cd0; border-color: #684cd0; outline: 3px solid #d9d1ff; }
.family-summary, .privacy-summary { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 13px; margin-top: 12px; }
.family-summary > div, .privacy-summary > div { flex: 1; }
.family-summary strong, .family-summary small, .privacy-summary strong, .privacy-summary small { display: block; }
.family-summary small, .privacy-summary small { color: var(--muted); margin-top: 3px; line-height: 1.35; }
.privacy-summary > span { font-size: 25px; }
.onboarding-actions { display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); margin-top: 22px; padding-top: 17px; }

.post-composer-backdrop { position: fixed; z-index: 130; inset: 0; display: grid; place-items: center; padding: 18px; background: #14204499; backdrop-filter: blur(5px); }
.post-composer-panel { width: min(100%, 650px); max-height: calc(100vh - 30px); overflow: auto; background: white; border-radius: 25px; padding: 22px; box-shadow: 0 24px 70px #10182d55; }
.post-composer-panel > header { display: flex; align-items: center; justify-content: space-between; }
.post-composer-panel h2 { margin: 0; font-size: 27px; }
.post-composer-panel > header > button { border: 0; background: #f1f3f8; width: 40px; height: 40px; border-radius: 12px; color: var(--muted); font-size: 25px; cursor: pointer; }
.post-author { display: flex; align-items: center; gap: 10px; margin: 17px 0 12px; }
.post-author strong, .post-author small { display: block; }
.post-author small { color: var(--muted); margin-top: 2px; }
#post-text { width: 100%; min-height: 125px; resize: vertical; border: 0; background: #f7f8fc; border-radius: 15px; padding: 14px; font-size: 17px; line-height: 1.5; }
.post-media-preview { margin-top: 11px; border-radius: 16px; overflow: hidden; background: #eef2fb; }
.post-media-preview img { display: block; width: 100%; max-height: 340px; object-fit: contain; }
.drawing-wrap { margin-top: 11px; padding: 10px; background: #f2f5fb; border-radius: 16px; }
.drawing-wrap canvas { display: block; width: 100%; height: auto; aspect-ratio: 700 / 380; background: white; border: 1px solid var(--line); border-radius: 11px; touch-action: none; }
.drawing-wrap > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 9px; }
.drawing-wrap label { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.composer-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.tool-button { border: 1px solid var(--line); background: white; min-height: 42px; border-radius: 12px; padding: 0 13px; display: inline-flex; align-items: center; color: var(--blue); font-weight: 750; cursor: pointer; }
.post-composer-panel > footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 14px; }
.post-composer-panel > footer span { color: var(--muted); font-size: 13px; }

@media (max-width: 850px) {
  .landing-header { width: min(100% - 30px, 720px); min-height: 82px; }
  .landing-header nav a { display: none; }
  .landing-header nav { gap: 0; }
  .landing-hero { width: min(100% - 30px, 720px); min-height: 0; padding: 55px 0 85px; grid-template-columns: 1fr; gap: 20px; text-align: center; }
  .landing-hero::before { right: -440px; top: 360px; }
  .hero-copy > p { margin-inline: auto; }
  .hero-actions, .hero-trust { justify-content: center; }
  .circle-preview { min-height: 520px; margin-top: 10px; }
  .floating-message { left: 2%; }
  .floating-shield { right: 1%; }
  .landing-section { width: min(100% - 30px, 720px); padding: 80px 0 95px; }
  .section-intro { display: block; text-align: center; }
  .section-intro .landing-eyebrow { margin-bottom: 14px; }
  .feature-grid { grid-template-columns: 1fr; }
  .landing-feature { min-height: 0; }
  .landing-feature:nth-child(2) { transform: none; }
  .landing-feature h3 { margin-top: 28px; }
  .safety-story { width: min(100% - 30px, 720px); padding: 42px; grid-template-columns: 130px 1fr; gap: 35px; }
  .safety-symbol { width: 130px; height: 130px; }
  .safety-story ul { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
  .landing-footer { width: min(100% - 30px, 720px); grid-template-columns: 1fr auto; }
  .landing-footer p { display: none; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { height: 102px; padding: 32px 18px 13px; }
  .mobile-brand { display: flex; }
  .mobile-brand > span:last-child { display: none; }
  .page-heading { flex: 1; }
  .page-heading h1 { font-size: 20px; }
  .page-heading p { display: none; }
  .content { width: min(100% - 28px, 700px); padding-top: 4px; }
  .bottom-nav { position: fixed; z-index: 40; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); height: 68px; display: grid; grid-template-columns: repeat(4, 1fr); background: #ffffffef; backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 21px; box-shadow: 0 12px 32px #23345b2b; padding: 6px; }
  .bottom-nav .nav-item { display: grid; justify-items: center; align-content: center; min-height: 0; padding: 2px; gap: 1px; border-radius: 14px; }
  .bottom-nav .nav-item span { font-size: 21px; }
  .bottom-nav .nav-item small { font-size: 11px; }
  .bottom-nav .nav-item em { position: absolute; top: 2px; right: 23%; width: 18px; min-width: 18px; height: 18px; }
  .friend-grid { grid-template-columns: repeat(2, 1fr); }
  .child-family-list { grid-template-columns: 1fr; }
  .family-members-grid { grid-template-columns: 1fr; }
  .family-role-grid { grid-template-columns: 1fr; }
  .child-settings-grid { grid-template-columns: 1fr; }
  .child-settings-heading { grid-template-columns: auto 1fr; }
  .child-settings-heading .primary { grid-column: 1 / -1; }
  .family-code-card { grid-template-columns: 58px 1fr; }
  .family-code-card .secondary { grid-column: 2; justify-self: start; }
  .chat-layout.active { grid-template-columns: 1fr; height: auto; }
  .conversation-list { display: flex; overflow-x: auto; gap: 8px; box-shadow: none; border: 0; background: transparent; padding: 0 0 8px; }
  .conversation-list .search { display: none; }
  .conversation-section-label { min-width: max-content; align-self: center; margin: 0 2px; }
  .conversation { min-width: 185px; background: white; }
  .create-chat-group { min-width: 170px; width: auto; margin: 0; padding: 0 12px; }
  .chat-panel { height: calc(100vh - 235px); min-height: 460px; }
  .mail-layout { grid-template-columns: 1fr; }
  .circlemail-layout { grid-template-columns: 1fr; min-height: 0; }
  .circlemail-folders { display: flex; gap: 7px; overflow-x: auto; }
  .circlemail-new, .email-folder { min-width: max-content; width: auto; margin: 0; padding: 0 13px; }
  .circlemail-lesson { display: none; }
  .letter-preview-wrap { grid-row: 1; }
  .stamp-album { grid-template-columns: repeat(3, 1fr); }
  .parent-grid { grid-template-columns: 1fr; }
  .mail-permission-grid { grid-template-columns: 1fr; }
  .parent-chat-layout { grid-template-columns: 1fr; min-height: 0; }
  .parent-chat-list { display: flex; gap: 8px; overflow-x: auto; }
  .parent-chat-section { display: contents; }
  .parent-chat-section + .parent-chat-section { border: 0; margin: 0; padding: 0; }
  .parent-chat-section h2 { min-width: max-content; align-self: center; writing-mode: vertical-rl; transform: rotate(180deg); }
  .parent-chat-contact { min-width: 195px; background: white; }
  .parent-chat-panel { min-height: 500px; }
  .notification-item { grid-template-columns: 48px 1fr; }
  .notification-actions, .notification-done { grid-column: 2; justify-self: start; }
  .parent-emergency-alert { grid-template-columns: 48px 1fr; }
  .emergency-pulse { width: 46px; height: 46px; }
  .emergency-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .prototype-note { top: 5px; }
  .landing-header { width: calc(100% - 24px); padding-top: 15px; }
  .landing-header .brand { font-size: 20px; }
  .landing-login-link { min-height: 40px; padding: 0 13px; }
  .landing-hero { width: calc(100% - 28px); padding: 42px 0 62px; }
  .hero-copy h1 { font-size: clamp(40px, 14vw, 56px); }
  .hero-copy > p { font-size: 17px; line-height: 1.55; }
  .hero-actions { display: grid; }
  .hero-trust { display: grid; gap: 8px; }
  .circle-preview { min-height: 445px; }
  .preview-glow { width: 320px; height: 320px; }
  .main-preview-card { min-height: 330px; padding: 20px 15px; }
  .preview-person { width: 53px; height: 53px; }
  .preview-person.person-main { width: 74px; height: 74px; }
  .floating-message { left: 0; bottom: 8px; width: 240px; }
  .floating-shield { right: -8px; top: 5px; width: 196px; }
  .landing-section { width: calc(100% - 28px); padding: 65px 0 75px; }
  .section-intro h2 { font-size: 36px; }
  .landing-feature { padding: 25px; border-radius: 22px; }
  .safety-story { width: calc(100% - 28px); margin-bottom: 55px; padding: 30px 24px; grid-template-columns: 1fr; text-align: center; }
  .safety-symbol { margin: 0 auto; }
  .safety-story ul { grid-column: auto; grid-template-columns: 1fr; text-align: left; }
  .landing-footer { width: calc(100% - 28px); min-height: 100px; }
  .landing-footer .brand { font-size: 19px; }
  .landing-footer > button { text-align: right; }
  .login-shell { padding: 42px 10px 12px; }
  .login-card { border-radius: 24px; padding: 24px 17px; }
  .welcome-art { transform: scale(.88); margin-top: 12px; height: 105px; }
  .role-pick { grid-template-columns: 1fr; }
  .role { grid-template-columns: 42px 1fr; text-align: left; align-items: center; }
  .role span { grid-row: 1 / 3; }
  .login-credentials { grid-template-columns: 1fr; }
  .page-heading h1 { font-size: 18px; }
  .top-actions .icon-button:not(.sos-compact) { display: none; }
  .content { width: min(100% - 20px, 480px); }
  .composer { padding: 11px; }
  .composer > button:nth-of-type(1) { font-size: 14px; }
  .paper-art { height: 205px; }
  .post footer span { display: none; }
  .friend-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .friend-card { padding: 17px 9px 13px; }
  .friend-card .secondary { font-size: 13px; padding: 0 8px; }
  .section-actions { align-items: stretch; gap: 8px; }
  .section-actions .primary { padding: 0 12px; }
  .chat-panel { height: calc(100vh - 225px); }
  .chat-accessibility-tools { display: grid; grid-template-columns: 1fr 1fr; }
  .voice-hint { font-size: 12px; }
  .voice-action { padding: 0 8px; }
  .voice-status { grid-column: 1 / -1; text-align: center; min-height: 0; }
  .messages { padding: 13px; }
  .bubble { max-width: 88%; }
  .letter-form { padding: 16px; }
  .mail-mode-switch { gap: 7px; }
  .mail-mode-switch button { grid-template-columns: 34px 1fr; padding: 9px; }
  .mail-mode-switch button > span { width: 34px; height: 34px; }
  .mail-mode-switch button small { display: none; }
  .circlemail-security { grid-template-columns: 38px 1fr; padding: 11px; }
  .circlemail-address { grid-column: 2; justify-self: start; }
  .circlemail-form-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .circlemail-assistive { display: grid; grid-template-columns: 1fr 1fr; }
  .circlemail-assistive > span { grid-column: 1 / -1; margin: 0; text-align: center; }
  .attachment-button { grid-column: 1 / -1; justify-content: center; }
  .mailbox-toolbar { grid-template-columns: 1fr auto !important; }
  .mailbox-toolbar .email-search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .opened-email-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .email-row { grid-template-columns: 42px 1fr; padding: 12px; }
  .email-row time { grid-column: 2; }
  .letter-preview-wrap { padding: 0; }
  .envelope { height: 320px; }
  .envelope-back { top: 55px; }
  .letter-paper { inset: 8px 22px 72px; padding: 18px; }
  .envelope-front { height: 165px; }
  .handwriting-toggle small { display: none; }
  .stamp-album { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .letter-card, .sent-letter-card { grid-template-columns: 55px 1fr; }
  .letter-card > em, .sent-letter-card > .delivered { grid-column: 2; justify-self: start; }
  .mail-stamp { width: 52px; height: 59px; }
  .post-composer-backdrop { padding: 7px; }
  .post-composer-panel { padding: 17px 13px; border-radius: 21px; }
  .composer-tools { display: grid; grid-template-columns: repeat(3, 1fr); }
  .tool-button { justify-content: center; padding: 0 7px; font-size: 13px; }
  .login-detail input { width: 74px; }
  .parent-topbar { padding: 14px; }
  .parent-nav { padding: 0 10px; }
  .parent-nav-item { flex: 1; justify-content: center; min-width: 0; padding: 0 5px; }
  .parent-nav-item { font-size: 12px; gap: 4px; }
  .parent-topbar .brand small, .parent-top-actions .secondary { display: none; }
  .parent-content { width: min(100% - 20px, 500px); padding-top: 25px; }
  .parent-welcome { align-items: stretch; flex-direction: column; }
  .family-heading-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .family-heading-actions .primary { grid-column: 1 / -1; }
  .family-member-card > header { grid-template-columns: 54px 1fr; }
  .family-member-card .member-role { grid-column: 2; justify-self: start; }
  .family-code-card { grid-template-columns: 48px 1fr; padding: 15px; }
  .family-code-icon { width: 48px; height: 48px; border-radius: 15px; }
  .child-family-card { padding: 15px; }
  .child-family-heading { align-items: center; }
  .child-settings-heading { grid-template-columns: 1fr; }
  .child-settings-heading .secondary, .child-settings-heading .primary { width: 100%; grid-column: 1; }
  .settings-profile-row { grid-template-columns: 58px 1fr; }
  .settings-profile-row label:last-child { grid-column: 2; }
  .parent-chat-heading { align-items: stretch; flex-direction: column; }
  .notification-heading { align-items: stretch; flex-direction: column; }
  .notification-heading .secondary { width: 100%; }
  .notification-item { padding: 14px 12px; gap: 10px; }
  .notification-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .parent-chat-heading .primary { width: 100%; }
  .parent-welcome .primary { width: 100%; }
  .parent-card { padding: 17px; }
  .child-overview > header { flex-wrap: wrap; }
  .safe-status { margin-left: 86px; }
  .request-actions { grid-template-columns: 1fr; }
  .setup-grid { grid-template-columns: 1fr; gap: 0; }
  .onboarding-backdrop { padding: 8px; }
  .onboarding-card { padding: 21px 16px; border-radius: 22px; }
  .sos-panel { padding: 22px 15px; border-radius: 22px; }
  .sos-call-grid { grid-template-columns: 1fr; }
  .parent-family-form { align-items: stretch; }
  .parent-family-form .primary { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }

.install-app {
  width: 100%;
  min-height: 58px;
  margin-top: 11px;
  padding: 8px 14px;
  border: 1px solid #cad5ff;
  border-radius: 16px;
  background: #f3f6ff;
  color: #263c91;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  cursor: pointer;
}
.install-app > span:first-child { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: #3155d9; color: white; font-size: 22px; }
.install-app > span:last-child { display: grid; text-align: left; gap: 2px; }
.install-app strong { font-size: 15px; }
.install-app small { color: #6673a6; font-size: 12px; }
.install-app.hidden { display: none; }
