/* ArtSys Propel — designbrief: mørk nordisk system-UI */
:root {
    color-scheme: dark;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 40px;
    --space-8: 48px;
    --space-9: 64px;

    --bg-base: #0D1117;
    --bg-secondary: #111820;
    --surface: #171E27;
    --surface-solid: #171E27;
    --surface-hover: #1D2732;
    --surface-muted: #111820;

    --border: #2B3540;
    --border-strong: #3A4652;
    --input-border: #34404C;

    --accent: #00B8F5;
    --accent-hover: #19C8FF;
    --accent-deep: #008FC4;
    --accent-soft: rgba(0, 184, 245, 0.08);
    --accent-glow: rgba(0, 184, 245, 0.10);
    --accent-on: #071015;
    --brand-mark: #00B8F5;

    --bg-glow-1: rgba(0, 184, 245, 0.05);
    --bg-glow-2: transparent;
    --bg-glow-3: transparent;

    --glass-bg: #171E27;
    --glass-border: #2B3540;
    --glass-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);

    --sidebar-bg: #0A0E14;
    --sidebar-width: 240px;
    --topbar-height: 68px;
    --topbar-bg: #111820;
    --topbar-border: #2B3540;
    --topbar-search-bg: #0D1117;
    --topbar-search-bg-focus: #0D1117;
    --topbar-search-border: #34404C;
    --topbar-search-text: #F2F5F7;
    --topbar-search-placeholder: #6F7A85;

    --modal-bg: #171E27;
    --modal-border: #2B3540;
    --modal-backdrop: rgba(0, 0, 0, 0.55);

    --text: #F2F5F7;
    --text-secondary: #A7B0B9;
    --text-muted: #6F7A85;
    --text-inverse: #F2F5F7;
    --text-heading: #F2F5F7;

    --input-bg: #111820;

    --success: #20C77A;
    --warning: #F2B84B;
    --danger: #F05D68;
    --info: #4C9EFF;

    --success-bg: rgba(32, 199, 122, 0.12);
    --success-border: rgba(32, 199, 122, 0.35);
    --success-text: #20C77A;
    --error-bg: rgba(240, 93, 104, 0.12);
    --error-border: rgba(240, 93, 104, 0.35);
    --error-text: #F05D68;
    --danger-soft: rgba(240, 93, 104, 0.18);

    --blur: 0px;
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    --ease: cubic-bezier(0, 0, 0.2, 1);
    --t-fast: 0.16s var(--ease);
    --t-base: 0.2s var(--ease);
    --t-slow: 0.22s var(--ease);

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.22);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.28);
    --shadow-glow: 0 0 18px rgba(0, 184, 245, 0.10);

    --font-display: "Exo 2", "Inter", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;

    --content-max: 1520px;

    /* Legacy aliases (moduler som framleis refererer desse) */
    --grad-primary: var(--accent);
    --grad-warm: var(--accent-deep);
    --navy: #0D1117;
    --cyan: #00B8F5;
    --bg-blob-1: transparent;
    --bg-blob-2: transparent;
    --bg-blob-3: transparent;
    --bg-blob-opacity: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    color: var(--text);
    background: var(--bg-base);
    font-family: var(--font-body);
}

h1, h2, h3 {
    color: var(--text-heading);
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0.02em;
}

h1 { font-weight: 300; }
h2 { font-weight: 300; }
h3 { font-weight: 400; }

.label-caps,
.section-label,
.search-section h3,
.preview-label,
.adm-hint-caps {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

/* Bakgrunn — diskret grafitt + svak cyan */
.bg-scene {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(circle at 70% 10%, rgba(0, 184, 245, 0.05), transparent 35%),
        linear-gradient(135deg, #0D1117 0%, #10161D 100%);
}

.bg-mesh,
.bg-blob,
.bg-trail {
    display: none;
}

a {
    color: var(--accent);
    transition: color var(--t-fast);
}

a:hover {
    color: var(--accent-hover);
}

@keyframes as-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes as-rise-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-overlay[style*="flex"] {
    animation: as-fade-in 0.18s var(--ease);
}

.modal-overlay[style*="flex"] .modal-box {
    animation: as-rise-in 0.2s var(--ease);
}

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

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    font-weight: 400;
}

#app {
    min-height: 100vh;
}

a:hover {
    text-decoration: underline;
}

button,
input[type="submit"] {
    font: inherit;
    cursor: pointer;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
    font: inherit;
    width: 100%;
    max-width: 320px;
    min-height: 42px;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--input-border, var(--border-strong));
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 184, 245, 0.12);
}

button,
input[type="submit"],
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 42px;
    padding: 0.55rem 1.1rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--accent-on);
    font-weight: 600;
    box-shadow: none;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

button:hover,
input[type="submit"]:hover,
.btn:hover {
    background: var(--accent-hover);
    color: var(--accent-on);
    filter: none;
    transform: none;
    box-shadow: var(--shadow-glow);
}

button:active,
.btn:active {
    transform: none;
}

button:focus-visible,
.btn:focus-visible,
input[type="submit"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 184, 245, 0.12);
}

.btn-ghost,
button.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
    box-shadow: none;
}

.btn-ghost:hover,
button.btn-ghost:hover {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: none;
}

.btn-small {
    min-height: 36px;
    padding: 0.35rem 0.75rem;
    font-size: 0.88rem;
}

/* Shell — sidebar + topbar (designbrief) */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#app {
    display: block;
}

.sidenav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 220;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: var(--space-5) var(--space-3) var(--space-5);
    overflow-y: auto;
}

.sidenav-brand {
    padding: 0 var(--space-2) var(--space-5);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-4);
}

.sidenav-brand .brand-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
}

.sidenav-brand .brand-logo {
    height: 1.75rem;
    max-width: 100%;
}

.sidenav.has-lobby .sidenav-brand {
    border-bottom: 0;
    margin-bottom: var(--space-3);
    padding-bottom: 0;
}

.sidenav-lobby {
    margin: 0 0 var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}

.sidenav-lobby-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 40px;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.sidenav-lobby-toggle:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: rgba(0, 184, 245, 0.06);
}

.sidenav-lobby-toggle.is-open {
    color: var(--accent);
    border-color: rgba(0, 184, 245, 0.35);
}

.sidenav-lobby-toggle-chevron {
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform var(--t-fast);
    opacity: 0.75;
}

.sidenav-lobby-toggle.is-open .sidenav-lobby-toggle-chevron {
    transform: rotate(-135deg);
}

.sidenav-lobby-panel {
    margin-top: var(--space-2);
}

.sidenav-lobby-loading,
.sidenav-lobby-empty {
    display: block;
    margin: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sidenav-lobby-body .as-lobby-menu {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0;
    background: transparent;
    border: 0;
    font: inherit;
}

.sidenav-lobby-body .as-lobby-menu a {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 0.4rem 0.75rem;
    border: 0;
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.sidenav-lobby-body .as-lobby-menu a:hover {
    background: rgba(0, 184, 245, 0.06);
    color: var(--text);
    text-decoration: none;
}

.sidenav-lobby-body .as-lobby-menu a.home {
    color: var(--accent);
    font-weight: 600;
}

.sidenav-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.sidenav-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.55rem 0.85rem 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.94rem;
    font-weight: 500;
    border-left: 2px solid transparent;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.sidenav-link:hover {
    background: rgba(0, 184, 245, 0.06);
    color: var(--text);
    text-decoration: none;
}

.sidenav-link.is-active {
    background: rgba(0, 184, 245, 0.08);
    color: var(--text);
    border-left-color: var(--accent);
}

.sidenav-link.is-active .sidenav-link-label {
    color: var(--text);
}

.sidenav-link-dev {
    border: 1px dashed var(--border-strong);
    border-left-width: 2px;
    margin-top: var(--space-2);
}

.sidenav-link-help {
    margin-top: var(--space-3);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding-top: 0.85rem;
}

.sidenav-backdrop {
    display: none;
}

.sidenav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.sidenav-toggle-bars,
.sidenav-toggle-bars::before,
.sidenav-toggle-bars::after {
    display: block;
    width: 1rem;
    height: 1.5px;
    background: currentColor;
    border-radius: 1px;
    position: relative;
}

.sidenav-toggle-bars::before,
.sidenav-toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
}

.sidenav-toggle-bars::before { top: -5px; }
.sidenav-toggle-bars::after { top: 5px; }

#topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    height: var(--topbar-height);
    padding: 0 var(--space-6);
    background: var(--topbar-bg);
    color: var(--text);
    border-bottom: 1px solid var(--topbar-border);
    box-shadow: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-left: auto;
    flex-shrink: 0;
}

#name {
    font-size: 0.88rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.topbar-search-wrap {
    position: relative;
    flex: 1;
    max-width: 360px;
}

#topbar .topbar-search-input {
    width: 100%;
    max-width: none;
    min-height: 42px;
    font: inherit;
    font-size: 0.9rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--topbar-search-border);
    border-radius: var(--radius-sm);
    background: var(--topbar-search-bg);
    color: var(--topbar-search-text);
    outline: none;
    box-shadow: none;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

#topbar .topbar-search-input::placeholder {
    color: var(--topbar-search-placeholder);
}

#topbar .topbar-search-input:focus {
    border-color: var(--accent);
    background: var(--topbar-search-bg-focus);
    box-shadow: 0 0 0 3px rgba(0, 184, 245, 0.12);
}

.globalsearch-results {
    display: none;
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    min-width: 320px;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 300;
    animation: as-rise-in 0.18s var(--ease);
}

.globalsearch-results.is-open,
.globalsearch-results.is-loading {
    display: block;
}

.search-results-inner {
    padding: 0.75rem 0;
}

.search-summary {
    margin: 0;
    padding: 0 1rem 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.search-section h3 {
    margin: 0;
    padding: 0.45rem 1rem;
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-family: var(--font-body);
}

.search-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-list li a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background var(--t-fast), color var(--t-fast);
}

.search-list li a:hover {
    background: var(--accent-soft);
    color: var(--accent);
    text-decoration: none;
}

.search-item-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-right: 0.65rem;
}

.search-item-content .search-item-main {
    flex: 1;
    min-width: 0;
    padding-right: 0.35rem;
}

.search-item-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.15rem;
}

.search-item-actions a {
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
}

.search-item-actions a:hover {
    background: rgba(0, 184, 245, 0.1);
    color: var(--accent);
}

.search-meta {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.85rem;
}

.search-empty {
    margin: 0;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#exit {
    color: var(--text-secondary);
    font-size: 0.88rem;
    text-decoration: none;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-xs);
    transition: color var(--t-fast), background var(--t-fast);
}

#exit:hover {
    color: var(--danger);
    background: var(--error-bg);
    text-decoration: none;
}

/* Brand — full Propel-logo */
.brand {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.7rem;
    line-height: 1;
    text-decoration: none;
    color: inherit;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
}

.brand-logo {
    display: block;
    width: auto;
    height: 2rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    min-width: 0;
}

.brand-product {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--text);
}

.brand-parent {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-body);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: none;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.brand-rule {
    display: block;
    width: 0.85rem;
    height: 1px;
    background: currentColor;
    opacity: 0.7;
}

.brand-bar {
    transition: opacity var(--t-fast);
}

.brand-bar:hover {
    opacity: 0.9;
}

.brand-bar .brand-logo {
    height: 1.85rem;
    max-width: 100%;
}

.brand-hero {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.brand-hero .brand-mark {
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.brand-hero .brand-logo {
    height: 3.25rem;
    max-width: min(320px, 85vw);
}

.brand-hero .brand-text {
    align-items: center;
}

.brand-hero .brand-product {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 300;
    letter-spacing: 0.06em;
}

.login-stage {
    position: relative;
    width: min(420px, 100%);
    margin: 8vh auto 4rem;
    padding: 0 1rem;
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 0 1.5rem;
    text-align: center;
}

.login-brand .brand-hero {
    margin-bottom: 0.25rem;
}

.login-tagline {
    margin: 1rem 0 0;
    font-size: 1rem;
    color: var(--text-secondary);
}

.welcome-brand {
    display: flex;
    justify-content: flex-start;
    margin: 0 0 1.35rem;
}

.welcome-brand .brand-hero {
    align-items: flex-start;
}

.welcome-brand .brand-hero .brand-text {
    align-items: flex-start;
}

.welcome-title {
    margin: 0 0 0.35rem;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 1.85rem);
    letter-spacing: 0.02em;
    color: var(--text-heading);
}

.welcome h1 {
    margin: 0 0 0.35rem;
    color: var(--text-heading);
}

#content {
    max-width: var(--content-max);
    margin: 0;
    margin-left: var(--sidebar-width);
    padding: calc(var(--topbar-height) + var(--space-6)) var(--space-6) var(--space-8);
}

#content:has(.content-edit-layout),
#content:has(.img-library),
#content:has(.doc-library) {
    max-width: none;
    width: calc(100% - var(--sidebar-width));
    padding: calc(var(--topbar-height) + var(--space-5)) var(--space-5) var(--space-9);
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    box-shadow: var(--shadow-md);
    transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.panel:hover {
    border-color: var(--border-strong);
}

.panel h1 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 300;
}

.welcome-lead {
    margin: 0 0 1.25rem;
    color: var(--text-secondary);
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-4);
}

.type-card {
    display: block;
    padding: var(--space-5) var(--space-4);
    min-height: 5.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

.type-card:hover {
    border-color: var(--border-strong);
    background: var(--surface-hover);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.msg {
    max-width: 420px;
    margin: 0 auto 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
}

.msg-error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
}

.propel-session-overlay {
    z-index: 600;
}

.propel-session-box {
    width: min(420px, 100%);
    padding: 1.5rem 1.35rem 1.25rem;
    gap: 0.85rem;
}

.propel-session-box h2 {
    margin: 0;
    font-family: "Exo 2", sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.propel-session-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.propel-session-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.5rem;
}

.propel-session-actions .btn {
    text-decoration: none;
}

.login-form {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.login-form p {
    margin: 0 0 1rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.login-form input {
    max-width: none;
}

.subuser-field {
    display: none;
}

.login-alt {
    margin: 0;
    font-size: 0.9rem;
    text-align: center;
}

.login-alt a {
    color: var(--text-secondary);
}

@media (max-width: 960px) {
    .sidenav {
        transform: translateX(-100%);
        transition: transform var(--t-base);
        box-shadow: var(--shadow-lg);
    }

    body.sidenav-open .sidenav {
        transform: translateX(0);
    }

    .sidenav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 210;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--t-base);
    }

    body.sidenav-open .sidenav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .sidenav-backdrop[hidden] {
        display: none;
    }

    body.sidenav-open .sidenav-backdrop[hidden] {
        display: block;
    }

    .sidenav-toggle {
        display: inline-flex;
    }

    #topbar {
        left: 0;
        padding: 0 var(--space-4);
    }

    #content,
    #content:has(.content-edit-layout),
    #content:has(.img-library),
    #content:has(.doc-library) {
        margin-left: 0;
        width: 100%;
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .topbar-search-wrap {
        max-width: none;
    }

    #name {
        display: none;
    }
}

@media (max-width: 640px) {
    #topbar {
        gap: var(--space-2);
        padding: 0 var(--space-3);
    }

    .topbar-actions #exit {
        font-size: 0.8rem;
    }
}

.content-type-select {
    margin-bottom: 1rem;
}

.content-type-select label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.content-type-select select {
    font: inherit;
    min-width: 220px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.content-type-picker {
    max-width: 920px;
}

.content-type-picker-header {
    margin-bottom: 1.25rem;
}

.content-type-picker-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    color: var(--text-heading);
}

.content-type-picker-lead {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.content-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.85rem;
}

.content-type-tile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    min-height: 7.5rem;
    padding: 1.25rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition:
        border-color var(--t-fast),
        transform var(--t-fast),
        box-shadow var(--t-fast),
        background var(--t-fast);
}

.content-type-tile:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    background: var(--surface-hover);
}

.content-type-tile:active {
    transform: translateY(0);
}

.content-type-tile-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1.25;
    color: var(--text-heading);
}

.content-type-tile-meta {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.content-list h1 {
    margin: 0 0 1rem;
    font-size: 1.35rem;
}

.content-breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.content-breadcrumb a {
    color: var(--accent);
}

.content-folders-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin-bottom: 0.45rem;
}

.content-folders-label {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.content-folders-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1rem;
    width: 100%;
}

.content-folder-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: 7.5rem;
}

.content-folder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.55rem 0.4rem 0.5rem;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 500;
    box-shadow: none;
    text-align: center;
    transition: transform var(--t-fast), color var(--t-fast), background var(--t-fast);
}

.content-folder:hover {
    border-color: transparent;
    background: var(--surface-hover);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: none;
    color: var(--accent);
}

.content-folder-icon {
    display: block;
    width: 2.9rem;
    height: 2.65rem;
    color: var(--accent);
    filter: drop-shadow(0 4px 8px rgba(0, 184, 245, 0.18));
    transition: transform var(--t-fast), filter var(--t-fast);
}

.content-folder:hover .content-folder-icon {
    transform: translateY(-1px);
    filter: drop-shadow(0 6px 12px rgba(0, 184, 245, 0.28));
}

.content-folder-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.content-folder-icon-sheet {
    fill: rgba(255, 255, 255, 0.78);
}

.content-folder-icon-back {
    fill: #4fd0ff;
}

.content-folder-icon-front {
    fill: var(--accent);
}

.content-folder-icon-edge {
    fill: none;
    stroke: rgba(7, 16, 21, 0.22);
    stroke-width: 1.4;
    stroke-linecap: round;
}

.content-folder:hover .content-folder-icon-sheet {
    fill: #ffffff;
}

.content-folder:hover .content-folder-icon-back {
    fill: #6adcff;
}

.content-folder:hover .content-folder-icon-front {
    fill: var(--accent-hover);
}

.content-folder-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
    font-size: 0.86rem;
    line-height: 1.25;
    word-break: break-word;
}

.content-folder-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: 0.75rem;
}

.content-folder-edit {
    color: var(--accent);
}

.content-folder-delete {
    color: var(--danger);
}

.content-folder-form-header {
    margin-bottom: 1rem;
}

.content-folder-form-header h1 {
    margin: 0 0 0.35rem;
}

.content-folder-form-lead {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.content-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.content-list-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.content-items {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.content-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}

.content-item:hover {
    transform: none;
    border-color: var(--border-strong);
    background: var(--surface-hover);
    box-shadow: var(--shadow-md);
}

.content-item-link {
    flex: 1;
    color: var(--text);
    font-weight: 500;
    transition: color var(--t-fast);
}

.content-item-link:hover {
    text-decoration: none;
    color: var(--accent);
}

.content-item-meta {
    display: inline-block;
    margin-left: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.content-item-delete {
    font-size: 0.85rem;
    color: var(--danger);
    transition: opacity var(--t-fast);
}

.content-item-edit {
    font-size: 0.85rem;
    color: var(--accent);
}

.content-item-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.content-folders {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.content-item-edit:hover {
    text-decoration: underline;
}

/* Modal — innholdsforhåndsvisning */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.modal-box {
    position: relative;
    width: min(720px, 100%);
    max-height: calc(100vh - 3rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--modal-bg);
    border: 1px solid var(--modal-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-box-preview {
    width: min(720px, 100%);
}

.modal-box-preview > .modal-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .modal-box-preview {
        width: min(1080px, 96vw);
    }
}

.modal-box .modal-close {
    color: var(--text-secondary);
}

.modal-close {
    position: absolute;
    top: 0.65rem;
    right: 0.75rem;
    z-index: 2;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
    transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}

.modal-close:hover {
    background: var(--accent-soft);
    color: var(--text);
    transform: scale(1.05);
    filter: none;
}

.modal-body {
    overflow-y: auto;
}

.preview-modal-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    max-height: 100%;
}

.preview-modal-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem 1rem;
    flex-shrink: 0;
    padding: 1.1rem 3.25rem 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--modal-bg);
    position: sticky;
    top: 0;
    z-index: 2;
}

.preview-modal-heading {
    min-width: 0;
    flex: 1 1 12rem;
}

.preview-modal-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
    line-height: 1.3;
    color: var(--text);
}

.preview-modal-type {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.preview-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: center;
}

.preview-modal-body {
    padding: 1rem 1.5rem 1.35rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: var(--modal-bg);
    color: var(--text);
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem 1.25rem;
    align-content: start;
}

.preview-field {
    margin-bottom: 0;
    min-width: 0;
}

.preview-field-rich {
    grid-column: 1 / -1;
}

@media (min-width: 1024px) {
    .preview-modal-body {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.preview-field-image .preview-label {
    margin-bottom: 0.45rem;
}

.preview-image {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-start;
}

.preview-image-link {
    display: block;
    max-width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    line-height: 0;
    transition: box-shadow var(--t-fast), transform var(--t-fast);
}

.preview-image-link:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    text-decoration: none;
}

.preview-image-img {
    display: block;
    max-width: 100%;
    max-height: 320px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.preview-image-caption {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.preview-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.preview-value {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text);
}

.preview-muted {
    color: var(--text-secondary);
}

.preview-html h1,
.preview-html h2,
.preview-html h3,
.preview-html h4,
.preview-html h5 {
    margin: 0.5rem 0 0.35rem;
    font-size: inherit;
    font-weight: 700;
}

.preview-html ul,
.preview-html ol {
    margin: 0.35rem 0;
    padding-left: 1.25rem;
}

.preview-html p {
    margin: 0.35rem 0;
}

.preview-html a {
    color: var(--accent);
}

.preview-loading,
.preview-empty {
    margin: 0;
    padding: 1.5rem;
    color: var(--text-secondary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--accent-on);
    text-decoration: none;
    border: 0;
    font: inherit;
    font-weight: 600;
    box-shadow: none;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.btn:hover {
    background: var(--accent-hover);
    color: var(--accent-on);
    text-decoration: none;
    filter: none;
    transform: none;
    box-shadow: var(--shadow-glow);
}

.btn-small {
    min-height: 36px;
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
    box-shadow: none;
}

.btn-ghost:hover {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: none;
}

.msg-ok {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

/* Redigering — full bredde, to kolonner */
.content-edit-layout {
    width: 100%;
}

.content-edit-header {
    margin-bottom: 1.25rem;
}

.content-edit-header h1 {
    margin: 0;
    font-size: 1.35rem;
}

.edit-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1.15fr);
    gap: 1.5rem;
    align-items: start;
}

.edit-columns-single {
    grid-template-columns: minmax(0, 1fr);
    max-width: none;
}

.edit-columns-freeimgs {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1.15fr) minmax(220px, 280px);
}

.edit-columns-single.edit-columns-freeimgs {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
}

.edit-col-freeimgs {
    position: sticky;
    top: 1rem;
    align-self: start;
    max-height: calc(100vh - 5.5rem);
    overflow: auto;
    min-width: 0;
    padding: 0.85rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.content-freeimgs-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.content-freeimgs-header h2 {
    margin: 0;
    font-size: 1rem;
}

.content-freeimgs-folder {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.content-freeimgs-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.content-freeimgs-tree {
    max-height: 180px;
    overflow: auto;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.content-freeimgs-actions {
    margin: 0 0 0.5rem;
}

.content-freeimgs-upload.img-upload-block {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
}

.content-freeimgs-upload .img-upload-form input[type="text"],
.content-freeimgs-upload .img-upload-form input[type="file"],
.content-freeimgs-upload .img-upload-form textarea {
    max-width: none;
}

.content-freeimgs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.content-freeimgs-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: inherit;
    cursor: pointer;
    overflow: hidden;
    text-align: left;
    font: inherit;
}

.content-freeimgs-item:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-glow);
}

.content-freeimgs-thumb {
    display: block;
    aspect-ratio: 1;
    background: var(--surface-muted);
    overflow: hidden;
}

.content-freeimgs-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.content-freeimgs-name {
    display: block;
    padding: 0 0.4rem 0.4rem;
    font-size: 0.72rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content-picker-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.content-picker-grid-header .content-picker-grid-title {
    margin: 0;
}

.content-picker-upload-block.img-upload-block {
    margin-bottom: 1rem;
}

.content-picker-upload-block .img-upload-form input[type="text"],
.content-picker-upload-block .img-upload-form input[type="file"],
.content-picker-upload-block .img-upload-form textarea,
.content-picker-upload-block .img-upload-progress {
    max-width: none;
}

.edit-fields-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 1.25rem;
    align-items: start;
}

.edit-fields-images {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 1.25rem;
    align-items: start;
    margin: 0.25rem 0;
    padding: 1.15rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.edit-col-fields,
.edit-col-rich {
    min-width: 0;
}

.content-edit .field {
    margin: 0;
    min-width: 0;
}

.content-edit .field-files-picker {
    grid-column: 1 / -1;
    max-width: 640px;
}

.content-edit .field-image-picker {
    margin: 0;
}

.edit-col-rich {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-start;
    align-content: flex-start;
}

.content-edit .field-rich {
    margin: 0;
    display: flex;
    flex-direction: column;
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
}

.content-edit label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.content-edit input[type="text"],
.content-edit input[type="number"],
.content-edit select,
.content-edit textarea.plain-text {
    width: 100%;
    max-width: 100%;
    font: inherit;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
}

.content-edit textarea.plain-text {
    min-height: 200px;
    resize: vertical;
    flex: 1;
}

.field-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-actions-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-start;
    padding: 0.85rem 1.5rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.22);
    transition: background var(--t-base), border-color var(--t-base);
}

@media (min-width: 961px) {
    .form-actions-fixed {
        left: var(--sidebar-width);
    }
}

.wysiwyg {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--input-bg);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.4rem;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
}

.wysiwyg-toolbar button {
    min-width: 2rem;
    padding: 0.3rem 0.5rem;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 0.85rem;
    box-shadow: none;
    transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.wysiwyg-toolbar button:hover {
    background: var(--accent-soft);
    border-color: rgba(0, 184, 245, 0.35);
    transform: translateY(-1px);
    filter: none;
}

.form-actions-fixed .btn {
    min-width: 6rem;
    text-align: center;
}

.wysiwyg-editor {
    min-height: 220px;
    padding: 0.75rem;
    outline: none;
    line-height: 1.6;
}

.edit-col-rich .wysiwyg {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 650px;
    min-height: 280px;
}

.edit-col-rich .wysiwyg-editor {
    flex: 1;
    min-height: 260px;
}

.wysiwyg-editor h1,
.wysiwyg-editor h2,
.wysiwyg-editor h3,
.wysiwyg-editor h4,
.wysiwyg-editor h5 {
    margin: 0.75rem 0 0.35rem;
}

.wysiwyg-editor ul,
.wysiwyg-editor ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.wysiwyg-editor ol {
    list-style-type: decimal;
}

.wysiwyg-editor a {
    color: var(--accent);
}

@media (max-width: 1200px) {
    .edit-columns-freeimgs {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
    }

    .edit-columns-freeimgs .edit-col-freeimgs {
        grid-column: 1 / -1;
        position: static;
        max-height: none;
    }
}

@media (max-width: 960px) {
    .edit-columns {
        grid-template-columns: 1fr;
    }

    .edit-columns-freeimgs,
    .edit-columns-single.edit-columns-freeimgs {
        grid-template-columns: 1fr;
    }

    .edit-fields-grid,
    .edit-fields-images {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .edit-columns-single {
        max-width: none;
    }

    #content:has(.content-edit-layout) {
        padding-bottom: 6rem;
    }
}

@media (max-width: 640px) {
    .edit-fields-grid,
    .edit-fields-images {
        grid-template-columns: 1fr;
    }
}

/* Innhold — bilde/filveljar */
.modal-box-picker {
    width: min(920px, 100%);
    max-height: calc(100vh - 2rem);
}

.content-image-field,
.content-file-field,
.content-files-field {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.content-image-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    padding: 0.5rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
}

.content-image-preview-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: zoom-in;
    box-shadow: none;
    transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.content-image-preview-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
    filter: none;
}

.content-image-preview-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.content-image-preview-img {
    display: block;
    max-width: 100%;
    max-height: 120px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.content-image-empty,
.content-file-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.content-image-actions,
.content-file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.content-files-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.content-files-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
}

.content-files-name {
    min-width: 0;
    font-size: 0.9rem;
    word-break: break-word;
}

.content-files-remove {
    flex-shrink: 0;
    width: 1.6rem;
    height: 1.6rem;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--danger);
    font-size: 1.1rem;
    line-height: 1;
    box-shadow: none;
}

.content-files-remove:hover {
    background: var(--danger-soft);
    filter: none;
    transform: none;
}

.content-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.content-picker-header h2 {
    margin: 0;
    font-size: 1.05rem;
}

.content-picker-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.content-picker-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 420px;
    max-height: calc(100vh - 8rem);
}

.content-picker-sidebar {
    overflow-y: auto;
    padding: 0.75rem;
    border-right: 1px solid var(--border);
    background: var(--surface-muted);
}

.content-picker-main {
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.content-picker-grid-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.content-picker-subfolders {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}

.content-picker-subfolder {
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    box-shadow: none;
}

.content-picker-subfolder:hover {
    filter: none;
    transform: translateY(-1px);
}

.content-picker-hint,
.content-picker-empty {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.content-picker-img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.content-picker-img-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    box-shadow: none;
}

.content-picker-img-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    filter: none;
}

.content-picker-img-thumb {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--surface-solid);
}

.content-picker-img-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.content-picker-img-name {
    padding: 0 0.45rem 0.45rem;
    font-size: 0.75rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content-picker-file-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.content-picker-file-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    text-align: left;
    cursor: pointer;
    box-shadow: none;
}

.content-picker-file-item:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    filter: none;
    transform: translateX(3px);
}

.content-picker-file-name {
    font-weight: 600;
    color: var(--text);
}

.content-picker-file-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.preview-file-list {
    margin: 0;
    padding-left: 1.1rem;
}

.preview-file-list a {
    color: var(--accent);
}

.field-rich-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.field-rich-label .content-ai-open {
    flex-shrink: 0;
}

.modal-box-ai {
    width: min(1100px, 100%);
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
}

.content-ai-header {
    padding: 1rem 1.25rem 0.5rem;
}

.content-ai-header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.content-ai-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
    gap: 0;
    min-height: 0;
    flex: 1;
    overflow: hidden;
    border-top: 1px solid var(--border);
}

.content-ai-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    padding: 0.85rem 1rem;
}

.content-ai-content-pane {
    border-right: 1px solid var(--border);
}

.content-ai-pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.content-ai-working {
    flex: 1;
    min-height: 280px;
    max-height: min(55vh, 520px);
    overflow: auto;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    line-height: 1.45;
}

.content-ai-working-plain {
    flex: 1;
    min-height: 280px;
    max-height: min(55vh, 520px);
    width: 100%;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    line-height: 1.45;
    resize: vertical;
}

.content-ai-chat {
    flex: 1;
    min-height: 180px;
    max-height: min(40vh, 360px);
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 0.65rem;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
}

.content-ai-msg {
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
}

.content-ai-msg-user {
    border-left: 2px solid var(--accent);
}

.content-ai-msg-assistant {
    border-left: 2px solid var(--text-muted);
}

.content-ai-msg-error {
    border-left: 2px solid var(--error-border, #c44);
    color: var(--error-text, #f8b4b4);
}

.content-ai-msg-role {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.content-ai-msg-body {
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.content-ai-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-bottom: 0.55rem;
}

.content-ai-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.content-ai-compose {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: end;
}

.content-ai-compose textarea {
    width: 100%;
    font: inherit;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    resize: vertical;
}

.content-ai-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 0.85rem 1.15rem 1.1rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 860px) {
    .content-ai-layout {
        grid-template-columns: 1fr;
        overflow: auto;
    }

    .content-ai-content-pane {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .content-ai-working,
    .content-ai-working-plain,
    .content-ai-chat {
        max-height: 240px;
        min-height: 160px;
    }
}

@media (max-width: 720px) {
    .content-picker-layout {
        grid-template-columns: 1fr;
    }

    .content-picker-sidebar {
        max-height: 180px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
}

/* Bulk create / edit */
.content-bulk-header {
    margin-bottom: 1rem;
}

.content-bulk-header h1 {
    margin: 0 0 0.35rem;
}

.content-bulk-lead {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.content-bulk-scroll {
    overflow-x: auto;
    margin-bottom: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.content-bulk-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

.content-bulk-table th,
.content-bulk-table td {
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    text-align: left;
}

.content-bulk-table th {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface-hover);
    white-space: nowrap;
}

.content-bulk-table tbody tr:last-child td {
    border-bottom: 0;
}

.content-bulk-col-delete {
    width: 3.2rem;
    text-align: center;
}

.content-bulk-delete-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.content-bulk-input {
    width: 100%;
    min-width: 7rem;
    font: inherit;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
}

.content-bulk-textarea {
    min-height: 2.6rem;
    resize: vertical;
}

.content-bulk-table select.content-bulk-input {
    min-width: 8rem;
}

.content-bulk-row.is-bulk-deleted {
    opacity: 0.45;
}

.content-bulk-row.is-bulk-deleted .content-bulk-input {
    text-decoration: line-through;
}

.content-bulk-add {
    margin: 0 0 1rem;
}

.content-bulk-actions {
    margin-top: 0.25rem;
}

/* Bildebibliotek */
.img-library {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1.25rem;
    min-height: calc(100vh - 7rem);
    align-items: start;
}

.img-sidebar {
    position: sticky;
    top: 4.5rem;
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    box-shadow: var(--shadow-md);
    transition: background var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
}

.img-sidebar-newfolder {
    padding: 0.15rem 0;
}

.imgnewfolder-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}

.imgnewfolder-form .field {
    margin: 0 0 0.85rem;
}

.imgnewfolder-form label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.imgnewfolder-form input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
}

.img-sidebar-hint {
    margin: 0 0 0.85rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.imgnewfolder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.img-tree-row {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.img-tree-row .img-tree-label {
    flex: 1;
    min-width: 0;
}

.img-tree-add {
    flex: 0 0 auto;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--accent);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.img-tree-add:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: scale(1.08);
}

.img-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.img-tree ul {
    list-style: none;
    margin: 0.15rem 0 0.15rem 0.85rem;
    padding: 0;
    border-left: 1px solid var(--border);
}

.img-tree-label {
    display: block;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
    transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}

.img-tree-label:hover,
.img-tree-label.is-active {
    background: var(--accent-soft);
    color: var(--accent);
}

.img-tree-label-root {
    font-weight: 700;
}

.img-main {
    min-width: 0;
}

.img-folder-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
}

.img-folder-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.img-folder-header-main {
    min-width: 0;
}

.img-folder-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.img-upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.img-folder-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.img-folder-hint {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.img-subfolder-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.img-subfolder-item {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(0, 184, 245, 0.25);
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.img-subfolder-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px var(--accent-glow);
}

.img-subfolder-name {
    font-weight: 600;
}

.img-upload-block {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.img-upload-form .field {
    margin: 0 0 0.75rem;
}

.img-upload-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.img-upload-form input[type="text"],
.img-upload-form input[type="file"],
.img-upload-form textarea {
    width: 100%;
    max-width: 480px;
    font: inherit;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
}

.img-upload-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0 0.75rem;
    max-width: 480px;
}

.img-upload-progress #img-upload-progress-bar,
.img-upload-progress .img-upload-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    width: 0;
    max-width: 100%;
    transition: width var(--t-fast);
}

.img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.img-grid-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-base), box-shadow var(--t-base);
}

.img-grid-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.img-grid-thumb {
    display: block;
    aspect-ratio: 1;
    background: var(--surface-muted);
    overflow: hidden;
}

.img-grid-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.img-grid-meta {
    padding: 0.45rem 0.55rem 0;
    font-size: 0.8rem;
}

.img-grid-name {
    display: block;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.img-grid-copy {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.img-grid-focus {
    display: block;
    color: var(--accent);
    font-size: 0.72rem;
}

.img-grid-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.45rem 0.55rem 0.55rem;
}

@media (max-width: 900px) {
    .img-library {
        grid-template-columns: 1fr;
    }

    .img-sidebar {
        position: static;
        max-height: none;
    }
}

/* Modal — biletevisning */
.modal-box-image {
    width: min(960px, 100%);
    max-height: calc(100vh - 3rem);
}

.img-view-body {
    padding: 1rem 1.5rem;
    text-align: center;
    overflow: auto;
    flex: 1;
    min-height: 0;
    background: #111827;
}

.img-view-body img {
    max-width: 100%;
    max-height: calc(100vh - 12rem);
    width: auto;
    height: auto;
    display: inline-block;
}

.img-view-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface-muted);
}

.img-view-info {
    min-width: 0;
    flex: 1;
}

.img-view-info strong {
    display: block;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#img-view-meta {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal — fokuspunkt */
.modal-box-focus {
    width: min(920px, 100%);
    max-height: calc(100vh - 3rem);
}

.img-focus-header {
    padding: 1rem 1.5rem 0.5rem;
    border-bottom: 1px solid var(--border);
}

.img-focus-header h2 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    padding-right: 2rem;
}

.img-focus-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.img-focus-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: 1rem;
    padding: 1rem 1.5rem;
    min-height: 0;
    flex: 1;
    overflow: auto;
}

.img-focus-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    max-height: calc(100vh - 18rem);
    background: #111827;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: crosshair;
}

.img-focus-canvas {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: calc(100vh - 18rem);
    line-height: 0;
}

.img-focus-stage img {
    max-width: 100%;
    max-height: calc(100vh - 18rem);
    width: auto;
    height: auto;
    display: block;
    user-select: none;
    pointer-events: none;
}

.img-focus-marker {
    position: absolute;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 10px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    left: 50%;
    top: 50%;
}

.img-focus-marker::after {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.img-focus-previews {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.img-focus-preview-item {
    margin: 0;
}

.img-focus-preview-item figcaption {
    margin: 0 0 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.img-focus-preview {
    overflow: hidden;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.img-focus-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.img-focus-preview-square {
    aspect-ratio: 1;
}

.img-focus-preview-wide {
    aspect-ratio: 16 / 9;
}

.img-focus-preview-landscape {
    aspect-ratio: 4 / 3;
}

.img-focus-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface-muted);
}

.img-focus-coords {
    font-size: 0.85rem;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.img-focus-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 720px) {
    .img-focus-editor {
        grid-template-columns: 1fr;
    }

    .img-focus-previews {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .img-focus-preview-item {
        flex: 1 1 100px;
        min-width: 90px;
    }
}

/* Slideshow-admin */
.img-module-links {
    margin-bottom: 0.65rem;
}

.img-slideshow-admin {
    max-width: 980px;
}

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

.img-slideshow-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.35rem;
}

.img-slideshow-lead {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.img-slideshow-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.img-slideshow-toolbar label {
    font-size: 0.85rem;
    font-weight: 600;
}

.img-slideshow-toolbar select {
    min-width: 220px;
    max-width: none;
}

.img-ss-create-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.img-ss-create-form input[type="text"] {
    min-width: 220px;
    max-width: none;
}

.img-slideshow-panel {
    padding: 1.15rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.img-slideshow-panel h2 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
}

.img-slideshow-hint,
.img-slideshow-empty {
    margin: 0 0 0.85rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.img-slideshow-actions {
    margin-bottom: 1rem;
}

.img-slideshow-slides {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.img-slideshow-slide {
    display: grid;
    grid-template-columns: auto 72px minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast), opacity var(--t-fast);
}

.img-slideshow-slide.is-dragging {
    opacity: 0.55;
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.img-slideshow-slide.is-drag-over {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.img-slideshow-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    letter-spacing: -0.12em;
    user-select: none;
    cursor: grab;
    touch-action: none;
}

.img-slideshow-drag-handle:active {
    cursor: grabbing;
}

.img-slideshow-slide-thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-solid);
}

.img-slideshow-slide-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

.img-slideshow-slide-meta {
    min-width: 0;
}

.img-slideshow-slide-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.img-slideshow-slide-comment {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.img-slideshow-slide-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.img-transfer-badge, .doc-transfer-badge {
    display: inline-block;
    margin-top: 0.2rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #8a1f1f;
    background: color-mix(in srgb, #c62828 14%, transparent);
}

/* Filarkiv */
.doc-library {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1.25rem;
    min-height: calc(100vh - 7rem);
    align-items: start;
}

.doc-sidebar {
    position: sticky;
    top: 4.5rem;
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    box-shadow: var(--shadow-md);
    transition: background var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
}

.doc-sidebar-newfolder {
    padding: 0.15rem 0;
}

.docnewfolder-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}

.docnewfolder-form .field {
    margin: 0 0 0.85rem;
}

.docnewfolder-form label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.docnewfolder-form input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.doc-sidebar-hint {
    margin: 0 0 0.85rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.docnewfolder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.doc-tree-row {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.doc-tree-row .doc-tree-label {
    flex: 1;
    min-width: 0;
}

.doc-tree-add {
    flex: 0 0 auto;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--accent);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.doc-tree-add:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: scale(1.08);
}

.doc-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.doc-tree ul {
    list-style: none;
    margin: 0.15rem 0 0.15rem 0.85rem;
    padding: 0;
    border-left: 1px solid var(--border);
}

.doc-tree-label {
    display: block;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
    transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}

.doc-tree-label:hover,
.doc-tree-label.is-active {
    background: var(--accent-soft);
    color: var(--accent);
}

.doc-tree-label-root {
    font-weight: 700;
}

.doc-main {
    min-width: 0;
}

.doc-folder-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
}

.doc-folder-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.doc-folder-header-main {
    min-width: 0;
}

.doc-folder-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.doc-folder-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.doc-folder-hint,
.doc-folder-empty {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.doc-subfolder-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.doc-subfolder-item {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(0, 184, 245, 0.25);
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.doc-subfolder-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px var(--accent-glow);
}

.doc-subfolder-name {
    font-weight: 600;
}

.doc-upload-block {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.doc-upload-form .field {
    margin: 0 0 0.75rem;
}

.doc-upload-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.doc-upload-form input[type="file"],
.doc-upload-form textarea {
    width: 100%;
    max-width: 480px;
    font: inherit;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
}

.doc-upload-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0 0.75rem;
    max-width: 480px;
}

.doc-upload-progress #doc-upload-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    width: 0;
    max-width: 100%;
    transition: width var(--t-fast);
}

.doc-upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.doc-file-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.doc-file-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.doc-file-item:hover {
    transform: translateX(3px);
    box-shadow: var(--shadow-md);
}

.doc-file-main {
    min-width: 0;
    flex: 1;
}

.doc-file-name {
    display: block;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    word-break: break-word;
    transition: color var(--t-fast);
}

.doc-file-name:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.doc-file-meta {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.doc-file-comment {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--text);
}

.doc-file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .doc-library {
        grid-template-columns: 1fr;
    }

    .doc-sidebar {
        position: static;
        max-height: none;
    }

    .doc-file-item {
        flex-direction: column;
    }
}

.doc-transfer-badge {
    display: inline;
    margin-top: 0;
    padding: 0.05rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #8a1f1f;
    background: color-mix(in srgb, #c62828 14%, transparent);
}

/* Administrasjon / oppsett */
.adm-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    max-width: 920px;
    box-shadow: var(--shadow-md);
}

.adm-panel.adm-media-hub {
    max-width: 1100px;
}

.adm-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.adm-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.adm-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.35rem;
}

.adm-header .adm-lead {
    margin: 0;
}

.adm-client-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding-top: 0.15rem;
    border-top: 1px solid var(--border);
}

.adm-client-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
    padding: 0.2rem;
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    border: 1px solid var(--border);
}

.adm-client-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: calc(var(--radius-sm) - 2px);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.adm-client-tab:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.adm-client-tab.is-active {
    color: var(--text);
    background: var(--surface-solid, var(--surface));
    border-color: var(--border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    font-weight: 600;
}

.adm-client-back {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.15rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    margin-left: auto;
}

.adm-client-back:hover {
    color: var(--text);
    border-bottom-color: var(--border);
}

.adm-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.adm-lead {
    margin: 0 0 1rem;
    color: var(--text-secondary);
}

.adm-hint {
    margin: 0 0 0.85rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.adm-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.adm-card {
    display: block;
    padding: 1rem 1.1rem;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    text-decoration: none;
    color: inherit;
    transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}

.adm-card:hover {
    transform: translateY(-3px);
    background: var(--surface-hover);
    border-color: var(--accent);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.adm-card strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--accent);
}

.adm-card span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.adm-section {
    margin: 0 0 1.5rem;
    padding: 0 0 1.25rem;
    border-bottom: 1px solid var(--border);
}

.adm-section:last-of-type {
    border-bottom: 0;
    padding-bottom: 0;
}

.adm-section h2 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}

.adm-version-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
    transition: border-color var(--t-fast), background var(--t-fast);
}

.adm-version-chip:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.adm-version-chip .adm-version-label,
.adm-version-banner .adm-version-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.adm-version-chip strong,
.adm-version-num {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.adm-version-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 0.85rem;
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: var(--radius-md);
    background: var(--accent-soft);
}

.adm-version-section {
    margin: 0 0 0.25rem;
    padding: 0 0 1.25rem;
    border-top: 0;
    border-bottom: 0;
}

.adm-changelog-entry h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.65rem;
}

.adm-changelog-ver {
    font-weight: 700;
    color: var(--accent);
}

.adm-changelog-title {
    font-weight: 600;
    color: var(--text);
}

.adm-changelog-date {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.adm-changelog-badge {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--surface-solid, #fff);
}

.adm-changelog-entry.is-current {
    padding: 0.85rem 1rem 1.25rem;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
}

.adm-changelog-list {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--text-secondary);
}

.adm-changelog-list li {
    margin: 0 0 0.35rem;
}

.adm-changelog-list li:last-child {
    margin-bottom: 0;
}

.adm-form .field {
    margin: 0 0 0.85rem;
}

.adm-form .field .adm-hint {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
}

.adm-form label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.adm-form input[type="text"],
.adm-form input[type="email"],
.adm-form input[type="password"],
.adm-form input[type="number"],
.adm-form select,
.adm-form textarea {
    width: 100%;
    max-width: 520px;
    box-sizing: border-box;
    font: inherit;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.adm-form textarea {
    min-height: 5.5rem;
    resize: vertical;
    line-height: 1.4;
}

.adm-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.adm-module-check {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--surface-muted);
    transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.adm-module-check:hover {
    border-color: var(--border-strong);
}

.adm-module-check:has(input:checked) {
    border-color: rgba(0, 184, 245, 0.45);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px rgba(0, 184, 245, 0.15);
}

.adm-module-check input {
    margin: 0 0 0.15rem;
}

.adm-module-mval {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.adm-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.adm-flash {
    margin: 1rem 0 0;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.adm-flash-ok {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.adm-flash-err {
    background: color-mix(in srgb, #c62828 12%, transparent);
    border: 1px solid color-mix(in srgb, #c62828 35%, transparent);
    color: #8b1a1a;
}

.adm-org-toolbar {
    margin: 0 0 0.75rem;
}

.adm-inline-form {
    display: inline;
    margin: 0;
}

.adm-org-badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    vertical-align: middle;
}

.adm-org-item.is-inactive {
    opacity: 0.78;
    background: var(--surface);
}

.adm-org-inactive {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.adm-org-inactive h3 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}

.adm-btn-danger {
    color: #8b1a1a !important;
    border-color: color-mix(in srgb, #c62828 40%, transparent) !important;
}

.adm-btn-danger:hover {
    background: color-mix(in srgb, #c62828 12%, transparent) !important;
    border-color: #c62828 !important;
}

.adm-danger-zone {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid color-mix(in srgb, #c62828 35%, transparent);
}

.adm-danger-zone h2 {
    color: #8b1a1a;
}

.adm-change-log-wrap {
    overflow-x: auto;
    margin-top: 0.5rem;
}

.adm-change-log-table .adm-change-val {
    font-size: 0.82rem;
    word-break: break-word;
}

.adm-change-log-more {
    margin: 0.75rem 0 0;
}

.adm-org-list {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.adm-org-list h2 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.adm-org-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.adm-org-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    transition: border-color var(--t-fast), background var(--t-fast);
}

.adm-org-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-left: auto;
}

.adm-org-item:hover {
    border-color: var(--border-strong);
    background: var(--surface-hover);
}

.adm-org-name {
    flex: 1;
    min-width: 160px;
}

.adm-org-name em {
    color: var(--text-secondary);
    font-style: normal;
}

.adm-org-mods {
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.adm-objtype-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.adm-objtype-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
}

.adm-objtype-main {
    min-width: 0;
}

.adm-objtype-main strong {
    display: block;
}

.adm-objtype-meta {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.adm-objtype-ai {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.adm-objtype-vals {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.adm-objtype-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-self: flex-start;
}

.adm-objtype-form-panel {
    max-width: 980px;
}

.adm-objtype-section h2 {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.adm-objtype-key {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
}

.adm-objtype-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
}

.adm-objtype-field input[type="text"],
.adm-objtype-field select {
    max-width: none;
}

.adm-objtype-field .adm-hint {
    display: block;
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
}

.adm-inline-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.adm-langtxt-ai-prompt {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    font: inherit;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    resize: vertical;
    min-height: 5.5rem;
}

.adm-readonly-value {
    display: inline-block;
    padding: 0.45rem 0;
    color: var(--text-secondary);
}

.adm-prompt-checks {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 0.85rem 0 1rem;
}

.adm-prompt-form .adm-form-actions {
    margin-top: 0.5rem;
}

.adm-token-row input {
    flex: 1 1 16rem;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
}

.adm-scroll-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.adm-scroll-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
}

.adm-scroll-input {
    max-width: none;
}

@media (max-width: 720px) {
    .adm-objtype-fields {
        grid-template-columns: 1fr;
    }

    .adm-scroll-item {
        grid-template-columns: 1fr;
    }
}

/* Media transfer hub */
.adm-media-hub { max-width: 1100px; }
.adm-media-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.adm-media-period label { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }
.adm-media-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.65rem; margin: 0.75rem 0 1rem; }
.adm-media-stat { padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-muted); }
.adm-media-stat-n { display: block; font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.adm-media-stat-l { display: block; margin-top: 0.2rem; font-size: 0.78rem; color: var(--text-secondary); }
.adm-media-stat-ok .adm-media-stat-n { color: var(--ok, #1a7f37); }
.adm-media-stat-fail .adm-media-stat-n { color: var(--danger, #c62828); }
.adm-media-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.adm-media-columns h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.adm-media-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.adm-media-table th, .adm-media-table td { text-align: left; padding: 0.4rem 0.45rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.adm-media-table tr.is-fail { background: color-mix(in srgb, var(--danger, #c62828) 8%, transparent); }
.adm-media-msg { max-width: 28rem; word-break: break-word; }
.adm-media-badge { display: inline-block; padding: 0.1rem 0.4rem; border-radius: 0.25rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.adm-media-badge-ok { background: color-mix(in srgb, #1a7f37 18%, transparent); color: #1a7f37; }
.adm-media-badge-manglar, .adm-media-badge-feil { background: color-mix(in srgb, #c62828 18%, transparent); color: #c62828; }
.adm-creator-prompt {
    display: block;
    width: 100%;
    max-width: none;
    min-height: 28rem;
    box-sizing: border-box;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    color: var(--text);
    resize: vertical;
}
.adm-media-log-filters { display: flex; gap: 0.35rem; }
.adm-media-log-filters .is-active { border-color: var(--accent); }
.adm-flash-warn { background: color-mix(in srgb, #c62828 12%, transparent); border: 1px solid color-mix(in srgb, #c62828 35%, transparent); padding: 0.65rem 0.85rem; border-radius: var(--radius-sm); }
@media (max-width: 800px) { .adm-media-columns { grid-template-columns: 1fr; } }

/* Database schema sync */
.adm-dbsync { max-width: 960px; }
.adm-dbsync-warn {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid color-mix(in srgb, #b45309 35%, transparent);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, #b45309 10%, transparent);
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.adm-dbsync-warn strong { color: var(--text); }
.adm-dbsync-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 0.85rem;
}
.adm-dbsync-filter label { margin: 0; }
.adm-dbsync-filter select { max-width: 360px; }
.adm-dbsync-row {
    margin: 0 0 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-muted);
}
.adm-dbsync-row-top {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.35rem;
}
.adm-dbsync-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.adm-dbsync-status-ok .adm-dbsync-badge {
    background: color-mix(in srgb, #1a7f37 20%, transparent);
    color: #1a7f37;
}
.adm-dbsync-status-outdated .adm-dbsync-badge {
    background: color-mix(in srgb, #b45309 22%, transparent);
    color: #9a3412;
}
.adm-dbsync-status-error .adm-dbsync-badge {
    background: color-mix(in srgb, #c62828 20%, transparent);
    color: #c62828;
}
.adm-dbsync-issues {
    margin: 0.35rem 0 0;
    padding-left: 1.15rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
}
.adm-dbsync-err {
    margin: 0.35rem 0 0;
    color: #c62828;
    font-size: 0.88rem;
}
.adm-dbsync-inline { margin-top: 0.65rem; }
.adm-dbsync-result {
    margin: 0;
    padding-left: 1.15rem;
}
.adm-dbsync-result li { margin: 0 0 0.45rem; }
.adm-dbsync-result .adm-hint { display: block; margin-top: 0.15rem; }

/* Hjelpeside for sluttbrukar */

.help-page {
    max-width: 1100px;
}

.help-header {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--border);
}

.help-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.help-header h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 300;
}

.help-lead {
    margin: 0;
    max-width: 42rem;
    color: var(--text-secondary);
    font-size: 1.02rem;
}

.help-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

.help-toc {
    padding: var(--space-4);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.help-toc-title {
    margin: 0 0 var(--space-3);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.help-toc ol {
    margin: 0;
    padding: 0 0 0 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.help-toc a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
}

.help-toc a:hover {
    color: var(--accent);
    text-decoration: none;
}

.help-section {
    margin: 0 0 var(--space-7);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border);
    scroll-margin-top: calc(var(--topbar-height) + var(--space-4));
}

.help-section:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.help-section h2 {
    margin: 0 0 var(--space-3);
    font-size: 1.45rem;
    font-weight: 400;
}

.help-section h3 {
    margin: var(--space-5) 0 var(--space-2);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text);
}

.help-section p,
.help-section li {
    color: var(--text-secondary);
    line-height: 1.55;
}

.help-section p {
    margin: 0 0 var(--space-3);
}

.help-section ul,
.help-section ol {
    margin: 0 0 var(--space-3);
    padding-left: 1.25rem;
}

.help-section li {
    margin-bottom: 0.4rem;
}

.help-section strong {
    color: var(--text);
    font-weight: 600;
}

.help-section kbd {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xs);
    background: var(--bg-secondary);
    font-family: ui-monospace, monospace;
    font-size: 0.85em;
    color: var(--text);
}

.help-footnote {
    margin-top: var(--space-5) !important;
    padding: var(--space-4);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    font-size: 0.92rem;
}

@media (min-width: 960px) {
    .help-layout {
        grid-template-columns: 200px minmax(0, 1fr);
        align-items: start;
        gap: var(--space-7);
    }

    .help-toc {
        position: sticky;
        top: calc(var(--topbar-height) + var(--space-4));
    }
}
