:root {
    --bg: #eff4ef;
    --surface: #ffffff;
    --text: #1c2822;
    --muted: #5f6f67;
    --brand: #1f6b52;
    --accent: #2f8a6a;
    --accent-soft: #e3f3ea;
    --soft: #e6efe8;
    --soft2: #edf3ee;
    --field: #b4c4ba;
    --shadow: 0 1px 2px rgba(20, 50, 38, .06), 0 4px 14px rgba(20, 50, 38, .06);
    --brand-dark: #154d3b;
    --line: #d9e4db;
    --ok: #2e6b3a;
    --ok-bg: #e5f2e7;
    --err: #9b2c2c;
    --err-bg: #fbe7e7;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 16px; padding-bottom: 32px; }

.topbar { background: var(--brand); color: #fff; }
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 8px; padding-bottom: 8px; }
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; }
.nav a, .nav .linklike { color: #fff; text-decoration: none; }
.nav a:hover, .nav .linklike:hover { text-decoration: underline; }

h1 { font-size: 1.4rem; margin: 0 0 10px; }
h2 { font-size: 1.1rem; margin: 16px 0 6px; }
a { color: var(--brand); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 12px; display: block; }
.card.narrow, .narrow { max-width: 520px; }
.card h1, .card h2:first-child { margin-top: 0; }
a.card { text-decoration: none; font-weight: 600; }
a.card:hover { border-color: var(--brand); }

.cardlist { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.cardlist .card { margin: 0; }
.cardlist.wide { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cardlist.wide .card { display: flex; flex-direction: column; gap: 4px; height: 100%; font-weight: 400; }
.cardlist.wide .card strong { font-size: 1.1rem; }

.pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.pagehead h1 { margin: 0; }

label { display: block; margin-bottom: 10px; font-weight: 600; }
label.check { font-weight: 400; margin-bottom: 4px; display: flex; gap: 8px; align-items: flex-start; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], textarea {
    display: block; width: 100%; margin-top: 2px; padding: 6px 10px;
    border: 1px solid var(--field); border-radius: 6px; font: inherit; background: #fff; color: inherit;
}
select { display: block; width: 100%; margin-top: 2px; padding: 6px 10px; border: 1px solid var(--field); border-radius: 6px; font: inherit; background: #fff; color: inherit; }
input:disabled { background: var(--soft2); color: var(--muted); }
input[type=checkbox] { margin-top: 5px; }
fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 0 0 10px; padding: 6px 12px; }
legend { font-weight: 600; padding: 0 6px; }

.btn {
    display: inline-block; padding: 6px 12px; border: 0; border-radius: 6px; cursor: pointer;
    background: var(--brand); color: #fff; font: inherit; font-weight: 600; text-decoration: none;
}
.btn:hover { background: var(--brand-dark); }
.btn-secondary { background: #5d7267; }
.btn-danger { background: var(--err); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline; }
form.inline { display: inline; margin: 0; }

.flash { padding: 6px 12px; border-radius: 6px; margin-bottom: 10px; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--err-bg); color: var(--err); }

.muted { color: var(--muted); font-weight: 400; }

.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 5px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--soft); font-size: .85rem; }
tr:last-child td { border-bottom: 0; }

input[type=number], input[type=file] { display: block; width: 100%; margin-top: 2px; padding: 6px 10px; border: 1px solid var(--field); border-radius: 6px; font: inherit; background: #fff; color: inherit; }
.row2 { display: grid; gap: 0 16px; grid-template-columns: 1fr 1fr; }
.row3 { display: grid; gap: 0 16px; grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 560px) { .row2, .row3 { grid-template-columns: 1fr; } }
h3 { font-size: 1rem; margin: 12px 0 6px; }
.prewrap { white-space: pre-wrap; margin: 0; }
ul.plain { list-style: none; padding: 0; margin: 0 0 12px; }
ul.plain li { padding: 3px 0; border-bottom: 1px solid var(--line); }

.horsegrid { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.horsecard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; text-decoration: none; color: inherit; height: 100%; }
.horsecard:hover { border-color: var(--brand); }
.horsecard img, .noimg { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #dde8df; }
.noimg { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .9rem; }
.horsecard-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.badge { display: inline-block; align-self: flex-start; padding: 2px 8px; border-radius: 999px; background: var(--soft2); color: var(--muted); font-size: .8rem; font-weight: 600; }
.badge-warn { background: var(--err-bg); color: var(--err); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.count { display: inline-block; min-width: 1.4em; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--brand); font-size: .8rem; font-weight: 700; text-align: center; }

.pick { border-bottom: 1px solid var(--line); padding: 5px 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.pick > .check { margin: 0; flex: 1 1 260px; }
.pick-off { opacity: .6; }
.pick .rider { margin: 0; font-weight: 400; font-size: .9rem; flex: 0 1 220px; }
.inlineform { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.inlineform input[type=text] { flex: 1 1 200px; margin: 0; }
.inlineform select { flex: 1 1 200px; margin: 0; width: auto; }
.daynav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.daynav form { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.datepick { width: auto; margin: 0; padding: 4px 8px; border: 1px solid var(--field); border-radius: 6px; font: inherit; }

.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.tabs a { padding: 4px 10px; text-decoration: none; font-weight: 600; }
.tabs a.active { background: var(--brand); color: #fff; }
table.cal { min-width: 640px; }
table.cal td, table.cal th { min-width: 88px; font-size: .85rem; padding: 3px 8px; }
table.cal td:first-child, table.cal th:first-child { min-width: 100px; font-size: .9rem; }
.cal .today { background: var(--accent-soft); }
.cal th.today a { font-weight: 800; }
.cal th a { color: inherit; text-decoration: none; }
.slot { margin-bottom: 2px; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 16px; }
.month-head { text-align: center; font-weight: 700; color: var(--muted); font-size: .85rem; padding: 4px 0; }
.month-day { display: flex; flex-direction: column; gap: 3px; min-height: 70px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: inherit; }
.month-day:hover { border-color: var(--brand); }
.month-day.other { opacity: .5; }
.month-day.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.month-day .num { font-weight: 700; }
.month-day .badge { font-size: .7rem; padding: 1px 6px; }
@media (max-width: 560px) { .month-day { min-height: 64px; padding: 4px; } .month-day .badge { font-size: .62rem; padding: 0 4px; } }

.notes { list-style: none; padding: 0; margin: 0; }
.notes li { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 5px; }
.notes li.unread { border-left: 4px solid var(--brand); }
.notes a { display: flex; flex-direction: column; gap: 1px; padding: 7px 12px; text-decoration: none; color: inherit; }
.notes li:not(.unread) strong { font-weight: 500; }

.gallery { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-bottom: 16px; }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #dde8df; }
.gallery figcaption { padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .9rem; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 3px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.convlist { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 5px; }
.convrow { display: flex; flex-direction: column; gap: 1px; padding: 7px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: inherit; }
.convrow:hover { border-color: var(--brand); }
.convrow.unread { border-left: 4px solid var(--brand); }
.convtop { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.count-dark { background: var(--brand); color: #fff; }

.messages { max-height: 60vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.messages.context { max-height: none; background: #f6faf6; }
.msg { margin-bottom: 8px; max-width: 85%; }
.msg.mine { margin-left: auto; text-align: right; }
.msg .meta { font-size: .85rem; }
.msg .text { display: inline-block; text-align: left; white-space: pre-wrap; word-break: break-word; background: var(--soft); border-radius: 10px; padding: 5px 10px; margin-top: 2px; }
.msg.mine .text { background: #cfe5d8; }
.msg.flagged .text { background: var(--err-bg); }
.msgactions { font-size: .8rem; }
.msgactions .linklike { color: var(--muted); }
.sendform { display: flex; gap: 8px; align-items: flex-end; }
.sendform textarea { flex: 1; margin: 0; }
@media (max-width: 560px) { .msg { max-width: 95%; } }

.notes-card { border-left: 4px solid var(--err); }
.notes-card li strong { font-weight: 600; }
.inlinedetails { display: inline-block; margin-left: 8px; font-size: .9rem; }
.inlinedetails summary { cursor: pointer; color: var(--muted); }
.inlinedetails .inlineform { margin: 6px 0; }
.horsenotes { margin: 4px 0 0; padding-left: 18px; font-size: .9rem; color: var(--err); }

.searchform { margin-bottom: 20px; }
.infogrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.infosection h2 { font-size: 1.15rem; }
.infosection ul.plain li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.infotools { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; font-size: .9rem; }
.infotext h3 { margin: 14px 0 6px; font-size: 1.1rem; }
.infotext h4 { margin: 10px 0 4px; font-size: 1.05rem; }
.infotext > :first-child { margin-top: 0; }
.infotext p { margin: 0 0 10px; }
.infotext ul { margin: 0 0 10px; padding-left: 22px; }
.infotext table { width: 100%; }
.infotext .tablewrap { margin-bottom: 14px; }
.infotext td:last-child { text-align: right; white-space: nowrap; font-weight: 600; }
.helpbox { margin: 0 0 14px; padding: 6px 12px; background: #f6faf6; border: 1px solid var(--line); border-radius: 6px; }
.helpbox summary { cursor: pointer; font-weight: 600; }
.helpbox code { background: var(--soft); padding: 1px 5px; border-radius: 4px; }

/* Kompakte knapper og små elementer i værktøjslinjer og tabeller */
.daynav .btn, td .btn, .infotools .btn, .pagehead .btn { padding: 4px 10px; font-size: .9rem; }
td .badge, .slot .badge { font-size: .75rem; padding: 1px 6px; }
td form.inline + form.inline, td a + form.inline { margin-left: 6px; }

/* Knapper og korte felter må aldrig brydes over flere linjer */
.btn, button.btn, .tabs a { white-space: nowrap; line-height: 1.3; }
.daynav form { flex-wrap: nowrap; margin: 0 0 0 auto; }
.daynav form .btn { align-self: center; flex: 0 0 auto; }
.daynav .datepick, .datepick { height: auto; line-height: 1.3; flex: 0 1 auto; }
.inlineform .btn, .sendform .btn { align-self: center; padding: 5px 12px; }
.sendform { align-items: stretch; }
.sendform textarea { min-height: 0; }
form.inline .btn { padding: 4px 10px; }

/* ---------- Designløft ---------- */
body { background: linear-gradient(180deg, #e3eee6 0, var(--bg) 260px) no-repeat, var(--bg); }
h1, h2, h3 { color: #17392c; letter-spacing: -.01em; }
h1 { font-weight: 750; }

.topbar { background: linear-gradient(135deg, #17523f, #1f6b52 60%, #2a7c60); border-bottom: 3px solid var(--accent); box-shadow: 0 2px 10px rgba(20, 50, 38, .25); }
.brand { font-size: 1.2rem; letter-spacing: .01em; }
.brand::before { content: "\1F40E"; margin-right: 8px; }
.nav a, .nav .linklike { padding: 4px 9px; border-radius: 999px; transition: background .15s; }
.nav a:hover, .nav .linklike:hover { background: rgba(255, 255, 255, .16); text-decoration: none; }
.nav .count { background: var(--accent); color: #fff; }

.card, .tablewrap, .notes li, .convrow, .horsecard, .month-day, .gallery figure, .messages { box-shadow: var(--shadow); }
.card { border-color: #d3e0d6; }
a.card { color: var(--brand-dark); transition: transform .12s, box-shadow .12s, border-color .12s; }
a.card:hover, .horsecard:hover, .convrow:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20, 50, 38, .14); }
.cardlist > li > a.card { border-left: 4px solid var(--accent); padding-top: 16px; padding-bottom: 16px; font-size: 1.02rem; }

.btn { background: var(--brand); box-shadow: 0 1px 2px rgba(20, 50, 38, .25); transition: background .15s, transform .1s; }
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn-secondary { background: #ffffff; color: var(--brand-dark); border: 1px solid var(--field); box-shadow: none; }
.btn-secondary:hover { background: var(--soft); }
.btn-danger { background: var(--err); }
.btn-danger:hover { background: #7f2222; }

input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
a { color: #17654c; }

th { background: var(--soft); color: #24493b; text-transform: none; }
tbody tr:hover td { background: #f7fbf7; }
table.cal tbody tr:hover td { background: inherit; }
.cal .today, .cal td.today { background: var(--accent-soft); }

.tabs { border-color: var(--field); box-shadow: none; }
.tabs a { color: var(--brand-dark); }
.tabs a:hover:not(.active) { background: var(--soft); }
.tabs a.active { background: var(--brand); color: #fff; }

.badge { background: var(--soft); color: #3f5a4d; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: #fdeceb; color: var(--err); }
.count { background: var(--accent); color: #fff; }
.count-dark { background: var(--brand); }

.flash-ok { background: var(--ok-bg); border-left: 4px solid var(--ok); }
.flash-error { border-left: 4px solid var(--err); }

.month-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.notes li.unread, .convrow.unread { border-left-color: var(--accent); }
.horsecard img, .noimg { border-bottom: 1px solid var(--line); }
.horsecard-body strong { color: var(--brand-dark); }
.msg .text { background: var(--soft); }
.msg.mine .text { background: #cfe5d8; }
.helpbox { background: #f6faf6; }
.linklike { color: #17654c; }
.infotext td:last-child { color: var(--brand-dark); }
main.guest { padding-top: 48px; }
main.guest .card.narrow { margin-left: auto; margin-right: auto; padding: 24px; border-top: 4px solid var(--accent); }
main.guest h1 { text-align: center; }


/* ---------- Kompakte forsidefelter ---------- */
.tiles { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tiles a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; box-shadow: var(--shadow); text-decoration: none; color: var(--brand-dark); font-weight: 650; transition: transform .12s, box-shadow .12s; }
.tiles a:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(20, 50, 38, .14); }
.tiles .ico { font-size: 1.25rem; line-height: 1; }
@media (max-width: 480px) { .tiles { grid-template-columns: 1fr 1fr; gap: 6px; } .tiles a { padding: 9px 10px; gap: 8px; } }

/* Ny accent-farve (grøn i stedet for gul) og mindre forsidefelter */
.topbar { border-bottom-color: #7cc4a4; }
.nav .count, .menu-toggle .count { background: #fff; color: var(--brand-dark); }
.tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.tiles a { padding: 7px 10px; gap: 7px; border-radius: 8px; font-size: .9rem; }
.tiles a > span:last-child { min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }
.tiles .ico { font-size: 1.05rem; flex: 0 0 auto; }
@media (max-width: 480px) { .tiles a { padding: 7px 8px; gap: 6px; font-size: .85rem; } }

/* Teksten i forsidefelterne står altid på én linje */
.tiles { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.tiles a > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
@media (max-width: 480px) { .tiles { grid-template-columns: 1fr 1fr; } .tiles a { font-size: .82rem; padding: 7px 7px; gap: 5px; } .tiles .ico { font-size: 1rem; } }

/* ---------- Baggrundsbillede ---------- */
body { background: var(--bg); }
body::before {
    content: ""; position: fixed; inset: 0; z-index: -1;
    background: linear-gradient(rgba(239, 244, 239, .84), rgba(239, 244, 239, .84)), url(/assets/bg-bred.jpg) 62% center / cover no-repeat;
}
body.home::before {
    background: linear-gradient(rgba(239, 244, 239, .50), rgba(239, 244, 239, .38)), url(/assets/bg-bred.jpg) 62% center / cover no-repeat;
}
@media (max-aspect-ratio: 1/1), (max-width: 760px) {
    body::before { background-image: linear-gradient(rgba(239, 244, 239, .84), rgba(239, 244, 239, .84)), url(/assets/bg-hoj.jpg); background-position: center; }
    body.home::before { background-image: linear-gradient(rgba(239, 244, 239, .50), rgba(239, 244, 239, .38)), url(/assets/bg-hoj.jpg); }
}
body.home h1 { text-shadow: 0 1px 0 rgba(255, 255, 255, .9), 0 0 12px rgba(255, 255, 255, .8); }

/* Kraftigere baggrundsbillede: lettere slør */
body::before { background-image: linear-gradient(rgba(239, 244, 239, .68), rgba(239, 244, 239, .68)), url(/assets/bg-bred.jpg); }
body.home::before { background-image: linear-gradient(rgba(239, 244, 239, .28), rgba(239, 244, 239, .12)), url(/assets/bg-bred.jpg); }
@media (max-aspect-ratio: 1/1), (max-width: 760px) {
    body::before { background-image: linear-gradient(rgba(239, 244, 239, .68), rgba(239, 244, 239, .68)), url(/assets/bg-hoj.jpg); }
    body.home::before { background-image: linear-gradient(rgba(239, 244, 239, .28), rgba(239, 244, 239, .12)), url(/assets/bg-hoj.jpg); }
}

/* Samme sløring på alle sider som på forsiden */
body::before { background-image: linear-gradient(rgba(239, 244, 239, .28), rgba(239, 244, 239, .12)), url(/assets/bg-bred.jpg); }
@media (max-aspect-ratio: 1/1), (max-width: 760px) {
    body::before { background-image: linear-gradient(rgba(239, 244, 239, .28), rgba(239, 244, 239, .12)), url(/assets/bg-hoj.jpg); }
}
/* Tekst, der står direkte på billedet, får en lys kant så den kan læses */
main > h1, main > h2, main > h3, main > p, main > .pagehead h1, main > .muted, .daynav { text-shadow: 0 1px 0 rgba(255, 255, 255, .9), 0 0 10px rgba(255, 255, 255, .85); }

/* Forsidefelter som mat glas, der blender med baggrunden */
.tiles a {
    background: rgba(255, 255, 255, .46);
    -webkit-backdrop-filter: blur(8px) saturate(1.2); backdrop-filter: blur(8px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, .65); border-left: 4px solid rgba(47, 138, 106, .85);
    box-shadow: 0 2px 10px rgba(20, 50, 38, .12);
    color: #123a2b;
}
.tiles a:hover { background: rgba(255, 255, 255, .7); }

/* ---------- Vinterbaggrund og valg af baggrund ---------- */
body.bg-vinter::before, body.bg-vinter.home::before { background-image: linear-gradient(rgba(239, 244, 239, .28), rgba(239, 244, 239, .12)), url(/assets/bg-vinter-bred.jpg); }
@media (max-aspect-ratio: 1/1), (max-width: 760px) {
    body.bg-vinter::before, body.bg-vinter.home::before { background-image: linear-gradient(rgba(239, 244, 239, .28), rgba(239, 244, 239, .12)), url(/assets/bg-vinter-hoj.jpg); }
}
.bgchoices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 12px; }
.bgchoice { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; margin: 0; background: #fff; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; }
.bgchoice:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(31, 107, 82, .25); }
.bgchoice input { position: absolute; top: 12px; left: 12px; margin: 0; }
.bgchoice img { display: block; width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: 6px; }
.bgauto { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.bgauto img { aspect-ratio: 16 / 14; }

/* ---------- Glaseffekt på alle kort, tabeller og lister ---------- */
.card, .tablewrap, .notes li, .convrow, .horsecard, .month-day, .gallery figure, .messages, .tabs {
    background-color: rgba(255, 255, 255, .64);
    -webkit-backdrop-filter: blur(9px) saturate(1.15); backdrop-filter: blur(9px) saturate(1.15);
    border-color: rgba(255, 255, 255, .7);
}
.card { box-shadow: 0 2px 12px rgba(20, 50, 38, .12); }
a.card:hover, .horsecard:hover, .convrow:hover, .month-day:hover { background-color: rgba(255, 255, 255, .8); }
.tablewrap { background-color: rgba(255, 255, 255, .7); }
th { background: rgba(230, 239, 232, .85); }
tbody tr:hover td { background: rgba(255, 255, 255, .5); }
.cal .today, .cal td.today, .month-day.today { background-color: rgba(227, 243, 234, .85); }
.messages.context, .helpbox { background-color: rgba(246, 250, 246, .7); }
.msg .text { background: rgba(230, 239, 232, .9); }
.msg.mine .text { background: rgba(207, 229, 216, .95); }
.noimg { background: rgba(221, 232, 223, .8); }
main.guest .card.narrow { background-color: rgba(255, 255, 255, .58); border-top: 4px solid var(--accent); }
main.guest h1, main.guest .card h1 { text-shadow: none; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .card, .tablewrap, .notes li, .convrow, .horsecard, .month-day, .gallery figure, .messages, .tabs { background-color: rgba(255, 255, 255, .92); }
}

/* Kalender: hele ugedage (kort form på smalle skærme i månedsvisning) og glas på alle knapper */
.month-head .short { display: none; }
@media (max-width: 640px) { .month-head .full { display: none; } .month-head .short { display: inline; } }
.btn-secondary { background-color: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); border-color: rgba(255, 255, 255, .75); color: var(--brand-dark); }
.btn-secondary:hover { background-color: rgba(255, 255, 255, .8); }
.datepick, .daynav input[type=date] { background-color: rgba(255, 255, 255, .6); -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); border-color: rgba(255, 255, 255, .75); }
.tabs a.active { background: rgba(31, 107, 82, .92); }

/* ---------- Profilbilleder ---------- */
.av { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 50%; overflow: hidden; vertical-align: middle; color: #fff; font-weight: 700; background: #5d7267; }
.av img { display: block; width: 100%; height: 100%; object-fit: cover; }
.av-sm { width: 24px; height: 24px; font-size: .68rem; margin-right: 4px; }
.av-md { width: 44px; height: 44px; font-size: 1rem; }
.av-lg { width: 120px; height: 120px; font-size: 2.2rem; }
.av-c0 { background: #2f8a6a; } .av-c1 { background: #3d7ea6; } .av-c2 { background: #8a6bb0; }
.av-c3 { background: #b07a3d; } .av-c4 { background: #b0566b; } .av-c5 { background: #5d7267; }
.msg .meta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.msg.mine .meta { justify-content: flex-end; }
.withavatar { display: flex; align-items: center; gap: 10px; }
.avatarrow { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.avatarrow > div { flex: 1 1 220px; }
td .av-sm { margin-right: 8px; }

/* Forsidefelter: teksten klippes aldrig */
.tiles { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
.tiles a { padding: 7px 6px; gap: 4px; }
.tiles a > span:last-child { overflow: visible; text-overflow: clip; white-space: nowrap; }
.tiles .ico { font-size: .95rem; }
@media (max-width: 480px) { .tiles { grid-template-columns: 1fr 1fr; } .tiles a { padding: 7px 5px; gap: 4px; font-size: .8rem; } .tiles .ico { font-size: .9rem; } }

/* ---------- Topbjælke og menu ---------- */
.topbar .wrap { max-width: none; padding-left: 14px; padding-right: 14px; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; padding-top: 6px; padding-bottom: 6px; flex-wrap: nowrap; }
.brand { font-size: 1.05rem; white-space: nowrap; flex: 0 0 auto; }
.brand::before { margin-right: 5px; }
.menu { flex: 1 1 auto; min-width: 0; display: block; }
.menu > summary { display: none; list-style: none; }
.menu > summary::-webkit-details-marker, .dd > summary::-webkit-details-marker { display: none; }
.nav { display: flex; align-items: center; gap: 0 1px; }
.nav > a, .dd > summary { display: inline-flex; align-items: center; height: 34px; padding: 0 8px; border-radius: 999px; color: #fff; text-decoration: none; cursor: pointer; list-style: none; white-space: nowrap; font-size: .95rem; line-height: 1.3; }
.nav > a:hover, .dd > summary:hover, .dd[open] > summary { background: rgba(255, 255, 255, .16); text-decoration: none; }
.nav a.on, .dd.on > summary { background: rgba(255, 255, 255, .24); font-weight: 700; }
.dd > summary::after { content: "\25BE"; margin-left: 3px; font-size: .8em; opacity: .8; }
.dd { position: relative; flex: 0 0 auto; }
.nav > a { flex: 0 0 auto; }
.dd.right { margin-left: auto; }
.dd.right > summary .av { width: 28px; height: 28px; margin: 0; font-size: .8rem; }
.dd.right > summary::after { margin-left: 6px; }
.navname { display: none; }
.nav .count { padding: 0 5px; min-width: 1.2em; margin-left: 4px; }
.ddpanel { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 190px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(20, 50, 38, .22); display: flex; flex-direction: column; }
.dd.right .ddpanel { left: auto; right: 0; }
.ddpanel a, .ddpanel .linklike { display: block; width: 100%; padding: 7px 10px; border-radius: 6px; color: var(--text); text-decoration: none; text-align: left; }
.ddpanel a:hover, .ddpanel .linklike:hover { background: var(--soft); text-decoration: none; }
.ddpanel a.on { background: var(--soft); font-weight: 700; color: var(--brand-dark); }
.ddpanel form { margin: 0; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
/* Smal skærm (telefon), og når menuen ikke kan stå på én linje (klassen sættes af app.js) */
@media (max-width: 760px) {
.topbar .brand { white-space: normal; }
.topbar .topbar-inner { flex-wrap: wrap; }
.topbar .menu { flex: 0 0 auto; }
.topbar .menu > summary { display: inline-flex; align-items: center; padding: 5px 14px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 999px; color: #fff; cursor: pointer; font-weight: 600; }
.topbar .menu > summary::before { content: "\2630"; margin-right: 8px; }
.topbar .menu[open] { flex-basis: 100%; order: 3; }
.topbar .menu[open] > summary { margin-bottom: 6px; }
.topbar .nav { flex-direction: column; align-items: stretch; gap: 2px; padding-bottom: 6px; }
.topbar .nav > a, .topbar .dd > summary { display: flex; height: auto; padding: 9px 12px; border-radius: 8px; font-size: 1rem; }
.topbar .dd.right { margin-left: 0; margin-top: 4px; border-top: 1px solid rgba(255, 255, 255, .25); padding-top: 4px; }
.topbar .dd.right > summary .av { width: 24px; height: 24px; margin-right: 8px; }
.topbar .navname { display: inline; flex: 1; }
.topbar .ddpanel { position: static; box-shadow: none; background: rgba(255, 255, 255, .1); border: 0; margin: 2px 0 4px 10px; }
.topbar .ddpanel a, .topbar .ddpanel .linklike { color: #fff; padding: 9px 10px; }
.topbar .ddpanel a:hover, .topbar .ddpanel .linklike:hover, .topbar .ddpanel a.on { background: rgba(255, 255, 255, .16); color: #fff; }
.topbar .ddpanel form { border-top-color: rgba(255, 255, 255, .25); }
}
.topbar.collapsed .brand { white-space: normal; }
.topbar.collapsed .topbar-inner { flex-wrap: wrap; }
.topbar.collapsed .menu { flex: 0 0 auto; }
.topbar.collapsed .menu > summary { display: inline-flex; align-items: center; padding: 5px 14px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 999px; color: #fff; cursor: pointer; font-weight: 600; }
.topbar.collapsed .menu > summary::before { content: "\2630"; margin-right: 8px; }
.topbar.collapsed .menu[open] { flex-basis: 100%; order: 3; }
.topbar.collapsed .menu[open] > summary { margin-bottom: 6px; }
.topbar.collapsed .nav { flex-direction: column; align-items: stretch; gap: 2px; padding-bottom: 6px; }
.topbar.collapsed .nav > a, .topbar.collapsed .dd > summary { display: flex; height: auto; padding: 9px 12px; border-radius: 8px; font-size: 1rem; }
.topbar.collapsed .dd.right { margin-left: 0; margin-top: 4px; border-top: 1px solid rgba(255, 255, 255, .25); padding-top: 4px; }
.topbar.collapsed .dd.right > summary .av { width: 24px; height: 24px; margin-right: 8px; }
.topbar.collapsed .navname { display: inline; flex: 1; }
.topbar.collapsed .ddpanel { position: static; box-shadow: none; background: rgba(255, 255, 255, .1); border: 0; margin: 2px 0 4px 10px; }
.topbar.collapsed .ddpanel a, .topbar.collapsed .ddpanel .linklike { color: #fff; padding: 9px 10px; }
.topbar.collapsed .ddpanel a:hover, .topbar.collapsed .ddpanel .linklike:hover, .topbar.collapsed .ddpanel a.on { background: rgba(255, 255, 255, .16); color: #fff; }
.topbar.collapsed .ddpanel form { border-top-color: rgba(255, 255, 255, .25); }
.ddsep { height: 1px; margin: 4px 0; background: var(--line); }
.topbar.collapsed .ddsep { background: rgba(255, 255, 255, .25); }
@media (max-width: 760px) { .ddsep { background: rgba(255, 255, 255, .25); } }

/* Forsidens knapper: én kolonne. Smal og centreret på pc, i fuld bredde på telefon. */
.tiles { display: flex; flex-direction: column; gap: 8px; max-width: 260px; margin: 0 auto 16px; padding: 0; }
.tiles li { display: block; }
.tiles a { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; font-size: 1rem; border-radius: 12px; border-left-width: 4px; }
.tiles a > span:last-child { flex: 1; }
.tiles a::after { content: "\203A"; font-size: 1.5rem; line-height: 1; opacity: .55; }
.tiles .ico { font-size: 1.35rem; width: 1.6rem; text-align: center; flex: 0 0 auto; }
.tiles a:hover::after { opacity: 1; }
body.home h1 { max-width: 260px; margin-left: auto; margin-right: auto; }
@media (max-width: 480px) {
    .tiles { max-width: none; gap: 7px; }
    .tiles a { padding: 12px 14px; font-size: 1rem; gap: 12px; }
    body.home h1 { max-width: none; }
}
.withavatar .av-lg { width: 96px; height: 96px; font-size: 1.8rem; box-shadow: var(--shadow); border: 2px solid rgba(255, 255, 255, .8); }
@media (max-width: 480px) { .withavatar .av-lg { width: 72px; height: 72px; font-size: 1.4rem; } }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Klikbare ting i kalenderen */
.personlink { font-weight: 600; }
a.badgelink { text-decoration: none; }
a.badgelink:hover { text-decoration: underline; background: #fff; }

/* ---------- Månedsvisning med opsummering ---------- */
.month-day { position: relative; min-height: 98px; overflow: hidden; }
.month-day .num { font-weight: 700; text-decoration: none; color: inherit; align-self: flex-start; }
.month-day .num::after { content: ""; position: absolute; inset: 0; }
.month-day:hover { border-color: var(--brand); }
.month-day .detail { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.month-day .compact { display: none; gap: 3px; flex-wrap: wrap; }
.chip { display: block; max-width: 100%; padding: 1px 6px; border-radius: 6px; font-size: .68rem; line-height: 1.35; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-ev { background: #dff0ea; color: #1d5a45; border-left: 3px solid #2f8a6a; }
.chip-cl { background: #e4eefa; color: #24507a; border-left: 3px solid #3d7ea6; }
.chip-bk { background: var(--ok-bg); color: var(--ok); }
.chip-pd { background: #fff2d9; color: #7a5510; }
.chip-more { background: transparent; color: var(--muted); padding-left: 2px; }
.chip-closed { background: #fdeceb; color: var(--err); }
.dot { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; font-size: .62rem; font-weight: 700; color: #fff; }
.dot-ev { background: #2f8a6a; } .dot-cl { background: #3d7ea6; } .dot-bk { background: #5d7267; }
@media (max-width: 640px) {
    .month-day { min-height: 62px; }
    .month-day .detail { display: none; }
    .month-day .compact { display: flex; }
    .month-day .chip-closed { font-size: .58rem; padding: 0 3px; }
}
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: .85rem; margin: 0 0 16px; }
.legend .dot { margin-right: 4px; }
@media (min-width: 641px) { .legend { display: none; } }

/* ---------- Vagter: kompakt liste og månedsvisning ---------- */
.dutydays { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; align-items: start; }
.dutyday { padding: 8px 12px; margin: 0; }
.dutyday.is-today { border-color: var(--accent); }
.dutyday h2 { font-size: .95rem; margin: 0 0 4px; text-transform: capitalize; }
.dutyrows { list-style: none; margin: 0; padding: 0; }
.dutyrow { display: flex; align-items: center; gap: 8px; padding: 4px 0 4px 8px; min-height: 36px; border-top: 1px solid var(--line); border-left: 3px solid transparent; }
.dutyrow:first-child { border-top: 0; }
.dstate-open { border-left-color: #d98a1f; }
.dstate-mine { border-left-color: #2f8a6a; background: rgba(47, 138, 106, .08); }
.dstate-cancelled { opacity: .55; }
.dtime { flex: none; width: 42px; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.dmain { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.dmain > a { font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmain > a:hover { text-decoration: underline; }
.dwho { font-size: .8rem; }
.dact { flex: none; display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.btn-sm { padding: 3px 12px; font-size: .85rem; }
.dchip { text-decoration: none; }
.dchip-open { background: #fff2d9; color: #7a5510; border-left: 3px solid #d98a1f; }
.dchip-taken { background: #e6eee8; color: #3f5a4d; border-left: 3px solid #9bb3a5; }
.dchip-mine { background: #2f8a6a; color: #fff; }
.dchip-cancelled { background: #f1e4e4; color: #8a4a4a; text-decoration: line-through; }
.dot-open { background: #d98a1f; }
.dot-mine { background: #2f8a6a; }
.legend2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .85rem; margin: 0 0 16px; }
.legend2 .chip { display: inline-block; }
@media (max-width: 480px) { .dutydays { grid-template-columns: 1fr; } }

/* ---------- Tabeller i praktisk information: kolonnerne står pænt under hinanden ---------- */
.infotext .tablewrap { display: inline-block; max-width: 100%; min-width: min(100%, 360px); }
.infotext table { width: auto; min-width: 100%; }
.infotext td:first-child { padding-right: 24px; }
.infotext td:last-child { text-align: left; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.infotext td:only-child { white-space: normal; font-weight: 400; }

/* ---------- Enkel tekstredigering ---------- */
.wys-label { display: block; font-weight: 600; margin-bottom: 4px; }
.wys-tip { font-size: .85rem; margin: 6px 0 12px; }
.wys { border: 1px solid var(--field); border-radius: 8px; background: #fff; }
.wys:focus-within { outline: 2px solid var(--accent); border-color: var(--accent); }
.wys-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: var(--soft); border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.wys-btn { padding: 4px 10px; border: 1px solid var(--field); border-radius: 6px; background: #fff; color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; }
.wys-btn:hover:not(:disabled) { background: var(--soft2); }
.wys-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.wys-btn:disabled { opacity: .4; cursor: not-allowed; }
.wys-bold { font-weight: 800; min-width: 30px; }
.wys-area { min-height: 280px; padding: 12px 14px; outline: none; }
.wys-area table td { border: 1px dashed var(--field); padding: 4px 10px; min-width: 70px; }
.wys-area .tablewrap { border-style: dashed; }
.wys-area a { cursor: text; }
textarea[hidden], .wys-hide[hidden], [hidden].helpbox { display: none !important; }

/* ---------- Billeder ---------- */
.photogrid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 14px; }
.photo { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 10px; background: var(--soft); box-shadow: var(--shadow); }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.photo:hover img { transform: scale(1.04); }
.photocap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; color: #fff; font-size: .78rem; line-height: 1.25; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photostrip { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); margin-bottom: 8px; }
.photostrip a { display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 8px; }
.photostrip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photoadd summary { cursor: pointer; }
.photoadd form { margin-top: 10px; }
.photoview { text-align: center; }
.photoview img { max-width: 100%; height: auto; border-radius: 10px; display: inline-block; }
.photocaption { font-weight: 600; margin: 8px 0 0; }
.photonav { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 480px) { .photogrid { grid-template-columns: repeat(2, 1fr); } }

/* Billeder i praktisk information og i editoren */
.infoimg { margin: 0 0 14px; }
.infoimg img { display: block; max-width: 100%; height: auto; border-radius: 10px; }
.infoimg figcaption { margin-top: 4px; font-size: .85rem; color: var(--muted); }
.wys-area figure { cursor: pointer; outline-offset: 3px; }
.wys-area figure.sel { outline: 3px solid var(--accent); }
.wys-pick { padding: 8px 10px; background: #f6faf6; border-bottom: 1px solid var(--line); }
.wys-pick-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; }
.wys-pick-grid { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); max-height: 220px; overflow-y: auto; }
.wys-pick-item { padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer; aspect-ratio: 1 / 1; overflow: hidden; }
.wys-pick-item:hover, .wys-pick-item:focus { border-color: var(--accent); }
.wys-pick-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Tilpas forsiden ---------- */
.tilesedit { text-align: center; margin: 4px 0 16px; font-size: .9rem; }
.tilesempty { text-align: center; }
.tilepick { max-width: 520px; }
.tilelist { list-style: none; margin: 0 0 8px; padding: 0; }
.tilelist li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.tilelist li:last-child { border-bottom: 0; }
.tilelist label.check { flex: 1; align-items: center; margin: 0; gap: 10px; font-weight: 600; }
.tilelist input[type=checkbox] { margin: 0; width: 18px; height: 18px; }
.tilelist .ico { width: 1.6rem; text-align: center; font-size: 1.2rem; }
.tilemove { display: flex; gap: 4px; }
.tilemove .btn { min-width: 34px; padding: 3px 8px; }

/* Overskrift med redigér-ikon på forsiden */
.homehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 260px; margin: 0 auto 10px; }
.homehead h1 { margin: 0; max-width: none; }
body.home .homehead h1 { margin: 0; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; color: var(--brand-dark); background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .75); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 1px 4px rgba(20, 50, 38, .15); transition: background .15s, transform .1s; }
.iconbtn:hover { background: rgba(255, 255, 255, .85); }
.iconbtn:active { transform: scale(.94); }
@media (max-width: 480px) { .homehead { max-width: none; } }
.tilesedit { display: none; }

/* Vagter: måneder og uger */
.dutymonth { margin: 0 0 12px; }
.dutymonth > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 10px; cursor: pointer; list-style: none; font-weight: 700; background: rgba(255, 255, 255, .64); -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); border: 1px solid rgba(255, 255, 255, .7); box-shadow: var(--shadow); }
.dutymonth > summary::-webkit-details-marker { display: none; }
.dutymonth > summary::before { content: "\25B8"; margin-right: 8px; transition: transform .15s; color: var(--brand); }
.dutymonth[open] > summary::before { transform: rotate(90deg); }
.dutymonth > summary .mname { flex: 1; font-size: 1.05rem; text-transform: capitalize; color: #17392c; }
.dutymonth > summary .msum, .weeksum { display: inline-flex; gap: 6px; align-items: center; font-size: .85rem; font-weight: 400; }
.dutyweek { margin-top: 12px; }
.weekhead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 6px 2px; font-size: .95rem; text-shadow: 0 1px 0 rgba(255, 255, 255, .9), 0 0 10px rgba(255, 255, 255, .85); }
.weekhead .muted { font-weight: 400; font-size: .85rem; }
.weekhead .weeksum { margin-left: auto; }

/* Ejer og parter på hestekortene */
.horsepeople { display: flex; flex-direction: column; gap: 1px; font-size: .82rem; line-height: 1.3; }

/* Hestekort: hele kortet kan klikkes via navnet, mens ejer og parter er egne links */
.horsecard { position: relative; }
.horsecard .cardlink { text-decoration: none; color: inherit; }
.horsecard .cardlink::after { content: ""; position: absolute; inset: 0; }
.horsecard .cardlink:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.horsepeople a { position: relative; z-index: 1; }

/* Book-knap på hestekort */
.horsecard .bookbtn { position: relative; z-index: 1; align-self: flex-start; margin-top: 4px; }

/* Dato, tid og tal har samme udseende og højde, så felter i en række står på linje */
input[type=time], input[type=date], input[type=number], input[type=datetime-local], input[type=month] {
    display: block; width: 100%; min-height: 36px; margin-top: 2px; padding: 6px 10px; border: 1px solid var(--field); border-radius: 6px;
    font: inherit; line-height: 1.3; background: #fff; color: inherit;
}
.row2, .row3 { align-items: end; }
/* På smalle skærme: dato øverst i fuld bredde, Fra og Til side om side på samme linje */
@media (max-width: 560px) {
    .row3:has(input[type=time]) { grid-template-columns: 1fr 1fr; }
    .row3:has(input[type=time]) > label:first-child { grid-column: 1 / -1; }
}

/* Arrangementstype som lille mærke */
.badge-type { background: #dfeaf6; color: #24507a; }

/* Fordeling af heste på arrangementer */
.assignrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.assignname { flex: 1 1 160px; font-weight: 600; }
.assignrow select { flex: 1 1 220px; width: auto; margin: 0; }

.readnotes { margin-top: 16px; }
.readnotes summary { cursor: pointer; color: var(--muted, #667); padding: 6px 0; }
.readnotes .notes li { opacity: .75; }

.extraperms { margin: 12px 0; }
.extraperms summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.extraperms summary::-webkit-details-marker { display: none; }
.extraperms summary h2 { display: inline; margin: 0; }
.extraperms summary::before { content: "\25B8"; font-size: 1.1rem; transition: transform .12s; }
.extraperms[open] summary::before { transform: rotate(90deg); }

.chip-vs { background: #f6e8d3; color: #6b4a1f; border-left: 3px solid #c08a3e; text-decoration: none; }
.dot-vs { background: #c08a3e; }

.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; margin: 8px 0 12px; }
.checkgrid .check { margin: 0; }

.picker .picked { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.picker .picked li { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .6); border: 1px solid var(--line); }
.picker .pk-controls { display: flex; gap: 8px; align-items: center; }
.picker .pk-search { flex: 1; min-width: 0; }
.picker .pk-results { list-style: none; margin: 6px 0 0; padding: 4px; max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .85); }
.picker .pk-results li { padding: 0; }
.picker .pk-results li.muted { padding: 6px 10px; }
.picker .pk-opt { display: block; width: 100%; text-align: left; padding: 6px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font: inherit; color: inherit; }
.picker .pk-opt:hover, .picker .pk-opt:focus { background: rgba(47, 138, 106, .15); }

/* Vagter: en ramme om hver uge, så det tydeligt hører sammen */
.dutyweek { margin-top: 16px; padding: 0 10px 2px; border: 2px solid rgba(47, 138, 106, .45); border-radius: 16px; background: rgba(255, 255, 255, .22); box-shadow: 0 2px 10px rgba(20, 50, 38, .08); }
.dutyweek .weekhead { margin: 0 -10px 10px; padding: 8px 14px; border-radius: 14px 14px 0 0; background: rgba(47, 138, 106, .22); border-bottom: 1px solid rgba(47, 138, 106, .35); text-shadow: none; }
.dutyweek .dutyday { margin-left: 0; margin-right: 0; }
@media (max-width: 480px) { .dutyweek { padding: 0 6px 2px; border-radius: 14px; } .dutyweek .weekhead { margin: 0 -6px 8px; padding: 7px 10px; } }

/* Ugeoverskriften en anelse større og tydeligere */
.dutyweek .weekhead { font-size: 1.08rem; }
.dutyweek .weekhead .muted { font-size: .95rem; font-weight: 600; color: var(--brand-dark, #1d3a2e); opacity: .9; }
.dutyweek .weekhead .weeksum { font-size: .95rem; font-weight: 600; color: var(--brand-dark, #1d3a2e); }

.offhorses { margin: 8px 0 12px; }
.offhorses > summary { cursor: pointer; color: var(--muted, #667); padding: 6px 0; }

.pick .rider { flex: 1 1 280px; }
.pick .rider .picker { margin-top: 4px; }
.inlineform .picker { flex: 1 1 260px; min-width: 220px; }
.field { display: block; margin-bottom: 10px; font-weight: 600; }
.field .picker { font-weight: 400; margin-top: 4px; }

.nextup { max-width: 260px; margin: 0 auto 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .5); box-shadow: var(--shadow); }
.nextup h2 { margin: 0 0 6px; font-size: 1rem; }
.nextup ul.plain { margin: 0; }
.nextup li { padding: 3px 0; font-size: .92rem; }
.nextup .nlabel { display: inline-block; min-width: 5.2em; font-weight: 700; color: var(--brand-dark, #1d3a2e); }
.nextup .nopen { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); font-size: .9rem; font-weight: 600; }
@media (max-width: 480px) { .nextup { max-width: none; } }

.fieldgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 12px; align-items: start; }
.fieldgrid .card { margin: 0; }
.fieldgrid .pagehead h2 { margin: 0; }

/* Næste for dig: kun et linjeskift efter etiketten, ellers som før */
.nextup .nlabel { display: block; min-width: 0; }

/* Tilbud */
.offergrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 230px)); grid-auto-rows: 1fr; gap: 12px; align-items: stretch; margin-bottom: 16px; }
.offergrid .offer { margin: 0; padding: 10px; font-size: .88rem; display: flex; flex-direction: column; }
.offer form:last-of-type, .offer .actions, .offer .offerfoot { margin-top: auto; }
.offer p { margin: 4px 0; }
.offer h2 { margin: 6px 0 2px; font-size: 1rem; }
.offerimg { position: relative; height: 90px; width: 100%; border-radius: 8px; overflow: hidden; background: rgba(255, 255, 255, .5); display: flex; align-items: center; justify-content: center; }
.offerimg img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; display: block; }
.offerph { font-size: 3rem; opacity: .5; }
.offerbadge { z-index: 1; position: absolute; top: 8px; right: 8px; padding: 4px 10px; border-radius: 999px; background: var(--accent, #2f8a6a); color: #fff; font-weight: 700; }
.offerprices { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; margin: 6px 0 8px; }
.offerprices dt { color: var(--muted, #5d7267); }
.offerprices dd { margin: 0; text-align: right; }
.offerprices .was { text-decoration: line-through; color: var(--muted, #5d7267); }
.offerprices .now { font-weight: 700; font-size: 1.05rem; }
.offercode { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 8px 10px; margin-bottom: 8px; border: 2px dashed var(--accent, #2f8a6a); border-radius: 10px; background: rgba(47, 138, 106, .08); }
.offercode strong { font-size: 1.2rem; letter-spacing: .12em; font-family: ui-monospace, Menlo, Consolas, monospace; }

.sponsorline { display: flex; align-items: center; gap: 6px; min-height: 42px; margin-top: 6px; font-size: .85rem; color: var(--muted, #5d7267); }
.sponsorlogo { height: 34px; width: auto; max-width: 110px; object-fit: contain; border-radius: 4px; }
.sponsorlogo.big { height: 64px; max-width: 160px; }
.sponsorrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sponsorrow > div { flex: 1; min-width: 180px; }
.sponsorrow h2 { margin: 0 0 2px; }

.offerremind { margin: 6px 0; padding: 6px 8px; border-radius: 8px; background: rgba(255, 193, 7, .18); font-size: .8rem; }
.offerbought { border-color: #2e7d32; }
.offerthanks { margin: 8px 0 0; font-weight: 600; color: #2e7d32; }
.offerfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.offerfoot .offerthanks { margin: 0; }
.offerfoot .badge { margin-left: auto; white-space: nowrap; flex: none; }
.offer h2 { margin-top: 2px; }
.offerdesc { height: 3.4em; overflow-y: auto; font-size: .78rem; line-height: 1.7; color: var(--muted, #5d7267); margin: 2px 0 4px; }
.offerdesc:empty { visibility: hidden; }
.pricerow { display: flex; gap: 10px; flex-wrap: nowrap; }
.pricerow label { flex: 0 1 110px; min-width: 0; }
.pricerow input[type=text] { width: 100%; }
.sponsorline { padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .6); }
.offercode.offerlocked strong { opacity: .45; }
.offerfoot { flex-wrap: wrap; }
.offerfoot .offerthanks { white-space: nowrap; font-size: .85rem; }
.offercode { justify-content: center; height: 64px; box-sizing: border-box; overflow: hidden; }
.offercode.offerlocked strong { opacity: 1; }
.offerdesc { height: 6.4em; font-size: .88rem; line-height: 1.6; }
.offer h2 { height: 2.5em; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.offerdesc { margin-bottom: 10px; }

/* Tilbud som eget ikon i menuen */
.nav > a.navicon { position: relative; padding: 0 9px; }
.tagicon { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linejoin: round; display: block; }
.tagicon circle { fill: #fff; stroke: none; }
.navlabel { display: none; margin-left: 8px; }
.navicon.fresh .tagicon { fill: #ffd54f; stroke: #ffd54f; }
.navicon.fresh .tagicon circle { fill: #154d3b; }
.newdot { position: absolute; top: 3px; right: 3px; width: 10px; height: 10px; border-radius: 50%; background: #ff5252; border: 2px solid #154d3b; animation: newpulse 1.8s ease-out infinite; }
@keyframes newpulse { 0% { box-shadow: 0 0 0 0 rgba(255, 82, 82, .7); } 70% { box-shadow: 0 0 0 8px rgba(255, 82, 82, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0); } }
@media (prefers-reduced-motion: reduce) { .newdot { animation: none; } }
@media (max-width: 760px) { .topbar .navlabel { display: inline; } .topbar .newdot { position: static; margin-left: 8px; } }
.topbar.collapsed .navlabel { display: inline; }
.topbar.collapsed .newdot { position: static; margin-left: 8px; }
.offernew { position: absolute; z-index: 1; top: 8px; left: 8px; padding: 3px 9px; border-radius: 999px; background: #ffd54f; color: #3b2e00; font-weight: 700; font-size: .8rem; }
.navicon .count { position: absolute; top: 0; right: -2px; margin: 0; min-width: 1.1em; padding: 0 4px; font-size: .68rem; line-height: 1.35; text-align: center; }
@media (max-width: 760px) { .topbar .navicon .count { position: static; margin-left: 8px; font-size: .8rem; } }
.topbar.collapsed .navicon .count { position: static; margin-left: 8px; font-size: .8rem; }
.homehead { position: relative; height: 0; max-width: none; margin: 0; display: block; }
.homehead .iconbtn { position: absolute; top: 0; right: 0; z-index: 2; }
@media (max-width: 760px) { .homehead { height: 36px; margin-bottom: 8px; } }

/* Emojivælger i chatten */
.emojibtn { align-self: center; padding: 5px 10px; font-size: 1.15rem; line-height: 1; }
.emojipanel { margin: 6px 0 0; padding: 8px 10px; max-height: 220px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.emojititle { margin: 6px 0 2px; font-size: .78rem; color: var(--muted); }
.emojirow { display: flex; flex-wrap: wrap; gap: 2px; }
.emojiopt { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; font-size: 1.35rem; line-height: 1; cursor: pointer; }
.emojiopt:hover, .emojiopt:focus-visible { background: var(--soft); }
.emojipanel[hidden] { display: none; }
.nav > a.navicon.offers { margin-left: auto; }
.nav > a.navicon.offers + .dd.right { margin-left: 0; }
@media (max-width: 760px) { .topbar .nav > a.navicon.offers { margin-left: 0; } }
.topbar.collapsed .nav > a.navicon.offers { margin-left: 0; }
.month-day.selected { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.filterbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 0 0 12px; }
.filterbar label { margin: 0; font-weight: 600; font-size: .9rem; }
.filterbar select { width: auto; display: block; margin-top: 2px; min-width: 150px; }
.filterbar .btn { align-self: flex-end; }
.photoup summary { cursor: pointer; }
.photoup form { margin-top: 10px; }
.horsecard img, .gallery img { height: auto; max-width: 100%; }
