:root {
    color-scheme: light;
    --forest-950: #131417;
    --forest-900: #191a1d;
    --forest-800: #202125;
    --forest-700: #d90000;
    --forest-100: #ffe5e5;
    --cream: #f4f5f7;
    --paper: #ffffff;
    --gold: #ff0000;
    --gold-soft: #fff0f0;
    --ink: #191a1d;
    --muted: #6d7078;
    --line: #e7e8eb;
    --danger: #bd2424;
    --danger-soft: #fff0f0;
    --success: #159447;
    --success-soft: #eaf7ef;
    --shadow: 0 18px 45px rgba(19, 20, 23, 0.09);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--cream);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--cream);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.login-page {
    background: var(--forest-950);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(22rem, 0.9fr) minmax(31rem, 1.1fr);
}

.login-brand {
    min-height: 100vh;
    padding: clamp(2rem, 5vw, 5rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background:
        radial-gradient(circle at 80% 18%, rgba(255, 0, 0, 0.22), transparent 28rem),
        linear-gradient(145deg, #101114 0%, #191a1d 70%, #24252a 100%);
    position: relative;
    overflow: hidden;
}

.login-brand::after {
    content: "G+";
    position: absolute;
    right: -2.8rem;
    bottom: -8rem;
    font-size: clamp(14rem, 31vw, 34rem);
    line-height: 1;
    font-weight: 900;
    letter-spacing: -0.12em;
    color: rgba(255, 255, 255, 0.035);
    pointer-events: none;
}

.login-brand > * {
    position: relative;
    z-index: 1;
}

.login-brand > img {
    width: min(13rem, 48%);
    border-radius: 1.15rem;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.brand-kicker,
.eyebrow {
    display: block;
    margin: 0 0 0.45rem;
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.login-brand h1 {
    max-width: 42rem;
    margin: 0;
    font-size: clamp(3rem, 6.5vw, 6.8rem);
    line-height: 0.94;
    letter-spacing: -0.065em;
}

.login-brand p {
    max-width: 32rem;
    margin: 1.7rem 0 0;
    color: rgba(255, 255, 255, 0.73);
    font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.login-brand > small {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.82rem;
}

.login-panel {
    display: grid;
    place-items: center;
    padding: clamp(2rem, 7vw, 7rem);
    background: var(--cream);
}

.login-card {
    width: min(100%, 29rem);
}

.mobile-logo {
    display: none;
}

.login-card h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.form-intro {
    margin: 0.75rem 0 2rem;
    color: var(--muted);
}

.google-button {
    min-height: 3.35rem;
    width: 100%;
    display: grid;
    grid-template-columns: 1.25rem minmax(0, 1fr) 1.25rem;
    align-items: center;
    column-gap: 0.75rem;
    box-sizing: border-box;
    border: 1px solid #747775;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    color: #1f1f1f;
    background: #fff;
    box-shadow: 0 2px 6px rgba(31, 31, 31, 0.08);
    font-family: "Google Sans", Roboto, Arial, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.google-button:hover {
    border-color: #5f6368;
    background: #f8fafd;
    box-shadow: 0 3px 8px rgba(31, 31, 31, 0.12);
}

.google-button:focus-visible {
    outline: 3px solid rgba(26, 115, 232, 0.24);
    outline-offset: 2px;
}

.google-button:active {
    background: #f1f3f4;
    transform: translateY(1px);
}

.google-mark {
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    display: block;
    overflow: hidden;
    border-radius: 50%;
}

.google-mark img {
    position: absolute;
    top: -0.625rem;
    left: -0.625rem;
    width: 2.5rem;
    height: 2.5rem;
    max-width: none;
}

.google-button-label {
    min-width: 0;
    text-align: center;
    white-space: nowrap;
}

.google-button-balance {
    width: 1.25rem;
    height: 1.25rem;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.25rem 0;
    color: var(--muted);
    font-size: 0.75rem;
}

.login-divider::before,
.login-divider::after {
    height: 1px;
    flex: 1;
    background: var(--line);
    content: '';
}

.login-form,
.password-form {
    display: grid;
    gap: 1.15rem;
}

.login-form label,
.password-form label {
    display: grid;
    gap: 0.45rem;
    color: #304139;
    font-size: 0.9rem;
    font-weight: 750;
}

input {
    width: 100%;
    min-height: 3.25rem;
    border: 1px solid #c9d4cf;
    border-radius: 0.8rem;
    padding: 0.78rem 0.95rem;
    color: var(--ink);
    background: var(--paper);
    font-size: 1rem;
    outline: 0;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus {
    border-color: var(--forest-700);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.11);
}

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    padding-right: 5.2rem;
}

.password-toggle {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    min-height: 2.25rem;
    border: 0;
    border-radius: 0.55rem;
    padding: 0 0.7rem;
    color: var(--forest-700);
    background: transparent;
    font-size: 0.78rem;
    font-weight: 800;
    transform: translateY(-50%);
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: var(--forest-100);
}

.primary-button {
    min-height: 3.35rem;
    border: 0;
    border-radius: 0.85rem;
    padding: 0.85rem 1.2rem;
    color: #fff;
    background: linear-gradient(135deg, #d90000, #bd0000);
    box-shadow: 0 9px 20px rgba(255, 0, 0, 0.2);
    font-weight: 800;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.primary-button:hover,
.primary-button:focus-visible {
    background: linear-gradient(135deg, #e90000, #c90000);
    transform: translateY(-1px);
}

.login-help {
    margin: 1.4rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.alert {
    margin: 0 0 1.2rem;
    border: 1px solid transparent;
    border-radius: 0.8rem;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    font-weight: 650;
}

.alert.error {
    border-color: #efc8c3;
    color: #7e2d25;
    background: var(--danger-soft);
}

.alert.success {
    border-color: #b8dfcc;
    color: #18593d;
    background: var(--success-soft);
}

.access-switcher {
    display: flex;
    align-items: end;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(19, 20, 23, 0.12);
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    background: #fff;
    box-shadow: 0 7px 20px rgba(19, 20, 23, 0.06);
}

.access-switcher label {
    min-width: 0;
    display: grid;
    flex: 1;
    gap: 0.35rem;
}

.access-switcher label > span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.access-switcher select {
    width: 100%;
    min-height: 2.85rem;
    border: 1px solid #c9d4cf;
    border-radius: 0.7rem;
    padding: 0.65rem 0.8rem;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

.access-switcher button {
    min-height: 2.85rem;
    border: 0;
    border-radius: 0.7rem;
    padding: 0.65rem 1rem;
    color: #fff;
    background: var(--forest-950);
    font-weight: 800;
    cursor: pointer;
}

.app-shell {
    min-height: 100vh;
}

.topbar {
    min-height: 4.5rem;
    display: grid;
    grid-template-columns: minmax(11rem, 1fr) auto minmax(11rem, 1fr);
    align-items: center;
    gap: 1.5rem;
    border-bottom: 3px solid var(--forest-700);
    padding: 0 max(1.25rem, calc((100vw - 76rem) / 2));
    color: #fff;
    background: rgba(19, 20, 23, 0.97);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    justify-self: start;
    color: #fff;
    text-decoration: none;
}

.brand img {
    width: 3.25rem;
    height: 3.25rem;
    flex: 0 0 auto;
    object-fit: contain;
}

.brand-copy {
    min-width: 0;
    display: grid;
    line-height: 1.05;
}

.brand-copy strong {
    font-size: 0.86rem;
    font-weight: 900;
    letter-spacing: 0.045em;
    white-space: nowrap;
}

.brand-copy small {
    margin-top: 0.28rem;
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.67rem;
    font-weight: 650;
    letter-spacing: 0.025em;
}

.desktop-nav {
    display: flex;
    justify-self: center;
    justify-content: center;
    gap: 0.35rem;
}

.desktop-nav a {
    border-radius: 999px;
    padding: 0.62rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 750;
}

.desktop-nav a:hover,
.desktop-nav a.active {
    color: #fff;
    background: var(--forest-700);
}

.account-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-self: end;
}

.avatar {
    width: 2.55rem;
    height: 2.55rem;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    color: #fff;
    background: var(--forest-700);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.04em;
}

.avatar.large {
    width: 5rem;
    height: 5rem;
    font-size: 1.35rem;
}

.account-copy {
    display: grid;
    min-width: 0;
    line-height: 1.2;
}

.account-copy strong {
    max-width: 11rem;
    overflow: hidden;
    font-size: 0.88rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-copy small {
    max-width: 11rem;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-button {
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.65rem;
    padding: 0.48rem 0.72rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.78rem;
    font-weight: 750;
    cursor: pointer;
}

.logout-button:hover,
.logout-button:focus-visible {
    border-color: var(--forest-700);
    color: #fff;
    background: var(--forest-700);
}

.content {
    width: min(100% - 2.5rem, 76rem);
    margin: 0 auto;
    padding: clamp(2.2rem, 4vw, 3.5rem) 0 6rem;
}

.refresh-tools { display: flex; justify-content: flex-end; align-items: center; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.refresh-button, .history-filters button, .history-filters a { min-height: 44px; border: 1px solid var(--line); border-radius: 0.65rem; padding: 0.65rem 1rem; background: var(--paper); color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; }
.refresh-tools [role="status"] { color: var(--muted); font-size: 0.875rem; }
.refresh-button:focus-visible, .history-filters :focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.history-filters { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin: 0 0 1.5rem; }
.history-filters nav, .history-filters form { display: flex; align-items: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.history-filters a { display: inline-flex; align-items: center; text-decoration: none; }
.history-filters a[aria-current="page"] { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.history-filters label { display: grid; gap: 0.35rem; color: var(--muted); font-size: 0.875rem; }
.history-filters input { min-height: 44px; min-width: 0; max-width: 100%; padding: 0.6rem; border: 1px solid var(--line); border-radius: 0.65rem; color: var(--ink); background: var(--paper); font: inherit; font-size: 1rem; }
.quota-progress { display: block; appearance: none; width: 100%; height: 0.5rem; border: 0; border-radius: 1rem; overflow: hidden; background: var(--line); }
.quota-progress::-webkit-progress-bar { background: var(--line); border-radius: 1rem; }
.quota-progress::-webkit-progress-value { background: var(--forest-700); border-radius: 1rem; }
.quota-progress::-moz-progress-bar { background: var(--forest-700); border-radius: 1rem; }
.history-panel .panel-heading > a { display: inline-flex; align-items: center; min-height: 44px; }

.welcome-row,
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.welcome-row h1,
.page-heading h1 {
    margin: 0;
    font-size: clamp(2.3rem, 5vw, 4.2rem);
    line-height: 1;
    letter-spacing: -0.055em;
}

.welcome-row > div > p:last-child,
.page-heading > div > p:last-child {
    margin: 0.65rem 0 0;
    color: var(--muted);
}

.availability {
    min-width: 14rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border: 1px solid #cde3d8;
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.62);
}

.availability > span {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: #34a470;
    box-shadow: 0 0 0 5px rgba(52, 164, 112, 0.13);
}

.availability.waiting > span {
    background: var(--gold);
    box-shadow: 0 0 0 5px rgba(199, 155, 69, 0.15);
}

.availability div {
    display: grid;
    line-height: 1.25;
}

.availability small {
    color: var(--muted);
    font-size: 0.72rem;
}

.availability strong {
    font-size: 0.9rem;
}

.quota-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 0.72fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.quota-card,
.panel {
    border: 1px solid rgba(19, 20, 23, 0.1);
    border-radius: 1.25rem;
    background: var(--paper);
    box-shadow: 0 8px 30px rgba(19, 20, 23, 0.045);
}

.quota-card {
    min-height: 12rem;
    padding: 1.5rem;
}

.quota-card.featured {
    color: #fff;
    background: linear-gradient(135deg, var(--forest-950) 0%, #25262b 70%, #500000 100%);
    box-shadow: 0 18px 36px rgba(19, 20, 23, 0.16);
}

.quota-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.quota-head > span,
.total-card > span {
    color: var(--muted);
    font-size: 0.83rem;
    font-weight: 750;
}

.featured .quota-head > span,
.featured p {
    color: rgba(255, 255, 255, 0.7);
}

.quota-head > strong,
.total-card > strong {
    font-size: 2.25rem;
    line-height: 1;
    letter-spacing: -0.05em;
}

.quota-head strong small {
    font-size: 0.8rem;
    font-weight: 650;
    letter-spacing: 0;
}

.progress {
    height: 0.48rem;
    margin: 2rem 0 0.8rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.progress span {
    height: 100%;
    display: block;
    border-radius: inherit;
    background: var(--gold);
}

.progress.monthly {
    background: var(--forest-100);
}

.progress.monthly span {
    background: var(--forest-700);
}

.quota-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.unlimited-line {
    height: 0.48rem;
    margin: 2rem 0 0.8rem;
    border-radius: 999px;
    background: repeating-linear-gradient(90deg, var(--gold) 0 1.2rem, var(--gold-soft) 1.2rem 1.55rem);
}

.total-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--gold-soft);
}

.total-card > strong {
    margin: 0.65rem 0 0.5rem;
    font-size: 3.3rem;
    color: var(--forest-950);
}

.dashboard-grid,
.security-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel {
    padding: 1.5rem;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.panel-heading h2 {
    margin: 0;
    font-size: 1.3rem;
    letter-spacing: -0.025em;
}

.panel-heading a {
    color: #df0000;
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
}

.status-pill,
.consumption-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.32rem 0.62rem;
    color: var(--success);
    background: var(--success-soft);
    font-size: 0.72rem;
    font-weight: 800;
}

.profile-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.15rem 1.5rem;
    margin: 0;
}

.profile-list div {
    min-width: 0;
}

.profile-list dt,
.account-card dt {
    color: var(--muted);
    font-size: 0.72rem;
}

.profile-list dd,
.account-card dd {
    margin: 0.2rem 0 0;
    overflow-wrap: anywhere;
    font-size: 0.93rem;
    font-weight: 700;
}

.option-list {
    display: grid;
    gap: 0.85rem;
}

.option-list > div {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.85rem;
}

.option-list > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.option-icon {
    width: 2.4rem;
    height: 2.4rem;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 0.7rem;
    color: #cf0000;
    background: var(--gold-soft);
    font-size: 0.78rem;
    font-weight: 900;
}

.option-list p {
    display: grid;
    margin: 0;
    line-height: 1.25;
}

.option-list small {
    color: var(--muted);
    font-size: 0.72rem;
}

.option-list strong {
    margin-top: 0.16rem;
    font-size: 0.92rem;
}

.history-panel {
    overflow: hidden;
}

.consumption-list {
    display: grid;
}

.consumption-list article {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 10.5rem 6.8rem;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid var(--line);
    padding: 1rem 0;
}

.consumption-list article:first-child {
    border-top: 0;
}

.drink-mark {
    width: 2.7rem;
    height: 2.7rem;
    display: grid;
    place-items: center;
    border-radius: 0.78rem;
    color: #cf0000;
    background: var(--gold-soft);
    font-size: 0.74rem;
    font-weight: 900;
}

.consumption-main {
    min-width: 0;
    display: grid;
    line-height: 1.28;
}

.consumption-main strong,
.consumption-main span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.consumption-main strong {
    font-size: 0.93rem;
}

.consumption-main span,
.consumption-list time {
    color: var(--muted);
    font-size: 0.78rem;
}

.consumption-status.waiting {
    color: #7a5b18;
    background: var(--gold-soft);
}

.consumption-status.neutral {
    color: var(--muted);
    background: #edf0ee;
}

.empty-state {
    padding: 2rem 1rem;
    text-align: center;
}

.empty-state.large {
    padding: 5rem 1rem;
}

.empty-state strong {
    font-size: 1.05rem;
}

.empty-state p {
    margin: 0.4rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.total-badge {
    min-width: 7rem;
    border-radius: 1rem;
    padding: 0.8rem 1.1rem;
    color: #fff;
    background: var(--forest-900);
    text-align: center;
}

.total-badge small,
.total-badge strong {
    display: block;
}

.total-badge small {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.72rem;
}

.total-badge strong {
    font-size: 1.65rem;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid var(--line);
    padding-top: 1.2rem;
}

.pagination a {
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    padding: 0.6rem 0.85rem;
    color: var(--forest-700);
    background: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none;
}

.pagination a.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.pagination span {
    color: var(--muted);
    font-size: 0.8rem;
}

.security-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(17rem, 0.8fr);
}

.password-card {
    padding: clamp(1.5rem, 4vw, 2.3rem);
}

.password-form {
    max-width: 34rem;
}

.password-form label > small {
    color: var(--muted);
    font-weight: 500;
}

.form-error {
    border-radius: 0.7rem;
    padding: 0.7rem 0.85rem;
    color: var(--danger);
    background: var(--danger-soft);
    font-size: 0.82rem;
    font-weight: 700;
}

.notice {
    margin-bottom: 1.3rem;
    border-left: 4px solid var(--gold);
    border-radius: 0 0.7rem 0.7rem 0;
    padding: 0.8rem 1rem;
    background: #fbf5e8;
}

.notice p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.account-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.account-card h2 {
    margin: 1rem 0 0;
    font-size: 1.25rem;
}

.account-card > p {
    margin: 0.25rem 0 1.5rem;
    color: var(--muted);
    overflow-wrap: anywhere;
    font-size: 0.84rem;
}

.account-card dl {
    width: 100%;
    display: grid;
    gap: 0.8rem;
    margin: 0;
}

.account-card dl div {
    border-top: 1px solid var(--line);
    padding-top: 0.8rem;
}

.machine-map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(18rem, 0.75fr);
    align-items: start;
    gap: 1rem;
}

.map-panel {
    min-width: 0;
    overflow: hidden;
    padding: 0;
}

.map-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.4rem 1.5rem;
}

.map-heading h2 {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: -0.025em;
}

.map-heading p:last-child {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.map-heading a {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 0.65rem 0.9rem;
    color: #fff;
    background: var(--forest-950);
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
}

.map-heading a:hover,
.map-heading a:focus-visible {
    background: var(--forest-700);
}

.map-frame {
    height: clamp(25rem, 55vh, 40rem);
    border-top: 1px solid var(--line);
    background: #e9eaec;
}

.map-frame iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

.map-unavailable {
    min-height: 32rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.map-unavailable > span {
    width: 4rem;
    height: 4rem;
    display: grid;
    place-items: center;
    margin-bottom: 1rem;
    border-radius: 50%;
    color: #d00000;
    background: var(--gold-soft);
    font-size: 2rem;
    font-weight: 900;
}

.map-unavailable strong {
    font-size: 1.1rem;
}

.map-unavailable p {
    max-width: 28rem;
    margin: 0.4rem 0 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.machine-location-panel {
    max-height: calc(clamp(25rem, 55vh, 40rem) + 8.3rem);
    overflow: auto;
}

.machine-location-list {
    display: grid;
    gap: 0.6rem;
}

.machine-location-list > a,
.machine-location-list > div {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    padding: 0.9rem;
    color: var(--ink);
    background: #fff;
    text-decoration: none;
}

.machine-location-list > a:hover,
.machine-location-list > a:focus-visible {
    border-color: rgba(255, 0, 0, 0.38);
    background: #fff8f8;
}

.machine-location-list > a.active {
    border-color: var(--forest-700);
    background: var(--gold-soft);
    box-shadow: inset 3px 0 0 var(--forest-700);
}

.machine-location-list .missing-location {
    background: #f7f7f8;
    opacity: 0.75;
}

.location-pin {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--forest-700);
    font-size: 0.65rem;
    font-weight: 900;
}

.missing-location .location-pin {
    color: var(--muted);
    background: #e4e5e8;
    font-size: 0.82rem;
}

.machine-location-list > a > span:last-child,
.machine-location-list > div > span:last-child {
    min-width: 0;
    display: grid;
    line-height: 1.3;
}

.machine-location-list strong,
.machine-location-list small,
.machine-location-list em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.machine-location-list strong {
    font-size: 0.9rem;
}

.machine-location-list small {
    margin-top: 0.12rem;
    color: var(--muted);
    font-size: 0.75rem;
}

.machine-location-list em {
    margin-top: 0.3rem;
    color: #bd0000;
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 750;
}

.missing-location em {
    color: var(--muted);
}

.map-privacy-note {
    margin: 0.8rem 0 0;
    color: var(--muted);
    font-size: 0.72rem;
    text-align: center;
}

.mobile-nav {
    display: none;
}

.install-prompt {
    width: min(32rem, calc(100% - 2rem));
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.8rem;
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 80;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 1rem;
    padding: 0.75rem;
    color: #fff;
    background: rgba(19, 20, 23, 0.97);
    box-shadow: 0 18px 45px rgba(19, 20, 23, 0.28);
    backdrop-filter: blur(16px);
}

.install-prompt[hidden] {
    display: none;
}

.install-prompt-icon {
    width: 3rem;
    height: 3rem;
    overflow: hidden;
    border-radius: 0.75rem;
    background: #fff;
}

.install-prompt-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.install-prompt-copy {
    min-width: 0;
    display: grid;
    line-height: 1.2;
}

.install-prompt-copy strong {
    font-size: 0.9rem;
}

.install-prompt-copy small {
    margin-top: 0.2rem;
    color: rgba(255, 255, 255, 0.67);
    font-size: 0.72rem;
}

.install-action {
    min-height: 2.55rem;
    border: 0;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    color: #fff;
    background: var(--forest-700);
    font-size: 0.78rem;
    font-weight: 850;
    cursor: pointer;
}

.install-action:hover,
.install-action:focus-visible {
    background: #d90000;
}

.install-dismiss {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 50%;
    padding: 0;
    color: rgba(255, 255, 255, 0.68);
    background: transparent;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.install-dismiss:hover,
.install-dismiss:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 980px) {
    .topbar {
        grid-template-columns: minmax(10rem, 1fr) auto minmax(5rem, 1fr);
        gap: 1rem;
    }

    .account-copy {
        display: none;
    }

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

    .total-card {
        grid-column: 1 / -1;
        min-height: 9rem;
    }
}

@media (max-width: 760px) {
    .login-shell {
        display: block;
        background: var(--cream);
    }

    .login-brand {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
        align-items: center;
        padding: 2rem 1.25rem;
    }

    .mobile-logo {
        display: block;
        margin-bottom: 2.5rem;
    }

    .mobile-logo img {
        width: 9rem;
    }

    .topbar {
        min-height: 4rem;
        grid-template-columns: 1fr auto;
        padding: 0 1.1rem;
    }

    .brand img {
        width: 2.85rem;
        height: 2.85rem;
    }

    .brand-copy strong {
        font-size: 0.78rem;
    }

    .brand-copy small {
        font-size: 0.61rem;
    }

    .desktop-nav,
    .account-menu .avatar,
    .account-copy {
        display: none;
    }

    .content {
        width: min(100% - 2rem, 46rem);
        padding: 2rem 0 7rem;
    }

    .access-switcher {
        align-items: stretch;
        flex-direction: column;
    }

    .welcome-row,
    .page-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 1.2rem;
    }

    .welcome-row h1,
    .page-heading h1 {
        font-size: clamp(2.2rem, 12vw, 3.5rem);
    }

    .availability {
        min-width: 0;
        width: 100%;
    }

    .quota-grid,
    .dashboard-grid,
    .security-grid,
    .machine-map-layout {
        grid-template-columns: 1fr;
    }

    .map-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 1rem;
    }

    .map-heading a {
        width: fit-content;
    }

    .map-frame {
        height: min(62vh, 31rem);
    }

    .machine-location-panel {
        max-height: none;
    }

    .quota-card,
    .panel {
        border-radius: 1rem;
    }

    .quota-card {
        min-height: 10.5rem;
    }

    .total-card {
        grid-column: auto;
        min-height: 8.5rem;
    }

    .profile-list {
        grid-template-columns: 1fr;
    }

    .consumption-list article {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.75rem;
    }

    .consumption-list time {
        grid-column: 2;
    }

    .consumption-status {
        grid-column: 3;
        grid-row: 1 / span 2;
    }

    .compact-list .consumption-status {
        display: none;
    }

    .total-badge {
        width: fit-content;
        min-width: 6.5rem;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .pagination span {
        width: 100%;
        order: -1;
        text-align: center;
    }

    .mobile-nav {
        min-height: 4.7rem;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        position: fixed;
        right: 0.8rem;
        bottom: calc(0.8rem + env(safe-area-inset-bottom));
        left: 0.8rem;
        z-index: 30;
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 1rem;
        padding: 0.35rem;
        background: rgba(19, 20, 23, 0.97);
        box-shadow: 0 15px 35px rgba(19, 20, 23, 0.3);
        backdrop-filter: blur(16px);
    }

    .mobile-nav a {
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-radius: 0.7rem;
        padding: 0.35rem;
        color: rgba(255, 255, 255, 0.62);
        font-size: 0.68rem;
        font-weight: 750;
        text-decoration: none;
    }

    .mobile-nav a span {
        margin-bottom: 0.08rem;
        font-size: 1rem;
    }

    .mobile-nav a.active {
        color: #fff;
        background: var(--forest-700);
    }

    .portal-page .install-prompt {
        right: 0.8rem;
        bottom: calc(6.15rem + env(safe-area-inset-bottom));
        width: calc(100% - 1.6rem);
    }
}

@media (max-width: 420px) {
    .content {
        width: min(100% - 1.25rem, 46rem);
    }

    .panel,
    .quota-card {
        padding: 1.15rem;
    }

    .consumption-list article {
        gap: 0.6rem;
    }

    .drink-mark {
        width: 2.35rem;
        height: 2.35rem;
    }

    .install-prompt {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .install-action {
        grid-column: 2;
        width: fit-content;
    }

    .install-dismiss {
        grid-column: 3;
        grid-row: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
