/* Skippern admin – lys, rolig og ryddig */
:root {
  --bg: #faf8f4;
  --card: #ffffff;
  --line: #e4ded3;
  --line-2: #efeae1;
  --ink: #142132;
  --muted: #5f6873;
  --navy: #0f2a44;
  --navy-2: #1b3d61;
  --gold: #a8844f;
  --gold-soft: #f4ede2;
  --ok: #2e6b4f;
  --ok-soft: #e8f2ec;
  --err: #a3392f;
  --err-soft: #fbecea;
  --info-soft: #eaf0f6;
  --radius: 12px;
  --side: 248px;
  --shadow: 0 1px 2px rgba(20, 33, 50, .04), 0 4px 18px rgba(20, 33, 50, .04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 2.15rem; letter-spacing: .005em; }
h2 { font-size: 1.08rem; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.vh { visibility: hidden; }
.i { width: 20px; height: 20px; flex: none; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---------- Ramme: sidemeny + innhold ---------- */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side); background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 16px 18px; z-index: 30; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 0 8px 20px; }
.brand img { height: 46px; width: auto; filter: brightness(0) saturate(100%) invert(12%) sepia(30%) saturate(1600%) hue-rotate(185deg) brightness(92%); }
.brand span { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; border-left: 1px solid var(--line); padding-left: 10px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; text-decoration: none;
  color: var(--ink); font-weight: 500; font-size: .97rem;
}
.side nav a .i { color: var(--muted); }
.side nav a:hover { background: var(--bg); }
.side nav a.on { background: var(--gold-soft); color: var(--navy); }
.side nav a.on .i { color: var(--gold); }
.side nav .count { margin-left: auto; font-style: normal; background: var(--navy); color: #fff; font-size: .75rem; font-weight: 600; border-radius: 99px; padding: 1px 8px; }
.side-new { margin: 18px 4px 0; }
.side-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 4px; }
.side-foot .me { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 6px 8px; border-radius: 9px; }
.side-foot .me:hover { background: var(--bg); }
.side-foot .me strong { display: block; font-size: .92rem; font-weight: 600; }
.side-foot .me small { display: block; color: var(--muted); font-size: .8rem; }
.side-foot .site-link, .linkish {
  display: flex; align-items: center; gap: 10px; padding: 8px; color: var(--muted); text-decoration: none; font: inherit; font-size: .9rem;
  background: none; border: 0; cursor: pointer; width: 100%; border-radius: 8px; text-align: left;
}
.side-foot .site-link:hover, .linkish:hover { color: var(--ink); background: var(--bg); }
.side-foot form { margin: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; flex: none; background: var(--gold-soft); display: inline-flex; align-items: center; justify-content: center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.avatar .ini { font-weight: 600; color: var(--gold); font-size: .85rem; }
.avatar.lg { width: 64px; height: 64px; }
.avatar.lg .ini { font-size: 1.2rem; }
.avatar.xl { width: 120px; height: 120px; }
.avatar.xl .ini { font-size: 2rem; }

.main { margin-left: var(--side); padding: 36px 44px 80px; max-width: calc(var(--side) + 1160px); }
.login-page .main { margin: 0; max-width: none; padding: 0; }
.topbar { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(20, 33, 50, .28); z-index: 25; }

/* ---------- Sidetopp ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { margin: 6px 0 0; color: var(--muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Kort ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card, .editor > .card + .card, section.card { margin-bottom: 20px; }
.card h2 { margin-bottom: 14px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head a { font-size: .9rem; }
.empty { color: var(--muted); margin: 0; }
.empty-card { text-align: center; padding: 40px 24px; color: var(--muted); }
.empty-card p { margin: 0 0 16px; }
.danger { border-color: #ecd3cf; }

/* ---------- Knapper ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 500 .95rem Inter, system-ui, sans-serif;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: #cfc6b7; background: #fdfcfa; }
.btn .i { width: 18px; height: 18px; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn-quiet:hover { background: var(--bg); border-color: var(--line); color: var(--ink); }
.btn-danger { color: var(--err); border-color: #e8c4be; }
.btn-danger:hover { background: var(--err-soft); border-color: var(--err); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .88rem; }
.btn-block { width: 100%; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .rte-area:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}

/* ---------- Meldinger ---------- */
.flash {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 10px; margin-bottom: 18px;
  border: 1px solid; font-weight: 500;
}
.flash span { flex: 1; }
.flash-ok { background: var(--ok-soft); border-color: #c4dccd; color: var(--ok); }
.flash-err { background: var(--err-soft); border-color: #eccac4; color: var(--err); }
.flash-info { background: var(--info-soft); border-color: #cfdcea; color: var(--navy); }
.flash-x { background: none; border: 0; color: inherit; cursor: pointer; padding: 4px; opacity: .6; display: inline-flex; }
.flash-x:hover { opacity: 1; }
.flash-x .i { width: 18px; height: 18px; }

/* ---------- Skjema ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; min-width: 0; }
fieldset.field { border: 0; padding: 0; margin: 0 0 18px; }
.field > label, fieldset.field legend { font-weight: 600; font-size: .92rem; color: var(--ink); padding: 0; margin-bottom: 0; }
fieldset.field legend { margin-bottom: 8px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], input[type=date], input[type=number], select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid #d9d2c5; border-radius: 9px; background: #fff;
  font: 16px/1.4 Inter, system-ui, sans-serif; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.55; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%235f6873' stroke-width='1.6'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(15, 42, 68, .1); outline: none; }
input::placeholder, textarea::placeholder { color: #9aa1a9; }
.hint { margin: 0; color: var(--muted); font-size: .85rem; }
.note { margin: 0 0 16px; padding: 10px 14px; background: var(--gold-soft); border-radius: 8px; color: #6d5530; font-size: .9rem; }
.static { min-height: 48px; display: flex; align-items: center; padding: 0 14px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px; }
.with-suffix { position: relative; }
.with-suffix input { padding-right: 70px; }
.with-suffix .suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; pointer-events: none; }
.row-2, .row-3 { display: grid; gap: 0 18px; }
.row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; }
.narrow { max-width: 460px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; margin-bottom: 14px; cursor: pointer; background: #fff; }
.check:hover { border-color: var(--line); background: #fdfcfa; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy); flex: none; }
.check strong { display: block; font-weight: 600; font-size: .95rem; }
.check small { display: block; color: var(--muted); font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 1px solid #d9d2c5; border-radius: 99px; font-size: .9rem; background: #fff; transition: all .15s; }
.chip input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--navy); font: 500 .88rem Inter, sans-serif; cursor: pointer; padding: 8px 10px; }
.field > .lbl { font-weight: 600; font-size: .92rem; }
.file-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px; border: 1px dashed #d1c8b8; border-radius: 9px; background: #fcfbf8; cursor: pointer; }
.file-pick:hover { border-color: var(--gold); }
.file-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-pick input:focus-visible + .btn { outline: 2px solid var(--gold); outline-offset: 2px; }
.file-pick .file-name { font-size: .9rem; overflow-wrap: anywhere; }
.file-pick.has-file .file-name { color: var(--ok); font-weight: 500; }
.file-plain { font: inherit; font-size: .92rem; padding: 10px; border: 1px dashed #d1c8b8; border-radius: 9px; background: var(--bg); width: 100%; }

/* ---------- Språkfaner ---------- */
.lang-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.lang-tab {
  position: relative; background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; margin-bottom: -1px;
  font: 500 .92rem Inter, sans-serif; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.lang-tab:hover { color: var(--ink); }
.lang-tab.on { color: var(--navy); border-bottom-color: var(--gold); font-weight: 600; }
.lang-tab:first-child::after { content: "Må fylles ut"; font-size: .7rem; font-weight: 500; color: var(--gold); background: var(--gold-soft); padding: 1px 6px; border-radius: 4px; }
.lang-tab .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; }
.lang-pane { display: none; }
.lang-pane.on { display: block; }

/* ---------- Teksteditor ---------- */
.rte { border: 1px solid #d9d2c5; border-radius: 10px; background: #fff; overflow: hidden; }
.rte:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(15, 42, 68, .1); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line-2); background: #fcfbf8; position: sticky; top: 0; z-index: 2; }
.rte-bar button { min-height: 34px; padding: 0 10px; border: 1px solid transparent; border-radius: 7px; background: none; font: 500 .85rem Inter, sans-serif; color: var(--ink); cursor: pointer; }
.rte-bar button:hover { background: #fff; border-color: var(--line); }
.rte-bar button.on { background: var(--gold-soft); border-color: #e6d9c3; }
.rte-area { min-height: 220px; max-height: 70vh; overflow-y: auto; padding: 16px 18px; font-size: 1rem; line-height: 1.65; outline: none; }
.rte-area:empty::before { content: attr(data-placeholder); color: #9aa1a9; }
.rte-area > :first-child { margin-top: 0; }
.rte-area p { margin: 0 0 .9em; }
.rte-area h2, .rte-area h3, .rte-area h4 { font-size: 1.1rem; margin: 1.2em 0 .4em; }
.rte-area h2 { font-size: 1.2rem; }
.rte-area ul, .rte-area ol { padding-left: 1.4em; margin: 0 0 .9em; }
.rte-area blockquote { margin: 0 0 .9em; padding-left: 14px; border-left: 3px solid var(--gold); color: var(--muted); }
.rte-area a { color: var(--navy); text-decoration: underline; }
.rte-area img { max-width: 100%; height: auto; border-radius: 6px; }
.rte-area p[data-youtube] { min-height: 44px; display: flex; align-items: center; padding: 0 14px; background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: .88rem; }
.rte-area p[data-youtube]::before { content: "Film fra YouTube vises her på nettsiden"; }

/* ---------- Oversikt ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); padding: 20px 22px; transition: border-color .15s, transform .15s; }
.stat:hover { border-color: #cfc6b7; }
.stat .n { font-family: "Cormorant Garamond", Georgia, serif; font-size: 2.6rem; font-weight: 600; line-height: 1; color: var(--navy); font-variant-numeric: lining-nums; }
.stats .card, .grid-2 .card { margin: 0; }
.stat .l { color: var(--muted); font-size: .92rem; }
.stat-hot { border-color: #e2cfaf; background: linear-gradient(0deg, #fff, #fdf9f2); }
.stat-hot .n { color: var(--gold); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.grid-2 > .card { margin: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li a { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 11px 0; border-top: 1px solid var(--line-2); text-decoration: none; color: var(--ink); }
.list li:first-child a { border-top: 0; }
.list li a strong { font-weight: 600; }
.list li a .muted { grid-column: 1; font-size: .9rem; }
.list li a small { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--muted); font-size: .82rem; text-align: right; }
.list li.is-new a strong::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-right: 8px; vertical-align: middle; }
.list li a small b { color: var(--gold); font-weight: 600; }
.rank { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rank li a { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); text-decoration: none; color: var(--ink); }
.rank li:first-child a { border-top: 0; }
.rank .th { width: 56px; height: 40px; border-radius: 6px; overflow: hidden; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.rank .th img { width: 100%; height: 100%; object-fit: cover; }
.rank .t { font-weight: 500; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .v { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.rank .v .i { width: 16px; height: 16px; }
.howto { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: .94rem; }
.howto li { margin-bottom: 8px; }
.howto strong { color: var(--ink); }

/* ---------- Lister ---------- */
.filters { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; padding: 18px 20px 0; margin-bottom: 16px; }
.filters .field { margin-bottom: 18px; min-width: 170px; }
.filters .grow { flex: 1 1 260px; }
.search { position: relative; }
.search .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search input { padding-left: 40px; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; margin-bottom: 16px; gap: 2px; }
.seg a { padding: 8px 16px; border-radius: 7px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: .92rem; }
.seg a.on { background: var(--navy); color: #fff; }
.result-count { margin: 0 0 10px; font-size: .9rem; }
.boat-list { padding: 0; overflow: hidden; }
.bl-head, .bl-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) 128px 92px 136px 228px; gap: 16px; align-items: center; padding: 12px 20px; }
.post-list .bl-row { grid-template-columns: 88px minmax(0, 1fr) 104px 120px 90px; }
.boat-list.card { padding: 0; }
.bl-head + .bl-row, .post-list .bl-row:first-child { border-top: 0; }
.bl-who { font-size: .9rem; line-height: 1.35; }
.bl-who small { display: block; color: var(--muted); font-size: .82rem; }
.bl-price { white-space: nowrap; }
.bl-price.por { white-space: normal; color: var(--muted); }
.bl-actions .unpub { flex-basis: 100%; display: flex; justify-content: flex-end; }
.bl-actions .unpub button { background: none; border: 0; padding: 2px 0; color: var(--muted); font: inherit; font-size: .84rem; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.bl-actions .unpub button:hover { color: var(--ink); }
.bl-head { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding-top: 14px; padding-bottom: 10px; background: #fcfbf8; }
.bl-row { border-top: 1px solid var(--line-2); }
.bl-row:hover { background: #fdfcf9; }
.bl-th { width: 88px; height: 60px; border-radius: 7px; overflow: hidden; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.bl-th img { width: 100%; height: 100%; object-fit: cover; }
.noimg { color: #c3b9a8; display: flex; }
.bl-title a { font-weight: 600; text-decoration: none; color: var(--ink); display: block; overflow: hidden; text-overflow: ellipsis; }
.bl-title a:hover { color: var(--navy); text-decoration: underline; }
.bl-title small { display: block; font-size: .85rem; }
.bl-price { font-variant-numeric: tabular-nums; font-size: .95rem; }
.bl-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.bl-actions form { margin: 0; }
.tag { font-size: .72rem; background: var(--gold-soft); color: #7a5c2f; border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; font-size: .78rem; font-weight: 600; border-radius: 99px; padding: 3px 10px; white-space: nowrap; border: 1px solid transparent; }
.b-for_sale, .b-published { background: var(--ok-soft); color: var(--ok); }
.b-sold { background: var(--info-soft); color: var(--navy); }
.b-draft { background: #f1efeb; color: var(--muted); border-color: #e4e0d9; }
.b-new { background: var(--gold); color: #fff; }
.b-done { background: #f1efeb; color: var(--muted); }
.b-admin { background: var(--gold-soft); color: #7a5c2f; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }

/* ---------- Båtskjema ---------- */
.editor { max-width: 980px; }
.has-savebar .main { padding-bottom: 120px; }
.savebar { position: sticky; bottom: 0; z-index: 20; margin: 0 -8px; padding: 12px 8px; background: linear-gradient(to top, var(--bg) 70%, rgba(250, 248, 244, 0)); }
.savebar-in { display: flex; align-items: center; justify-content: flex-end; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 10px 18px; box-shadow: 0 6px 24px rgba(20, 33, 50, .08); }
.savebar-note { margin-right: auto; font-size: .9rem; visibility: hidden; }
.savebar.dirty .savebar-note { visibility: visible; color: var(--gold); font-weight: 500; }
.savebar .btn-primary { min-width: 150px; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.img-grid:empty { display: none; }
.img-tile { position: relative; aspect-ratio: 4 / 3; border-radius: 9px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); cursor: grab; touch-action: manipulation; user-select: none; }
.img-tile img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.img-tile.dragging { opacity: .4; }
.img-tile.over { outline: 2px dashed var(--gold); outline-offset: 2px; }
.img-tile.loading { display: flex; align-items: center; justify-content: center; cursor: default; }
.img-tile.loading::after { content: ""; width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
.img-tile.failed { border-color: #eccac4; background: var(--err-soft); }
@keyframes spin { to { transform: rotate(360deg); } }
.img-first { display: none; position: absolute; left: 8px; top: 8px; background: var(--navy); color: #fff; font-size: .72rem; font-weight: 600; padding: 3px 8px; border-radius: 99px; }
.img-tile:first-child .img-first { display: block; }
.img-grip { position: absolute; left: 6px; bottom: 6px; background: rgba(255, 255, 255, .92); border-radius: 6px; padding: 3px; display: flex; color: var(--muted); }
.img-grip .i { width: 16px; height: 16px; }
.img-del { position: absolute; right: 6px; top: 6px; width: 34px; height: 34px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .94); color: var(--err); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.img-del:hover { background: #fff; }
.img-del .i { width: 17px; height: 17px; }
.img-move { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; }
.img-move button { width: 32px; height: 30px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .94); color: var(--ink); cursor: pointer; font-size: 1rem; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.img-tile:first-child .img-left, .img-tile:last-child .img-right { visibility: hidden; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 30px 20px;
  border: 2px dashed #d6ccbb; border-radius: 12px; background: #fcfbf8; cursor: pointer; transition: all .15s; position: relative;
}
.dropzone:hover, .dropzone.over { border-color: var(--gold); background: var(--gold-soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone .i { width: 30px; height: 30px; color: var(--gold); }
.dropzone strong { color: var(--navy); }
.dropzone small { color: var(--muted); }
.upload-status { margin-top: 10px; font-size: .9rem; color: var(--muted); }
.upload-status .err { color: var(--err); display: block; }
.specs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.spec-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 44px; gap: 8px; }
.spec-del { border: 1px solid var(--line); background: #fff; border-radius: 9px; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.spec-del:hover { color: var(--err); border-color: #e8c4be; }
.yt-prev { width: 240px; border-radius: 8px; border: 1px solid var(--line); }

/* ---------- Henvendelser ---------- */
.enq-list .enq { margin-bottom: 16px; }
.enq.is-new { border-left: 4px solid var(--gold); }
.enq header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.enq header h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 4px; font-size: 1.1rem; }
.enq header p { margin: 0; font-size: .9rem; }
.enq header form { margin: 0; }
.enq-contact { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 16px 0 0; }
.enq-contact div { min-width: 0; }
.enq-contact dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.enq-contact dd { margin: 0; overflow-wrap: anywhere; }
.enq-msg { margin: 16px 0; padding: 14px 16px; background: var(--bg); border-radius: 9px; white-space: normal; overflow-wrap: anywhere; }
.enq p:last-child { margin-bottom: 0; }

/* ---------- Meglere ---------- */
.broker-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.broker-card { display: flex; gap: 16px; align-items: center; text-decoration: none; color: var(--ink); padding: 18px; margin: 0 !important; transition: border-color .15s; }
.broker-card:hover { border-color: #cfc6b7; }
.bc-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bc-body strong { font-size: 1.02rem; }
.bc-body .muted { font-size: .88rem; }
.bc-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.photo-row { display: grid; grid-template-columns: 140px 1fr; gap: 22px; align-items: start; margin-bottom: 8px; }
.photo-row.wide { grid-template-columns: 260px 1fr; }
.photo-prev { width: 140px; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.photo-prev.wide { width: 260px; aspect-ratio: 16 / 10; }
.photo-prev img { width: 100%; height: 100%; object-fit: cover; }
.photo-prev .avatar.xl { border-radius: 50%; }
.pw-shown { border-color: #c4dccd; background: #f6fbf8; }
.pw-big code { display: inline-block; font-size: 1.5rem; letter-spacing: .04em; background: #fff; border: 1px solid #c4dccd; padding: 10px 18px; border-radius: 9px; user-select: all; }

/* ---------- Innlogging ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(1200px 500px at 50% -10%, #f1ebe0, var(--bg)); }
.login-card { width: 100%; max-width: 420px; padding: 36px 32px; }
.login-logo { display: block; height: 64px; width: auto; margin: 0 auto 22px; filter: brightness(0) saturate(100%) invert(12%) sepia(30%) saturate(1600%) hue-rotate(185deg) brightness(92%); }
.login-card h1 { text-align: center; font-size: 2rem; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--muted); margin: 0 0 24px; }
.login-card .hint.center { margin-top: 18px; }

/* ---------- Mobil og nettbrett ---------- */
@media (max-width: 1180px) {
  .bl-head { display: none; }
  .bl-row { grid-template-columns: 88px minmax(0, 1fr) auto; grid-template-areas: "th title status" "th price who" "act act act"; gap: 4px 14px; padding: 14px 18px; }
  .post-list .bl-row { grid-template-columns: 88px minmax(0, 1fr) auto; grid-template-areas: "th title status" "th date date" "act act act"; }
  .bl-th { grid-area: th; align-self: start; }
  .bl-title { grid-area: title; }
  .bl-price { grid-area: price; font-size: .9rem; color: var(--muted); }
  .bl-status { grid-area: status; justify-self: end; }
  .bl-who { grid-area: who; justify-self: end; text-align: right; }
  .bl-who small { display: none; }
  .bl-actions .unpub { flex-basis: auto; }
  .post-list .bl-date { display: block; grid-area: date; }
  .bl-actions { grid-area: act; justify-content: flex-start; margin-top: 8px; }
}
@media (max-width: 980px) {
  :root { --side: 280px; }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between;
    height: 60px; padding: 0 12px 0 16px; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px);
  }
  .topbar .brand { padding: 0; }
  .topbar .brand img { height: 28px; }
  .menu-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font: 500 .95rem Inter, sans-serif; color: var(--ink); cursor: pointer; }
  .side { transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(20, 33, 50, .15); }
  .side.open { transform: none; }
  .main { margin-left: 0; padding: 22px 16px 70px; }
  .has-savebar .main { padding-bottom: 130px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.8rem; }
  .card { padding: 18px 16px; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .page-head { margin-bottom: 18px; align-items: flex-start; }
  .page-actions, .page-actions .btn { width: 100%; }
  .stat { padding: 16px; }
  .stat .n { font-size: 2.2rem; }
  .filters { padding: 14px 14px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
  .filters .field { min-width: 0; margin-bottom: 14px; }
  .filters .grow { grid-column: 1 / -1; }
  .filters .field.go { display: none; }
  .filters.no-sel .field.go { display: flex; grid-column: 1 / -1; }
  .filters .field.go .vh { display: none; }
  .filters .btn { width: 100%; }
  .bl-row { padding: 14px 14px; grid-template-columns: 76px minmax(0, 1fr); grid-template-areas: "th title" "th price" "th status" "act act"; }
  .post-list .bl-row { grid-template-columns: 76px minmax(0, 1fr); grid-template-areas: "th title" "th status" "th date" "act act"; }
  .bl-th { width: 76px; height: 56px; }
  .bl-status { justify-self: start; }
  .bl-who { display: none; }
  .img-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-row { grid-template-columns: minmax(0, 1fr) 44px; }
  .spec-row input:nth-child(2) { grid-column: 1; }
  .spec-row .spec-del { grid-row: 1 / span 2; grid-column: 2; }
  .spec-row { padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
  .savebar { margin: 0 -16px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); position: fixed; left: 0; right: 0; bottom: 0; margin: 0; }
  .savebar-in { padding: 8px; }
  .savebar-note { display: none; }
  .savebar .btn { flex: 1; }
  .photo-row, .photo-row.wide { grid-template-columns: 1fr; }
  .photo-prev.wide { width: 100%; }
  .lang-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .lang-tab { white-space: nowrap; }
  .seg { display: flex; }
  .seg a { flex: 1; text-align: center; padding: 8px 10px; }
  .broker-list { grid-template-columns: 1fr; }
  .enq header form, .enq header form .btn { width: 100%; }
  .login-card { padding: 28px 20px; }
}
.editor ~ .danger, .danger { max-width: 980px; }

/* ---------- Lister med tall (båter og artikler) ---------- */
.sorth { display: inline-flex; align-items: center; gap: 3px; color: inherit; text-decoration: none; justify-content: flex-end; white-space: nowrap; }
.sorth svg { width: 12px; height: 12px; opacity: 0; transition: opacity .15s; }
.sorth:hover { color: var(--ink); }
.sorth:hover svg { opacity: .5; }
.sorth.on { color: var(--navy); }
.sorth.on svg { opacity: 1; }
.bl-n { text-align: right; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bl-n b { font-weight: 600; font-size: 1rem; color: var(--ink); }
.bl-n b.zero { color: #b9b3a8; font-weight: 500; }
.bl-n small { display: block; font-size: .74rem; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.bl-n.n-enq small { color: #9a4429; font-weight: 600; }
.bl-n .n-l { display: none; }
.bl-title small .badge { margin-right: 4px; vertical-align: 1px; }

.stats-list .bl-head, .stats-list .bl-row { grid-template-columns: 76px minmax(0, 1fr) 118px repeat(5, 80px) 152px; gap: 12px; }
.stats-list .bl-head > :nth-child(n+3) { text-align: right; }
.stats-list .bl-head .sorth { width: 100%; }
.stats-list .bl-nums { display: contents; }
.stats-list .bl-th { width: 76px; height: 56px; }
.stats-list .bl-actions { flex-direction: column; align-items: stretch; }
.stats-list .bl-actions .btn { width: 100%; justify-content: center; }
.stats-list .bl-actions .unpub { justify-content: center; }
.post-list.stats-list .bl-head, .post-list.stats-list .bl-row { grid-template-columns: 76px minmax(0, 1fr) 110px repeat(3, 84px) 96px; }

@media (max-width: 1360px) {
  .stats-list .bl-head { display: none; }
  .stats-list .bl-row, .post-list.stats-list .bl-row { grid-template-columns: 76px minmax(0, 1fr) auto; grid-template-areas: "th title price" "nums nums nums" "act act act"; gap: 8px 14px; padding: 16px 18px; }
  .stats-list .bl-th { grid-area: th; align-self: start; }
  .stats-list .bl-title { grid-area: title; }
  .stats-list .bl-price { grid-area: price; justify-self: end; color: var(--ink); }
  .stats-list .bl-nums { grid-area: nums; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
  .post-list.stats-list .bl-nums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-list .bl-n { text-align: left; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
  .stats-list .bl-n .n-l { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; }
  .stats-list .bl-actions { grid-area: act; flex-direction: row; justify-content: flex-start; align-items: center; margin-top: 4px; }
  .stats-list .bl-actions .btn { width: auto; }
}
@media (max-width: 640px) {
  .stats-list .bl-row, .post-list.stats-list .bl-row { grid-template-columns: 68px minmax(0, 1fr); grid-template-areas: "th title" "th price" "nums nums" "act act"; padding: 14px; }
  .stats-list .bl-th { width: 68px; height: 52px; }
  .stats-list .bl-price { justify-self: start; font-size: .92rem; }
  .stats-list .bl-nums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-list .bl-n small { white-space: normal; }
}
.list-sort { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; font-size: .88rem; color: var(--muted); }
.list-sort .sorth { padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.list-sort .sorth.on { border-color: var(--navy); background: var(--navy); color: #fff; }

.stats-list .bl-head .sorth { position: relative; }
.stats-list .bl-head .sorth svg { position: absolute; right: -13px; top: 50%; transform: translateY(-50%); }
.stats-list .bl-head, .stats-list .bl-row { grid-template-columns: 76px minmax(0, 1fr) 118px repeat(5, 88px) 152px; }
.post-list.stats-list .bl-head > :nth-child(3) { text-align: left; }
.post-list.stats-list .bl-head, .post-list.stats-list .bl-row { grid-template-columns: 76px minmax(0, 1fr) 110px repeat(3, 96px) 96px; }
@media (max-width: 1360px) {
  .stats-list .bl-row, .post-list.stats-list .bl-row { grid-template-columns: 76px minmax(0, 1fr) auto; }
}
@media (max-width: 640px) {
  .stats-list .bl-row, .post-list.stats-list .bl-row { grid-template-columns: 68px minmax(0, 1fr); }
}
.stats-list .bl-head > :nth-child(3) { text-align: left; }
.stats-list .bl-head > .sorth:nth-child(3) { justify-content: flex-start; width: auto; }
