/* =====================================================
   TABLE OF CONTENTS
   1) Root variables
   2) Document / Base layout
   3) Containers
   4) Header / Toolbar
   5) Layout: Cards & Grid
   6) Navigation: Tabs + Filter Bar
   7) Registry: Entries + Visits + Gear + Badges
   8) Buttons
   9) Forms: Right column
  10) Alphabetical filter
  11) Footer
  12) Modals (What's New + Shared modal styles)
  13) Policy page
  14) Guest counter
  15) Kasseoppgjør
  16) Utilities
  17) Global chat
  18) Mobile sidebar toolbar (responsive)
===================================================== */


/* =========================
   1) Root variables
========================= */
:root {
    --bg: #0d0f12;
    --card: rgba(20, 22, 23, 0.8);
    --muted: #9aa4ad;
    --accent: #4cc9f0; /* default fallback */
}


/* =========================
   2) Document / Base layout
========================= */

/* Make footer stick to bottom */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

/* =========================
   Body & General
========================= */
body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: var(--bg);
    color: #e7eef6;
}


/* =========================
   3) Containers
========================= */
.wrap {
    flex: 1; /* THIS keeps footer at the bottom */
    display: flex;
    justify-content: center;
    padding: 28px 16px;
}

.container { max-width: 1200px; width: 100%; }


/* =========================
   4) Header / Toolbar
========================= */

header { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }

.brand {
    font-weight: 800; font-size: 24px; letter-spacing: 1.5px; text-transform: uppercase;
    background: linear-gradient(90deg, var(--accent), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.toolbar { margin-left: auto; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.search, select {
    padding: 10px 12px; border-radius: 10px; border: none; background: #161b20; color: #fff; font-weight: 500;
}

.history-link { font-size: 13px; color: var(--muted); transition: 0.3s; }
.history-link:hover { color: var(--accent); }

#colorPicker {
    cursor: pointer; width: 36px; height: 36px; border: none; border-radius: 10px;
    background: var(--accent); box-shadow: 0 0 10px var(--accent); transition: all 0.25s;
}


/* =========================
   5) Layout: Cards & Grid
========================= */
.card {
    background: var(--card); padding: 20px; border-radius: 18px; backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7);
}

.grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
@media (max-width: 950px) { .grid { grid-template-columns: 1fr; } }


/* =========================
   6) Navigation: Tabs + Filter Bar
========================= */

/* Tabs */
nav.tabs { display: flex; gap: 10px; margin-bottom: 16px; }

.tab-btn {
    padding: 10px 16px; border-radius: 12px; border: none; cursor: pointer; font-weight: 600;
    background: linear-gradient(135deg, var(--accent), var(--accent)); color: #fff; transition: all 0.3s;
}

.tab-btn:hover { filter: brightness(1.2); transform: translateY(-2px); }
.tab-btn.active { outline: 2px solid var(--accent); }

/* Filter bar */
.filter-bar{
    display:flex;
    gap:12px;
    margin-bottom:18px;
    flex-wrap:wrap;
}

.filter-bar input,
.filter-bar select{
    flex:1;
    min-width:160px;
}


/* =========================
   7) Registry: Entries + Visits + Gear + Badges
========================= */

/* Entries */
.entry {
    background: rgba(14, 15, 16, 0.9); padding: 14px; border-radius: 14px; margin-bottom: 5px;
    display: flex; justify-content: space-between; align-items: flex-start; transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.entry:hover { border-color: var(--accent); box-shadow: 0 0 14px color-mix(in srgb, var(--accent), transparent 60%); }
.entry .meta { font-size: 13px; color: var(--muted); }

.entry-date {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    font-size: 13px;
    line-height: 1.4;
}

.entry-date .date-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7f8a96;
    opacity: 0.9;
}

.entry-date .date-value {
    font-size: 12px;
    font-weight: 700;
    color: #7f8a96;
    opacity: 0.9;
}

/* Visits (Klyppekort) */
.visit-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #aeb7c2;
    margin-top: 4px;
    flex-wrap: wrap;
}

.visit-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
}

.visit-stat .label {
    opacity: 0.75;
}

.visit-stat .value {
    font-weight: 700;
    color: #fff;
}

.visit-stat.used .value {
    color: #ff6b6b;
}

.visit-stat.remaining .value {
    color: #1eb938;
}

.divider {
    opacity: 0.35;
}

.visits { display: flex; gap: 6px; margin-top: 8px; }

.visit-btn {
    width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(33,33,33,0.33);
    color: #fff; cursor: pointer; transition: 0.2s;
}

.visit-btn:hover { background: var(--accent); }
.visit-btn.used { background: var(--accent); }

/* FIX: card removal gear button */
.editable-pill {
    display: inline-block;
    padding: 6px 10px;
    background: rgba(255,255,255,0.07);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    margin-right: 6px;
}

.editable-pill:hover {
    background: rgba(255,255,255,0.15);
}

.entry-gear-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 20px;
    color: #d0d0d0;
    cursor: pointer;

    display: flex;
    justify-content: center;
    align-items: center;

    transition: 
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease,
        color 0.2s ease;
}

.entry-gear-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.08);
}

.entry-gear-btn:active {
    transform: scale(0.95);
}

/* FIX: name + ticket badge alignment */
.entry-main > div:first-child {
    display: flex !important;
    align-items: center !important;
    gap: 8px;
}

.entry-main > div:first-child span:last-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* badge for type of ticket vaksen / barn whatever */
.badge {
    padding: 3px 10px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;

    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent), transparent 50%);
    background: rgba(255, 255, 255, 0.04);

    box-shadow: 0 0 10px color-mix(in srgb, var(--accent), transparent 85%);

    backdrop-filter: blur(3px);
    transition: all 0.25s ease;
}

.badge:hover {
    box-shadow: 0 0 14px color-mix(in srgb, var(--accent), transparent 60%);
}


/* =========================
   8) Buttons
========================= */
.btn {
    padding: 8px 12px; border-radius: 10px; border: none; cursor: pointer; font-weight: 600;
    color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent)); transition: 0.3s;
}

.btn:hover { filter: brightness(1.2); transform: translateY(-2px); }

.small { padding: 6px 10px; font-size: 13px; }

.btn.ghost {
    background: #12161c; color: #c9d1d9; border: 1px solid rgba(255,255,255,.08);
}

/* Red Ghost Button (dark + red accent) */
.btn.redghost {
    background: #1a0e10; 
    color: #ffb3b3;
    border: 1px solid rgba(255, 80, 80, 0.28);
    transition: 0.3s;
}

.btn.redghost:hover {
    background: rgba(255, 80, 80, 0.12);
    border-color: rgba(255, 80, 80, 0.6);
    color: #ffcccc;
    filter: brightness(1.15);
    transform: translateY(-2px);
}

.btn.redghost:active {
    transform: scale(0.96);
}


/* =========================
   9) Forms: Right Column / Form
========================= */
.right h3 { margin-bottom: 14px; }
.right form { display: flex; flex-direction: column; gap: 12px; }
.right input, .right select { padding: 10px; border-radius: 10px; border: none; background: #0b0d0f; color: #fff; }


/* =========================
   10) Alphabetical Filter
========================= */
.alpha { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.alpha button {
    border: 1px solid var(--accent); border-radius: 50%; width: 36px; height: 36px; background: transparent;
    color: var(--accent); font-weight: 700; cursor: pointer; transition: all 0.25s;
}

.alpha button:hover, .alpha button.active { background: var(--accent); color: #000; transform: scale(1.2); }


/* =========================
   11) Footer (fixed bottom)
========================= */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;

    padding: 16px 0;
    text-align: center;
    font-size: 14px;

    color: #7d8a99;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, transparent, rgba(20,22,23,0.7));
    backdrop-filter: blur(6px);

    z-index: 9999;
}

.site-footer p {
    margin: 0;
    letter-spacing: 0.5px;
}

.site-footer span {
    color: var(--accent);
    font-weight: 600;
    text-shadow: 0 0 6px color-mix(in srgb, var(--accent), transparent 50%);
}

/* Footer policy link */
.policy-link {
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
}

.policy-link:hover {
    color: var(--accent);
    text-decoration: underline;
}


/* =========================
   12) Modals (What's New Modal + shared)
========================= */
.wn-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    opacity: 0; transition: opacity .25s ease; z-index: 9998;
}

.wn-modal {
    position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .25s ease; z-index: 9999;
}

.wn-card {
    width: min(640px, 92vw);
    background: var(--card); color:#fff;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.6);
    padding: 20px;
    transform: translateY(12px) scale(.96);
    opacity: 0;
    transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .28s ease;
}

.wn-head { display:flex; align-items:center; justify-content:space-between; margin-bottom: 8px; }
.wn-head h3 { margin:0; font-size:20px; font-weight:800; letter-spacing:.3px; }
.wn-head h3 span { color: var(--accent); }

.wn-close {
    background: transparent; color:#c9d1d9; border: 1px solid rgba(255,255,255,.1);
    width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
}

.wn-list { margin: 8px 0 16px 18px; line-height: 1.55; }
.wn-actions { display:flex; gap:10px; justify-content:flex-end; }

.wn-note {
    margin: 6px 0 12px;
    font-size: 13px;
    color: var(--muted);
}

.wn-card form.stack-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stack-form input,
.stack-form select {
    padding: 12px;
    border-radius: 2px;
    background: #0b0d0f;
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    font-size: 15px;
}

/* visible state */
.show.wn-overlay { opacity: 1; }
.show.wn-modal { opacity: 1; }
.show .wn-card { transform: translateY(0) scale(1); opacity: 1; }

/* hidden (display none) utility */
.hidden { display: none; }


/* =========================
   13) Policy Page Layout
========================= */
main.policy-page {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.policy-card {
    background: var(--card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
}

.policy-card h2 { color: var(--accent); margin-top: 0; }
.policy-card p { color: var(--muted); line-height: 1.6; }

.policy-footer {
    margin-top: 40px;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 10px;
}

.policy-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.section-box form input,
.section-box form textarea,
.section-box form select {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    background: #0b0d0f;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: #fff;
}

.stack-form label {
    margin-top: 8px;
    color: var(--muted);
    font-size: 14px;
}


/* =========================
   14) GJESTEOPPTELLING NEW UI
========================= */
.guest-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 24px 30px;
    max-width: 520px;
    margin-top: 16px;
}

.guest-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.guest-row:last-child {
    border-bottom: none;
}

.guest-label {
    font-size: 15px;
    font-weight: 500;
    color: #e7eef6;
}

.guest-counter {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guest-number {
    width: 26px;
    text-align: center;
    font-size: 16px;
}

.counter-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 18px;
    border-radius: 10px;
}

/* Buttons area */
.guest-footer {
    display: flex;
    gap: 12px;
    margin-top: 22px;
}


/* =========================
   15) KASSEOPPGJØR (Equalized & Clean)
========================= */

/* Center the card in its tab */
#tab-kasseoppgjer {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Main card container */
.kasseoppgjer-card {
    width: 100%;
    max-width: 1111px; /* more equal + centered width */
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 26px 36px !important; /* equal spacing left/right */
    margin-top: 20px;
    box-sizing: border-box;
}

/* Form internal spacing */
.kasseoppgjer-form {
    display: flex;
    flex-direction: column;
    gap: 16px; /* equal spacing between fields */
    width: 100%;
}

/* Field groups */
.kasseoppgjer-form > div {
    display: flex;
    flex-direction: column;
    gap: 5px; /* tighter label->input spacing */
}

/* Input styling */
.kasseoppgjer-form input,
.kasseoppgjer-form textarea {
    width: 100%;
    padding: 10px 12px; /* compact inputs */
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255,255,255,0.06);
    color: #fff;
    font-size: 14px;
    line-height: 1.3;
    transition: border-color .2s, background .2s, box-shadow .2s;
}

.kasseoppgjer-form textarea {
    min-height: 70px;
    resize: vertical;
}

/* Input focus */
.kasseoppgjer-form input:focus,
.kasseoppgjer-form textarea:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.45);
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent), transparent 70%);
}

/* Labels */
.kasseoppgjer-form label {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

/* Section title */
.form-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    margin-top: 6px;
    margin-bottom: 2px;
}

/* Divider */
.kasse-divider {
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 10px 0;
}

/* Export CSV footer */
.kasse-footer {
    margin-top: 25px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: flex-start;
}


/* =========================
   16) Utilities
========================= */
/* (Your utility class is already defined above: .hidden) */

/* =========================
   17) GLOBAL CHAT
========================= */

/* make sure hidden always wins */
.hidden {
    display: none !important;
}
.global-chat-item + .global-chat-item {
    margin-top: 10px;
}
/* make chat modal sit above footer */
#globalchat-overlay {
    z-index: 10000;
}

#globalchat-modal {
    z-index: 10001;
}

.chat-trigger {
    position: relative;
}

.chat-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    min-width: 18px;
    text-align: center;
    border-radius: 999px;
    background: rgba(255, 80, 80, 0.16);
    color: #ffb3b3;
    border: 1px solid rgba(255, 80, 80, 0.35);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

/* modal card */
.global-chat-card {
    width: min(760px, 94vw);
    height: min(82vh, 820px);
    padding: 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* keep header fixed within card */
.global-chat-card .wn-head {
    flex: 0 0 auto;
    margin-bottom: 10px;
}

/* scroll areas */
.global-chat-messages,
.global-chat-history {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    margin-top: 4px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255,255,255,0.06);
    display: block;
}

/* force hidden panels to stay hidden */
.global-chat-messages.hidden,
.global-chat-history.hidden {
    display: none !important;
}

/* chat item */
.global-chat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
}

.global-chat-item.own {
    border-color: color-mix(in srgb, var(--accent), transparent 55%);
    box-shadow: 0 0 10px color-mix(in srgb, var(--accent), transparent 85%);
}

.global-chat-item.pinned {
    border-color: color-mix(in srgb, var(--accent), transparent 45%);
    box-shadow: 0 0 14px color-mix(in srgb, var(--accent), transparent 80%);
}

.global-chat-topline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
}

.global-chat-user {
    font-weight: 700;
    color: #fff;
}

.global-chat-text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
}

/* image */
.global-chat-image {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 12px;
    margin-top: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.25);
}

/* small subtle actions */
.global-chat-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.chat-action-link {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    line-height: 1.2;
}

.chat-action-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* composer */
.global-chat-form {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.global-chat-form input[type="text"],
.global-chat-form input:not([type]) {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: #0b0d0f;
    color: #fff;
    font-size: 15px;
}

.global-chat-form input[type="text"]:focus,
.global-chat-form input:not([type]):focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent), transparent 75%);
}

.global-chat-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.file-pick-btn {
    width: fit-content;
}

.selected-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: #d7dee6;
    font-size: 12px;
    line-height: 1.3;
}

.selected-file .remove-file-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

/* edit mode */
.chat-edit-wrap {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-edit {
    width: 75%;
    min-height: 70px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #0b0d0f;
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    font-size: 13px;
    line-height: 1.35;
    resize: vertical;
}

.chat-edit:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent), transparent 75%);
}

.chat-edit-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.chat-edit-actions .btn {
    padding: 5px 10px;
    font-size: 12px;
}

.chat-action-delete {
    color: #ff9b9b;
}

.chat-action-delete:hover {
    color: #ff6b6b;
}

/* mobile */
@media (max-width: 700px) {
    .global-chat-card {
        width: 96vw;
        height: 86vh;
        padding: 14px;
    }

    .global-chat-messages,
    .global-chat-history {
        padding: 10px;
    }

    .global-chat-image {
        max-height: 220px;
    }

    .global-chat-form-actions {
        justify-content: stretch;
    }
}


/* =====================================================
   REAL PHONE FIX
===================================================== */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    min-width: 0;
}

.wrap,
.container,
.card,
.big-card,
.left,
.left-scroll,
.entries-list,
.entry,
.entry-main {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* Prevent page from becoming wider than screen */
img,
input,
select,
button,
textarea {
    max-width: 100%;
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {

    html,
    body {
        overflow-x: hidden;
    }

    .wrap {
        display: block;
        padding: 12px 10px 18px;
    }

    .container {
        width: 100%;
        max-width: 100%;
    }

    header.header-flex {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
    }

    .kommune-logo {
        height: 34px;
        margin-right: 2px;
        flex: 0 0 auto;
    }

    .brand {
        font-size: 16px;
        line-height: 1.15;
        letter-spacing: 0.3px;
        text-transform: none;
        word-break: break-word;
    }

    /* top buttons scroll sideways cleanly */
    nav.tabs.tabs-wide {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 8px;
        padding-bottom: 8px;
        margin-bottom: 12px;
        width: 100%;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    nav.tabs.tabs-wide > * {
        flex: 0 0 auto;
    }

    .tab-btn,
    .btn.small {
        min-height: 40px;
        padding: 9px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    /* search area stacked */
    .filter-bar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        width: 100%;
        margin-bottom: 12px;
    }

    .filter-bar input,
    .filter-bar select,
    .search,
    #cat-select {
        width: 100%;
        min-width: 0;
        font-size: 16px;
        min-height: 44px;
        box-sizing: border-box;
    }

    .card.big-card {
        padding: 12px;
        border-radius: 14px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .grid.layout-flex {
        display: block;
    }

    .left.left-scroll {
        width: 100%;
        max-width: 100%;
    }

    .section-title {
        font-size: 20px;
        line-height: 1.2;
        margin-bottom: 12px;
        word-break: break-word;
    }

    .alpha,
    .alpha.alpha-tight {
        gap: 8px;
        margin-bottom: 14px;
    }

    .alpha button {
        width: 38px;
        height: 38px;
        font-size: 13px;
        transform: none !important;
    }

    .entry,
    .entry.entry-card {
        position: relative;
        display: block;
        width: 100%;
        max-width: 100%;
        padding: 12px 12px 12px;
        margin-bottom: 10px;
        border-radius: 14px;
        overflow: hidden;
    }

    .entry-main {
        width: 100%;
        max-width: 100%;
        padding-right: 52px;
        box-sizing: border-box;
    }

    .entry-main > div:first-child {
        display: flex !important;
        justify-content: space-between;
        align-items: flex-start !important;
        gap: 8px;
        flex-wrap: wrap;
    }

    .entry-main > div:first-child span:first-child {
        font-size: 17px;
        line-height: 1.2;
        max-width: 100%;
        word-break: break-word;
    }

    .meta,
    .entry .meta {
        font-size: 13px;
        line-height: 1.35;
        word-break: break-word;
    }

    .entry-date {
        gap: 4px;
        font-size: 12px;
        line-height: 1.35;
    }
    
    .entry-date .date-value {
        word-break: break-word;
    }

    .badge {
        font-size: 12px;
        padding: 4px 10px;
        max-width: 100%;
    }

    .entry-gear-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .visits {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 10px;
        max-width: 100%;
    }

    .visit-btn {
        width: 30px;
        height: 30px;
        font-size: 13px;
        flex: 0 0 auto;
    }

    /* Guest */
    .guest-card {
        max-width: 100%;
        padding: 16px;
    }

    .guest-row {
        align-items: flex-start;
        gap: 10px;
    }

    .guest-label {
        max-width: 58%;
        line-height: 1.35;
    }

    .guest-footer {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Kasse */
    .kasseoppgjer-card {
        width: 100%;
        max-width: 100%;
        padding: 16px !important;
        overflow: hidden;
    }

    .kasseoppgjer-form {
        width: 100%;
        max-width: 100%;
    }

    .kasseoppgjer-form > div {
        width: 100%;
        max-width: 100%;
    }

    .kasseoppgjer-form input,
    .kasseoppgjer-form textarea,
    .kasseoppgjer-form select {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        font-size: 16px;
    }

    /* Footer MUST NOT be fixed on phone */
    .site-footer {
        position: static;
        width: 100%;
        margin-top: 18px;
        padding: 12px 10px 20px;
        background: transparent;
        backdrop-filter: none;
        border-top: 1px solid rgba(255,255,255,0.08);
        text-align: center;
        box-sizing: border-box;
    }
}

/* Extra-small phones */
@media (max-width: 560px) {
    .brand {
        font-size: 15px;
    }

    .kommune-logo {
        height: 30px;
    }

    .tab-btn,
    .btn.small {
        font-size: 12px;
        padding: 8px 11px;
    }

    .section-title {
        font-size: 18px;
    }

    .entry-main > div:first-child span:first-child {
        font-size: 16px;
    }
    .entry-date {
        font-size: 12px;
    }
    .alpha button {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
}

.alpha a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    background: transparent;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
}

.alpha a:hover,
.alpha a.active {
    background: var(--accent);
    color: #000;
    transform: scale(1.2);
}
/* Better search bars */
.search-wrap {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    min-height: 44px;
    padding: 12px 14px 12px 42px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(22,27,32,0.95), rgba(11,13,15,0.95));
    color: #fff;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s, transform .15s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 75%);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 14px;
    pointer-events: none;
}

/* Smaller alphabet filter */
.alpha.small-alpha {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
}

.alpha.small-alpha a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent), transparent 20%);
    background: rgba(255,255,255,0.02);
    color: var(--accent);
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    transition: all 0.2s ease;
}

.alpha.small-alpha a:hover,
.alpha.small-alpha a.active {
    background: var(--accent);
    color: #000;
    transform: scale(1.08);
    box-shadow: 0 0 10px color-mix(in srgb, var(--accent), transparent 65%);
}

