:root {
    --bg: #F4E6D3;
    --ink: #1B150F;
    --paper: #FFFDF8;
    --muted: #6F675D;
    --blue: #2F7C9F;
    --green: #6F924E;
    --orange: #D34F19;
    --soft-blue: #D9EAF1;
    --soft-green: #DCE8D1;
    --soft-orange: #F5C5B2;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { font-family: "Manrope", Arial, sans-serif; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.topbar { position: fixed; inset: 0 0 auto; z-index: 50; height: 78px; padding: 8px 14px; background: var(--bg); border-bottom: 2px solid var(--ink); display: flex; align-items: center; justify-content: space-between; }
.topbar-logo { width: 62px; height: 62px; object-fit: contain; filter: invert(1); }
.topbar-signout {
    position: absolute;
    top: 3px;
    right: 17px;

    color: var(--ink);
    font-size: 8px;
    font-weight: 700;
    line-height: 1;

    text-decoration: none;
    opacity: 0.38;
}

.topbar-signout:hover,
.topbar-signout:focus {
    opacity: 0.8;
    text-decoration: underline;
}
.identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.identity-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; font-size: 14px; }
.avatar { width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid var(--ink); border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-weight: 800; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.page { width: min(100%, 780px); min-height: 100dvh; margin: 0 auto; padding: 98px 16px 28px; }
.page.with-nav { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.card { background: var(--paper); border: 2px solid var(--ink); border-radius: 18px; box-shadow: 4px 5px 0 rgba(27,21,15,.12); }
.button { min-height: 48px; padding: 10px 14px; border: 2px solid var(--ink); border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; text-align: center; font-weight: 800; cursor: pointer; }
.button.blue { background: var(--blue); }
.button.light { background: var(--bg); }
.button.danger { background: var(--orange); }
.error { margin: 12px 0; padding: 11px; background: #FFE3D9; border: 1px solid #9B2F1D; border-radius: 10px; color: #7A2417; font-size: 13px; }
.bottom-nav { position: fixed; inset: auto 0 0; z-index: 50; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 2px solid var(--ink); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nav-item { min-height: 60px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-weight: 700; }
.nav-item.active { background: #DCE6DE; }
.nav-label { font-size: 15px; line-height: 1; }
.nav-thai { font-size: 11px; line-height: 1.1; opacity: .9; }
.logout-link { font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
