/* shell.css — แถบบน · แถบเมนูล่าง (มือถือ) / แท็บใต้หัว (จอใหญ่) · กรอบเนื้อหา · หัวหน้า */

.shell { min-height: 100dvh; }

.topbar {
    position: sticky; top: 0; z-index: 20;
    background: color-mix(in srgb, var(--paper) 82%, transparent);
    backdrop-filter: saturate(170%) blur(16px);
    -webkit-backdrop-filter: saturate(170%) blur(16px);
    padding-top: env(safe-area-inset-top);
}
/* ขอบล่างแบบจาง แทนเส้นแข็ง */
.topbar::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--line) 12%, var(--line) 88%, transparent);
}
.topbar__inner {
    max-width: 1040px; margin: 0 auto; padding: 10px 16px;
    display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; margin-right: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand__name { font-weight: 600; color: var(--brand); font-size: 1rem; white-space: nowrap; }
.brand__sub { font-size: .74rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__logout { margin: 0; }

/* แถบเมนู: มือถือ = แถบล่างลอย (วัสดุโปร่ง) · จอใหญ่ = แท็บใต้หัว */
.tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: saturate(170%) blur(18px);
    -webkit-backdrop-filter: saturate(170%) blur(18px);
    border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    padding: 6px 4px env(safe-area-inset-bottom);
}
.tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: calc(var(--tabbar-h) - 12px); color: var(--ink-2); text-decoration: none;
    font-size: .76rem; font-weight: 500;
}
.tab__icon {
    display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px;
    transition: background-color .18s ease, transform .1s ease-out, color .18s ease;
}
.tab:hover { color: var(--ink); }
.tab:active .tab__icon { transform: scale(.9); }
.tab.active { color: var(--brand); font-weight: 600; }
.tab.active .tab__icon { background: var(--brand-soft); }
/* 6–7 แถบบนจอแคบ (6 พ.ย. 69 เพิ่ม "ชำระเงิน" · 8 พ.ย. 69 เพิ่ม "LINE" เมื่อเปิดด่าน LINE): จำนวนช่องตามจำนวนแถบ ·
   ลดความกว้างพื้นหลังไอคอนไม่ให้ล้นช่อง · ป้ายห้ามตัดบรรทัด */
.tab > span:last-child { white-space: nowrap; }
@media (max-width: 420px) {
    .tab__icon { width: 40px; }
    .tab { font-size: .7rem; }
}
@media (max-width: 350px) {
    .tab__icon { width: 34px; }
    .tab { font-size: .64rem; }
}

.content {
    max-width: 1040px; margin: 0 auto;
    padding: 18px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom));
    outline: none;
}

@media (min-width: 900px) {
    .tabs {
        position: static; display: flex; gap: 4px; justify-content: flex-start;
        max-width: 1040px; margin: 0 auto; padding: 12px 12px 0; border-top: 0;
        background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
    }
    .tab { flex-direction: row; gap: 6px; min-height: 44px; padding: 0 12px 0 4px; border-radius: 999px; font-size: .95rem; }
    .tab__icon { width: 34px; height: 34px; background: transparent !important; }
    .tab:hover { background: var(--surface-2); }
    .tab.active { background: var(--brand-soft); }
    .content { padding: 22px 24px 56px; }
}

@media (prefers-reduced-transparency: reduce) {
    .topbar { background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; }
    .tabs { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@supports not (backdrop-filter: blur(1px)) {
    .topbar { background: var(--paper); }
    .tabs { background: var(--surface); }
}

/* ── หัวหน้า ─────────────────────────────────────────────── */
.page-head { margin: 6px 0 22px; display: grid; gap: 6px; }
.page-head h1 { font-size: 1.9rem; }
.page-head__lead { color: var(--ink-2); }
.page-head .muted { color: var(--ink-2); }
.back {
    display: inline-flex; align-items: center; gap: 4px; min-height: 44px; width: fit-content;
    text-decoration: none; font-size: .95rem; font-weight: 500;
}

/* แผงเนื้อหาทั่วไป */
.panel {
    background: var(--surface); border: 1px solid var(--line-soft); border-radius: 24px;
    padding: 22px 20px; box-shadow: var(--shadow-sm);
}
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel__title { margin-bottom: 10px; }
.panel__more { font-size: .92rem; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
