:root {
  --ink: #1a1a1a;
  --muted: #5d695f;
  --paper: #f5f8ef;
  --surface: #ffffff;
  --surface-2: #edf6e8;
  --green: #338c26;
  --green-dark: #236a1b;
  --mint: #e3f1c9;
  --gold: #8fd400;
  --coral: #d66d4d;
  --blue: #2b6f58;
  --line: #d4e2cb;
  --shadow: 0 14px 40px rgba(51, 140, 38, .13);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
a { color: inherit; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--ink); color: white; border-radius: 10px; }
.skip-link:focus { top: 12px; }

.app-shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; padding: 12px clamp(16px, 4vw, 56px); border-bottom: 1px solid rgba(223,231,225,.9); background: rgba(255,253,248,.95); backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: 11px; border: 0; background: transparent; color: var(--ink); padding: 0; text-align: left; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; overflow: hidden; border-radius: 14px; background: var(--green); box-shadow: inset 0 -5px 0 rgba(0,0,0,.1); }
.brand-logo { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand strong { display: block; font-family: Georgia, serif; font-size: 21px; line-height: 1; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.secretary-link { color: var(--green); font-size: 12px; font-weight: 800; text-decoration: none; }
.secretary-link:hover { color: var(--coral); text-decoration: underline; }
.menu-button { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--mint); color: var(--green-dark); font-weight: 800; }
.user-chip { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 5px 10px 5px 5px; }
.user-chip span:last-child { font-size: 13px; font-weight: 700; }

.public-nav { display: flex; gap: 4px; align-items: center; }
.public-nav button { border: 0; background: transparent; color: var(--muted); padding: 9px 10px; border-radius: 10px; font-weight: 650; font-size: 13px; }
.public-nav button:hover, .public-nav button.active { background: var(--surface-2); color: var(--green-dark); }
.private-layout { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.sidebar { border-right: 1px solid var(--line); background: var(--paper); padding: 24px 14px; }
.sidebar-header { padding: 0 12px 16px; }
.sidebar-kicker, .eyebrow { color: var(--green); font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.sidebar-header h2 { margin: 7px 0 0; font-family: Georgia, serif; font-size: 23px; }
.side-nav { display: grid; gap: 3px; }
.side-nav button { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 44px; border: 0; border-radius: 12px; padding: 10px 12px; background: transparent; color: var(--muted); text-align: left; font-weight: 700; }
.side-nav button:hover, .side-nav button.active { background: var(--mint); color: var(--green-dark); }
.nav-icon { display: grid; place-items: center; width: 22px; font-size: 17px; }
.sidebar-footer { margin-top: 25px; padding: 13px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.45; }
.main { min-width: 0; padding: clamp(20px, 4vw, 46px) clamp(16px, 4vw, 56px) 60px; }
.public-main { padding-top: 0; }
.page-wrap { max-width: 1240px; margin: 0 auto; }

.hero { display: grid; grid-template-columns: 1.12fr .88fr; gap: clamp(25px, 6vw, 78px); align-items: center; max-width: 1240px; margin: 0 auto; padding: clamp(52px, 9vw, 110px) 0 80px; }
.hero h1 { max-width: 700px; margin: 12px 0 20px; font-family: Georgia, serif; font-size: clamp(42px, 6vw, 76px); line-height: .98; letter-spacing: -.045em; }
.hero h1 em { color: var(--coral); font-style: normal; }
.hero p { max-width: 590px; margin: 0; color: var(--muted); font-size: clamp(16px, 2vw, 19px); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-art { position: relative; min-height: 420px; border-radius: 34px; overflow: hidden; background: var(--green); box-shadow: var(--shadow); }
.hero-art::before, .hero-art::after { content: ""; position: absolute; border-radius: 50%; }
.hero-art::before { width: 270px; height: 270px; right: -50px; top: -55px; background: var(--gold); opacity: .9; }
.hero-art::after { width: 190px; height: 190px; left: -50px; bottom: -70px; background: var(--coral); opacity: .8; }
.art-card { position: absolute; z-index: 1; border: 1px solid rgba(255,255,255,.28); border-radius: 22px; background: rgba(255,255,255,.12); color: #fff; backdrop-filter: blur(12px); }
.art-main { inset: 82px 46px 65px 43px; padding: 27px; }
.hero-logo { display: block; width: 104px; height: 104px; border-radius: 27px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.art-main .cross { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 19px; background: var(--gold); color: var(--green); font-size: 37px; font-weight: 900; }
.art-main h3 { margin: 35px 0 9px; font-family: Georgia, serif; font-size: 30px; }
.art-main p { color: rgba(255,255,255,.75); font-size: 13px; line-height: 1.5; }
.art-float { padding: 13px 16px; font-weight: 750; font-size: 13px; }
.art-one { right: 18px; top: 48px; transform: rotate(5deg); }
.art-two { left: 21px; bottom: 30px; transform: rotate(-5deg); }

.section { padding: 70px 0; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 26px; }
.section h2, .page-title h1 { margin: 9px 0 0; font-family: Georgia, serif; font-size: clamp(30px, 4vw, 48px); line-height: 1.05; letter-spacing: -.035em; }
.section-heading p { max-width: 500px; margin: 0; color: var(--muted); line-height: 1.6; }
.feature-grid, .stage-grid, .educator-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card, .stage-card, .educator-card, .card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 4px 20px rgba(24,58,50,.04); }
.feature-card { padding: 23px; }
.feature-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; margin-bottom: 20px; background: var(--surface-2); font-size: 21px; }
.feature-card h3, .stage-card h3, .educator-card h3 { margin: 0 0 8px; font-size: 18px; }
.feature-card p, .stage-card p, .educator-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.stage-card { padding: 22px; }
.stage-age { display: inline-block; margin-bottom: 20px; padding: 5px 9px; border-radius: 99px; background: var(--mint); color: var(--green-dark); font-size: 12px; font-weight: 800; }
.educator-card { display: flex; gap: 14px; padding: 18px; align-items: flex-start; }
.portrait { display: grid; place-items: center; flex: 0 0 auto; width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(135deg, var(--gold), var(--coral)); color: white; font-weight: 850; }
.placeholder { border: 1px dashed #b7c9bf; border-radius: 12px; padding: 10px 12px; background: #f6faf6; color: var(--muted); font-size: 12px; }
.public-footer { margin-top: 30px; padding: 30px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.public-footer-inner { display: flex; justify-content: space-between; gap: 20px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 13px; }
.footer-links a { color: var(--green); font-weight: 750; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.source-line { margin-top: 18px !important; color: var(--green) !important; font-size: 12px !important; font-weight: 800; }
.source-note { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface); color: var(--muted); font-size: 12px; line-height: 1.55; }
.source-dot { display: grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--mint); color: var(--green-dark); font-weight: 900; }
.compact-hero { padding-bottom: 65px; }
.identity-card { display: grid; justify-items: start; align-content: center; min-height: 280px; }
.identity-card h3 { margin: 10px 0 5px; font-family: Georgia, serif; font-size: 28px; }
.identity-card p { margin: 0; color: var(--muted); font-size: 13px; }
.identity-logo, .contact-logo { display: block; width: 90px; height: 90px; border-radius: 24px; object-fit: cover; }
.contact-logo { width: 64px; height: 64px; border-radius: 18px; }

.page-title { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 26px; }
.page-title p { max-width: 640px; margin: 10px 0 0; color: var(--muted); line-height: 1.5; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid transparent; border-radius: 12px; padding: 10px 15px; font-weight: 800; font-size: 13px; transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green); color: white; }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { border-color: var(--line); background: var(--surface); color: var(--green-dark); }
.btn-quiet { border-color: transparent; background: var(--surface-2); color: var(--green-dark); }
.btn-danger { border-color: #f0c8c0; background: #fff5f2; color: #a04e41; }
.btn-small { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.role-switcher { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.role-switcher button { border: 0; border-radius: 9px; background: transparent; color: var(--muted); padding: 8px 10px; font-size: 12px; font-weight: 800; }
.role-switcher button.active { background: var(--green); color: white; }
.dev-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: -12px 0 28px; border: 1px solid #f0d6a6; border-radius: 14px; padding: 11px 14px; background: #fff7e7; color: #74592f; font-size: 12px; line-height: 1.45; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 24px; }
.stat-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--surface); }
.stat-card .stat-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.stat-card strong { display: block; margin-top: 7px; font-family: Georgia, serif; font-size: 31px; }
.stat-card small { display: block; margin-top: 6px; color: var(--green); font-size: 11px; font-weight: 700; }
.dashboard-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; }
.card { padding: 21px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.card-header h2, .card-header h3 { margin: 0; font-size: 17px; }
.card-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.list { display: grid; gap: 9px; }
.list-row { display: flex; justify-content: space-between; gap: 15px; align-items: center; border: 1px solid var(--line); border-radius: 13px; padding: 12px 13px; background: var(--surface); }
.list-row-main { min-width: 0; }
.list-row strong, .list-row span { display: block; }
.list-row strong { font-size: 13px; }
.list-row span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.list-row time { flex: 0 0 auto; color: var(--green); font-size: 12px; font-weight: 800; }
.tag { display: inline-flex; align-items: center; width: max-content; border-radius: 99px; padding: 5px 8px; background: var(--surface-2); color: var(--green-dark); font-size: 11px; font-weight: 800; }
.tag.gold { background: #fff0cf; color: #825d1d; }
.tag.coral { background: #ffebe6; color: #995246; }
.empty-state { border: 1px dashed #b7c9bf; border-radius: 14px; padding: 22px; background: #f9fcf8; color: var(--muted); text-align: center; font-size: 13px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters select, .search-input { min-height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 8px 10px; }
.calendar-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.calendar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.calendar-head h2 { margin: 0; font-family: Georgia, serif; font-size: 25px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calendar-label { padding: 6px 4px; color: var(--muted); font-size: 10px; font-weight: 800; text-align: center; text-transform: uppercase; }
.calendar-day { position: relative; min-height: 72px; border: 1px solid var(--line); border-radius: 11px; padding: 7px; background: var(--surface); text-align: left; }
.calendar-day.muted { opacity: .38; }
.calendar-day.today { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.calendar-day.selected { background: var(--mint); border-color: var(--green-dark); box-shadow: inset 0 0 0 2px var(--green); }
.calendar-day.has-events { background: #fffaf0; }
.calendar-day .day-number { display: block; font-size: 12px; font-weight: 800; }
.calendar-day .day-dot { display: block; width: 7px; height: 7px; margin-top: 10px; border-radius: 50%; background: var(--coral); }
.calendar-day .day-count { position: absolute; right: 7px; bottom: 6px; color: var(--green-dark); font-size: 11px; font-weight: 900; }
.calendar-day .day-empty { display: block; margin-top: 10px; color: var(--line); font-size: 12px; }
.calendar-help, .communication-note { display: flex; align-items: flex-start; gap: 10px; margin: -12px 0 18px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 1.5; }
.calendar-help .support-icon, .communication-note .support-icon { flex: 0 0 auto; }
.calendar-detail { min-height: 100%; }
.selected-events { display: grid; gap: 12px; }
.selected-event { border-left: 4px solid var(--green); border-radius: 12px; padding: 13px; background: var(--surface-2); }
.selected-event h3 { margin: 10px 0 5px; font-size: 16px; }
.selected-event p { margin: 5px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.reminder-status { display: inline-flex; margin-top: 4px; border-radius: 999px; padding: 5px 8px; background: #e9f3e8; color: var(--green-dark); font-size: 11px; font-weight: 800; }
.calendar-list-card { margin-top: 16px; }
.event-card { display: grid; gap: 12px; border-left: 4px solid var(--coral); border-radius: 13px; background: var(--surface-2); padding: 14px; }
.event-card h3 { margin: 0; font-size: 15px; }
.event-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.event-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.event-list { display: grid; gap: 10px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
th { background: var(--surface-2); color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.permission-note { display: flex; gap: 10px; align-items: flex-start; border-radius: 13px; padding: 13px; background: #f1f6f1; color: var(--muted); font-size: 12px; line-height: 1.5; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.album-card { min-height: 160px; position: relative; overflow: hidden; border-radius: 17px; padding: 17px; color: white; background: linear-gradient(135deg, var(--green), #4f8776); }
.album-card:nth-child(2) { background: linear-gradient(135deg, #b67159, #dfaa73); }
.album-card:nth-child(3) { background: linear-gradient(135deg, #557c8d, #9bbdc1); }
.album-card:nth-child(4) { background: linear-gradient(135deg, #6a5b80, #a49ac6); }
.album-card::after { content: "✦"; position: absolute; right: 18px; top: 11px; font-size: 50px; opacity: .22; }
.album-card h3 { margin: 69px 0 5px; font-size: 17px; }
.album-card p { margin: 0; color: rgba(255,255,255,.82); font-size: 12px; }
.photo-note { margin-top: 16px; }

.messages-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 510px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.conversation-list { border-right: 1px solid var(--line); padding: 10px; }
.conversation { display: block; width: 100%; border: 0; border-radius: 12px; background: transparent; padding: 13px 12px; text-align: left; }
.conversation:hover, .conversation.active { background: var(--surface-2); }
.conversation strong { display: block; font-size: 13px; }
.conversation span { display: block; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.chat-panel { display: flex; min-width: 0; flex-direction: column; }
.chat-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 16px 18px; }
.chat-header h2 { margin: 0; font-size: 16px; }
.chat-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.chat-messages { display: grid; align-content: start; gap: 10px; flex: 1; min-height: 300px; padding: 20px; background: #fbfaf6; }
.message { max-width: 75%; border-radius: 14px 14px 14px 4px; padding: 11px 13px; background: white; box-shadow: 0 4px 12px rgba(24,58,50,.05); }
.message.mine { justify-self: end; border-radius: 14px 14px 4px 14px; background: var(--mint); }
.message p { margin: 0; font-size: 13px; line-height: 1.45; }
.message time { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.chat-composer { display: flex; gap: 8px; border-top: 1px solid var(--line); padding: 13px; }
.chat-composer input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }

.profile-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 16px; }
.family-welcome { display: flex; justify-content: space-between; align-items: center; gap: 24px; border-left: 5px solid var(--green); }
.family-welcome h2 { margin: 8px 0 5px; font-family: Georgia, serif; font-size: 27px; }
.family-welcome p { margin: 0; max-width: 570px; color: var(--muted); line-height: 1.55; }
.family-quick-actions { display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)); gap: 8px; min-width: 390px; }
.family-dashboard-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; margin-top: 16px; }
.family-event-list { display: grid; gap: 12px; }
.family-event { display: flex; align-items: flex-start; gap: 13px; border: 1px solid var(--line); border-radius: 14px; padding: 13px; }
.family-event-date { display: grid; place-items: center; min-width: 48px; min-height: 48px; border-radius: 13px; background: var(--gold); color: var(--green-dark); }
.family-event-date strong { font-size: 20px; line-height: 1; }
.family-event-date span { font-size: 10px; font-weight: 800; text-transform: uppercase; }
.family-event h3 { margin: 0 0 4px; font-size: 15px; }
.family-event p { margin: 3px 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.family-support, .support-card { display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; border: 1px solid #d8e5d6; background: #f1f6f1; }
.support-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: var(--green); color: white; font-weight: 900; }
.family-support h2 { margin: 0 0 4px; font-size: 16px; }
.family-support p { margin: 0; color: var(--muted); line-height: 1.55; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.support-card { flex-wrap: wrap; align-items: center; }
.support-card strong, .support-card span { display: block; }
.support-card span { flex: 1; min-width: 220px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.template-card { margin-bottom: 16px; }
.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.template-button { display: grid; gap: 6px; min-height: 100px; border: 1px solid var(--line); border-radius: 13px; padding: 12px; background: var(--surface-2); color: var(--ink); text-align: left; }
.template-button:hover, .template-button:focus-visible { border-color: var(--green); background: var(--mint); }
.template-button span { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.communication-note { margin: 0 0 16px; }
.communication-note p { margin: 3px 0 0; }
.settings-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 16px; }
.settings-form { margin-top: 4px; }
.setting-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 13px; padding: 13px; cursor: pointer; }
.setting-row:hover { background: var(--surface-2); }
.setting-row strong, .setting-row small { display: block; }
.setting-row small { max-width: 360px; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.setting-row input { width: 20px; height: 20px; flex: 0 0 20px; accent-color: var(--green); }
.stage-setting { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.stage-setting:first-child { border-top: 0; padding-top: 0; }
.stage-setting-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.integration-card { margin-top: 16px; }
.integration-list { display: grid; gap: 10px; }
.integration-list > div { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 11px 0; }
.integration-list > div:last-child { border-bottom: 0; }
.integration-list span:not(.tag) { color: var(--muted); font-size: 12px; line-height: 1.45; }
.profile-hero { display: flex; align-items: center; gap: 15px; border-radius: 17px; padding: 20px; background: var(--green); color: white; }
.profile-hero .avatar { background: var(--gold); color: var(--green); }
.profile-hero h2 { margin: 0; font-family: Georgia, serif; font-size: 25px; }
.profile-hero p { margin: 4px 0 0; color: rgba(255,255,255,.75); font-size: 12px; }
.detail-list { display: grid; gap: 1px; margin: 0; }
.detail-list div { display: flex; justify-content: space-between; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.detail-list div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: 12px; }
.detail-list dd { margin: 0; font-size: 13px; font-weight: 700; text-align: right; }
.children-list { display: grid; gap: 10px; }
.child-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 13px; padding: 13px; }
.child-initial { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--gold); color: var(--green-dark); font-weight: 900; }
.child-silhouette { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px; background: var(--gold); color: var(--green-dark); }
.child-silhouette svg { display: block; width: 25px; height: 25px; fill: currentColor; }
.child-silhouette svg path { stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.child-card strong { display: block; font-size: 13px; }
.child-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

.modal-backdrop { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(21,45,39,.48); }
.modal { width: min(100%, 520px); max-height: min(740px, 90vh); overflow: auto; border-radius: 20px; background: var(--surface); box-shadow: 0 20px 80px rgba(0,0,0,.2); padding: 22px; }
.modal.modal-wide { width: min(1120px, calc(100vw - 32px)); max-height: min(900px, calc(100vh - 32px)); padding: 26px; }
.modal-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.modal h2 { margin: 0; font-family: Georgia, serif; font-size: 27px; }
.close-button { width: 34px; height: 34px; border: 0; border-radius: 9px; background: var(--surface-2); color: var(--green-dark); }
.form-grid { display: grid; gap: 13px; }
.educator-settings-form { width: min(100%, 900px); margin: 0 auto; text-align: left; }
.educator-settings-form .permission-note, .educator-settings-form .field, .educator-settings-form .check-row { text-align: left; }
.educator-settings-form .permission-check-grid { justify-items: stretch; text-align: left; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; }
.field label { color: var(--muted); font-size: 12px; font-weight: 750; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fffefa; color: var(--ink); padding: 10px 11px; }
.field textarea { min-height: 95px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 7px; }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: grid; gap: 8px; max-width: min(360px, calc(100vw - 36px)); }
.toast { border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 12px; padding: 12px 14px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); font-size: 13px; }
.role-choice-grid { display: grid; gap: 10px; }
.role-choice { display: flex; align-items: center; gap: 13px; width: 100%; border: 1px solid var(--line); border-radius: 15px; padding: 14px; background: var(--surface-2); color: var(--ink); text-align: left; transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.role-choice:hover, .role-choice:focus-visible { border-color: var(--green); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(24,58,50,.08); }
.role-choice-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px; background: var(--green); color: white; font-weight: 900; }
.role-choice-icon svg { width: 25px; height: 25px; display: block; }
.role-choice strong, .role-choice small { display: block; }
.role-choice small { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.access-intro p { margin: 0 0 14px; color: var(--muted); line-height: 1.55; }
.form-hint { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.modal-error { min-height: 18px; margin: 0; color: #9c3e35; font-size: 12px; line-height: 1.45; }
.consent-field label { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.consent-field input { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; accent-color: var(--green); }
.consent-field .link-button { flex: 0 0 auto; padding: 0; border: 0; background: transparent; color: var(--green-dark); text-decoration: underline; font: inherit; cursor: pointer; }
.detail-fieldset { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.detail-fieldset + .detail-fieldset { margin-top: 10px; }
.detail-fieldset legend { padding: 0 6px; color: var(--green-dark); font-size: 12px; font-weight: 800; }
.family-details-form > section > h3 { margin: 18px 0 8px; font-size: 15px; }
.family-latest-notices { margin-top: 18px; }
.avatar-silhouette { display: grid; place-items: center; background: var(--surface-2); color: var(--green); }
.avatar-silhouette svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chat-assignment { margin: 12px 0; padding: 11px 13px; border-left: 3px solid var(--gold); border-radius: 8px; background: #fff8e8; color: var(--ink); font-size: 12px; line-height: 1.45; }
.message-author { display: block; margin-bottom: 4px; color: var(--green-dark); font-size: 11px; }
.conversation .tag { margin-left: 6px; vertical-align: middle; }
.album-book { display: grid; gap: 18px; }
.album-book-cover { padding: 22px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, var(--green-dark), var(--green)); box-shadow: 0 12px 28px rgba(24,58,50,.16); }
.album-book-cover h3 { margin: 5px 0 8px; color: #fff; font-family: Georgia, serif; font-size: 26px; }
.album-book-cover p { max-width: 560px; margin: 0 0 14px; color: rgba(255,255,255,.82); line-height: 1.55; }
.album-upload-form { padding: 16px; border: 1px dashed var(--line); border-radius: 14px; background: var(--surface-2); }
.album-gallery-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.album-gallery-heading h3 { margin: 0; }
.album-collection { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
.album-sticker { margin: 0; padding: 9px 9px 12px; border: 1px solid #e3d7bd; border-radius: 6px 6px 14px 14px; background: #fffdf7; box-shadow: 0 7px 0 #e9dec7, 0 12px 22px rgba(24,58,50,.1); transform: rotate(-1deg); }
.album-sticker:nth-child(2n) { transform: rotate(1.4deg); }
.album-sticker:nth-child(3n) { transform: rotate(-2deg); }
.album-sticker-image { overflow: hidden; aspect-ratio: 1 / .78; border-radius: 4px; background: var(--surface-2); }
.album-sticker-image[role="button"] { position: relative; cursor: zoom-in; outline: 0; }
.album-sticker-image[role="button"]::after { content: "Ver en grande"; position: absolute; right: 8px; bottom: 8px; border-radius: 999px; padding: 5px 8px; background: rgba(21,45,39,.82); color: #fff; font-size: 10px; opacity: 0; transform: translateY(4px); transition: opacity .16s ease, transform .16s ease; }
.album-sticker-image[role="button"]:hover::after, .album-sticker-image[role="button"]:focus-visible::after { opacity: 1; transform: translateY(0); }
.album-sticker-image[role="button"]:focus-visible { box-shadow: 0 0 0 3px rgba(215,171,83,.7); }
.album-sticker-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.album-sticker figcaption { display: grid; gap: 4px; padding: 9px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.album-sticker figcaption strong { color: var(--ink); font-size: 12px; }
.album-sticker figcaption .btn { justify-self: start; margin-top: 5px; }
.photo-viewer { display: grid; gap: 18px; }
.photo-viewer-stage { display: grid; place-items: center; min-height: min(64vh, 620px); border-radius: 18px; padding: 12px; background: #102c26; }
.photo-viewer-stage img { display: block; max-width: 100%; max-height: min(62vh, 600px); width: auto; height: auto; object-fit: contain; border-radius: 10px; box-shadow: 0 18px 44px rgba(0,0,0,.22); }
.photo-viewer-caption { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.photo-viewer-caption h3 { margin: 4px 0 5px; color: var(--ink); font-family: Georgia, serif; font-size: 25px; }
.photo-viewer-caption p { max-width: 650px; margin: 0 0 5px; color: var(--muted); line-height: 1.5; }
.photo-viewer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.social-quote { margin: 0 0 16px; color: var(--green-dark); font-size: 13px; font-weight: 750; }
.enrollment-document { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--surface-2); }
.enrollment-document .card-header { margin-bottom: 12px; }
.enrollment-document h3 { margin: 0 0 4px; font-size: 15px; }
.enrollment-document p { margin: 0; color: var(--muted); font-size: 12px; }
.enrollment-pdf-preview { display: block; width: 100%; height: min(420px, 52vh); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.inline-control { display: flex; gap: 8px; align-items: stretch; }
.inline-control input { flex: 1; min-width: 0; }
.event-kind { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 800; }
.event-kind::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.kind-activity { color: #087b82; background: #d8edca; }
.kind-camp { color: #9a6d00; background: #fae9a4; }
.kind-outing { color: #b84e3e; background: #f6d5c9; }
.kind-meeting { color: #315eaa; background: #dce8fa; }
.kind-celebration { color: #7a4b99; background: #eadcf2; }
.kind-notice { color: #7b5b00; background: #fff0c4; }
.day-marks { display: flex; justify-content: center; gap: 3px; min-height: 8px; margin-top: 6px; }
.calendar-mark { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.calendar-mark.kind-activity { background: #087b82; }
.calendar-mark.kind-camp { background: #d39b00; }
.calendar-mark.kind-outing { background: #d35e4c; }
.calendar-mark.kind-meeting { background: #4276c3; }
.calendar-mark.kind-celebration { background: #8c5bab; }
.calendar-mark.kind-notice { background: #b88600; }
.album-cover { display: block; width: 100%; height: 132px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; background: var(--surface-2); }
.album-cover-empty { display: grid; place-items: center; color: var(--green); font-size: 40px; }
.album-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.album-photo { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.album-photo img { display: block; width: 100%; height: 150px; object-fit: cover; }
.album-photo figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; color: var(--muted); font-size: 11px; }
.album-photo figcaption .btn { width: auto; padding: 6px 8px; }
.album-manager-gallery { margin-top: 22px; }
.album-manager-gallery h3 { margin: 0; font-size: 15px; }

@media (max-width: 1100px) {
  .public-nav { display: none; }
  .public-nav.mobile-open { position: absolute; top: 64px; left: 12px; right: 12px; display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
  .public-nav.mobile-open button { padding: 12px; text-align: left; }
  .menu-button { display: inline-grid; place-items: center; }
  .hero { grid-template-columns: 1fr .8fr; }
  .private-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 780px) {
  .topbar { min-height: 64px; }
  .topbar .user-chip span:last-child { display: none; }
  .private-layout { display: block; }
  .sidebar { position: fixed; z-index: 30; inset: 64px auto 0 0; width: min(290px, 86vw); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 14px 0 30px rgba(24,58,50,.1); }
  .sidebar.open { transform: translateX(0); }
  .sidebar::after { content: ""; position: fixed; z-index: -1; inset: 0 -100vw 0 100%; background: rgba(21,45,39,.2); opacity: 0; pointer-events: none; }
  .sidebar.open::after { opacity: 1; pointer-events: auto; }
  .main { padding-top: 28px; }
  .hero { grid-template-columns: 1fr; padding-top: 48px; }
  .hero-art { min-height: 300px; }
  .art-main { inset: 42px 30px 43px; }
  .art-main h3 { margin-top: 24px; font-size: 25px; }
  .feature-grid, .stage-grid, .educator-grid, .photo-grid { grid-template-columns: 1fr; }
  .section-heading, .page-title { display: block; }
  .section-heading p { margin-top: 12px; }
  .page-actions { margin-top: 18px; }
  .dashboard-grid, .calendar-layout, .profile-grid, .family-dashboard-grid, .settings-grid { grid-template-columns: 1fr; }
  .family-welcome { display: block; }
  .family-quick-actions { grid-template-columns: 1fr; min-width: 0; margin-top: 16px; }
  .template-grid { grid-template-columns: 1fr; }
  .integration-list > div { grid-template-columns: 1fr; gap: 5px; }
  .messages-layout { grid-template-columns: 1fr; }
  .modal.modal-wide { width: min(100%, calc(100vw - 20px)); max-height: calc(100vh - 20px); padding: 16px; }
  .photo-viewer-stage { min-height: 46vh; }
  .photo-viewer-caption { display: block; }
  .photo-viewer-actions { justify-content: stretch; margin-top: 14px; }
  .photo-viewer-actions .btn { flex: 1; width: auto; }
  .album-collection { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .album-gallery-heading { align-items: flex-start; flex-direction: column; }
  .conversation-list { display: flex; gap: 5px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .conversation { min-width: 190px; }
  .dev-banner { align-items: flex-start; }
  .role-switcher { width: 100%; }
  .role-switcher button { flex: 1; }
}
@media (max-width: 480px) {
  .album-collection { grid-template-columns: 1fr; }
  .brand strong { font-size: 18px; }
  .brand small { font-size: 9px; }
  .topbar-actions { gap: 6px; }
  .btn { width: 100%; }
  .page-actions .btn, .hero-actions .btn { width: auto; }
  .stats-grid { gap: 8px; }
  .stat-card { padding: 14px; }
  .stat-card strong { font-size: 26px; }
  .calendar-day { min-height: 54px; padding: 5px; }
  .calendar-day .day-dot { margin-top: 6px; }
  .form-row { grid-template-columns: 1fr; }
  .album-gallery { grid-template-columns: 1fr; }
  .public-footer-inner { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.event-kind-emoji { font-size: 1.05em; line-height: 1; }
.event-kind::before { display: none; }
.calendar-mark { width: 22px; height: 22px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); font-size: 13px; }
.calendar-mark.kind-activity { background: #e0f3f0; }
.calendar-mark.kind-camp { background: #fff0c2; }
.calendar-mark.kind-outing { background: #ffe0da; }
.calendar-mark.kind-meeting { background: #e0e9fb; }
.calendar-mark.kind-celebration { background: #f0e2fb; }
.calendar-mark.kind-notice { background: #fff3d6; }
.family-document { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.family-document .card-header { margin-bottom: 12px; }
.educator-carousel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.educator-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding: 4px 2px 14px; }
.educator-public-card { min-width: min(100%, 330px); scroll-snap-align: start; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 4px 20px rgba(24,58,50,.04); display: flex; align-items: center; gap: 16px; }
.educator-public-card h3 { margin: 5px 0 8px; font-family: Georgia, serif; font-size: 22px; }
.educator-public-card p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 14px; }
.educator-public-photo { width: 88px; height: 88px; border-radius: 50%; flex: 0 0 88px; overflow: hidden; display: grid; place-items: center; background: var(--green); color: white; font-weight: 800; font-size: 24px; }
.educator-public-photo img { width: 100%; height: 100%; object-fit: cover; }
.carousel-control { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; font-size: 20px; }
.carousel-control:hover { background: var(--green); color: white; }
.educator-admin-thumb { width: 58px; height: 58px; border-radius: 12px; object-fit: cover; display: block; margin-top: 8px; border: 1px solid var(--line); }
.table-subtitle { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.permission-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.check-row { display: flex; align-items: flex-start; gap: 8px; color: var(--ink); font-size: 14px; line-height: 1.4; }

.download-grid, .document-upload-grid, .guardian-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.document-download, .document-upload-tile { display: grid; gap: 6px; min-height: 104px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); color: var(--ink); text-decoration: none; }
.document-download:hover, .document-upload-tile:focus-within { border-color: var(--green); box-shadow: var(--shadow); }
.document-download span, .document-upload-tile span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.document-upload-tile input { margin-top: 8px; }
.table-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.enrollment-document-grid { display: grid; gap: 16px; margin-top: 18px; }
.enrollment-document { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.enrollment-document .card-header { padding: 14px; }
.enrollment-pdf-preview { display: block; width: 100%; min-height: 320px; border-top: 1px solid var(--line); background: #f7faf5; }
.detail-fieldset ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }

@media (max-width: 760px) {
  .download-grid, .document-upload-grid, .guardian-grid { grid-template-columns: 1fr; }
  .table-filters { justify-content: stretch; }
  .table-filters > * { flex: 1 1 180px; }
}
.check-row input { margin-top: 3px; accent-color: var(--green); }
.storage-card { margin-bottom: 16px; }
.storage-meter { padding: 10px 0 2px; }
.storage-meter-label { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.storage-meter-label strong { color: var(--ink); }
.progress-track { height: 10px; margin: 10px 0; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress-track span { display: block; height: 100%; min-width: 0; border-radius: inherit; background: var(--green); transition: width .25s ease; }
.search-input { min-width: 210px; }
@media (max-width: 650px) {
  .educator-carousel { grid-template-columns: 1fr auto; }
  .educator-track { grid-column: 1 / -1; grid-row: 1; }
  .carousel-control { z-index: 1; }
  .permission-check-grid { grid-template-columns: 1fr; }
  .search-input { width: 100%; min-width: 0; }
}
