:root {
    --bg: #f7f7f7;
    --card: #fff;
    --text: #111;
    --muted: #666;
    --border: #ddd;
    --accent: #111;
}

/* Make sizing predictable (prevents mobile horizontal drift) */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    background: transparent;
}

html {
    scrollbar-gutter: stable;
    position: relative;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
}

body {
    font-family: system-ui, Arial, sans-serif;
    margin: 0;
    background: transparent;
    color: var(--text);
    overflow-x: hidden;
}

    body::before {
        content: none;
    }

html::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("/images/bg.png");
    background-size: cover;
    background-position: center;
    filter: blur(6px);
    transform: scale(1.05);
    z-index: -1;
    pointer-events: none;
}



/* Sticky footer shell for Razor Pages */
.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top bar */
.topbar {
                background: rgba(255,255,255,0.92);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    min-width: 0;
}

.brand {
    font-weight: 700;
    font-size: 1.2rem;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Navigation */
.topnav {
    display: flex;
    gap: 14px;
    align-items: center;
    flex: 1;
    flex-wrap: wrap;
}

.topnav a {
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text);
}

.topnav a:hover { background: #f0f0f0; }

.topnav a.active {
    background: var(--accent);
    color: white;
}

.spacer { flex: 1; }

/* Mobile menu */
.hamburger {
    display: none;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    line-height: 1;
    font-size: 1.2rem;
}

/* Blazor TopBar.razor uses these class names */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.18);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 72px 16px 16px;
}

.mobile-menu-sep {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.mobile-menu-user {
    font-weight: 700;
    padding: 10px 12px;
}

.mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.10);
    z-index: 40;
}

.mobile-menu {
    position: absolute;
    left: 20px;
    right: 20px;
    top: calc(100% + 10px);
    max-width: 1100px;
    margin: 0 auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    z-index: 60;
}

/* When used inside the TopBar overlay, make it a centered sheet */
.mobile-menu-overlay .mobile-menu {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    width: min(520px, 100%);
    max-width: 520px;
    margin: 0;
}

.mobile-menu a,
.mobile-menu button {
    width: 100%;
    text-align: left;
    display: block;
    padding: 12px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
}

.mobile-menu a:hover,
.mobile-menu button:hover {
    background: #f2f2f2;
}

.mobile-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.mobile-account {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-sub {
    padding-left: 8px;
    margin-top: 4px;
}

.mobile-sub a,
.mobile-sub button {
    padding: 10px 12px;
    font-size: 0.95rem;
}

.mobile-menu a.danger,
.mobile-menu button.danger {
    color: #b00020;
}

.auth-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 999;
}

.mobile-menu-title {
    font-weight: 700;
    padding: 8px 12px;
}

.mobile-sep {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

@media (max-width: 780px) {
    /* Hide the desktop nav and show the hamburger */
    .topbar .topnav { display: none; }
    .hamburger { display: inline-flex; align-items: center; justify-content: center; }

    /* Make header content fit on small screens */
    .brand {
        font-size: 1.05rem;
        white-space: normal;
        flex: 1;
        text-align: center;
    }
    .topbar { padding: 10px 12px; }
    .topbar-inner { justify-content: space-between; gap: 10px; }

    /* Content should sit closer to the screen edge on mobile */
    .main-content { margin: 8px auto; padding: 0 4px; }

    /* Cards/boxes: a bit tighter on mobile */
    .card, .center-card {            background: rgba(255,255,255,0.88);
 padding: 12px; margin: 8px 0; }
}

@media (max-width: 420px) {
    .topbar { padding: 8px 10px; }
    .main-content { margin: 6px auto; padding: 0 2px; }
    .card, .center-card { margin: 6px 0; }
    .center-card { padding: 12px; }
}

/* Dropdown */
.dropdown { position: relative; }
.dropdown-toggle {
    color: var(--text);
    border: 1px solid var(--border);
    background: var(--card);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dropdown-toggle span, .dropdown-toggle .caret { flex: 0 0 auto; }
.caret { font-size: 0.9em; color: var(--muted); }

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    min-width: 220px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    padding: 6px;
    z-index: 50;
}
.dropdown-menu a {
    display: block;
    padding: 10px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
}
.dropdown-menu a:hover { background: #f2f2f2; }
.dropdown-menu a.danger { color: #b00020; }

/* Main content */
.main-content {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 20px;
    width: 100%;
    flex: 1;
}

/* Centered card for auth pages */
.center-card {
    max-width: 520px; /* slightly narrower, better for auth pages */
    width: 100%; /* keeps it responsive */
    margin: 0 auto;
    background: rgba(255,255,255,0.88);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px 32px; /* adds nicer side breathing room */
}


.card h1 {
    margin-top: 0;
}

/* Cards */
.card {
    background: rgba(255,255,255,0.88);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 26px;
    margin: 12px 0;
}

.post-header {
    display: flex;
    gap: 12px;
    align-items: start;
}
.post-title {
    margin: 0 0 14px 0;
    flex: 1;
}
.chip {
    border: 1px solid var(--border);
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 999px;
    cursor: pointer;
}
.chip:hover { background: #ededed; }

.post-footer {
    display:flex;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.8rem;
}

/* Attachments */
.attachments {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.attachment {
    border: 1px solid var(--border);
    background: #fafafa;
    border-radius: 12px;
    padding: 10px;
    text-decoration: none;
    color: var(--text);
}
.attachment:hover { background: #f2f2f2; }
.thumb {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin-bottom: 8px;
}
.attachment-name {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file { display: flex; gap: 10px; align-items: center; }
.file-icon { font-size: 1.2rem; }

/* Forms */
.form {
    display: grid;
    gap: 10px;
}
.form-centered { max-width: 520px; }
.form input, .form textarea {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    width: 100%;
    box-sizing: border-box;
}
.center-card {
    max-width: 460px;
    padding: 24px 32px;
}

.auth-page {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-page-reg {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.center-card {
    transform: translateY(-12vh);
}

.center-card .form {
    max-width: 440px;
    margin: 0 auto;
}


.form button, button {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    width: fit-content;
}
.form button:hover, button:hover { opacity: 0.92; }

.btn-secondary {
    border: 1px solid var(--border);
    background: #f5f5f5;
    color: var(--text);
}
.btn-secondary:hover { background: #efefef; }

.row { display:flex; gap: 10px; flex-wrap: wrap; }

/* Text helpers */
.meta { color: var(--muted); font-size: 0.8rem; }
.prewrap { white-space: pre-wrap; margin: 0; }
.error { background:#ffe5e5; border:1px solid #ffb3b3; padding:10px; border-radius:10px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border-bottom: 1px solid #eee; text-align: left; padding: 10px; }

.table-wrap { width: 100%; overflow-x: auto; }
.table-wrap .table { min-width: 640px; }

/* Admin users: accordion list (mobile-friendly) */
.user-list{
    display:flex;
    flex-direction:column;
    gap: 10px;
    margin-top: 12px;
}

.user-item{
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    overflow: hidden;
}

.user-summary{
    cursor: pointer;
    padding: 12px 14px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 10px;
    user-select: none;
}

/* Remove the default marker */
.user-summary::-webkit-details-marker{ display:none; }
.user-summary::marker{ content: ""; }

.user-name{ font-weight: 650; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.user-caret{ color: var(--muted); transition: transform 160ms ease; }

.user-item[open] .user-caret{ transform: rotate(180deg); }

.user-body{
    border-top: 1px solid #eee;
    padding: 12px 14px 14px;
    display:grid;
    gap: 12px;
}


.user-field{ display:grid; gap: 6px; }
.user-label{ font-size: 0.85rem; color: var(--muted); }
.user-value{ font-size: 0.95rem; word-break: break-word; }

.user-control{
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: #fff;
}

.user-actions{ display:flex; justify-content:flex-start; }
.user-actions button{ width: 100%; }

/* Footer */
.footer {
    text-align: center;
    padding: 18px 20px;
    color: var(--muted);
    background: transparent;
}

.pdf-frame{ width:100%; height:420px; border:1px solid var(--border); border-radius:12px; }
.pdf-preview summary{ cursor:pointer; margin-top:8px; }
.attachment.pdf{ padding:10px; }
.attachment-link{ display:flex; gap:10px; align-items:center; text-decoration:none; color:var(--text); }
.attachment-meta{ color:var(--muted); font-size:0.85rem; margin-top:2px; }
.actions{ white-space:nowrap; }


/* Inline images inside posts */
.inline-images{
    display:flex;
    flex-direction:column;
    gap: 10px;
    margin-top: 12px;
}
.inline-image{
    width: 100%;
}
.inline-image img{
    display:block;
    border-radius: 12px;
    border: 1px solid var(--border);
    max-width: 100%;
    height: auto;
}
.img-align-left{ display:flex; justify-content:flex-start; }
.img-align-center{ display:flex; justify-content:center; }
.img-align-right{ display:flex; justify-content:flex-end; }

.img-size-small img{ width: 320px; }
.img-size-medium img{ width: 560px; }
.img-size-large img{ width: 100%; }


/* Attachments as small row of links in posts */
.attachments-row{
    display:flex;
    flex-wrap:wrap;
    gap: 10px;
    align-items:center;
    margin-top: 10px;
}
.attachment-link-small{
    font-size: 0.8rem;
    text-decoration: underline;
    color: inherit;
}

.auth-inline{display:inline-flex; gap:14px; align-items:center;}
.auth-name{font-weight:600;}

.post-footer{display:flex; justify-content:space-between; gap:12px; align-items:flex-end;}
.post-author{display:flex; flex-direction:column;}
.author-title{font-size:0.85em; color: var(--muted); margin-top:2px;}


/* Shell: keep footer at bottom */
.site-shell{
    min-height: 100vh;
    display:flex;
    flex-direction:column;
}
.main-content{
    flex: 1;
}

/* Post spacing */
.post-title { margin: 0 0 14px 0; }
.post-body { margin-top: 6px; }
.post-body p { margin: 0 0 12px 0; }
.post-body .inline-image { margin: 14px 0; }

/* Attachments compact row */
.attachments-row { margin-top: 18px; display:flex; gap: 8px; flex-wrap: wrap; align-items:center; }
.attachment-link-small { font-size: 0.8rem; padding: 3px 8px; }

/* Make dropdown label not disappear */
.dropdown-toggle{
    max-width: 220px;
}


/* Post spacing */
.post-title{ margin-bottom: 14px; }
.post-par{ margin: 12px 0; white-space: pre-wrap; }

/* Compact attachments row in posts */
.attachments-row{
    display:flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}
.attachment-link, .attachments-row a{
    font-size: 0.8rem;
    text-decoration: underline;
}

/* Block builder */
.blocks{ display:flex; flex-direction:column; gap: 12px; margin-top: 10px; }
.block-head{ margin-bottom: 8px; }


/* User dropdown (top bar) */
.user-menu { position: relative; display: inline-block; }
.user-menu-button { display:flex; align-items:center; gap:8px; }
.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    padding: 4px;
    z-index: 9999;

    overflow: hidden;
    box-sizing: border-box;
}
.user-dropdown a, .user-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 10px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: inherit;
    font: inherit;
    text-decoration: none;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: #f3f3f3; }


/* Topbar user button styling */
.user-menu-button{
    background:#fff !important;
    color:#000 !important;
    border:1px solid var(--border) !important;
    border-radius: 999px !important;
    padding: 8px 12px !important;
    font-weight: 600;
}
.user-menu-button:hover{ background:#f6f6f6 !important; }

/* Compact dropdown items */
.user-dropdown a, .user-dropdown button{
    padding: 8px 10px !important;
    font-size: 13px;
}


/* Create post editor layout */
.editor-grid{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items:start;
}
@media (max-width: 980px){
    .editor-grid{ grid-template-columns: 1fr; }
}
.blocks{ display:flex; flex-direction:column; gap: 12px; margin-top: 12px; }
.block.card{ padding: 12px; }
.block-head{ align-items:center; }
.post-title{ margin-bottom: 16px; }
.post-body{ display:flex; flex-direction:column; gap: 14px; margin-top: 6px; }
.post-text{ white-space: pre-wrap; line-height: 1.5; }
.mt-24{ margin-top: 24px; }

.attachments-row{
    display:flex;
    flex-wrap:wrap;
    gap: 10px;
    margin-top: 18px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.attachment-link{
    font-size: 13px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fafafa;
}


/* When preview is hidden, center the editor card */
.editor-grid--no-preview{
    grid-template-columns: 1fr !important;
    max-width: 820px;
    margin: 0 auto;
}


/* Nicer dropdown item highlight (no full-width blob) */
.user-dropdown a, .user-dropdown button{
    margin: 2px 4px;
    width: calc(100% - 8px);
}


/* Post hide/show chip */
.chip{
    background:#fff;
    color:#000;
    border:1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 600;
    opacity: 1 !important;
}
.chip:hover{ background:#f6f6f6; }


/* dropdown item width fix */
.user-dropdown a, .user-dropdown button{
    margin: 2px 4px;
    width: calc(100% - 8px);
    border-radius: 8px;
}


/* Dropdown items: keep highlight within rounded box */
.user-dropdown a, .user-dropdown button{
    margin: 2px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
}


/* Custom date picker */
.datepick{ position: relative; display:flex; align-items:center; gap:8px; }
.datepick-input{
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}
.datepick-btn{
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
    cursor: pointer;
}
.datepick-btn:hover{ background:#f6f6f6; }
.datepick-pop{
    position:absolute;
    top: calc(100% + 8px);
    left: 0;
    background:#fff;
    border:1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    padding: 10px;
    z-index: 9999;
    width: 280px;
}
.datepick-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-bottom: 8px;
}
.datepick-month{ font-weight: 700; }
.datepick-grid{
    display:grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.datepick-dow{
    font-size: 12px;
    opacity: .7;
    text-align:center;
    padding: 4px 0;
}
.datepick-cell{
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    padding: 8px 0;
    cursor:pointer;
    text-align:center;
}
.datepick-cell:hover{ background:#f3f3f3; }
.datepick-cell.selected{ background:#111; color:#fff; border-color:#111; }
.datepick-cell.empty{ border:0; background:transparent; cursor: default; }


/* --- Button theme: no black buttons --- */
button, .btn, .btn-secondary, .danger, a.button-like {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
    border-radius: 12px;
    padding: 10px 14px;
}
button:hover, .btn:hover, .btn-secondary:hover, .danger:hover, a.button-like:hover {
    background: #f6f6f6 !important;
}
button:disabled, .btn:disabled, .btn-secondary:disabled, .danger:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* Ensure chip buttons like Dölj/Visa also follow theme */
.chip, .chip:hover {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
}

/* Make chip buttons the same size (so Dölj/Visa/Ta bort match) */
button.chip{
    padding: 6px 12px !important;
    border-radius: 999px !important;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
}

/* Links styled as chips (e.g. “Ändra”) should match button chips exactly */
a.chip{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px !important;
    border-radius: 999px !important;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
}
a.chip:hover{ text-decoration: none; }

/* The "danger" modifier should not change sizing/shape */
button.chip.danger{
    padding: 6px 12px !important;
}

/* Topbar user button already white/black; ensure no black bg sneaks in */
.user-menu-button{
    background:#fff !important;
    color:#000 !important;
    border:1px solid #000 !important;
}


/* --- Date picker theme fixes --- */
.datepick-pop { border: 1px solid #000 !important; }
.datepick-input, .datepick-btn { border: 1px solid #000 !important; }
.datepick-cell{
    border: 1px solid #000 !important;
    background: #fff !important;
    color: #000 !important;
}
.datepick-cell.selected{
    background:#eaeaea !important;
    color:#000 !important;
    border-color:#000 !important;
}
.datepick-head .btn-secondary{
    background:#fff !important;
    color:#000 !important;
    border: 1px solid #000 !important;
    border-radius: 12px;
    padding: 2px 6px;
}

.content-text{ white-space: normal; }


/* --- Info text line breaks --- */
.info-text {
    white-space: normal;
    line-height: 1.5;
}

/* --- DatePicker (clean + consistent) --- */
.datepick { position: relative; display: flex; gap: 8px; align-items: center; }
.datepick-input {
    width: 220px;
    padding: 10px 12px;
    border: 1px solid #000;
    border-radius: 8px;
    background: #fff;
}
.datepick-btn {
    border: 1px solid #000;
    background: #fff !important;
    color: #000 !important;
    border-radius: 8px;
    padding: 9px 12px;
    cursor: pointer;
}
.datepick-btn:hover { background: #f6f6f6 !important; }

.datepick-pop {
    /*
      Fixed + centered popover prevents overflow on both mobile and desktop.
      The previous absolute positioning could push the calendar off-screen
      depending on container width/alignment, which looked "exploded".
    */
    position: fixed;
    left: 50%;
    top: 18vh;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #000;
    border-radius: 12px;
    padding: 10px;
    width: min(360px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.datepick-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.datepick-nav {
    border: 1px solid #000 !important;
    background: #fff !important;
    color: #000 !important;
    border-radius: 8px;
    padding: 2px 6px;
    cursor: pointer;
}
.datepick-nav:hover { background: #f6f6f6 !important; }

.datepick-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.datepick-dow {
    font-size: 12px;
    opacity: .75;
    text-align: center;
    padding: 4px 0;
}
.datepick-day {
    border: 1px solid #000 !important;
    background: #fff !important;
    color: #000 !important;
    border-radius: 8px;
    padding: 7px 0;
    cursor: pointer;
    text-align: center;
}
.datepick-day:hover { background: #f6f6f6 !important; }
.datepick-day.selected {
    background: #eaeaea !important;
}
.datepick-empty { height: 32px; }


/* --- DatePicker alignment fix --- */
.datepick-grid{ justify-items: center; }
.datepick-day{
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    line-height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px;
}
.datepick-dow{ width: 32px; }
.datepick-head{ width: 100%; }


/* DatePicker header: small month arrows, larger year arrows */
.datepick-head{
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.datepick-monthrow{
    display:flex;
    align-items:center;
    justify-content: center;
    gap: 10px;
}
.datepick-yearrow{
    display:flex;
    align-items:center;
    justify-content: center;
    gap: 8px;
}
.datepick-month{ text-transform: capitalize; }
.datepick-year{ min-width: 4ch; text-align:center; }

.datepick-nav--sm{
    padding: 3px 8px !important;
    border-radius: 10px !important;
    font-size: 13px;
    line-height: 1;
}
.datepick-nav--lg{
    padding: 8px 12px !important;
    border-radius: 12px !important;
    font-size: 16px;
    line-height: 1;
}


/* Backdrops to close popovers on outside click */
.datepick-backdrop{
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 9998;
}
.user-menu-backdrop{
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 9998;
}
/* ensure popovers above backdrop */
.datepick-pop{ z-index: 9999; }
.user-dropdown{ z-index: 9999; }

/* DatePicker: mobile layout tweaks */
@media (max-width: 780px){
    .datepick{ flex-wrap: wrap; gap: 6px; }
    .datepick-input{ width: 100% !important; flex: 1 1 100%; }
    .datepick-btn{ align-self: flex-start; }
    .datepick-pop{ top: 14vh; width: min(340px, calc(100vw - 16px)); }
}


/* DatePicker: prevent header buttons from jumping when month name changes */
.datepick-monthrow{
    display: grid !important;
    grid-template-columns: auto 10ch auto; /* reserve space for longest-ish month */
    align-items: center;
    justify-items: center;
    gap: 10px;
}
.datepick-month{
    display: inline-block;
    width: 10ch;
    text-align: center;
}


/* DatePicker: unify month/year arrow sizes and slightly slimmer arrows */
.datepick-nav--sm{
    padding: 2px 7px !important;
    border-radius: 10px !important;
    font-size: 13px;
}
.datepick-nav--lg{
    padding: 2px 7px !important;
    border-radius: 10px !important;
    font-size: 13px;
}


/* Custom file picker to avoid browser "Choose files" text */
.file-picker{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
    margin-top:6px;
}
.file-picker-btn{
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px;
    border-radius: 8px;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    font-size: 0.8rem;
    flex: 0 0 auto;
}
.file-picker-input{
    position:absolute;
    inset:0;
    opacity:0;
    cursor:pointer;
}
.file-picker-text{
    font-size: 13px;
    color: #333;
}


.file-selected-list{
    margin: 10px 0 0 0;
    padding-left: 18px;
}
.file-selected-list li{
    margin: 2px 0;
}

/* Keep picker button + status aligned */
.file-picker{ align-items:center; }
@media (min-width: 600px){
  .file-picker{ flex-wrap:nowrap; }
}


/* Selected attachments list (before upload/publish) */
.selected-files{
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.selected-file{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #000;
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 0.8rem;
}
.selected-file-name{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Smaller helper buttons */
.btn-xs{
  padding: 2px 6px;
  font-size: 0.8rem;
}

/* Keep picker steady */
.file-picker-text{ display:inline-block; min-height: 1.4em; }

/* Text blocks: add a little left breathing room so paragraphs don't feel left-heavy */
.post-body p{
  padding-left: 0px;
}

/* Förhandsvisning: samma layout som slutresultatet, men nedskalad */
.preview-frame{
  overflow: hidden;
}

.preview-scale{
  transform-origin: top left;
  transform: scale(0.90);
  width: calc(100% / 0.90);
}



/* ===== Mobile: reduce outer gutters globally (strong override) =====
   If you still see big margins, this block is the "last word".
*/
@media (max-width: 780px) {
  /* Remove any default page inset */
  body { padding: 0 !important; }

  /* Make the main area use the full viewport width */
  .main-content {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 4px !important;
  }

  /* Cards should be almost edge-to-edge */
  .card,
  .center-card {
    width: 100% !important;
    margin: 4px 0 !important;
    padding: 10px !important;
    border-radius: 14px;
  }
}

@media (max-width: 420px) {
  .main-content { padding: 2px !important; }
  .card, .center-card { margin: 3px 0 !important; }
}

@media (max-width: 780px) {
    .auth-page {
        align-items: flex-start;
        padding-top: 24px;
    }

    .center-card {
        transform: translateY(0) !important;
    }
}

/* Force consistent post title spacing */
.card h1,
.card h2,
.card h3 {
    margin: 10px 20px 16px 0px !important;
}

/* Only buttons in the actions area inside content cards */
.actions button {
    margin-top: 12px;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    white-space: nowrap;
}

/* make h2 behave like your other titles */
.card-title {
    margin: 0 0 14px 0;
}

.table-compact th,
.table-compact td {
    padding-top: 3px;
    padding-bottom: 3px;
    vertical-align: middle;
}

    .table-compact td.actions {
        text-align: left;
        padding-left: 8px;
    }

/* Input width */
.title-input {
    width: 220px;
    max-width: 100%;
}

/* Tight input styling */
.table-compact input {
    height: 26px;
    line-height: 26px;
    padding: 3px 6px;
    margin: 0;
}

.title-create-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.title-create-input {
    width: 320px;
    max-width: 100%;
    height: 32px;
    padding: 6px 10px;
}

.title-create-row .chip {
    white-space: nowrap;
}

/* Match spacing with the "Ny titel" row */
.title-list {
    margin-top: 8px;
}

.title-list-head {
    font-weight: 650;
    margin: 10px 0 6px 0;
}

/* Each title row behaves like the "Ny titel" row */
.title-row {
    display: flex;
    align-items: center;
    gap: 10px; /* same feel as Skapa-next-to-input */
    padding: 6px 0;
    border-top: 1px solid rgba(0,0,0,0.06);
}

    .title-row:last-child {
        border-bottom: 1px solid rgba(0,0,0,0.06);
    }

/* Make these consistent with your create input */
.title-input {
    width: 220px;
    max-width: 100%;
    height: 26px;
    line-height: 26px;
    padding: 3px 6px;
    margin: 0;
}

.user-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}