/**
 * 家長端 — 白天清爽主題
 * 設計哲學：「同一個品牌的白天與黑夜」
 * 主頁是夜晚的科技感，家長端是白天的清爽感，色彩基因相同但光線完全不同。
 *
 * Brand DNA (共享):
 *   --neon-blue: #00d4ff  → 日光版: #0ea5e9 (sky-500)
 *   --neon-purple: #a855f7 → 日光版: #8b5cf6 (violet-500)
 *   --neon-cyan: #00ffd5   → 日光版: #06b6d4 (cyan-500)
 */

:root {
    /* === Surface === */
    --p-bg: #f0f4f8;
    --p-bg-soft: #f8fafc;
    --p-surface: #ffffff;
    --p-surface-hover: #f1f5f9;

    /* === Brand (daylight versions of neon palette) === */
    --p-blue: #0ea5e9;
    --p-blue-deep: #0284c7;
    --p-blue-soft: #e0f2fe;
    --p-blue-ghost: rgba(14, 165, 233, 0.08);
    --p-purple: #8b5cf6;
    --p-purple-deep: #7c3aed;
    --p-purple-soft: #ede9fe;
    --p-cyan: #06b6d4;
    --p-cyan-deep: #0891b2;
    --p-cyan-soft: #cffafe;

    /* === Text (WCAG AA on white) === */
    --p-text: #0f172a;
    --p-text-secondary: #475569;
    --p-muted: #94a3b8;

    /* === Lines & Borders === */
    --p-border: #e2e8f0;
    --p-border-hover: #cbd5e1;

    /* === Semantic === */
    --p-success: #10b981;
    --p-success-soft: #d1fae5;
    --p-warning: #f59e0b;
    --p-warning-soft: #fef3c7;
    --p-danger: #ef4444;
    --p-danger-soft: #fee2e2;
    --p-info: #0ea5e9;
    --p-info-soft: #e0f2fe;

    /* === Shadows === */
    --p-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --p-shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.04);
    --p-shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
    --p-shadow-xl: 0 20px 60px rgba(15, 23, 42, 0.10), 0 8px 20px rgba(15, 23, 42, 0.06);

    /* === Radius (shared with main site) === */
    --p-radius-xl: 28px;
    --p-radius-lg: 22px;
    --p-radius-md: 16px;
    --p-radius-sm: 12px;
    --p-radius-full: 999px;

    /* === Font === */
    --p-font: 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

    /* === Focus ring === */
    --p-focus-ring: 0 0 0 3px rgba(14, 165, 233, 0.25);

    /* === Gradient accent (shared brand gradient) === */
    --p-gradient-brand: linear-gradient(135deg, var(--p-blue), var(--p-purple));
    --p-gradient-brand-soft: linear-gradient(135deg, var(--p-blue-soft), var(--p-purple-soft));
    --p-gradient-cyan-blue: linear-gradient(135deg, var(--p-cyan), var(--p-blue));
}

/* ======================== Reset ======================== */
*, *::before, *::after { box-sizing: border-box; }

body.parent-app {
    min-height: 100vh;
    margin: 0;
    color: var(--p-text);
    font-family: var(--p-font);
    background: var(--p-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--p-blue-deep); text-decoration: none; }
a:hover { color: var(--p-purple-deep); }

/* ======================== Shell ======================== */
.parent-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

/* ======================== Nav Bar (Portal) ======================== */
.parent-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--p-border);
}

.parent-nav-logo {
    height: 40px;
    width: auto;
}

.parent-nav-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ======================== Page Banner ======================== */
.page-banner {
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1.2fr) auto;
    align-items: center;
    padding: 28px 32px;
    border-radius: var(--p-radius-xl);
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    box-shadow: var(--p-shadow-md);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.page-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--p-gradient-brand);
}

.banner-copy h1 {
    margin: 6px 0 8px;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 800;
    color: var(--p-text);
}

.banner-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--p-blue-deep);
    font-size: 0.9rem;
    font-weight: 700;
}

#bannerMemberName { color: var(--p-text); }

#bannerSubtitle {
    max-width: 56ch;
    font-size: 0.95rem;
    color: var(--p-text-secondary);
    margin: 0;
}

.banner-actions,
.auth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

/* ======================== Eyebrow ======================== */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--p-radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    background: var(--p-blue-soft);
    color: var(--p-blue-deep);
    border: 1px solid rgba(14, 165, 233, 0.15);
}

.banner-copy p,
.auth-hero p,
.section-copy,
.muted-copy {
    margin: 0;
    color: var(--p-text-secondary);
}

/* ======================== Cards ======================== */
.surface-card {
    border-radius: var(--p-radius-xl);
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    box-shadow: var(--p-shadow-sm);
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.panel {
    padding: 22px;
}

.home-notice-card,
.home-guidance-card {
    margin-bottom: 20px;
    border-left: 4px solid var(--p-blue);
}

.home-guidance-card {
    border-left-color: var(--p-purple);
}

.home-guidance-card {
    background: linear-gradient(135deg, rgba(237, 233, 254, 0.4), rgba(224, 242, 254, 0.4));
    border-color: rgba(139, 92, 246, 0.15);
    border-left-color: var(--p-purple);
}

.home-notice-card {
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.5), rgba(207, 250, 254, 0.3));
    border-color: rgba(14, 165, 233, 0.15);
}

.home-notice-card h2,
.home-guidance-card h2 {
    margin: 10px 0 0;
}

.home-notice-content,
.home-guidance-content {
    white-space: pre-line;
    line-height: 1.7;
}

/* ======================== Buttons ======================== */
.parent-btn,
.parent-btn-secondary,
.parent-btn-ghost,
.parent-btn-nav,
.parent-btn-danger,
.segment-btn {
    appearance: none;
    border: none;
    border-radius: var(--p-radius-full);
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.parent-btn,
.parent-btn-secondary,
.parent-btn-ghost,
.parent-btn-nav,
.parent-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 22px;
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    text-decoration: none;
}

.parent-btn {
    color: #fff;
    background: var(--p-gradient-brand);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25);
}

.parent-btn:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.3);
}

.parent-btn i { font-size: 1rem; }

.parent-btn-secondary {
    color: #fff;
    background: var(--p-gradient-cyan-blue);
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.2);
}

.parent-btn-secondary:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.25);
}

.parent-btn-ghost {
    color: var(--p-text);
    background: var(--p-surface);
    border-color: var(--p-border);
    box-shadow: var(--p-shadow-sm);
}

.parent-btn-ghost:hover {
    color: var(--p-text);
    background: var(--p-surface-hover);
    border-color: var(--p-border-hover);
    transform: translateY(-1px);
}

.parent-btn-nav {
    color: var(--p-blue-deep);
    background: var(--p-blue-soft);
    border-color: rgba(14, 165, 233, 0.18);
    box-shadow: var(--p-shadow-sm);
}

.parent-btn-nav:hover {
    color: var(--p-blue-deep);
    background: #fff;
    border-color: rgba(14, 165, 233, 0.3);
    transform: translateY(-1px);
    box-shadow: var(--p-shadow-md);
}

.parent-btn-danger {
    color: #fff;
    background: linear-gradient(135deg, #f87171, var(--p-danger));
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
}

.parent-btn-danger:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.25);
}

/* Focus visible */
.parent-btn:focus-visible,
.parent-btn-secondary:focus-visible,
.parent-btn-ghost:focus-visible,
.parent-btn-nav:focus-visible,
.parent-btn-danger:focus-visible,
.segment-btn:focus-visible,
.member-card:focus-visible,
.stat-card-button:focus-visible,
.text-link-btn:focus-visible {
    outline: none;
    box-shadow: var(--p-focus-ring);
}

/* Disabled */
.parent-btn:disabled,
.parent-btn-secondary:disabled,
.parent-btn-ghost:disabled,
.parent-btn-nav:disabled,
.parent-btn-danger:disabled,
.text-link-btn:disabled,
.segment-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ======================== Stats Grid ======================== */
.stats-grid,
.support-grid,
.history-grid {
    display: grid;
    gap: 16px;
}

.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 20px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    padding: 22px 24px;
    border-radius: var(--p-radius-lg);
    min-height: 172px;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    box-shadow: var(--p-shadow-sm);
}

.stat-card-static {
    position: relative;
    overflow: hidden;
}

.stat-card-static::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--p-gradient-brand);
    opacity: 0.6;
}

.stat-card-static .stat-label {
    color: var(--p-blue-deep);
    font-weight: 700;
}

.stat-label {
    font-size: 0.88rem;
    color: var(--p-text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.stat-value {
    font-size: clamp(2rem, 5vw, 2.6rem);
    font-weight: 800;
    line-height: 1;
    color: var(--p-text);
}

.stat-note {
    margin-top: 10px;
    color: var(--p-muted);
    font-size: 0.88rem;
}

.stat-card-button {
    width: 100%;
    position: relative;
    overflow: hidden;
    align-items: flex-start;
    text-align: left;
    cursor: pointer;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    box-shadow: var(--p-shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.stat-card-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--p-gradient-brand);
}

.stat-card-button.is-notification-jump::before {
    background: var(--p-gradient-cyan-blue);
}

.stat-card-button .stat-label {
    color: var(--p-blue-deep);
    font-weight: 700;
}

.stat-card-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--p-shadow-lg);
    border-color: var(--p-blue);
}

.stat-card-button.is-notification-jump:hover {
    border-color: var(--p-cyan);
}

.stat-card-button.is-notification-jump .stat-label,
.stat-card-button.is-notification-jump .stat-cta {
    color: var(--p-cyan-deep);
}

.stat-cta {
    margin-top: auto;
    padding-top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--p-blue-deep);
    font-size: 0.9rem;
    font-weight: 700;
}

.stat-cta i {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--p-blue-soft);
    border: 1px solid rgba(14, 165, 233, 0.15);
    transition: transform 0.15s ease;
}

.stat-card-button:hover .stat-cta i {
    transform: translateX(2px);
}

.panel-jump-highlight {
    animation: panelJumpHighlight 1.8s ease;
}

@keyframes panelJumpHighlight {
    0% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.3); border-color: var(--p-blue); }
    35% { box-shadow: 0 0 0 10px rgba(14, 165, 233, 0.08); border-color: var(--p-blue); }
    100% { box-shadow: var(--p-shadow-sm); border-color: var(--p-border); }
}

/* ======================== Portal Grid ======================== */
.portal-grid {
    display: grid;
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 20px;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-head h2,
.dialog-head h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--p-text);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

/* ======================== Bind Section ======================== */
.bind-section {
    margin-bottom: 16px;
    padding: 18px;
    border-radius: var(--p-radius-md);
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.6), rgba(207, 250, 254, 0.4));
    border: 1px solid rgba(14, 165, 233, 0.12);
}

.bind-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.bind-section-head h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 800;
}

.bind-form {
    display: grid;
    gap: 12px;
}

/* ======================== Chips ======================== */
.soft-chip,
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 12px;
    border-radius: var(--p-radius-full);
    font-size: 0.8rem;
    font-weight: 700;
}

.soft-chip {
    color: var(--p-blue-deep);
    background: var(--p-blue-soft);
    border: 1px solid rgba(14, 165, 233, 0.12);
}

.soft-chip.is-accent {
    color: var(--p-cyan-deep);
    background: var(--p-cyan-soft);
    border-color: rgba(6, 182, 212, 0.15);
}

.soft-chip.is-neutral {
    color: var(--p-text-secondary);
    background: var(--p-bg-soft);
    border-color: var(--p-border);
}

.status-chip.is-success {
    background: var(--p-success-soft);
    color: var(--p-success);
}

.status-chip.is-warning {
    background: var(--p-warning-soft);
    color: #b45309;
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.15);
}

.status-chip.is-danger {
    background: var(--p-danger-soft);
    color: var(--p-danger);
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.15);
}

.status-chip.is-info {
    background: var(--p-info-soft);
    color: var(--p-info);
}

.status-chip.is-neutral {
    background: var(--p-bg);
    color: var(--p-text-secondary);
}

/* ======================== Member List ======================== */
.member-list,
.stack-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.member-card,
.history-card,
.message-card,
.empty-state,
.summary-block {
    border-radius: var(--p-radius-md);
}

.member-card {
    width: 100%;
    position: relative;
    overflow: hidden;
    padding: 18px;
    text-align: left;
    border: 1px solid var(--p-border);
    background: var(--p-surface);
    box-shadow: var(--p-shadow-sm);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.member-card::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: var(--p-gradient-brand);
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.member-card:hover,
.member-card.is-active {
    transform: translateY(-2px);
    box-shadow: var(--p-shadow-md);
}

.member-card:hover { border-color: var(--p-blue); }
.member-card:hover::before { opacity: 1; }

.member-card.is-active {
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.5), rgba(207, 250, 254, 0.3));
    border-color: var(--p-blue);
    box-shadow: var(--p-shadow-md);
}

.member-card.is-active::before { opacity: 1; }

.member-card-title,
.history-title {
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 6px;
}

.member-card-meta,
.history-meta,
.tiny-copy {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--p-text-secondary);
    font-size: 0.9rem;
}

.member-card-tags,
.meta-list,
.permission-list,
.detail-list,
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.member-card-tags { margin-top: 12px; }

.member-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--p-border);
}

.member-card-affordance {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--p-blue-deep);
    font-size: 0.9rem;
    font-weight: 700;
}

.member-card-affordance i {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--p-blue-soft);
    border: 1px solid rgba(14, 165, 233, 0.12);
}

.member-card.is-active .member-card-affordance {
    color: var(--p-cyan-deep);
}

.member-card-arrow {
    color: var(--p-blue);
    font-size: 1.1rem;
    transition: transform 0.15s ease;
}

.member-card:hover .member-card-arrow,
.member-card.is-active .member-card-arrow {
    transform: translateX(2px);
}

.member-card.is-active .member-card-arrow { color: var(--p-cyan); }

/* ======================== Summary ======================== */
.summary-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 16px;
}

.summary-block {
    padding: 18px;
    background: var(--p-bg-soft);
    border: 1px solid var(--p-border);
}

.summary-block h3,
.detail-panel h3 {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 800;
}

.child-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.child-name strong {
    font-size: 1.4rem;
    letter-spacing: -0.02em;
}

.fact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.fact-card {
    padding: 14px;
    border-radius: var(--p-radius-sm);
    background: var(--p-surface);
    border: 1px solid var(--p-border);
}

.fact-label {
    color: var(--p-text-secondary);
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.fact-value {
    font-size: 1.15rem;
    font-weight: 800;
}

/* ======================== History ======================== */
.history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.history-card,
.message-card {
    padding: 16px;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    box-shadow: var(--p-shadow-sm);
}

.interactive-row-card {
    border-color: var(--p-border);
    background: var(--p-surface);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.interactive-row-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--p-shadow-md);
    border-color: var(--p-blue);
}

.interactive-row-card:has(.text-link-btn.is-danger:hover) {
    border-color: var(--p-danger);
}

.message-card.is-unread {
    border-color: var(--p-blue);
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.5), rgba(237, 233, 254, 0.3));
    box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.06), var(--p-shadow-sm);
}

.signup-opportunity-card {
    position: relative;
    overflow: hidden;
    padding: 16px;
    border-radius: var(--p-radius-md);
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    box-shadow: var(--p-shadow-sm);
}

.signup-opportunity-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--p-gradient-brand);
}

.signup-opportunity-head,
.signup-opportunity-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.signup-opportunity-copy { margin-top: 10px; }
.signup-opportunity-hint { margin-top: 10px; }

.signup-opportunity-footer {
    align-items: flex-end;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--p-border);
}

.signup-opportunity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.signup-action-btn { min-width: 156px; }

.history-copy,
.message-copy {
    margin: 8px 0 0;
    color: var(--p-text-secondary);
    line-height: 1.6;
}

.history-card-copy { margin-top: 10px; }

.history-actions,
.message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--p-border);
    align-items: center;
}

.compact-history-foot { display: flex; }

.compact-history-foot .parent-btn-nav {
    width: 100%;
    justify-content: space-between;
}

/* ======================== Text Link Buttons ======================== */
.text-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-full);
    background: var(--p-surface);
    color: var(--p-blue-deep);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    box-shadow: var(--p-shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.text-link-btn:hover {
    transform: translateY(-1px);
    color: var(--p-blue-deep);
    background: var(--p-blue-soft);
    border-color: rgba(14, 165, 233, 0.3);
    box-shadow: var(--p-shadow-md);
}

.text-link-btn.is-danger {
    color: var(--p-danger);
    background: var(--p-danger-soft);
    border-color: rgba(239, 68, 68, 0.15);
}

.text-link-btn.is-danger:hover {
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
    background: #fff;
}

.text-link-btn i { font-size: 0.9rem; }

/* ======================== Notification Toggle ======================== */
.notification-toggle-row {
    display: flex;
    justify-content: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-subtle);
    margin-top: 0.5rem;
}

.notification-toggle-row .parent-btn-nav {
    font-size: 0.85rem;
    padding: 0.35rem 1rem;
}

/* ======================== Support Grid ======================== */
.support-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ======================== Segment Group ======================== */
.segment-group {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--p-bg-soft);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-full);
}

.segment-btn {
    min-height: 36px;
    padding: 0 16px;
    border-radius: var(--p-radius-full);
    color: var(--p-text-secondary);
    border: 1px solid transparent;
    background: transparent;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
}

.segment-btn:hover {
    color: var(--p-blue-deep);
    background: var(--p-surface);
}

.segment-btn.is-active {
    color: #fff;
    background: var(--p-gradient-brand);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
}

/* ======================== Alerts ======================== */
.inline-alert {
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: var(--p-radius-md);
    font-weight: 600;
    font-size: 0.92rem;
    border: 1px solid transparent;
}

.inline-alert.is-danger {
    color: #991b1b;
    background: var(--p-danger-soft);
    border-color: rgba(239, 68, 68, 0.15);
}

.inline-alert.is-success {
    color: #065f46;
    background: var(--p-success-soft);
    border-color: rgba(16, 185, 129, 0.15);
}

.inline-alert.is-warning {
    color: #92400e;
    background: var(--p-warning-soft);
    border-color: rgba(245, 158, 11, 0.15);
}

.inline-alert.is-info {
    color: #075985;
    background: var(--p-info-soft);
    border-color: rgba(14, 165, 233, 0.15);
}

/* ======================== Empty State ======================== */
.empty-state {
    padding: 28px 18px;
    text-align: center;
    color: var(--p-muted);
    background: var(--p-bg-soft);
    border: 1px dashed var(--p-border);
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ======================== Detail Overlay / Modal ======================== */
.detail-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.detail-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.detail-dialog {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    overflow: auto;
    border-radius: 0;
    padding: 20px;
    background: var(--p-surface);
    border: none;
    box-shadow: none;
}

.dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.dialog-close {
    width: 40px;
    height: 40px;
    padding: 0;
}

.dialog-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-panel {
    padding: 16px;
    border-radius: var(--p-radius-md);
    background: var(--p-bg-soft);
    border: 1px solid var(--p-border);
}

.detail-panel pre {
    margin: 0;
    white-space: pre-wrap;
    font: inherit;
    line-height: 1.7;
    color: var(--p-text);
}

/* ======================== Forms ======================== */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field label {
    font-weight: 700;
    font-size: 0.92rem;
}

.parent-input,
.parent-select,
.auth-card .form-control {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: var(--p-radius-sm);
    border: 1px solid var(--p-border);
    background: var(--p-surface);
    color: var(--p-text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.parent-input:focus,
.parent-select:focus,
.auth-card .form-control:focus {
    outline: none;
    border-color: var(--p-blue);
    box-shadow: var(--p-focus-ring);
}

.form-help {
    color: var(--p-text-secondary);
    font-size: 0.85rem;
}

.modal-action-row { margin-top: 16px; }

/* ======================== History Filter ======================== */
.history-filter-shell {
    margin-bottom: 16px;
    padding: 14px;
    border-radius: var(--p-radius-md);
    background: var(--p-bg-soft);
    border: 1px solid var(--p-border);
}

.history-filter-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, 170px)) auto;
    gap: 12px;
    align-items: end;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-field label {
    color: var(--p-text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
}

.filter-field-wide { min-width: 0; }
.history-filter-reset { white-space: nowrap; }

/* ======================== Auth (Login Page) ======================== */
.auth-layout {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background:
        radial-gradient(circle at top left, rgba(224, 242, 254, 0.7), transparent 40%),
        radial-gradient(circle at top right, rgba(237, 233, 254, 0.6), transparent 40%),
        radial-gradient(circle at bottom center, rgba(207, 250, 254, 0.4), transparent 35%),
        var(--p-bg);
}

.auth-shell {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 20px;
    align-items: stretch;
}

.auth-card,
.auth-side {
    border-radius: var(--p-radius-xl);
}

.auth-card {
    padding: 36px;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    box-shadow: var(--p-shadow-lg);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--p-gradient-brand);
}

.auth-side {
    padding: 26px;
    background: linear-gradient(180deg, rgba(224, 242, 254, 0.6), rgba(237, 233, 254, 0.4));
    border: 1px solid var(--p-border);
    box-shadow: var(--p-shadow-md);
}

.auth-hero {
    margin-bottom: 28px;
}

.auth-hero h1 {
    margin: 8px 0 10px;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    line-height: 1.15;
    font-weight: 800;
    color: var(--p-text);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form .parent-btn { margin-top: 8px; }

.info-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.info-card {
    padding: 18px;
    border-radius: var(--p-radius-md);
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    box-shadow: var(--p-shadow-sm);
}

.info-card h2,
.info-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 800;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: var(--p-text);
}

.feature-dot {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--p-blue-soft);
    color: var(--p-blue-deep);
}

.small-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-top: 18px;
}

.is-hidden { display: none !important; }

/* ======================== Logo Animation ======================== */
.auth-logo-wrap {
    text-align: center;
    margin-bottom: 8px;
    opacity: 0;
    animation: fadeIn 0.6s 0.2s forwards;
}

.auth-logo {
    max-width: 200px;
    height: auto;
}

/* ======================== Public Popup ======================== */
.parent-public-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(14px);
}

.parent-public-popup-dialog {
    width: min(92vw, 560px);
    padding: 24px;
    border-radius: 28px;
    border: 1px solid rgba(15, 76, 117, 0.16);
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.96));
    box-shadow: 0 28px 72px rgba(15, 23, 42, 0.24);
}

.parent-public-popup-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.parent-public-popup-kicker {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.parent-public-popup-urgent .parent-public-popup-kicker {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.parent-public-popup-important .parent-public-popup-kicker {
    background: rgba(217, 119, 6, 0.13);
    color: #b45309;
}

.parent-public-popup-head h2 {
    margin: 0;
    font-size: clamp(1.35rem, 4vw, 2rem);
    font-weight: 900;
    color: #0f172a;
}

.parent-public-popup-close {
    flex: 0 0 auto;
    min-height: 40px;
}

.parent-public-popup-body {
    color: #334155;
    font-size: 1rem;
    line-height: 1.85;
}

.parent-public-popup-meta {
    margin-top: 16px;
    color: #64748b;
    font-size: 0.86rem;
}

.parent-public-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 22px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ======================== Responsive ======================== */
@media (max-width: 980px) {
    .page-banner,
    .portal-grid,
    .summary-layout,
    .support-grid,
    .history-grid,
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .banner-actions { justify-content: flex-start; }
}

@media (max-width: 720px) {
    .parent-shell {
        width: min(100% - 24px, 100%);
        padding-top: 18px;
        padding-bottom: 28px;
    }

    .page-banner,
    .auth-card,
    .panel,
    .detail-dialog,
    .parent-public-popup-dialog,
    .auth-side {
        padding: 18px;
    }

    .parent-nav {
        padding: 10px 16px;
    }

    .parent-nav-logo {
        height: 32px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .fact-grid {
        grid-template-columns: 1fr;
    }

    .toolbar,
    .section-head,
    .bind-section-head {
        align-items: stretch;
    }

    .toolbar { justify-content: flex-start; }

    .signup-opportunity-head,
    .signup-opportunity-footer,
    .history-filter-grid {
        flex-direction: column;
        align-items: stretch;
    }

    .signup-action-btn { width: 100%; }

    .history-filter-grid { display: flex; }
    .history-filter-reset { width: 100%; }
}

@media (max-width: 480px) {
    .page-banner { padding: 16px; }
    .page-banner::before { height: 3px; }
    .auth-card::before { height: 3px; }

    .banner-copy h1 { font-size: 1.5rem; }

    .parent-btn,
    .parent-btn-secondary,
    .parent-btn-ghost,
    .parent-btn-nav,
    .parent-btn-danger {
        min-height: 44px;
        font-size: 0.88rem;
    }
}


/* ======================== Tab Panes + Bottom Nav (Parent Portal) ======================== */
.parent-tab-pane {
    display: none;
    animation: parentPaneFade 0.25s ease;
}

.parent-tab-pane.is-active {
    display: block;
}

@keyframes parentPaneFade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Reserve space so fixed bottom nav never covers content */
.parent-shell.has-bottom-nav {
    padding-bottom: 96px;
}

.parent-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--p-border);
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.06);
}

.parent-bottom-nav-item {
    position: relative;
    flex: 1 1 0;
    max-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    min-height: 52px;
    border: none;
    background: transparent;
    color: var(--p-muted);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    transition: color 0.18s ease, background 0.18s ease;
}

.parent-bottom-nav-item i {
    font-size: 1.25rem;
    line-height: 1;
}

.parent-bottom-nav-item:hover {
    color: var(--p-text-secondary);
    background: var(--p-surface-hover);
}

.parent-bottom-nav-item.is-active {
    color: var(--p-blue-deep);
    background: var(--p-blue-ghost);
}

.parent-bottom-nav-badge {
    position: absolute;
    top: 2px;
    right: 50%;
    transform: translateX(20px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--p-danger, #ef4444);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--p-surface, #fff);
}

.parent-bottom-nav-badge.is-hidden {
    display: none;
}

/* On wide screens, center the bar with a card-like max width */
@media (min-width: 900px) {
    .parent-bottom-nav {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(640px, calc(100% - 32px));
        margin-bottom: 12px;
        border-radius: 18px;
        border: 1px solid var(--p-border);
    }
}


/* ======================== Top Nav Dropdown (Parent) ======================== */
.parent-nav-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.parent-nav-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border: 1px solid var(--p-border);
    border-radius: 999px;
    background: var(--p-surface);
    color: var(--p-blue-deep);
    font-size: 1.15rem;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.parent-nav-refresh:hover {
    border-color: var(--p-border-hover);
    background: var(--p-surface-hover);
}

.parent-nav-refresh:disabled {
    opacity: 0.6;
    cursor: default;
}

.parent-nav-refresh.is-spinning .bi {
    animation: parent-nav-refresh-spin 0.8s linear infinite;
}

@keyframes parent-nav-refresh-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.parent-nav-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--p-border);
    border-radius: 999px;
    background: var(--p-surface);
    color: var(--p-text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    max-width: 62vw;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.parent-nav-trigger:hover {
    border-color: var(--p-border-hover);
    background: var(--p-surface-hover);
}

.parent-nav-trigger.is-open {
    border-color: var(--p-blue);
    box-shadow: 0 0 0 3px var(--p-blue-ghost);
}

.parent-nav-trigger > .bi-person-circle {
    font-size: 1.15rem;
    color: var(--p-blue-deep);
    flex: 0 0 auto;
}

.parent-nav-trigger-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.parent-nav-caret {
    font-size: 0.75rem;
    color: var(--p-muted);
    transition: transform 0.2s ease;
    flex: 0 0 auto;
}

.parent-nav-trigger.is-open .parent-nav-caret {
    transform: rotate(180deg);
}

.parent-nav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    max-width: min(320px, 86vw);
    padding: 8px;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
    z-index: 300;
    animation: parentNavFade 0.18s ease;
}

.parent-nav-dropdown[hidden] {
    display: none;
}

@keyframes parentNavFade {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.parent-nav-dropdown-section {
    padding: 4px 4px 8px;
}

.parent-nav-dropdown-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--p-muted);
    text-transform: uppercase;
    padding: 4px 8px;
}

.parent-nav-child-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 40vh;
    overflow-y: auto;
}

.parent-nav-child-empty {
    margin: 0;
    padding: 8px;
    font-size: 0.82rem;
    color: var(--p-muted);
}

.parent-nav-child-item,
.parent-nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--p-text);
    font-size: 0.88rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.parent-nav-child-item:hover,
.parent-nav-dropdown-item:hover {
    background: var(--p-surface-hover);
}

.parent-nav-child-item .bi,
.parent-nav-dropdown-item .bi {
    font-size: 1rem;
    flex: 0 0 auto;
    color: var(--p-muted);
}

.parent-nav-child-item.is-active {
    background: var(--p-blue-ghost);
    color: var(--p-blue-deep);
    font-weight: 700;
}

.parent-nav-child-item.is-active .bi {
    color: var(--p-blue-deep);
}

.parent-nav-child-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.parent-nav-child-tag {
    flex: 0 0 auto;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--p-blue-deep);
    background: var(--p-blue-soft);
    padding: 2px 8px;
    border-radius: 999px;
}

.parent-nav-dropdown-item.is-danger {
    color: var(--p-danger, #ef4444);
}

.parent-nav-dropdown-item.is-danger .bi {
    color: var(--p-danger, #ef4444);
}

.parent-nav-dropdown-item.is-danger:hover {
    background: rgba(239, 68, 68, 0.08);
}

.parent-nav-dropdown-divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--p-border);
}


/* ======================== Child Hero Card (eClass-style) ======================== */
.child-hero-card {
    background: linear-gradient(135deg, var(--p-blue-deep) 0%, var(--p-blue) 55%, var(--p-cyan) 100%);
    border-radius: 20px;
    padding: 18px 20px;
    margin-bottom: 18px;
    color: #fff;
    box-shadow: 0 14px 34px rgba(2, 132, 199, 0.28);
}

.child-hero-card.is-hidden {
    display: none;
}

.child-hero-main {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.child-hero-avatar {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.child-hero-avatar.is-letter {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
}

.child-hero-avatar-art {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.child-hero-avatar-art img,
.child-hero-avatar-art .cyber20-png {
    image-rendering: pixelated;
    height: 58px;
    width: auto;
}

/* Rarity glow around avatar */
.child-hero-avatar.rarity-legendary { border-color: #fbbf24; box-shadow: 0 0 18px rgba(251, 191, 36, 0.55); }
.child-hero-avatar.rarity-epic { border-color: #c084fc; box-shadow: 0 0 16px rgba(168, 85, 247, 0.5); }
.child-hero-avatar.rarity-rare { border-color: #7dd3fc; box-shadow: 0 0 14px rgba(56, 189, 248, 0.45); }
.child-hero-avatar.rarity-uncommon { border-color: #6ee7b7; box-shadow: 0 0 12px rgba(52, 211, 153, 0.4); }

.child-hero-info {
    flex: 1 1 auto;
    min-width: 0;
}

.child-hero-name {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.child-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.82rem;
    opacity: 0.92;
}

.child-hero-meta .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Today's arrival / departure (only rendered when there is an activity) */
.child-hero-today {
    margin-top: 16px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 12px 14px;
    backdrop-filter: blur(4px);
}

.child-hero-today-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    opacity: 0.95;
    margin-bottom: 10px;
}

.child-hero-clock {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.child-hero-clock-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
}

.child-hero-clock-item.is-arrival {
    background: rgba(251, 146, 60, 0.28);
}

.child-hero-clock-item.is-departure {
    background: rgba(250, 204, 21, 0.26);
}

.child-hero-clock-label {
    font-size: 0.74rem;
    font-weight: 600;
    opacity: 0.92;
}

.child-hero-clock-value {
    font-size: 1.5rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}


/* ======================== Home feed rows (eClass-style) ======================== */
.home-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.feed-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: var(--p-surface, #fff);
    border: 1px solid var(--p-border, #e2e8f0);
    border-radius: 16px;
    cursor: pointer;
    text-align: left;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.feed-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
    border-color: var(--p-blue, #0ea5e9);
}

.feed-row-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--p-blue, #0ea5e9);
    background: var(--p-blue-ghost, rgba(14, 165, 233, 0.12));
}

.feed-row.is-consent-jump .feed-row-icon {
    color: #d97706;
    background: rgba(251, 191, 36, 0.16);
}

.feed-row-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feed-row-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--p-ink, #0f172a);
}

.feed-row-note {
    font-size: 0.8rem;
    color: var(--p-muted, #64748b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-row-count {
    flex: 0 0 auto;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: 13px;
    background: var(--p-blue, #0ea5e9);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-row.is-consent-jump .feed-row-count {
    background: #f59e0b;
}

.feed-row-arrow {
    flex: 0 0 auto;
    color: var(--p-muted, #94a3b8);
    font-size: 1rem;
}

/* Collapsible 孩子與帳戶管理 */
.home-account-manage {
    padding: 0;
    overflow: hidden;
}

.home-account-manage details {
    width: 100%;
}

.account-manage-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px;
    cursor: pointer;
    font-weight: 700;
    color: var(--p-ink, #0f172a);
    list-style: none;
}

.account-manage-summary::-webkit-details-marker {
    display: none;
}

.account-manage-summary > span:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-manage-summary > span:first-child i {
    color: var(--p-blue, #0ea5e9);
}

.account-manage-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-manage-caret {
    transition: transform 0.2s ease;
    color: var(--p-muted, #94a3b8);
}

.home-account-manage details[open] .account-manage-caret {
    transform: rotate(180deg);
}

.account-manage-body {
    padding: 0 18px 18px;
    border-top: 1px solid var(--p-border, #e2e8f0);
}

.account-stat-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 14px 0;
    flex-wrap: wrap;
}

.account-stat-label {
    font-size: 0.85rem;
    color: var(--p-muted, #64748b);
}

.account-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--p-ink, #0f172a);
}

.account-stat-note {
    font-size: 0.8rem;
    color: var(--p-muted, #94a3b8);
}

/* 隱藏容器：孩子摘要/帳戶管理元素，預設不顯示，只在「新增綁定孩子」時展開 */
.parent-manage-hidden { display: none; }
.parent-manage-hidden.is-visible { display: block; margin-top: 4px; }

/* ===================== 活動報名與記錄：列表／日曆雙模式 ===================== */
.activity-mode-switch.segment-group {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--p-surface-hover, #f1f5f9);
    border: 1px solid var(--p-border, #e2e8f0);
    border-radius: 12px;
    margin: 8px 0 0;
}
.activity-mode-switch .segment-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: none;
    background: transparent;
    color: var(--p-text-secondary, #475569);
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.activity-mode-switch .segment-btn:hover { color: var(--p-blue-deep, #0284c7); }
.activity-mode-switch .segment-btn.is-active {
    background: var(--p-surface, #fff);
    color: var(--p-blue-deep, #0284c7);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.activity-filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 12px;
}
.activity-filter-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--p-text-secondary, #475569);
    cursor: pointer;
    user-select: none;
}
.activity-filter-check input { accent-color: var(--p-blue, #0ea5e9); }

.activity-section { margin-bottom: 18px; }
.activity-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--p-text, #0f172a);
    margin: 0 0 10px;
}

.activity-section-title.is-past-title {
    color: var(--p-muted, #64748b);
    padding-top: 18px;
    margin-top: 10px;
    border-top: 1px dashed var(--p-border, #e2e8f0);
}

.activity-card {
    background: var(--p-surface, #fff);
    border: 1px solid var(--p-border, #e2e8f0);
    border-radius: 14px;
    padding: 14px 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.activity-card + .activity-card { margin-top: 10px; }
.activity-card:hover { border-color: var(--p-border-hover, #cbd5e1); }
/* 未決定 → 醒目底色 */
.activity-card.is-undecided {
    background: var(--p-warning-soft, #fef3c7);
    border-color: var(--p-warning, #f59e0b);
}
.activity-card.is-past { opacity: 0.72; }
.activity-card .history-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--p-text, #0f172a);
    margin-bottom: 6px;
}
.activity-card .history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    font-size: 12.5px;
    color: var(--p-text-secondary, #475569);
}
.activity-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* soft-chip 語意色（若主題未定義則以此為底） */
.soft-chip.is-success { background: #dcfce7; color: #15803d; }
.soft-chip.is-warning { background: var(--p-warning-soft, #fef3c7); color: #b45309; }
.soft-chip.is-danger { background: #fee2e2; color: #b91c1c; }
.soft-chip.is-neutral { background: var(--p-surface-hover, #f1f5f9); color: var(--p-text-secondary, #475569); }
.soft-chip.is-accent { background: var(--p-blue-soft, #e0f2fe); color: var(--p-blue-deep, #0284c7); }

/* ---- 日曆 ---- */
.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 8px 0 4px;
}
.cal-month-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
    font-weight: 700;
    color: var(--p-text, #0f172a);
    background: transparent;
    border: 0;
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.cal-month-label:hover { background: var(--p-surface-hover, #f1f5f9); }
.cal-month-label .bi { font-size: 13px; color: var(--p-muted, #94a3b8); transition: transform 0.15s ease; }
.cal-month-label.is-open .bi { transform: rotate(180deg); }
.cal-month-picker {
    margin: 4px 0 12px;
    padding: 12px;
    background: var(--p-surface, #fff);
    border: 1px solid var(--p-border, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}
.cal-picker-years {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--p-border, #e2e8f0);
}
.cal-picker-year {
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--p-text-secondary, #475569);
    background: var(--p-surface-hover, #f1f5f9);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
}
.cal-picker-year.is-active {
    color: #fff;
    background: var(--p-blue, #0ea5e9);
}
.cal-picker-months {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.cal-picker-month {
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--p-text, #0f172a);
    background: var(--p-surface-hover, #f1f5f9);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.cal-picker-month:hover { border-color: var(--p-blue, #0ea5e9); }
.cal-picker-month.is-active {
    color: #fff;
    background: var(--p-blue, #0ea5e9);
}
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 14px;
}
.cal-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--p-muted, #94a3b8);
    padding: 4px 0;
}
.cal-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--p-surface-hover, #f1f5f9);
    color: var(--p-text, #0f172a);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.12s ease;
}
.cal-cell.is-empty {
    background: transparent;
    cursor: default;
    pointer-events: none;
}
.cal-cell:hover:not(.is-empty) { border-color: var(--p-blue, #0ea5e9); }
.cal-cell.has-activity {
    background: var(--p-blue-soft, #e0f2fe);
    color: var(--p-blue-deep, #0284c7);
    font-weight: 600;
}
.cal-cell.has-undecided {
    background: var(--p-warning-soft, #fef3c7);
    color: #b45309;
}
.cal-cell.is-today { border-color: var(--p-blue, #0ea5e9); }
.cal-cell.is-selected {
    border-color: var(--p-blue-deep, #0284c7);
    box-shadow: 0 0 0 2px var(--p-blue-ghost, rgba(14, 165, 233, 0.18));
}
.cal-day-num { line-height: 1; }
.cal-dot {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--p-blue, #0ea5e9);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.cal-cell.has-undecided .cal-dot { background: var(--p-warning, #f59e0b); }
.cal-day-list { margin-top: 6px; }

/* ===================== 精簡活動列 + eNotice 回條式決定 modal ===================== */
.activity-row-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.activity-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    background: var(--p-surface, #fff);
    border: 1px solid var(--p-border, #e2e8f0);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.activity-row:hover {
    border-color: var(--p-blue, #0ea5e9);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}
.activity-row.is-undecided {
    background: var(--p-warning-soft, #fef3c7);
    border-color: var(--p-warning, #f59e0b);
}
.activity-row.is-past { opacity: 0.66; }
.activity-row-date {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--p-blue-deep, #0284c7);
}
.activity-row-date .bi { font-size: 12px; }
.activity-row.is-undecided .activity-row-date { color: #b45309; }
.activity-row-deadline {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 600;
    color: var(--p-blue-deep, #0284c7);
}
.activity-row-deadline.is-expired { color: #dc2626; }
.activity-row-deadline .bi { font-size: 12px; }
.activity-row.is-undecided .activity-row-deadline { color: #b45309; }
.activity-row.is-undecided .activity-row-deadline.is-expired { color: #dc2626; }
.activity-row-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.activity-row-title {
    display: block;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--p-text, #0f172a);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.activity-row-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: var(--p-blue-deep, #0284c7);
    background: var(--p-blue-soft, #e0f2fe);
    border-radius: 6px;
    padding: 1px 6px;
    vertical-align: middle;
    margin-left: 4px;
}
.activity-row .soft-chip { flex: 0 0 auto; font-size: 11.5px; }

/* --- eNotice 通告詳情 --- */
.enotice-detail {
    background: var(--p-surface, #fff);
    border: 1px solid var(--p-border, #e2e8f0);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
}
.enotice-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.enotice-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--p-text, #0f172a);
    margin: 0;
    line-height: 1.35;
}
.enotice-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    font-size: 13px;
    color: var(--p-text-secondary, #475569);
}
.enotice-meta .em-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    min-width: 0;
}
.enotice-meta .em-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.enotice-meta .em-label i { color: var(--p-blue, #0ea5e9); margin-right: 0; }
.enotice-meta .em-value {
    font-size: 13.5px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.45;
    word-break: break-word;
}
.enotice-meta .em-value.is-expired { color: #dc2626; }
.enotice-body {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--p-border, #e2e8f0);
    font-size: 14px;
    line-height: 1.7;
    color: var(--p-text, #0f172a);
    white-space: normal;
}

/* --- eNotice 回條（決定） --- */
.enotice-reply {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 4px 0 0;
}
.enotice-reply-head {
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--p-success, #16a34a);
    margin-bottom: 14px;
}
.enotice-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}
.enotice-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--p-surface, #fff);
    border: 1.5px solid var(--p-border, #e2e8f0);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.enotice-option:hover { border-color: var(--p-blue, #0ea5e9); }
.enotice-option.is-checked {
    border-color: var(--p-blue, #0ea5e9);
    background: var(--p-blue-ghost, rgba(14, 165, 233, 0.08));
}
.enotice-option input { position: absolute; opacity: 0; pointer-events: none; }
.enotice-option-dot {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--p-border-hover, #cbd5e1);
    position: relative;
    transition: all 0.15s ease;
}
.enotice-option.is-checked .enotice-option-dot {
    border-color: var(--p-blue, #0ea5e9);
}
.enotice-option.is-checked .enotice-option-dot::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--p-blue, #0ea5e9);
}
.enotice-option-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--p-text, #0f172a);
}
.enotice-family-btn { width: 100%; margin-bottom: 12px; }

/* --- 日曆該月活動列表 --- */
.cal-month-list { margin-top: 6px; }

/* --- eNotice 出席記錄（過去已報名活動） --- */
.enotice-attendance {
    margin-top: 14px;
    background: var(--p-blue-soft, #eff6ff);
    border: 1px solid var(--p-border, #e2e8f0);
    border-radius: 12px;
    padding: 16px;
}
.enotice-attendance .enotice-reply-head {
    color: var(--p-blue-deep, #0284c7);
}
.enotice-att-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13.5px;
    color: var(--p-text-secondary, #475569);
}
.enotice-att-meta i { color: var(--p-blue, #0ea5e9); margin-right: 4px; }

/* --- 報名及紀錄頁：最外層改為無卡片框（只保留間距） --- */
.activity-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* --- 活動工具列（模式切換 + 更多） --- */
.activity-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    padding-top: 16px;
}
.activity-toolbar .activity-mode-switch.segment-group {
    margin: 0;
}
/* 段控制項 active 按鈕有 box-shadow，預留少許空間避免視覺被切 */
.activity-mode-switch.segment-group { overflow: visible; }
.activity-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--p-text-secondary, #475569);
    background: var(--p-surface, #fff);
    border: 1px solid var(--p-border, #e2e8f0);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.activity-more-btn:hover { border-color: var(--p-blue, #0ea5e9); color: var(--p-blue-deep, #0284c7); }
.activity-more-btn.is-active {
    background: var(--p-blue-soft, #e0f2fe);
    border-color: var(--p-blue, #0ea5e9);
    color: var(--p-blue-deep, #0284c7);
}

/* --- 「更多」面板 --- */
.activity-more-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    background: var(--p-surface, #fff);
    border: 1px solid var(--p-border, #e2e8f0);
    border-radius: 12px;
}
.activity-more-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}
.activity-more-label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--p-text-secondary, #475569);
}
.activity-status-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.activity-status-filters .activity-filter-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    color: var(--p-text, #0f172a);
    cursor: pointer;
}
.activity-date-range {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: var(--p-text-secondary, #475569);
}
.activity-date-clear {
    font-size: 12.5px;
    padding: 6px 12px;
}
/* ===== 自製日期選擇欄位 + popup（網站風格，上限 2026-12-31）===== */
.activity-date-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 13.5px;
    border: 1px solid var(--p-border, #e2e8f0);
    border-radius: 10px;
    background: var(--p-surface, #fff);
    color: var(--p-text, #0f172a);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.activity-date-field:hover { border-color: var(--p-blue, #0ea5e9); }
.activity-date-field.is-open {
    border-color: var(--p-blue, #0ea5e9);
    box-shadow: 0 0 0 3px var(--p-blue-soft, rgba(14, 165, 233, 0.15));
}
.activity-date-field-label {
    font-weight: 700;
    color: var(--p-text-secondary, #475569);
}
.activity-date-field-value { color: var(--p-text, #0f172a); }
.activity-date-field .bi { color: var(--p-blue, #0ea5e9); font-size: 14px; }

.activity-date-popup {
    position: absolute;
    z-index: 60;
    top: 100%;
    left: 0;
    margin-top: 8px;
    width: min(320px, calc(100vw - 48px));
    padding: 12px;
    background: var(--p-surface, #fff);
    border: 1px solid var(--p-border, #e2e8f0);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}
.dp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.dp-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--p-border, #e2e8f0);
    border-radius: 8px;
    background: var(--p-surface, #fff);
    color: var(--p-text, #0f172a);
    cursor: pointer;
}
.dp-nav:hover:not(:disabled) { border-color: var(--p-blue, #0ea5e9); }
.dp-nav:disabled { opacity: 0.35; cursor: not-allowed; }
.dp-selects { display: flex; gap: 6px; }
.dp-selects select {
    padding: 5px 8px;
    font-size: 13px;
    border: 1px solid var(--p-border, #e2e8f0);
    border-radius: 8px;
    background: var(--p-surface, #fff);
    color: var(--p-text, #0f172a);
    cursor: pointer;
}
.dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}
.dp-weekday {
    text-align: center;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--p-muted, #94a3b8);
    padding: 4px 0;
}
.dp-cell {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--p-text, #0f172a);
    cursor: pointer;
}
.dp-cell.is-empty { cursor: default; }
.dp-cell:hover:not(.is-empty):not(.is-disabled):not(:disabled) { border-color: var(--p-blue, #0ea5e9); }
.dp-cell.is-selected {
    background: var(--p-blue, #0ea5e9);
    color: #fff;
    font-weight: 700;
}
.dp-cell.is-disabled, .dp-cell:disabled {
    color: var(--p-muted, #cbd5e1);
    opacity: 0.4;
    cursor: not-allowed;
}
.dp-foot {
    margin-top: 10px;
    text-align: center;
}
.dp-hint {
    font-size: 11.5px;
    color: var(--p-muted, #94a3b8);
}

/* 回條內嵌親子同行資料（v0.4.25） */
.enotice-family-inline {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--p-border, #e2e8f0);
}
.enotice-family-inline > .history-copy {
    margin: 4px 0 10px;
}
.enotice-family-inline .detail-panel {
    background: var(--p-surface, #fff);
    border: 1px solid var(--p-border, #e2e8f0);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
}

/* ===================== 更多頁面（清單式選單） ===================== */
.more-menu-list {
    display: flex;
    flex-direction: column;
    background: var(--p-surface, #fff);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-xl, 18px);
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

.more-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    border: none;
    border-bottom: 1px solid var(--p-border);
    background: transparent;
    color: var(--p-text, #1f2937);
    font-size: 0.98rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.16s ease;
}

.more-menu-item:last-child {
    border-bottom: none;
}

.more-menu-item:hover,
.more-menu-item:active {
    background: var(--p-surface-hover, #f1f5f9);
}

.more-menu-icon {
    flex: 0 0 auto;
    font-size: 1.25rem;
    color: var(--p-blue, #2563eb);
    width: 26px;
    text-align: center;
}

.more-menu-label {
    flex: 1 1 auto;
    min-width: 0;
}

.more-menu-arrow {
    flex: 0 0 auto;
    color: var(--p-muted, #94a3b8);
    font-size: 0.9rem;
}

.more-menu-item.is-danger {
    color: #dc2626;
}

.more-menu-item.is-danger .more-menu-icon {
    color: #dc2626;
}

.more-menu-gap {
    height: 10px;
    background: transparent;
    border-bottom: none;
}

/* 我的帳戶 modal */
.account-modal {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.account-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-field-label {
    font-size: 0.8rem;
    color: var(--p-muted, #94a3b8);
    font-weight: 600;
}

.account-field-value {
    font-size: 1rem;
    color: var(--p-text, #1f2937);
    font-weight: 600;
}

.account-children {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-child-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--p-surface-hover, #f1f5f9);
    border-radius: 10px;
    font-weight: 600;
    color: var(--p-text, #1f2937);
}

/* 更多選單：副標籤（狀態） */
.more-menu-sub {
    display: block;
    margin-top: 2px;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--p-muted, #94a3b8);
}

.more-menu-item.is-done .more-menu-icon {
    color: var(--p-success, #16a34a);
}

/* 通知中心：即時 / 普通 分頁 */
.notify-delivery-tabs {
    display: flex;
    gap: 8px;
    margin: 4px 0 14px;
    border-bottom: 1px solid var(--p-border, #e2e8f0);
}
.notify-delivery-tab {
    flex: 1;
    padding: 10px 8px;
    border: 0;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--p-muted, #94a3b8);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color .15s, border-color .15s;
}
.notify-delivery-tab i {
    margin-right: 4px;
}
.notify-delivery-tab.is-active {
    color: var(--p-accent, #2563eb);
    border-bottom-color: var(--p-accent, #2563eb);
}
.notify-delivery-tab:hover:not(.is-active) {
    color: var(--p-text, #1e293b);
}

/* 即時訊息 eClass 風格卡片 */
.im-card {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: var(--p-surface, #fff);
    border: 1px solid var(--p-border, #e2e8f0);
    border-radius: var(--p-radius-xl, 16px);
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s;
}
.im-card + .im-card {
    margin-top: 10px;
}
.im-card:hover {
    border-color: var(--p-accent, #2563eb);
    box-shadow: 0 4px 14px rgba(37, 99, 235, .08);
}
.im-card.is-unread {
    background: var(--p-accent-soft, #eff4ff);
}
.im-card-avatar {
    flex: 0 0 auto;
}
.im-avatar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 1.15rem;
}
.im-avatar-announcement { background: #dbeafe; color: #1d4ed8; }
.im-avatar-consent_pending { background: #fef3c7; color: #b45309; }
.im-avatar-consent_signed { background: #dcfce7; color: #15803d; }
.im-avatar-consent_rejected { background: #fee2e2; color: #b91c1c; }
.im-avatar-signup_created { background: #dcfce7; color: #15803d; }
.im-avatar-signup_cancelled { background: #fee2e2; color: #b91c1c; }
.im-avatar-system { background: #e0e7ff; color: #4338ca; }
.im-card-main {
    flex: 1 1 auto;
    min-width: 0;
}
.im-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}
.im-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--p-text, #1e293b);
}
.im-card-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    display: inline-block;
}
.im-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--p-text, #0f172a);
    margin-bottom: 4px;
    line-height: 1.4;
}
.im-card-body {
    font-size: 0.9rem;
    color: var(--p-muted, #64748b);
    margin: 0 0 8px;
    line-height: 1.5;
    word-break: break-word;
}
.im-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.im-card-time {
    font-size: 0.78rem;
    color: var(--p-muted, #94a3b8);
}
.im-card-detail-btn {
    border: 1px solid var(--p-border, #cbd5e1);
    background: var(--p-surface, #fff);
    color: var(--p-accent, #2563eb);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 4px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.im-card-detail-btn:hover {
    background: var(--p-accent, #2563eb);
    color: #fff;
}

/* 通知詳情彈窗 */
.im-detail-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--p-text, #0f172a);
    margin-bottom: 12px;
}
.im-detail-meta {
    background: var(--p-surface-hover, #f8fafc);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 14px;
}
.im-detail-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
    font-size: 0.9rem;
}
.im-detail-meta-row span {
    color: var(--p-muted, #94a3b8);
}
.im-detail-meta-row b {
    color: var(--p-text, #1e293b);
    font-weight: 600;
    text-align: right;
}
.im-detail-body {
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--p-text, #1e293b);
    white-space: pre-wrap;
    word-break: break-word;
}

/* 通知分頁未讀紅點 */
.notify-delivery-tab {
    position: relative;
}
.notify-tab-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    margin-left: 5px;
    vertical-align: middle;
}
.notify-tab-dot[hidden] {
    display: none;
}

/* 通知分頁未讀紅點 */
.notify-delivery-tab {
    position: relative;
}
.notify-tab-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    margin-left: 5px;
    vertical-align: middle;
}
.notify-tab-dot[hidden] {
    display: none;
}

/* 首頁本月已報名活動 */
.home-signups-section {
    margin-top: 4px;
}
.home-signups-section.is-hidden {
    display: none;
}
.home-signups-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--p-text, #0f172a);
    margin: 0 0 10px;
}

/* 孩子卡：距離上次參與活動 */
.child-hero-lastpart {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .25);
    font-size: 0.88rem;
    color: inherit;
}
.child-hero-lastpart i {
    font-size: 1rem;
    opacity: .9;
}
.child-hero-lastpart b {
    font-weight: 700;
}
.child-hero-lastpart-date {
    opacity: .8;
    font-size: 0.82rem;
}
.child-hero-lastpart.is-empty {
    opacity: .85;
}


/* v0.4.62 已報名活動回條：請假原因必填 */
.enotice-leave-reason { margin-top:14px; padding:14px; border:1px solid #fecaca; border-radius:12px; background:#fff7f7; }
.enotice-leave-reason label { display:block; margin-bottom:8px; color:#991b1b; }
.enotice-leave-reason textarea { width:100%; min-height:88px; resize:vertical; box-sizing:border-box; border:1px solid #fca5a5; border-radius:9px; padding:10px 12px; font:inherit; color:#1f2937; background:#fff; }
.enotice-leave-reason textarea:focus { outline:2px solid rgba(220,38,38,.15); border-color:#dc2626; }
.enotice-leave-reason .history-copy { margin:7px 0 0; color:#991b1b; }

/* v0.4.63 家長端孩子頭像大圖預覽／更換 */
.child-photo-entry { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.child-hero-avatar { cursor:pointer; appearance:none; padding:0; }
.child-hero-avatar.is-custom-photo img { width:100%; height:100%; object-fit:cover; border-radius:inherit; display:block; }
/* v0.6.234：須上傳隊員制服照 → toast（與隊員端 member-photo-required-prompt 同步） */
.child-photo-required-prompt {
    position:absolute;
    top: 12px;
    bottom:auto;
    left: 0;
    z-index: 8;
    border: 0;
    background: #ffffff;
    color: #b91c1c;
    font-weight: 700;
    font-size: .8rem;
    line-height: 1.3;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 16px rgba(15,23,42,.14);
    cursor: pointer;
    max-width: 200px;
    white-space: nowrap;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 6px;
}
.child-photo-required-prompt::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 20px;
    border: 6px solid transparent;
    border-top-color: #ffffff;
}
.child-photo-required-prompt span { font-size:1rem; margin-right:0; }
.child-photo-status { margin-top:5px; font-size:.74rem; display:flex; gap:4px; align-items:center; }
.child-photo-status.is-pending { color:#a16207; } .child-photo-status.is-rejected { color:#dc2626; }
.child-photo-modal { position:fixed; inset:0; z-index:100500; display:flex; align-items:center; justify-content:center; padding:18px; background:rgba(15,23,42,.72); backdrop-filter:blur(5px); }
.child-photo-dialog { width:min(460px,100%); max-height:92vh; overflow:auto; border-radius:20px; background:#fff; box-shadow:0 24px 70px rgba(0,0,0,.35); }
.child-photo-dialog-head { display:flex; align-items:center; justify-content:space-between; padding:18px 20px; border-bottom:1px solid #e5e7eb; }
.child-photo-dialog-head h3 { margin:0; font-size:1.1rem; } .child-photo-dialog-head button { border:0; width:34px; height:34px; border-radius:50%; background:#f1f5f9; cursor:pointer; }
.child-photo-preview { margin:20px; height:min(48vh,370px); border-radius:16px; overflow:hidden; display:flex; align-items:center; justify-content:center; background:#ddd6fe; }
.child-photo-preview img { width:100%; height:100%; object-fit:contain; background:#f8fafc; }
.child-photo-preview.is-empty { flex-direction:column; gap:12px; color:#64748b; } .child-photo-preview.is-empty i { font-size:4rem; }
.child-photo-rule { margin:0 20px 16px; padding:14px; border-radius:12px; background:#fff7ed; border:1px solid #fdba74; display:flex; flex-direction:column; gap:5px; }
.child-photo-rule strong { color:#c2410c; } .child-photo-rule span { color:#475569; font-size:.82rem; }
.child-photo-review-note { margin:0 20px 14px; color:#a16207; font-weight:700; }
.child-photo-review-note.is-rejected { color:#b91c1c; }
.child-photo-review-note.is-pending { color:#1d4ed8; }
.child-photo-force-note { margin:0 20px 14px; padding:12px 14px; border-radius:12px; background:#fef2f2; border:1px solid #fca5a5; color:#b91c1c; font-weight:700; display:flex; align-items:center; gap:8px; }
.child-photo-force-note i { font-size:1.05rem; }
.child-photo-modal.is-force .child-photo-change { width:100%; display:flex; justify-content:center; }
.child-photo-modal.is-force .child-photo-change span { background:#2563eb; color:#fff; border-radius:12px; padding:12px 22px; font-weight:700; }
.child-photo-modal.is-force .parent-btn-ghost { background:#eef2ff; color:#3730a3; border:1px solid #c7d2fe; border-radius:12px; padding:10px 22px; font-weight:700; cursor:pointer; }
.child-photo-actions { display:flex; justify-content:flex-end; gap:10px; padding:0 20px 20px; }
.child-photo-change { cursor:pointer; }
@media(max-width:520px){ .child-photo-entry{gap:4px}.child-photo-required-prompt{max-width:150px;font-size:.72rem;top:8px}.child-photo-preview{height:42vh;margin:14px}.child-photo-rule{margin:0 14px 14px}.child-photo-actions{padding:0 14px 16px} }

/* v0.4.64 1:1 頭像裁剪器 */
.yu-avatar-crop-modal{position:fixed;inset:0;z-index:100900;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(15,23,42,.82);backdrop-filter:blur(5px)}
.yu-avatar-crop-dialog{width:min(500px,100%);max-height:95vh;overflow:auto;background:#fff;color:#172033;border-radius:20px;box-shadow:0 26px 80px rgba(0,0,0,.4)}
.yu-avatar-crop-head{display:flex;align-items:center;justify-content:space-between;padding:17px 20px;border-bottom:1px solid #e5e7eb}.yu-avatar-crop-head h3{margin:0;font-size:1.08rem}.yu-avatar-crop-head button{border:0;width:34px;height:34px;border-radius:50%;background:#f1f5f9;cursor:pointer}
.yu-avatar-crop-help{margin:14px 20px 10px;color:#475569;font-size:.84rem;line-height:1.5}.yu-avatar-crop-stage{position:relative;margin:0 20px;aspect-ratio:1/1;overflow:hidden;border-radius:15px;background:#cbd5e1;touch-action:none}.yu-avatar-crop-stage canvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none}.yu-avatar-crop-stage canvas:active{cursor:grabbing}.yu-avatar-crop-frame{position:absolute;inset:0;pointer-events:none;border:3px solid rgba(255,255,255,.9);box-shadow:inset 0 0 0 1px rgba(15,23,42,.25)}
.yu-avatar-crop-zoom{display:flex;align-items:center;gap:12px;margin:14px 20px;color:#334155;font-weight:700}.yu-avatar-crop-zoom input{flex:1}.yu-avatar-crop-error{min-height:20px;margin:0 20px;color:#dc2626;font-size:.82rem}.yu-avatar-crop-actions{display:flex;justify-content:flex-end;gap:10px;padding:8px 20px 20px}.yu-avatar-crop-actions button{border:0;border-radius:10px;padding:10px 16px;font-weight:800;cursor:pointer}.yu-avatar-crop-secondary{background:#e2e8f0;color:#334155}.yu-avatar-crop-confirm{background:#0ea5e9;color:#fff}.yu-avatar-crop-confirm:disabled{opacity:.6;cursor:wait}
@media(max-width:520px){.yu-avatar-crop-modal{padding:10px}.yu-avatar-crop-dialog{border-radius:16px}.yu-avatar-crop-stage{margin:0 12px}.yu-avatar-crop-help,.yu-avatar-crop-zoom,.yu-avatar-crop-error{margin-left:12px;margin-right:12px}.yu-avatar-crop-actions{padding-left:12px;padding-right:12px}}

/* ===== 自製日期選擇器（家長端出生年月日，1990-2026，v0.6.188） ===== */
.pkr-bd { position: relative; display: inline-block; width: 100%; vertical-align: top; }
.pkr-bd-input { cursor: pointer; }
.pkr-bd-input:focus { outline: 2px solid #2563eb; outline-offset: -1px; }
.pkr-bd-panel {
    position: absolute; z-index: 1080; top: calc(100% + 4px); left: 0;
    min-width: 250px; padding: 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}
.pkr-bd-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.pkr-bd-head select {
    flex: 1; min-width: 0; padding: 5px 6px;
    border: 1px solid #cbd5e1; border-radius: 6px;
    background: #ffffff; color: #0f172a; font-size: 13px;
}
.pkr-bd-sep { color: #64748b; font-weight: 700; }
.pkr-bd-actions { display: flex; justify-content: flex-end; gap: 8px; }
.pkr-bd-clear, .pkr-bd-today, .pkr-bd-ok {
    padding: 5px 12px; font-size: 13px; border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f1f5f9; color: #334155; cursor: pointer;
}
.pkr-bd-clear:hover, .pkr-bd-today:hover, .pkr-bd-ok:hover { background: #2563eb; border-color: #2563eb; color: #ffffff; }
.pkr-bd-ok { background: #2563eb; border-color: #2563eb; color: #ffffff; }
