:root {
  --bg: #f4f6f9; --card: #fff; --text: #1d2733; --muted: #6b7785; --line: #dde3ea;
  --accent: #1f4e79; --accent-soft: #e6eef7; --fr: #5b4a8a; --dec: #e9f5ec; --dec-line: #2e7d4f;
  --comm: #fff5e5; --comm-line: #c47f17; --danger: #b3261e; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c; --card: #1b2129; --text: #e4e9ef; --muted: #93a0ae; --line: #2c3540;
    --accent: #7fb2e5; --accent-soft: #1f2d3c; --fr: #b9a8e6; --dec: #17291f; --dec-line: #5fbf86;
    --comm: #2d2414; --comm-line: #e0a64a; --danger: #ef8a83;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.4rem; margin: .2rem 0; }
h2 { font-size: 1.15rem; margin: 0; }
h2.h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.nowrap { white-space: nowrap; }

header.top { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; padding: .7rem 1rem; background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { header.top { background: #0d2238; } }
header.top a, header.top .link { color: #fff; text-decoration: none; }
.brand { font-weight: 700; }
.brand span { font-weight: 400; opacity: .85; margin-left: .3rem; }
header nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
form.inline { display: inline; }

main { max-width: 760px; margin: 0 auto; padding: 1rem; }
main.wide { max-width: 1200px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; }
.card.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.flash { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: .6rem 1rem; margin-bottom: 1rem; }
.row-between { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

.btn { display: inline-block; border: 1px solid var(--accent); background: var(--card); color: var(--accent); border-radius: 8px; padding: .45rem .8rem; font: inherit; font-size: .95rem; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--card); }
.btn.ghost { border-color: var(--line); color: var(--text); }
.btn.small { padding: .2rem .5rem; font-size: .85rem; }
.btn.danger, button.danger { color: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.icon { border: 0; background: none; font-size: 1.3rem; color: var(--muted); cursor: pointer; }

.stack { display: grid; gap: .8rem; }
.grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
label { display: grid; gap: .25rem; font-size: .9rem; color: var(--muted); }
label.check { display: flex; gap: .5rem; align-items: center; }
input, textarea, select { font: inherit; font-size: 16px; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: .45rem .55rem; width: 100%; }
textarea { resize: vertical; }
input[type=checkbox] { width: auto; }
table.plain { width: 100%; border-collapse: collapse; }
table.plain td, table.plain th { text-align: left; padding: .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plain input { width: 10rem; display: inline-block; }

.list { display: grid; gap: .5rem; }
.list-item { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; text-decoration: none; color: var(--text); margin: 0; }
.list-item:hover { border-color: var(--accent); }
.kind { font-size: .8rem; padding: .1rem .5rem; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.kind.vor { background: var(--comm); color: var(--comm-line); }

/* Protocol page */
.sticky-bar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: .5rem 0; border-bottom: 1px solid var(--line); }
.bar-tools { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--card); color: var(--text); padding: .4rem .7rem; font: inherit; font-size: .9rem; cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--card); }

.card-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.card-head h2 { flex: 1 1 260px; }
.num { color: var(--accent); margin-right: .4rem; }
.tools { display: flex; gap: .4rem; align-items: center; }
.lockbadge { font-size: .85rem; background: var(--comm); color: var(--comm-line); border-radius: 99px; padding: .15rem .6rem; }
.item.child { margin-left: 1.5rem; border-left: 3px solid var(--accent-soft); }
.item.editing { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.flash-update { animation: flashup 2s ease-out; }
@keyframes flashup { from { box-shadow: 0 0 0 4px var(--accent); } to { box-shadow: none; } }

details.more { position: relative; }
details.more summary { list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more .menu { position: absolute; right: 0; top: 110%; z-index: 4; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .3rem; display: grid; min-width: 11rem; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
details.more .menu button { text-align: left; background: none; border: 0; padding: .45rem .6rem; font: inherit; color: var(--text); cursor: pointer; border-radius: 6px; }
details.more .menu button:hover { background: var(--accent-soft); }
details.more .menu button.danger { color: var(--danger); }

.pair { margin: .7rem 0; }
.lbl { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .25rem; font-weight: 600; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.cols > .fr, td.fr, th.fr { color: var(--fr); }
.cols > label.fr textarea, .cols > label.fr input, td.fr textarea { color: var(--fr); }
.pair.dec { background: var(--dec); border-left: 4px solid var(--dec-line); padding: .5rem .7rem; border-radius: 6px; }
.pair.comm { background: var(--comm); border-left: 4px solid var(--comm-line); padding: .5rem .7rem; border-radius: 6px; }
.view.conflict { outline: 2px dashed var(--comm-line); outline-offset: 4px; margin-bottom: 1rem; }
.vote { margin: .3rem 0 .6rem; }
.speaker { font-weight: 600; font-size: .9rem; }
.tally { font-size: .9rem; margin-top: .3rem; }
.tally-in { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin: .6rem 0; font-size: .9rem; }
.tally-in label { display: flex; align-items: center; gap: .3rem; }
.tally-in input { width: 4rem; }
.tag { font-size: .7rem; font-weight: 700; }
table.votes { width: 100%; border-collapse: collapse; }
table.votes th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; }
table.votes td { padding: .2rem .2rem .2rem 0; vertical-align: top; }
table.votes td:first-child { width: 22%; }
table.votes td:last-child { width: 2rem; }
.actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .8rem; }
.actions .msg { color: var(--comm-line); font-size: .9rem; }
.meta-list { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
.meta-list dt { color: var(--muted); font-size: .9rem; }
.meta-list dd { margin: 0; }
.toc ol { margin: .5rem 0 0; padding-left: 0; list-style: none; }
.toc ol ol { padding-left: 1.4rem; }
.toc li { margin: .15rem 0; }
.toc a { text-decoration: none; }
body.busy { cursor: progress; }

/* Language display toggle */
.show-de .fr, .show-fr .de, .show-de .sep, .show-fr .sep { display: none !important; }
.show-de .cols, .show-fr .cols { grid-template-columns: 1fr; }

@media (max-width: 700px) {
  .cols { grid-template-columns: 1fr; gap: .4rem; }
  .item.child { margin-left: .6rem; }
  table.votes, table.votes tbody, table.votes tr, table.votes td { display: block; width: 100% !important; }
  table.votes thead { display: none; }
  table.votes tr { border-bottom: 1px solid var(--line); padding: .4rem 0; position: relative; }
  table.votes td:last-child { position: absolute; top: .3rem; right: 0; width: auto !important; }
  table.votes td:first-child { padding-right: 2rem; }
  .sticky-bar { position: static; border: 0; }
  .sticky-bar h1 { font-size: 1.1rem; }
}

/* Search, files */
.search-mini input { width: 11rem; padding: .3rem .6rem; border: 0; border-radius: 6px; font-size: .9rem; }
.searchbar { display: flex; gap: .5rem; margin-bottom: 1rem; }
.result h2 { margin-bottom: .5rem; }
.hit { padding: .5rem 0; border-top: 1px solid var(--line); }
.hit a { text-decoration: none; }
mark { background: #ffe58a; color: inherit; border-radius: 2px; padding: 0 1px; }
@media (prefers-color-scheme: dark) { mark { background: #6b5600; } }
.files-layout { display: grid; grid-template-columns: 240px 1fr; gap: 1rem; align-items: start; }
.folders { display: grid; gap: .2rem; padding: .6rem; }
.folders a { text-decoration: none; color: var(--text); padding: .35rem .5rem; border-radius: 6px; }
.folders a.on, .folders a:hover { background: var(--accent-soft); }
.upload { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; align-items: end; margin-top: .6rem; }
.filepick input { padding: .35rem; }
table.files a { text-decoration: none; }
.small { font-size: .8rem; }
@media (max-width: 700px) {
  .files-layout { grid-template-columns: 1fr; }
  .meta-list { grid-template-columns: 1fr; gap: 0; }
  .meta-list dd { margin-bottom: .4rem; }
  .hide-sm { display: none; }
  .search-mini { order: -1; width: 100%; }
  .search-mini input { width: 100%; }
}

/* Insert chapter / sub-chapter between agenda items */
.insert-bar { display: flex; gap: .5rem; justify-content: center; align-items: center; margin: -.6rem 0 .4rem; position: relative; }
.insert-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--line); z-index: 0; }
.insert-bar.inner { margin-left: 1.5rem; }
.ins { position: relative; z-index: 1; font: inherit; font-size: .82rem; color: var(--accent); background: var(--bg); border: 1px dashed var(--accent); border-radius: 99px; padding: .15rem .7rem; cursor: pointer; opacity: .55; transition: opacity .15s; }
.ins:hover, .ins:focus-visible { opacity: 1; background: var(--accent-soft); }
@media (hover: none) { .ins { opacity: .9; } }
@media (max-width: 700px) { .insert-bar.inner { margin-left: .6rem; } }

/* Attendance chips in the meeting header */
.attendance { margin-bottom: 1rem; }
.att-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .9rem; color: var(--muted); margin-bottom: .4rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font: inherit; font-size: .9rem; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 99px; padding: .35rem .75rem; cursor: pointer; }
.chip small { margin-left: .35rem; font-size: .78rem; }
.chip.present { background: var(--dec); border-color: var(--dec-line); }
.chip.online { background: var(--accent-soft); border-color: var(--accent); }
.chip.excused { background: var(--comm); border-color: var(--comm-line); text-decoration: line-through; text-decoration-color: var(--muted); }
.attendance .hint { font-size: .8rem; margin: .4rem 0 0; }
.pair.disc { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: .5rem .7rem; border-radius: 6px; }

/* Inputs for the Vorprotokoll */
.flash.block { display: block; text-decoration: none; color: var(--text); }
.entry-body { margin-top: .5rem; white-space: normal; }
.entry details summary { cursor: pointer; }
.entry.is-used { opacity: .7; }
.kind.used { background: var(--dec); color: var(--dec-line); }
.kind.closed { background: var(--line); color: var(--muted); }
form.place { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .6rem; }
form.place select { width: auto; max-width: 100%; }
tr.sel td { background: var(--accent-soft); }

/* Machine translation, remarks, tasks, file summaries */
.mt-badge { display: inline-block; font-size: .72rem; color: var(--muted); background: var(--bg); border: 1px dashed var(--line); border-radius: 99px; padding: 0 .45rem; margin-right: .2rem; vertical-align: middle; }
.auto-tr { margin-left: auto; }
.extras { margin-top: .6rem; display: grid; gap: .4rem; }
.fb { border-left: 3px solid var(--line); padding: .3rem .6rem; font-size: .92rem; }
.fb .fb-tr { color: var(--muted); font-size: .88rem; margin-top: .2rem; }
.show-de .fb .tr-fr, .show-fr .fb .tr-de { display: none; }
.fb-form summary { cursor: pointer; font-size: .88rem; color: var(--accent); }
.fb-form form { margin-top: .5rem; }
.review .card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.export .menu a { display: block; padding: .35rem .7rem; text-decoration: none; color: var(--text); white-space: nowrap; }
.export .menu a:hover { background: var(--accent-soft); }
table.tasks tr.done td { color: var(--muted); text-decoration: line-through; }
.check-btn { font-size: 1.3rem; background: none; border: 0; cursor: pointer; color: var(--accent); padding: 0; }
.fsum { margin-top: .3rem; font-size: .88rem; }
.fsum summary { cursor: pointer; color: var(--accent); }
.fsum .cols { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: .3rem; }
.fsum .fr { color: var(--fr); }
@media (max-width: 700px) { .fsum .cols { grid-template-columns: 1fr; } }

.send-doc fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .8rem; display: grid; gap: .25rem; }
.send-doc .cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 700px) { .send-doc .cols2 { grid-template-columns: 1fr; } }
