/* =========================================================
   1. لوحة ألوان مريحة للعين ومليئة بالطاقة الإيجابية
   ========================================================= */
:root {
    --font: 'IBM Plex Sans Arabic', sans-serif;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    /* الوضع النهاري */
    --bg-page: #f4f8fb;
    --bg-glass: rgba(255, 255, 255, 0.88);
    --bg-card: #ffffff;
    --bg-soft: #eef4f9;
    --text-primary: #102a43;
    --text-secondary: #486581;
    --border-hairline: rgba(16, 42, 67, 0.1);
    --grid-color: rgba(2, 132, 199, 0.045);

    /* ألوان حيوية مريحة */
    --sky: #0284c7;
    --sky-bg: rgba(2, 132, 199, 0.11);
    --sky-glow: rgba(2, 132, 199, 0.25);

    --mint: #0d9488;
    --mint-bg: rgba(13, 148, 136, 0.11);
    --mint-glow: rgba(13, 148, 136, 0.25);

    --indigo: #4f46e5;
    --indigo-bg: rgba(79, 70, 229, 0.11);
    --indigo-glow: rgba(79, 70, 229, 0.25);

    --coral: #e11d48;
    --coral-bg: rgba(225, 29, 72, 0.1);
    --sun: #d97706;
    --sun-bg: rgba(217, 119, 6, 0.12);

    --card-shadow: 0 8px 24px -6px rgba(16, 42, 67, 0.07);
}

[data-theme="dark"] {
    /* الوضع الليلي */
    --bg-page: #0b1120;
    --bg-glass: rgba(15, 23, 42, 0.84);
    --bg-card: #131c31;
    --bg-soft: #1b2842;
    --text-primary: #f0f9ff;
    --text-secondary: #94a3b8;
    --border-hairline: rgba(148, 163, 184, 0.15);
    --grid-color: rgba(56, 189, 248, 0.03);

    --sky: #38bdf8;
    --sky-bg: rgba(56, 189, 248, 0.14);
    --sky-glow: rgba(56, 189, 248, 0.3);

    --mint: #2dd4bf;
    --mint-bg: rgba(45, 212, 191, 0.14);
    --mint-glow: rgba(45, 212, 191, 0.3);

    --indigo: #818cf8;
    --indigo-bg: rgba(129, 140, 248, 0.14);
    --indigo-glow: rgba(129, 140, 248, 0.3);

    --card-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.5);
}

/* =========================================================
   2. التأسيس العام والخلفية المضيئة الهادئة
   ========================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font);
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.35s ease, color 0.3s ease;
    position: relative;
}

.soft-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: 34px 34px;
    z-index: -2;
    pointer-events: none;
}

.aura-light {
    position: fixed;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    filter: blur(115px);
    opacity: 0.35;
    z-index: -1;
    pointer-events: none;
    animation: auraDrift 15s infinite alternate ease-in-out;
}
.aura-one { top: -90px; right: -80px; background: var(--sky-glow); }
.aura-two { bottom: -90px; left: -80px; background: var(--mint-glow); animation-delay: -7s; }

@keyframes auraDrift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-30px, 35px) scale(1.12); }
}

/* =========================================================
   3. الهيدر العلوي وزر الإدارة المخفي (F3)
   ========================================================= */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-hairline);
    padding: calc(10px + var(--safe-top)) 16px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    min-width: 0;
}

.logo-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--sky), var(--indigo));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 16px var(--sky-glow);
    transition: transform 0.25s ease;
}
.logo-mark svg { width: 22px; height: 22px; }
.brand-box:hover .logo-mark { transform: scale(1.05) rotate(-4deg); }

.brand-titles h1 { font-size: 0.98rem; font-weight: 700; line-height: 1.2; }
.brand-titles span { font-size: 0.7rem; color: var(--text-secondary); display: block; }

.top-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.tool-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-hairline);
    background: var(--bg-card);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tool-btn svg { width: 18px; height: 18px; }
.tool-btn:active { transform: scale(0.88); }

.admin-pill-btn {
    height: 40px;
    padding: 0 13px;
    border-radius: 12px;
    border: 1px solid var(--border-hairline);
    background: var(--sky-bg);
    color: var(--sky);
    font-weight: 700;
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.admin-pill-btn svg { width: 16px; height: 16px; }
.admin-pill-btn:active { transform: scale(0.93); }

/* حالة الإخفاء الافتراضية لزر الإدارة حتى ضغط F3 */
.hidden-admin-trigger {
    display: none !important;
}
.hidden-admin-trigger.revealed {
    display: flex !important;
    animation: popInAdmin 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes popInAdmin {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* =========================================================
   4. الحاوية والحركة السلسة
   ========================================================= */
.page-wrapper {
    flex: 1;
    width: 100%;
    max-width: 1020px;
    margin: 0 auto;
    padding: 20px 14px 40px;
}

.view-section {
    display: none;
    animation: smoothFadeUp 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.view-section.active { display: block; }

@keyframes smoothFadeUp {
    from { opacity: 0; transform: translateY(12px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* =========================================================
   5. ترويسة الترحيب ومحدد المرحلة والشعبة والفرع
   ========================================================= */
.welcome-header {
    text-align: center;
    max-width: 620px;
    margin: 0 auto 20px;
}

.energy-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 99px;
    background: var(--mint-bg);
    color: var(--mint);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 10px;
}
.energy-badge svg { width: 15px; height: 15px; }

.welcome-header h2 { font-size: clamp(1.35rem, 4vw, 1.8rem); font-weight: 700; margin-bottom: 5px; }
.welcome-header p { font-size: 0.88rem; color: var(--text-secondary); }

.student-context-card {
    background: var(--bg-card);
    border: 1px solid var(--border-hairline);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
}

.context-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--sky);
    margin-bottom: 12px;
}
.context-header svg { width: 18px; height: 18px; }

.context-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.select-box label {
    display: block;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

/* زر اختيار عصري للهاتف بديل للقائمة المنسدلة النظامية */
.custom-picker-btn {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border-hairline);
    background: var(--bg-soft);
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: right;
}
.custom-picker-btn:hover {
    border-color: var(--sky);
    background: var(--sky-bg);
}
.custom-picker-btn:active {
    transform: scale(0.97);
}
.custom-picker-btn svg {
    width: 18px;
    height: 18px;
    color: var(--sky);
    flex-shrink: 0;
}

/* البطاقات الرئيسية */
.cards-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
    gap: 16px;
}

.nav-card {
    background: var(--bg-card);
    border: 1px solid var(--border-hairline);
    border-radius: 22px;
    padding: 22px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.spotlight::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(56, 189, 248, 0.1), transparent 50%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
.spotlight:hover::after, .spotlight:active::after { opacity: 1; }
.nav-card:active { transform: scale(0.96); }

.card-sky:hover { border-color: var(--sky); }
.card-mint:hover { border-color: var(--mint); }
.card-indigo:hover { border-color: var(--indigo); }

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.icon-badge {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.icon-badge svg { width: 25px; height: 25px; }

.card-sky .icon-badge { background: var(--sky-bg); color: var(--sky); }
.card-mint .icon-badge { background: var(--mint-bg); color: var(--mint); }
.card-indigo .icon-badge { background: var(--indigo-bg); color: var(--indigo); }

.go-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-card h3 { font-size: 1.22rem; font-weight: 700; margin-bottom: 6px; }
.nav-card p { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 16px; }

.card-foot {
    padding-top: 12px;
    border-top: 1px solid var(--border-hairline);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

/* =========================================================
   6. شريط الأيام وتصفية محاضرات اليوم المحدد
   ========================================================= */
.sub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 13px;
    border: 1px solid var(--border-hairline);
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.84rem;
    cursor: pointer;
    flex-shrink: 0;
}
.back-btn:active { transform: scale(0.93); }

.sub-titles { text-align: left; }
.sub-titles h2 { font-size: 1.18rem; font-weight: 700; }
.sub-titles span { font-size: 0.76rem; color: var(--text-secondary); }

.days-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
    margin-bottom: 14px;
    scrollbar-width: none;
}
.days-strip::-webkit-scrollbar { display: none; }

.day-pill {
    padding: 9px 15px;
    border-radius: 12px;
    border: 1px solid var(--border-hairline);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.84rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}
.day-pill.active {
    background: var(--sky);
    color: #fff;
    border-color: var(--sky);
    box-shadow: 0 4px 12px var(--sky-glow);
}

.search-input-wrap {
    position: relative;
    margin-bottom: 16px;
}
.search-input-wrap svg {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}
.search-input-wrap input {
    width: 100%;
    padding: 12px 42px 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border-hairline);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}
.search-input-wrap input:focus { border-color: var(--sky); }

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.subject-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-hairline);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease;
}
.subject-item-card:active { transform: scale(0.96); border-color: var(--sky); }

.subject-item-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.subject-item-card p { font-size: 0.8rem; color: var(--text-secondary); }

.view-ic {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--sky-bg);
    color: var(--sky);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* =========================================================
   7. الجدول العام والصور
   ========================================================= */
.block-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 10px;
}
.block-title svg { width: 18px; height: 18px; color: var(--indigo); }
.block-title h3 { font-size: 1rem; font-weight: 700; }

.gallery-section { margin-bottom: 20px; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.gallery-tile {
    background: var(--bg-card);
    border: 1px solid var(--border-hairline);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    cursor: pointer;
}
.gallery-img-box {
    aspect-ratio: 16 / 10;
    background: var(--bg-soft);
    overflow: hidden;
}
.gallery-img-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-cap { padding: 10px 12px; font-size: 0.84rem; font-weight: 700; }

.schedule-stack { display: flex; flex-direction: column; gap: 11px; }

.lec-card {
    background: var(--bg-card);
    border: 1px solid var(--border-hairline);
    border-right: 5px solid var(--sky);
    border-radius: 16px;
    padding: 15px 16px;
    box-shadow: var(--card-shadow);
    cursor: pointer;
}
.lec-card.lab-border { border-right-color: var(--mint); }

.lec-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 7px;
    flex-wrap: wrap;
    gap: 6px;
}

.chip-type {
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 700;
}
.chip-theory { background: var(--sky-bg); color: var(--sky); }
.chip-lab { background: var(--mint-bg); color: var(--mint); }

.lec-time { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }
.lec-card h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.lec-meta { font-size: 0.8rem; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 12px; }

/* =========================================================
   8. لوحة الإدارة وإدارة المراحل والشعب والفرع
   ========================================================= */
.admin-panel-box {
    background: var(--bg-card);
    border: 1px solid var(--border-hairline);
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: var(--card-shadow);
}

.panel-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-hairline);
}
.panel-head svg { width: 20px; height: 20px; color: var(--sky); }
.panel-head h3 { font-size: 1.04rem; font-weight: 700; }

.meta-managers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.meta-box {
    background: var(--bg-soft);
    border: 1px solid var(--border-hairline);
    border-radius: 15px;
    padding: 12px;
}
.meta-box h4 { font-size: 0.86rem; font-weight: 700; margin-bottom: 8px; }

.inline-add-row {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}
.inline-add-row input {
    flex: 1;
    min-width: 0;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-hairline);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.mini-add-btn {
    padding: 0 12px;
    border-radius: 10px;
    border: none;
    background: var(--mint);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
}

.tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 9px;
    background: var(--bg-card);
    border: 1px solid var(--border-hairline);
    font-size: 0.78rem;
    font-weight: 600;
}
.meta-tag-edit {
    border: none;
    background: var(--sun-bg);
    color: var(--sun);
    font-weight: 700;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: pointer;
}
.meta-tag button.meta-tag-del {
    border: none;
    background: none;
    color: var(--coral);
    font-weight: 800;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.field-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.field-group input,
.field-group select {
    width: 100%;
    padding: 11px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-hairline);
    background: var(--bg-soft);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}

.upload-box-label {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px;
    border-radius: 12px;
    border: 1.5px dashed var(--indigo);
    background: var(--indigo-bg);
    color: var(--indigo);
    font-weight: 700;
    font-size: 0.84rem;
    cursor: pointer;
}

.thumbs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.thumb-card { position: relative; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; }
.thumb-card img { width: 100%; height: 100%; object-fit: cover; }
.thumb-del {
    position: absolute; top: 4px; left: 4px;
    width: 26px; height: 26px; border-radius: 7px; border: none;
    background: var(--coral); color: #fff; font-weight: bold; cursor: pointer;
}

.action-submit-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: 13px;
    border: none;
    background: linear-gradient(135deg, var(--sky), #0369a1);
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    margin-top: 14px;
    box-shadow: 0 5px 15px var(--sky-glow);
}
.action-submit-btn.purple-grad {
    background: linear-gradient(135deg, var(--indigo), #4338ca);
    box-shadow: 0 5px 15px var(--indigo-glow);
}

.btn-row { display: flex; flex-direction: column; gap: 8px; }
.cancel-edit-btn {
    padding: 11px;
    border-radius: 12px;
    border: 1px solid var(--border-hairline);
    background: var(--bg-soft);
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
}

.list-heading-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.badge-count { padding: 2px 10px; border-radius: 99px; background: var(--sky-bg); color: var(--sky); font-weight: 700; font-size: 0.82rem; }

.admin-stack { display: flex; flex-direction: column; gap: 9px; }
.admin-row {
    background: var(--bg-card);
    border: 1px solid var(--border-hairline);
    border-radius: 15px;
    padding: 13px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.row-btns { display: flex; gap: 6px; }
.sm-btn {
    padding: 7px 11px;
    border-radius: 9px;
    border: none;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
}
.sm-edit { background: var(--sun-bg); color: var(--sun); }
.sm-del { background: var(--coral-bg); color: var(--coral); }

/* =========================================================
   9. التذييل الرسمي في الأسفل
   ========================================================= */
.site-footer {
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-hairline);
    padding: 18px 16px calc(18px + var(--safe-bottom));
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.footer-dept {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-primary);
}

.footer-dev {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sky);
}

/* =========================================================
   10. النوافذ المنبثقة العصرية للهاتف والعارض والتنبيهات
   ========================================================= */
.sheet-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(7px);
    z-index: 900;
    display: none;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}
@media (min-width: 640px) { .sheet-overlay { align-items: center; padding: 20px; } }
.sheet-overlay.active { display: flex; opacity: 1; }

.sheet-card {
    background: var(--bg-card);
    border: 1px solid var(--border-hairline);
    width: 100%;
    max-width: 470px;
    border-radius: 26px 26px 0 0;
    padding: 18px 20px calc(24px + var(--safe-bottom));
    transform: translateY(100%);
    transition: transform 0.34s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 640px) { .sheet-card { border-radius: 22px; transform: scale(0.94); } }
.sheet-overlay.active .sheet-card { transform: translateY(0) scale(1); }

.sheet-handle { width: 38px; height: 4px; border-radius: 99px; background: var(--border-hairline); margin: 0 auto 14px; }
@media (min-width: 640px) { .sheet-handle { display: none; } }

.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.picker-sheet-title { font-size: 1.08rem; font-weight: 700; color: var(--text-primary); }

.picker-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 60dvh;
    overflow-y: auto;
    padding-bottom: 4px;
}

.picker-option-btn {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--border-hairline);
    background: var(--bg-soft);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: right;
}
.picker-option-btn:active {
    transform: scale(0.98);
}
.picker-option-btn.selected {
    background: var(--sky-bg);
    border-color: var(--sky);
    color: var(--sky);
}
.picker-radio-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.picker-option-btn.selected .picker-radio-dot {
    border-color: var(--sky);
    background: var(--sky);
}
.picker-option-btn.selected .picker-radio-dot::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.sheet-close {
    width: 34px; height: 34px; border-radius: 10px;
    border: 1px solid var(--border-hairline); background: var(--bg-soft);
    color: var(--text-primary); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.sheet-title { font-size: 1.3rem; font-weight: 700; }
.sheet-sub { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 14px; }

.info-rows { display: flex; flex-direction: column; gap: 8px; }
.info-tile {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; border-radius: 14px;
    background: var(--bg-soft); border: 1px solid var(--border-hairline);
}
.tile-ic {
    width: 38px; height: 38px; border-radius: 11px;
    background: var(--sky-bg); color: var(--sky);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.info-tile small { display: block; font-size: 0.74rem; color: var(--text-secondary); }
.info-tile strong { font-size: 0.95rem; }

.center-sheet { text-align: center; }
.lock-badge {
    width: 50px; height: 50px; border-radius: 15px;
    background: var(--sky-bg); color: var(--sky);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 10px;
}
.center-sheet p { font-size: 0.84rem; color: var(--text-secondary); margin: 6px 0 14px; }
.pin-box {
    width: 100%; padding: 12px; border-radius: 13px;
    border: 1px solid var(--border-hairline); background: var(--bg-soft);
    color: var(--text-primary); font-size: 1.25rem; text-align: center; letter-spacing: 5px; outline: none;
}

.lightbox-overlay {
    position: fixed; inset: 0; background: rgba(11, 17, 32, 0.95);
    z-index: 1200; display: none; flex-direction: column;
    padding-top: var(--safe-top); padding-bottom: var(--safe-bottom);
}
.lightbox-overlay.active { display: flex; }
.lightbox-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.12);
}
.lb-icon-btn {
    width: 38px; height: 38px; border-radius: 10px;
    background: rgba(255,255,255,0.14); color: #fff; border: none;
    display: flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer;
}
.lightbox-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 14px; }
.lightbox-stage img { max-width: 100%; max-height: 82dvh; border-radius: 12px; object-fit: contain; }

.toast-msg {
    position: fixed; bottom: calc(18px + var(--safe-bottom)); left: 50%;
    transform: translateX(-50%) translateY(90px);
    background: var(--bg-card); border: 1px solid var(--border-hairline);
    color: var(--text-primary); padding: 10px 18px; border-radius: 13px;
    display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.86rem;
    box-shadow: 0 12px 30px rgba(0,0,0,0.28); z-index: 1500; opacity: 0;
    transition: all 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-msg.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.ripple-effect {
    position: absolute; border-radius: 50%;
    background: rgba(56, 189, 248, 0.25); transform: scale(0);
    animation: rippleGrow 0.6s ease-out; pointer-events: none;
}
@keyframes rippleGrow { to { transform: scale(4); opacity: 0; } }