/* ============================================================
   Bereth365 - Final Unified Stylesheet
   ============================================================ */

:root {
    /* Primary Colors */
    --b365-primary: #D5FF5F;
    --b365-primary-dark: #B8E04A;
    --b365-primary-light: #E5FF8F;

    /* Background Colors */
    --b365-bg-light: #F7F7F2;
    --b365-bg-dark: #12130F;
    --b365-bg-card: #FFFFFF;
    --b365-nav-bg: #050704;
    --b365-avatar-bg: #1B2017;

    /* Secondary Colors */
    --b365-secondary: #2C3029;
    --b365-secondary-green: #A1C084;
    --b365-border: #E0E0D9;

    /* Text Colors */
    --b365-text-primary: #12130F;
    --b365-text-secondary: #6B6B6B;
    --b365-text-light: #999999;
    --b365-text-white: #FFFFFF;
    --b365-text-on-primary: #12130F;

    /* Functional Colors */
    --b365-success: #A1C084;
    --b365-danger: #E74C3C;
    --b365-warning: #F39C12;
    --b365-info: #3498DB;

    /* Effects */
    --b365-accent-glow: rgba(213, 255, 95, 0.08);

    /* Sizes */
    --b365-header-height: 56px;
    --b365-bottom-nav-height: 64px;
    --b365-border-radius: 16px;
    --b365-border-radius-sm: 8px;
    --b365-border-radius-lg: 24px;
    --b365-layout-max-width: 1200px;
    --b365-mobile-content-max-width: 412px;
    --b365-sidebar-width: 96px;

    /* Font */
    --b365-font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================================
   Base
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    margin: 0;
    padding: 0;
}

body.bereth365 {
    font-family: var(--b365-font-family);
    background-color: var(--b365-bg-dark);
    color: var(--b365-text-white);
    min-height: 100vh;
    min-width: 320px;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   App Layout
   ============================================================ */
.b365-app {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    position: relative;
    margin: 0;
    background-color: var(--b365-bg-dark);
}

.b365-app-main {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
}

.b365-content {
    width: 100%;
    min-width: 0;
    min-height: calc(100vh - var(--b365-header-height));
    padding-bottom: calc(var(--b365-bottom-nav-height) + env(safe-area-inset-bottom, 0) + 16px);
    box-sizing: border-box;
}

/* ============================================================
   Mobile Header
   ============================================================ */
.b365-header {
    width: 100%;
    max-width: 100%;
    margin: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--b365-nav-bg);
    border-bottom: 1px solid rgba(213, 255, 95, 0.08);
    box-sizing: border-box;
}

.b365-header,
.b365-header *,
.b365-header *::before,
.b365-header *::after {
    box-sizing: border-box;
}

.b365-header__inner {
    width: 100%;
    min-height: 92px;
    padding: 14px 28px 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* LEFT BRAND */
.b365-header__brand {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-width: 160px;
}

.b365-header__brand-link {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    line-height: 1;
    color: inherit;
}

.b365-header__logo-img {
    display: none;
    height: 56px;
    width: auto;
    object-fit: contain;
}

.b365-header__logo-img--visible {
    display: block;
}

.b365-header__brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.b365-header__brand-text--hidden {
    display: none;
}

.b365-header__brand-main {
    display: block;
    margin: 0;
    color: #FFFFFF;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1;
}

.b365-header__brand-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
    margin-left: 10px;
    padding: 3px 12px 4px;
    border-radius: 999px;
    background: var(--b365-primary);
    color: var(--b365-text-on-primary);
    font-size: 12px;
    font-weight: 800;
    font-style: italic;
    line-height: 1;
    white-space: nowrap;
}

/* RIGHT USER AREA */
.b365-header__user {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}

.b365-header__church-row {
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
}

.b365-header__church-icon {
    font-size: 12px;
    color: var(--b365-primary);
    line-height: 1;
}

.b365-header__church-name {
    color: var(--b365-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.4px;
    line-height: 1;
    white-space: nowrap;
}

.b365-header__user-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.b365-header__user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 0;
}

.b365-header__user-name {
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.b365-header__user-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.b365-header__user-stat {
    color: var(--b365-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.8px;
}

.b365-header__user-sep {
    color: rgba(213, 255, 95, 0.7);
    font-size: 12px;
    font-weight: 700;
}

/* AVATAR */
.b365-header__avatar-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.b365-header__avatar-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.b365-header__avatar,
.b365-header__avatar-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
    background: var(--b365-avatar-bg);
    border: 2px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.05),
        0 0 18px var(--b365-accent-glow);
}

.b365-header__avatar-placeholder .material-icons {
    font-size: 22px;
    color: var(--b365-primary);
}

/* Legacy compatibility */
.b365-header .logo {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.b365-header .logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--b365-text-white);
    letter-spacing: -0.5px;
}

.b365-header .logo-badge {
    background-color: var(--b365-primary);
    color: var(--b365-text-on-primary);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
}

.b365-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.b365-header-actions .btn-icon {
    background: none;
    border: none;
    color: var(--b365-text-white);
    font-size: 24px;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.b365-header-actions .btn-icon:hover {
    background-color: rgba(255,255,255,0.1);
}

/* ============================================================
   Bottom Navigation
   ============================================================ */

/* ============================================================
   Calendar Component
   ============================================================ */
.b365-calendar {
    background-color: var(--b365-bg-light);
    border-radius: var(--b365-border-radius-lg);
    padding: 20px 16px;
    margin: 16px;
    color: var(--b365-text-primary);
}

.b365-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.b365-calendar-header .month-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--b365-text-primary);
}

.b365-calendar-header .nav-btn {
    background: none;
    border: 1px solid var(--b365-border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--b365-text-primary);
}

.b365-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 8px;
}

.b365-calendar-weekdays span {
    font-size: 12px;
    font-weight: 600;
    color: var(--b365-text-light);
    padding: 4px 0;
}

.b365-calendar-weekdays span:first-child {
    color: var(--b365-danger);
}

.b365-calendar-weekdays span:last-child {
    color: var(--b365-info);
}

.b365-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.b365-calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.b365-calendar-day:hover {
    background-color: var(--b365-border);
}

.b365-calendar-day.today {
    background-color: var(--b365-primary);
    color: var(--b365-text-on-primary);
    font-weight: 700;
}

.b365-calendar-day.has-diary::after {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--b365-secondary-green);
    position: absolute;
    bottom: 4px;
}

.b365-calendar-day.selected {
    background-color: var(--b365-secondary);
    color: var(--b365-text-white);
}

/* ============================================================
   Section / Cards
   ============================================================ */
.b365-section {
    padding: 0 16px;
    margin-bottom: 24px;
}

.b365-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--b365-text-white);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.b365-section-title .material-icons {
    font-size: 20px;
    color: var(--b365-primary);
}

.b365-card {
    background-color: var(--b365-secondary);
    border-radius: var(--b365-border-radius);
    padding: 16px;
    margin-bottom: 12px;
    transition: transform 0.2s;
}

.b365-card:hover {
    transform: translateY(-1px);
}

.b365-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--b365-text-white);
    margin-bottom: 6px;
}

.b365-card-text {
    font-size: 13px;
    color: var(--b365-text-secondary);
    line-height: 1.5;
}

.b365-card-meta {
    font-size: 11px;
    color: var(--b365-text-light);
    margin-top: 8px;
}

/* ============================================================
   Quick Actions
   ============================================================ */
.b365-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px;
}

.b365-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--b365-text-white);
    gap: 6px;
}

.b365-quick-action .icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background-color: var(--b365-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.b365-quick-action .icon-wrap .material-icons {
    font-size: 24px;
    color: var(--b365-primary);
}

.b365-quick-action:hover .icon-wrap {
    background-color: var(--b365-primary);
}

.b365-quick-action:hover .icon-wrap .material-icons {
    color: var(--b365-text-on-primary);
}

.b365-quick-action span:last-child {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
}

/* ============================================================
   List Items
   ============================================================ */
.b365-list-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    text-decoration: none;
    color: var(--b365-text-white);
    transition: background-color 0.2s;
}

.b365-list-item:hover {
    background-color: rgba(255,255,255,0.04);
    color: var(--b365-text-white);
}

.b365-list-item .list-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background-color: var(--b365-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.b365-list-item .list-icon .material-icons {
    font-size: 20px;
    color: var(--b365-primary);
}

.b365-list-item .list-content {
    flex: 1;
    min-width: 0;
}

.b365-list-item .list-content .title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.b365-list-item .list-content .subtitle {
    font-size: 12px;
    color: var(--b365-text-light);
    margin-top: 2px;
}

.b365-list-item .list-arrow {
    color: var(--b365-text-light);
    font-size: 18px;
}

/* ============================================================
   Diary Tabs
   ============================================================ */
.b365-diary-type-tabs {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.b365-diary-type-tabs::-webkit-scrollbar {
    display: none;
}

.b365-diary-tab {
    padding: 8px 16px;
    border-radius: 100px;
    border: 1px solid rgba(255,255,255,0.15);
    background: none;
    color: var(--b365-text-light);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.b365-diary-tab.active {
    background-color: var(--b365-primary);
    color: var(--b365-text-on-primary);
    border-color: var(--b365-primary);
}

/* ============================================================
   Prayer Card
   ============================================================ */
.b365-prayer-card {
    background-color: var(--b365-secondary);
    border-radius: var(--b365-border-radius);
    padding: 16px;
    margin-bottom: 12px;
}

.b365-prayer-card .prayer-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.b365-prayer-card .prayer-content {
    font-size: 13px;
    color: var(--b365-text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.b365-prayer-card .prayer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.b365-prayer-card .pray-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--b365-primary);
}

.b365-prayer-card .pray-count .material-icons {
    font-size: 16px;
}

.b365-btn-pray {
    background-color: var(--b365-primary);
    color: var(--b365-text-on-primary);
    border: none;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.b365-btn-pray:hover {
    background-color: var(--b365-primary-dark);
}

.b365-btn-pray.prayed {
    background-color: var(--b365-secondary-green);
    color: var(--b365-text-white);
}

/* ============================================================
   Forms
   ============================================================ */
.b365-form-group {
    margin-bottom: 16px;
}

.b365-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--b365-text-white);
    margin-bottom: 6px;
}

.b365-form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--b365-border-radius-sm);
    background-color: var(--b365-secondary);
    color: var(--b365-text-white);
    font-size: 14px;
    transition: border-color 0.2s;
}

.b365-form-control:focus {
    outline: none;
    border-color: var(--b365-primary);
    box-shadow: 0 0 0 2px rgba(213, 255, 95, 0.15);
}

.b365-form-control::placeholder {
    color: var(--b365-text-light);
}

textarea.b365-form-control {
    resize: vertical;
    min-height: 120px;
}

/* ============================================================
   Buttons
   ============================================================ */
.b365-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--b365-border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 6px;
}

.b365-btn-primary {
    background-color: var(--b365-primary);
    color: var(--b365-text-on-primary);
}

.b365-btn-primary:hover {
    background-color: var(--b365-primary-dark);
    color: var(--b365-text-on-primary);
}

.b365-btn-secondary {
    background-color: var(--b365-secondary);
    color: var(--b365-text-white);
}

.b365-btn-secondary:hover {
    background-color: rgba(44, 48, 41, 0.8);
    color: var(--b365-text-white);
}

.b365-btn-outline {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--b365-text-white);
}

.b365-btn-outline:hover {
    border-color: var(--b365-primary);
    color: var(--b365-primary);
}

.b365-btn-block {
    width: 100%;
}

.b365-btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.b365-btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

/* ============================================================
   Video Card
   ============================================================ */
.b365-video-card {
    background-color: var(--b365-secondary);
    border-radius: var(--b365-border-radius);
    overflow: hidden;
    margin-bottom: 12px;
}

.b365-video-card .video-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background-color: #000;
}

.b365-video-card .video-info {
    padding: 12px 16px;
}

.b365-video-card .video-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.b365-video-card .video-verse {
    font-size: 12px;
    color: var(--b365-secondary-green);
}

.b365-video-card .video-date {
    font-size: 11px;
    color: var(--b365-text-light);
    margin-top: 4px;
}

.b365-video-player {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    border-radius: var(--b365-border-radius);
    overflow: hidden;
}

/* ============================================================
   Badge / Tag
   ============================================================ */
.b365-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
}

.b365-badge-primary {
    background-color: rgba(213, 255, 95, 0.15);
    color: var(--b365-primary);
}

.b365-badge-success {
    background-color: rgba(161, 192, 132, 0.15);
    color: var(--b365-secondary-green);
}

.b365-badge-danger {
    background-color: rgba(231, 76, 60, 0.15);
    color: var(--b365-danger);
}

/* ============================================================
   Empty State
   ============================================================ */
.b365-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    text-align: center;
}

.b365-empty .material-icons {
    font-size: 48px;
    color: var(--b365-text-light);
    margin-bottom: 12px;
}

.b365-empty p {
    color: var(--b365-text-light);
    font-size: 14px;
}

/* ============================================================
   Profile
   ============================================================ */
.b365-profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 16px;
}

.b365-profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--b365-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.b365-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.b365-profile-avatar .material-icons {
    font-size: 32px;
    color: var(--b365-text-light);
}

.b365-profile-info .name {
    font-size: 18px;
    font-weight: 700;
}

.b365-profile-info .church {
    font-size: 13px;
    color: var(--b365-text-light);
    margin-top: 2px;
}

/* ============================================================
   Splash
   ============================================================ */
.b365-splash {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--b365-primary);
    color: var(--b365-text-on-primary);
}

.b365-splash .logo-large {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -1px;
}

.b365-splash .tagline {
    font-size: 14px;
    font-weight: 500;
    margin-top: 8px;
    opacity: 0.7;
}

/* ============================================================
   Login Page
   ============================================================ */
.b365-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--b365-bg-light);
    padding: 24px;
}

.b365-login-card {
    width: 100%;
    max-width: 400px;
    background-color: var(--b365-bg-card);
    border-radius: var(--b365-border-radius-lg);
    padding: 40px 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

.b365-login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.b365-login-logo .logo-name {
    font-size: 32px;
    font-weight: 800;
    color: var(--b365-text-primary);
}

.b365-login-logo .logo-sub {
    display: inline-block;
    background-color: var(--b365-primary);
    color: var(--b365-text-on-primary);
    padding: 2px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    margin-top: 4px;
}

.b365-login-heading {
    text-align: center;
    font-size: 14px;
    color: var(--b365-text-secondary);
    margin-bottom: 24px;
}

.b365-login-form .form-group {
    margin-bottom: 16px;
}

.b365-login-form .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--b365-border);
    border-radius: var(--b365-border-radius-sm);
    background-color: var(--b365-bg-light);
    font-size: 14px;
    color: var(--b365-text-primary);
}

.b365-login-form .form-control:focus {
    outline: none;
    border-color: var(--b365-primary-dark);
    box-shadow: 0 0 0 2px rgba(213, 255, 95, 0.2);
}

.b365-login-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.b365-login-links a {
    font-size: 13px;
    color: var(--b365-text-secondary);
    text-decoration: none;
}

.b365-login-links a:hover {
    color: var(--b365-text-primary);
}

.b365-social-login {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
}

.b365-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: var(--b365-border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--b365-border);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.b365-social-btn.kakao {
    background-color: #FEE500;
    color: #191919;
    border-color: #FEE500;
}

.b365-social-btn.naver {
    background-color: #03C75A;
    color: #FFFFFF;
    border-color: #03C75A;
}

.b365-social-btn.google {
    background-color: #FFFFFF;
    color: #333333;
    border-color: #DADCE0;
}

/* ============================================================
   Sub Header
   ============================================================ */
.b365-subheader {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.b365-subheader .back-btn {
    background: none;
    border: none;
    color: var(--b365-text-white);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
}

.b365-subheader .page-title {
    font-size: 18px;
    font-weight: 700;
}

/* ============================================================
   FAB
   ============================================================ */
.b365-fab {
    position: fixed;
    bottom: calc(var(--b365-bottom-nav-height) + 16px);
    right: 16px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--b365-primary);
    color: var(--b365-text-on-primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(213, 255, 95, 0.3);
    transition: all 0.2s;
    z-index: 999;
}

.b365-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(213, 255, 95, 0.4);
}

.b365-fab .material-icons {
    font-size: 24px;
}

/* ============================================================
   Church Page
   ============================================================ */
.b365-church-hero {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 0 0 var(--b365-border-radius-lg) var(--b365-border-radius-lg);
}

.b365-church-section {
    padding: 24px 16px;
}

.b365-church-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--b365-text-white);
}

.b365-church-section p {
    font-size: 14px;
    color: var(--b365-text-secondary);
    line-height: 1.7;
}

.b365-map-container {
    width: 100%;
    height: 300px;
    border-radius: var(--b365-border-radius);
    overflow: hidden;
    margin: 16px 0;
}

/* ============================================================
   Event
   ============================================================ */
.b365-event-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.b365-event-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--b365-primary);
    margin-top: 5px;
    flex-shrink: 0;
}

.b365-event-info .event-title {
    font-size: 14px;
    font-weight: 600;
}

.b365-event-info .event-time {
    font-size: 12px;
    color: var(--b365-text-light);
    margin-top: 2px;
}

.b365-event-info .event-location {
    font-size: 12px;
    color: var(--b365-text-secondary);
    margin-top: 2px;
}

/* ============================================================
   PC Sidebar
   ============================================================ */
.b365-sidebar {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--b365-sidebar-width);
    background-color: var(--b365-bg-dark);
    border-right: 1px solid var(--b365-secondary);
    z-index: 1100;
    flex-direction: column;
    align-items: center;
    /* padding: 24px 0; */
}

.b365-sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    margin-top: 80px;
}

.b365-sidebar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #A8B0A1;
    opacity: 0.6;
    transition: all 0.2s;
    width: 48px;
}

.b365-sidebar-item .icon-wrap {
    width: 48px;
    height: 36px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.b365-sidebar-item span.nav-label {
    font-family: 'Arimo', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.b365-sidebar-item.active {
    color: var(--b365-primary);
    opacity: 1;
}

.b365-sidebar-item.active .icon-wrap {
    background-color: var(--b365-primary);
}

.b365-sidebar-item.active .icon-wrap .material-icons {
    color: var(--b365-text-on-primary);
}

.b365-sidebar-item:hover {
    opacity: 1;
    color: var(--b365-primary);
}

.b365-sidebar-logo {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
}

.b365-sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
   PC Header
   ============================================================ */
.b365-pc-header {
    display: none;
    height: 100px;
    background-color: var(--b365-bg-dark);
    /* border-bottom: 1px solid var(--b365-secondary); */
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.b365-pc-header .church-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.9;
}

.b365-pc-header .church-logo .church-icon {
    width: 24px;
    height: 24px;
}

.b365-pc-header .church-name {
    font-family: 'Arimo', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--b365-text-white);
    letter-spacing: 0.02em;
}

.b365-pc-header .user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.b365-pc-header .user-name {
    font-family: 'Arimo', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--b365-text-white);
}

.b365-pc-header .user-stats {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Arimo', sans-serif;
    font-size: 12px;
    color: var(--b365-text-white);
}

.b365-pc-header .user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--b365-primary);
    border: 2px solid var(--b365-primary);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.b365-pc-header .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
   Auth Pages
   ============================================================ */
.b365-auth-bg {
    min-height: 100vh;
    background-image: url('/img/intro-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.b365-auth-bg.with-overlay {
    position: relative;
}

.b365-auth-bg.with-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.b365-auth-card {
    position: relative;
    z-index: 1;
    width: 480px;
    max-width: 90vw;
    background: rgba(17, 21, 34, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

.b365-auth-logo {
    text-align: center;
    margin-bottom: 8px;
}

.b365-auth-logo .bereth-text {
    font-family: 'Arimo', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: var(--b365-primary);
    letter-spacing: -0.025em;
    line-height: 1;
    display: block;
}

.b365-auth-logo .planner-badge {
    display: inline-block;
    background-color: var(--b365-primary);
    color: var(--b365-text-on-primary);
    font-family: 'Arimo', sans-serif;
    font-size: 15px;
    padding: 2px 16px;
    border-radius: 1000px;
    margin-top: 4px;
    letter-spacing: -0.08em;
}

.b365-auth-subtitle {
    text-align: center;
    font-family: 'Arimo', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.025em;
    margin-bottom: 24px;
    text-shadow: none;
}

.b365-auth-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    color: #e8eaf0;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.b365-auth-input::placeholder {
    color: rgba(255, 255, 255, 0.38);
    opacity: 1;
}

.b365-auth-input:focus {
    border-color: var(--b365-accent, #d5ff5f);
    background: rgba(255, 255, 255, 0.09);
}

.b365-auth-input-with-icon {
    position: relative;
}

.b365-auth-input-with-icon .material-icons {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: rgba(255, 255, 255, 0.45);
    opacity: 1;
}

.b365-auth-input-with-icon input {
    padding-left: 50px;
}

.b365-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    box-shadow: 0 4px 6px -4px rgba(0,0,0,0.1), 0 10px 15px -3px rgba(0,0,0,0.1);
}

.b365-auth-btn-login {
    background-color: var(--b365-primary);
    color: var(--b365-text-on-primary);
}

.b365-auth-btn-login:hover {
    background-color: var(--b365-primary-dark);
}

.b365-auth-btn-google {
    background-color: #FFFFFF;
    color: var(--b365-text-primary);
}

.b365-auth-btn-kakao {
    background-color: #FEE500;
    color: var(--b365-text-primary);
}

.b365-auth-btn-naver {
    background-color: #03C75A;
    color: #FFFFFF;
}

.b365-auth-btn-outline {
    background: none;
    border: 1px solid var(--b365-secondary);
    color: var(--b365-text-primary);
}

.b365-auth-btn-outline:hover {
    border-color: var(--b365-primary);
    color: var(--b365-primary);
}

.b365-auth-btn-register {
    background: rgba(18, 19, 15, 0.05);
    border: 1px solid var(--b365-secondary);
    color: var(--b365-text-primary);
    font-weight: 700;
}

.b365-auth-divider {
    border: none;
    border-top: 1px solid var(--b365-secondary);
    margin: 16px 0;
    opacity: 0.3;
}

.b365-auth-social {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.b365-auth-social-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #FFFFFF;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    overflow: hidden;
}

.b365-auth-social-btn:hover {
    transform: scale(1.05);
}

.b365-auth-social-btn img {
    width: 48px;
    height: 48px;
}

.b365-auth-links {
    display: flex;
    gap: 10px;
}

.b365-auth-links a,
.b365-auth-links button {
    flex: 1;
    text-align: center;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s;
}

.b365-auth-links a:hover,
.b365-auth-links button:hover {
    border-color: var(--b365-accent, #d5ff5f);
    color: var(--b365-accent, #d5ff5f);
    background: rgba(213, 255, 95, 0.08);
}

@media (max-width: 1023px) {
    .b365-auth-links {
        flex-direction: column;
        gap: 8px;
    }

    .b365-auth-links a,
    .b365-auth-links button {
        width: 100%;
        flex: none;
    }
}

/* ============================================================
   Section Header
   ============================================================ */
.b365-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.b365-section-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--b365-text-white);
    margin: 0;
}

.b365-section-more {
    font-size: 13px;
    color: var(--b365-primary);
    text-decoration: none;
    font-weight: 500;
}

/* ============================================================
   Mobile Home Scoped
   ============================================================ */
.b365-home-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 12px 88px;
    background: #0A0C09;
}

.b365m-calendar-card,
.b365m-list-card {
    background: #232631;
    border-radius: 28px;
    padding: 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.b365m-calendar-card {
    padding: 14px 16px 18px;
}

.b365m-calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.b365m-calendar-month {
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
}

.b365m-icon-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.25);
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.b365m-icon-btn .material-icons {
    font-size: 18px;
}

.b365m-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px 8px;
}

.b365m-calendar-grid--week {
    margin-bottom: 14px;
}

.b365m-calendar-grid--week span {
    text-align: center;
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    font-weight: 700;
}

.b365m-calendar-grid--days {
    align-items: center;
}

.b365m-calendar-grid--days > span {
    display: block;
    height: 34px;
}

.b365m-day {
    width: 34px;
    height: 34px;
    margin: 0 auto;
    border: none;
    background: transparent;
    color: #FFFFFF;
    font-size: 15px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.b365m-day.is-active {
    background: #D7FF4B;
    color: #1D2217;
    font-weight: 800;
}

.b365m-shortcut-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.b365m-shortcut-card {
    min-height: 64px;
    border-radius: 999px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.b365m-shortcut-card--primary {
    background: #D7FF4B;
    color: #20251C;
}

.b365m-shortcut-card--dark {
    background: #232631;
    color: #D7FF4B;
}

.b365m-shortcut-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.b365m-list-card {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.b365m-list-title {
    color: #D7FF4B;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.2px;
    white-space: nowrap;
}

.b365m-avatar-stack {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 150px;
    padding-left: 8px;
}

.b365m-avatar-stack img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #232631;
    margin-left: -12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.22);
    background: #3A3F4D;
}

.b365m-avatar-stack img:first-child {
    margin-left: 0;
}

.b365m-bottom-church-tab {
    position: fixed;
    left: 12px;
    right: 12px;
    /* bottom-nav height + safe area + 여백 */
    bottom: calc(var(--b365-bottom-nav-height) + env(safe-area-inset-bottom, 0) + 12px);
    z-index: 2100; /* bottom-nav보다 위 */
}

.b365m-bottom-church-tab__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 72px;
    border-radius: 999px;
    background: #D7FF4B;
    color: #20251C;
    text-decoration: none;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.5px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.28);
    animation: b365mChurchFloat 2.6s ease-in-out infinite;
}

@keyframes b365mChurchFloat {
    0% {
        transform: translateY(0);
        box-shadow: 0 12px 30px rgba(0,0,0,0.28);
    }
    50% {
        transform: translateY(-4px);
        box-shadow: 0 16px 34px rgba(0,0,0,0.34);
    }
    100% {
        transform: translateY(0);
        box-shadow: 0 12px 30px rgba(0,0,0,0.28);
    }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1023px) {
    .b365-sidebar {
        display: none !important;
    }

    .b365-pc-header {
        display: none !important;
    }

    .b365-header {
        display: block !important;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .b365-bottom-nav {
        display: flex !important;
    }

    .b365-app-main {
        width: 100%;
        margin-left: 0;
    }

    .b365-content {
        max-width: var(--b365-mobile-content-max-width);
        margin-left: auto;
        margin-right: auto;
        padding-left: 0;
        padding-right: 0;
    }

    .b365-header__inner {
        min-height: 80px;
        padding: 12px 20px;
    }

    .b365-header__brand-main {
        font-size: 20px;
    }

    .b365-header__brand-pill {
        font-size: 10px;
        margin-left: 6px;
        padding: 3px 9px 4px;
    }

    .b365-header__church-name {
        font-size: 10px;
    }

    .b365-header__user-name {
        font-size: 13px;
    }

    .b365-header__user-stat,
    .b365-header__user-sep {
        font-size: 10px;
    }

    .b365-header__avatar,
    .b365-header__avatar-placeholder {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 767px) {
    .b365-header__inner {
        min-height: 74px;
        padding: 10px 14px;
        gap: 12px;
    }

    .b365-header__brand {
        min-width: auto;
    }

    .b365-header__brand-main {
        font-size: 18px;
    }

    .b365-header__brand-pill {
        margin-top: 3px;
        margin-left: 4px;
        font-size: 9px;
        padding: 2px 8px 3px;
    }

    .b365-header__church-row {
        gap: 3px;
    }

    .b365-header__church-icon {
        font-size: 10px;
    }

    .b365-header__church-name {
        font-size: 9px;
        letter-spacing: 1px;
    }

    .b365-header__user-row {
        gap: 8px;
    }

    .b365-header__user-info {
        gap: 4px;
    }

    .b365-header__user-name {
        font-size: 11px;
    }

    .b365-header__user-stats {
        gap: 4px;
    }

    .b365-header__user-stat,
    .b365-header__user-sep {
        font-size: 9px;
    }

    .b365-header__avatar,
    .b365-header__avatar-placeholder {
        width: 34px;
        height: 34px;
    }

    .b365-header__avatar-placeholder .material-icons {
        font-size: 18px;
    }
}

@media (min-width: 1024px) {
    .b365-app {
        display: flex;
        width: 100%;
        max-width: 100%;
    }

    .b365-sidebar {
        display: flex !important;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: var(--b365-sidebar-width);
        z-index: 1100;
    }

    .b365-pc-header {
        display: flex !important;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .b365-app-main {
        flex: 1;
        min-width: 0;
        margin-left: var(--b365-sidebar-width);
        width: calc(100% - var(--b365-sidebar-width));
    }

    .b365-header {
        display: none !important;
    }

    .b365-bottom-nav {
        display: none !important;
    }

    .b365-content {
        max-width: var(--b365-layout-max-width);
        margin: 0 auto;
        padding-bottom: 24px;
    }

    .b365-calendar {
        max-width: 500px;
        margin: 24px auto;
    }

    .b365-section {
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
    }

    .b365-header__inner {
        min-height: 86px;
        padding: 12px 34px 12px 26px;
    }

    .b365-header__brand-main {
        font-size: 22px;
    }

    .b365-header__brand-pill {
        font-size: 11px;
        padding: 3px 10px 4px;
        margin-left: 8px;
    }

    .b365-header__church-name {
        font-size: 11px;
    }

    .b365-header__user-name {
        font-size: 13px;
    }

    .b365-header__user-stat,
    .b365-header__user-sep {
        font-size: 11px;
    }

    .b365-header__avatar,
    .b365-header__avatar-placeholder {
        width: 40px;
        height: 40px;
    }
}

/* ============================================================
   Utility
   ============================================================ */
.b365-text-primary { color: var(--b365-primary) !important; }
.b365-text-secondary { color: var(--b365-text-secondary) !important; }
.b365-text-light { color: var(--b365-text-light) !important; }
.b365-bg-primary { background-color: var(--b365-primary) !important; }
.b365-bg-dark { background-color: var(--b365-bg-dark) !important; }
.b365-bg-card { background-color: var(--b365-secondary) !important; }
.b365-mt-1 { margin-top: 8px; }
.b365-mt-2 { margin-top: 16px; }
.b365-mt-3 { margin-top: 24px; }
.b365-mb-1 { margin-bottom: 8px; }
.b365-mb-2 { margin-bottom: 16px; }
.b365-mb-3 { margin-bottom: 24px; }
.b365-px { padding-left: 16px; padding-right: 16px; }
.b365-py { padding-top: 16px; padding-bottom: 16px; }

/* 1. 메인 레이아웃 래퍼 */
.app-layout {
  display: flex;
  min-height: 100vh;
}
 
/* 2. 콘텐츠 영역 - 항상 가운데 */
.main-content {
  flex: 1;                   
  overflow-y: auto;         
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 70px;      
}

.bottom-nav {
  flex-shrink: 0;           
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;           
  z-index: 99999;
}

/* *
*/
/* ================================================================
   BERETH 365 — 공통 디자인 시스템  v2.0
   berith_layout.html 의 <head> 안에 <link> 로 포함
   ================================================================ */

/* ── 토큰 ── */
:root {
  --b365-lime:         #D5FF5F;
  --b365-lime-dim:     #B8E040;
  --b365-lime-bg:      rgba(213,255,95,0.10);
  --b365-lime-bg2:     rgba(213,255,95,0.06);

  --b365-bg:           #0D0F0B;
  --b365-surface:      #161810;
  --b365-card:         #1C1F16;
  --b365-card-hover:   #222618;
  --b365-secondary:    #2C3029;

  --b365-border:       #2A2E22;
  --b365-border-light: #323628;

  --b365-text:         #E8ECDF;
  --b365-subtext:      #7A8270;
  --b365-text-dim:     rgba(232,236,223,0.35);
  --b365-icon-dark:    #252820;

  --b365-pink:         #FF7F9F;
  --b365-pink-text:    #FFF1B8;

  --b365-shadow:       0 8px 32px rgba(0,0,0,0.40);
  --b365-shadow-sm:    0 4px 16px rgba(0,0,0,0.28);

  --b365-r-xl:         26px;
  --b365-r-lg:         20px;
  --b365-r-md:         14px;
  --b365-r-sm:         10px;

  --b365-sidebar-w:    220px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--b365-bg);
  color: var(--b365-text);
  font-family: 'Noto Sans KR', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ================================================================
   앱바
   berith_layout.html body 안에 삽입할 HTML:

   <nav class="b365-appbar">
     <a href="/" class="b365-appbar-logo">
       <span class="b365-logo-dot"></span>
       <span class="b365-logo-text">BERETH<em>365</em></span>
     </a>
     <div class="b365-nav">
       <a href="/"         class="b365-nav-item" data-nav="home">
         <span class="material-icons">home</span>
         <span class="b365-nav-label">홈</span>
       </a>
       <a href="/church"   class="b365-nav-item" data-nav="church">
         <span class="material-icons">church</span>
         <span class="b365-nav-label">교회</span>
       </a>
       <a href="/schedule" class="b365-nav-item" data-nav="schedule">
         <span class="material-icons">calendar_month</span>
         <span class="b365-nav-label">일정</span>
       </a>
       <a href="/my"       class="b365-nav-item" data-nav="my">
         <span class="material-icons">person</span>
         <span class="b365-nav-label">내정보</span>
       </a>
     </div>
   </nav>
   <main class="b365-main" layout:fragment="content"></main>

   body 닫기 직전 스크립트:
   <script>
   (function(){
     var p = location.pathname;
     document.querySelectorAll('.b365-nav-item[data-nav]').forEach(function(el){
       var key = el.dataset.nav;
       var targets = { home:'/', church:'/church', schedule:'/schedule', my:'/my' };
       var t = targets[key];
       if(!t) return;
       var match = key==='home' ? (p==='/' || p.startsWith('/home') || p.startsWith('/berith'))
                 : p.startsWith(t);
       if(match) el.classList.add('active');
     });
   })();
   </script>
   ================================================================ */

.b365-appbar {
  position: fixed; z-index: 200;
  background: var(--b365-surface);
}

.b365-appbar-logo {
  display: flex; align-items: center; gap: 9px;
  padding: 26px 20px 20px;
  text-decoration: none;
}
.b365-logo-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--b365-lime); flex-shrink: 0;
}
.b365-logo-text {
  font-size: 14px; font-weight: 900;
  letter-spacing: -0.01em; color: var(--b365-text);
}
.b365-logo-text em { color: var(--b365-lime); font-style: normal; }

.b365-nav-item {
  display: flex; align-items: center; gap: 11px;
  text-decoration: none; color: var(--b365-subtext);
  font-size: 14px; font-weight: 700;
  transition: color 0.18s, background 0.18s;
  position: relative; cursor: pointer;
}
.b365-nav-item .material-icons { font-size: 22px; transition: color 0.18s; }
.b365-nav-item:hover,
.b365-nav-item.active { color: var(--b365-lime); text-decoration: none; }

/* 데스크탑 사이드바 */
@media (min-width: 768px) {
  .b365-appbar {
    left: 0; top: 0; bottom: 0;
    width: var(--b365-sidebar-w);
    border-right: 1px solid var(--b365-border);
    display: flex; flex-direction: column;
  }
  .b365-nav {
    display: flex; flex-direction: column;
    gap: 2px; padding: 4px 12px; flex: 1;
  }
  .b365-nav-item {
    padding: 11px 12px;
    border-radius: var(--b365-r-md);
  }
  .b365-nav-item:hover  { background: var(--b365-lime-bg2); }
  .b365-nav-item.active { background: var(--b365-lime-bg); }
  .b365-nav-item.active::before {
    content: ''; position: absolute;
    left: -12px; top: 22%; height: 56%;
    width: 3px; border-radius: 0 3px 3px 0;
    background: var(--b365-lime);
  }
  .b365-nav-label { display: inline; }
  .b365-main { margin-left: var(--b365-sidebar-w); }
}

/* 모바일 하단 탭바 */
@media (max-width: 767px) {
  .b365-appbar {
    left: 0; right: 0; bottom: 0; height: 60px;
    border-top: 1px solid var(--b365-border);
    display: flex; flex-direction: row; align-items: stretch;
  }
  .b365-appbar-logo { display: none; }
  .b365-nav { display: flex; flex-direction: row; width: 100%; }
  .b365-nav-item {
    flex: 1; flex-direction: column; justify-content: center;
    gap: 3px; padding: 7px 4px 9px;
    font-size: 10px; font-weight: 700; text-align: center;
  }
  .b365-nav-item .material-icons { font-size: 22px; }
  .b365-nav-label { display: block; }
  .b365-nav-item.active::before {
    content: ''; position: absolute; top: 0; left: 15%; width: 70%;
    height: 2px; border-radius: 0 0 3px 3px; background: var(--b365-lime);
  }
  .b365-main { padding-bottom: 70px; }
}

/* ================================================================
   공통 캘린더
   ================================================================ */
.calendar-inner { padding: 20px 20px 22px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.cal-title { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; color: var(--b365-text); }
.cal-nav {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--b365-border-light);
  background: var(--b365-surface); color: var(--b365-text);
  font-size: 16px; cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.18s, border-color 0.18s;
}
.cal-nav:hover { background: var(--b365-card-hover); border-color: var(--b365-lime-dim); }
.cal-week { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; margin-bottom: 6px; }
.cal-week span { text-align: center; font-size: 10px; font-weight: 700; color: var(--b365-subtext); padding: 4px 0; }
.cal-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }

.day { position: relative; width: 100%; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.day-inner {
  width: 72%; aspect-ratio: 1/1; border-radius: 50%;
  background: var(--b365-surface); color: var(--b365-text);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  border: 1px solid transparent; position: relative;
}
.day-number { position: relative; z-index: 2; }
.day.empty { pointer-events: none; cursor: default; }
.day.empty .day-inner { background: transparent; border-color: transparent; }
.day.today .day-inner { background: var(--b365-lime); color: #0D0F0B; box-shadow: 0 0 0 2px rgba(213,255,95,0.35); font-weight: 900; }
.day.selected .day-inner { background: var(--b365-lime-bg); color: var(--b365-lime); border-color: rgba(213,255,95,0.35); font-weight: 900; }
.day.today.selected .day-inner { background: var(--b365-lime); color: #0D0F0B; border-color: transparent; }
.day:not(.empty):not(.today):hover .day-inner { background: var(--b365-card-hover); }

.watch-stamp {
  position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%);
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--b365-pink); color: var(--b365-pink-text);
  border: 2px solid var(--b365-card); box-shadow: 0 4px 10px rgba(0,0,0,0.22);
  display: none; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 900; z-index: 3; line-height: 1;
}
.day.watched .watch-stamp { display: inline-flex; }

.schedule-bar {
  position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%);
  width: 16px; height: 4px; border-radius: 999px;
  background: var(--b365-lime); display: none; z-index: 2;
  box-shadow: 0 0 8px rgba(213,255,95,0.22);
}
.day.has-schedule .schedule-bar,
.day.has-church-schedule .schedule-bar { display: block; }
.day.watched.has-schedule .schedule-bar,
.day.watched.has-church-schedule .schedule-bar { bottom: 17px; width: 6px; height: 6px; }
.day.today .schedule-bar,
.day.selected .schedule-bar { background: #0D0F0B; box-shadow: none; }

/* ── 페이드인 ── */
@keyframes b365FadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.b365-fadein { animation: b365FadeUp 0.45s ease both; }

/* --- B365 Sub-Page Common Framework --- */

/* 1. 공통 헤더 (상단 고정) */
.b365-page-header {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 16px; position: sticky; top: 0; z-index: 100;
    background: var(--b365-bg);
}
.b365-page-header .back-btn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin-left: -8px;
    color: var(--b365-text); text-decoration: none;
    border-radius: 50%; transition: background 0.2s;
}
.b365-page-header .back-btn:hover { background: var(--b365-card-hover); }
.b365-page-header h2 { font-size: 19px; font-weight: 800; color: var(--b365-text); margin: 0; }

/* 2. 공통 컨테이너 */
.b365-container { padding: 0 16px 40px; animation: b365FadeUp 0.45s ease both; }

/* 3. 입력 필드 디자인 (Fluent Style) */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; font-size: 12px; font-weight: 700;
    color: var(--b365-subtext); margin-bottom: 8px;
    padding-left: 4px; letter-spacing: 0.03em; text-transform: uppercase;
}
.b365-input {
    width: 100%; padding: 14px 16px;
    background: var(--b365-card);
    border: 1px solid var(--b365-border);
    border-radius: var(--b365-r-lg);
    color: var(--b365-text); font-size: 15px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none; box-sizing: border-box;
}
.b365-input:focus {
    border-color: var(--b365-lime);
    background: var(--b365-bg);
    box-shadow: 0 0 0 4px rgba(213,255,95,0.1);
}
.b365-input::placeholder { color: var(--b365-text-dim); font-size: 14px; }

/* 4. 버튼 공통 (전폭 버튼) */
.b365-btn-full {
    width: 100%; padding: 16px; border-radius: var(--b365-r-xl);
    font-size: 16px; font-weight: 800; margin-top: 20px;
    box-shadow: var(--b365-shadow);
}