/* Gemeinderat (apps/ratsinfo): Übersicht, Sitzung, Dokumenten-Ansicht, Suche */
.gr-page { padding-bottom: 3rem; }
.gr-kicker { margin: 0 0 .3rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.gr-head { padding: 1.5rem 0 1rem; max-width: 52rem; }
.gr-head .lead { color: var(--ink-soft); }
.gr-search { display: flex; align-items: center; gap: .5rem; max-width: 40rem; margin: 1rem 0 0; position: relative; }
.gr-search svg { position: absolute; left: .8rem; width: 1.15rem; height: 1.15rem; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.gr-search .input { padding-left: 2.4rem; flex: 1; min-width: 0; }

/* Datum als Kalenderblatt */
.gr-date-block { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 4.6rem; padding: .45rem .6rem; background: #fff; border: 1px solid var(--line); border-top: 6px solid var(--red); line-height: 1.05; }
.gr-day { font-size: 1.9rem; font-weight: 800; }
.gr-month { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--red); }
.gr-yr { font-size: .75rem; color: var(--muted); margin-top: .1rem; }

/* Nächste Sitzung */
.gr-next { display: flex; align-items: center; gap: 1.2rem; margin: 1.2rem 0 .4rem; padding: 1.1rem 1.3rem; background: var(--dark); color: #fff; border-left: 6px solid var(--red); text-decoration: none; }
.gr-next:hover, .gr-next:focus-visible { text-decoration: none; background: #262626; }
.gr-next .gr-date-block { background: #fff; color: var(--ink); }
.gr-next-body { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
.gr-next-label { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #ff8a95; }
.gr-next-title { font-size: 1.3rem; }
.gr-next-meta, .gr-next-items { color: #d6d6d6; font-size: .95rem; }
.gr-next-cta { font-weight: 700; white-space: nowrap; border: 2px solid #fff; padding: .45rem .9rem; }
.gr-public-note { color: var(--muted); font-size: .9rem; margin: .2rem 0 1.5rem; }

/* Jahr und Bilanz */
.gr-year { margin-top: 2.2rem; }
.gr-year-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.4rem; border-bottom: 2px solid var(--ink); padding-bottom: .4rem; margin-bottom: 1rem; }
.gr-year-head h2 { margin: 0; font-size: 2rem; }
.gr-year-stats { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin: 0; color: var(--ink-soft); }
.gr-unan { position: relative; padding-bottom: .35rem; }
.gr-unan::after { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: linear-gradient(90deg, var(--ok) calc(var(--pct) * 1%), var(--line) 0); }

/* Zeitleiste */
.gr-timeline { list-style: none; margin: 0; padding: 0 0 0 1.4rem; border-left: 2px solid var(--line); }
.gr-tl-item { position: relative; margin: 0 0 1rem; }
.gr-tl-item::before { content: ""; position: absolute; left: calc(-1.4rem - 7px); top: 1.5rem; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--red); }
.gr-card { display: flex; align-items: stretch; gap: 1rem; padding: .9rem 1rem; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.gr-card:hover, .gr-card:focus-visible { text-decoration: none; border-color: var(--red); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.gr-card-date { display: flex; flex-direction: column; align-items: center; min-width: 3.4rem; line-height: 1.05; padding-top: .15rem; }
.gr-card-date .gr-day { font-size: 1.6rem; }
.gr-card-body { display: flex; flex-direction: column; gap: .25rem; flex: 1; min-width: 0; }
.gr-card-meta { color: var(--muted); font-size: .9rem; }
.gr-card-titles { color: var(--ink-soft); font-size: .9rem; }
.gr-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.gr-chip { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .12rem .45rem; background: var(--bg-alt); color: var(--ink-soft); }
.gr-chip-doc { background: var(--red-soft); color: var(--red-dark); }
.gr-paper { flex: 0 0 auto; width: 74px; align-self: center; position: relative; }
.gr-paper img { width: 100%; height: auto; border: 1px solid var(--line); box-shadow: 3px 3px 0 #fff, 4px 4px 0 var(--line), 7px 7px 0 #fff, 8px 8px 0 var(--line); transform: rotate(2deg); background: #fff; }

/* Sitzung */
.gr-crumbs { font-size: .9rem; color: var(--muted); padding-top: 1.2rem; }
.gr-session-head { display: flex; gap: 1.2rem; align-items: center; margin: .8rem 0 1rem; }
.gr-session-head .gr-date-block, .gr-next .gr-date-block { align-self: flex-start; flex: 0 0 auto; }
.gr-session-head h1 { margin: 0; }
.gr-session-meta { margin: .3rem 0 0; color: var(--ink-soft); }
.gr-ribbon { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; padding: .7rem 1rem; background: var(--bg-alt); border-left: 4px solid var(--ok); margin: 0 0 1.5rem; }
.gr-ribbon-split strong { color: var(--warn); }
.gr-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.gr-layout-single { grid-template-columns: minmax(0, 1fr); max-width: 52rem; }
.gr-agenda h2, .gr-docs h2 { font-size: 1.3rem; }

.gr-item { display: flex; gap: .9rem; padding: 1rem 0; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.gr-item:target { background: var(--red-soft); box-shadow: -10px 0 0 var(--red-soft), 10px 0 0 var(--red-soft); }
.gr-item-num { flex: 0 0 2.2rem; height: 2.2rem; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; background: var(--ink); color: #fff; }
.gr-out-einstimmig .gr-item-num { background: var(--ok); }
.gr-out-mehrheitlich .gr-item-num { background: var(--warn); }
.gr-out-abgelehnt .gr-item-num { background: var(--red); }
.gr-out-kenntnis .gr-item-num, .gr-out-bericht .gr-item-num { background: #7b7b7b; }
.gr-item-body { flex: 1; min-width: 0; }
.gr-item-body h3 { font-size: 1.05rem; margin: .2rem 0 .4rem; }
.gr-item-result { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; margin: 0 0 .4rem; }
.gr-pill { font-size: .78rem; font-weight: 700; padding: .15rem .55rem; border: 1px solid currentColor; }
.gr-pill-einstimmig { color: var(--ok); }
.gr-pill-mehrheitlich { color: var(--warn); }
.gr-pill-abgelehnt { color: var(--red); }
.gr-pill-kenntnis, .gr-pill-bericht, .gr-pill-sonstig, .gr-pill-vertagt { color: #5d5d5d; }
.gr-vorlage { font-size: .8rem; color: var(--muted); }
.gr-votes { margin: .3rem 0 .5rem; max-width: 26rem; }
.gr-votes-bar { display: flex; height: 12px; background: var(--bg-alt); overflow: hidden; }
.gr-votes-bar span { display: block; height: 100%; }
.v-yes { background: var(--ok); } .v-no { background: var(--red); } .v-abs { background: #9a9a9a; }
.gr-votes-legend { display: flex; flex-wrap: wrap; gap: .2rem 1rem; margin: .3rem 0 0; font-size: .85rem; }
.gr-votes-legend span::before { content: ""; display: inline-block; width: .65rem; height: .65rem; margin-right: .3rem; background: var(--line); vertical-align: -.05rem; }
.gr-votes-legend .k-yes::before { background: var(--ok); } .gr-votes-legend .k-no::before { background: var(--red); } .gr-votes-legend .k-abs::before { background: #9a9a9a; }
.gr-wording { margin: .4rem 0; }
.gr-wording summary, .gr-view-edit summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--ink-soft); }
.gr-wording p { margin: .4rem 0 0; padding: .6rem .8rem; background: var(--bg-alt); font-size: .93rem; }
.gr-view { margin: .6rem 0; padding: .6rem .9rem; border-left: 4px solid var(--red); background: var(--red-soft); }
.gr-view-label { margin: 0 0 .2rem; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.gr-view p:last-child { margin: 0; }
.gr-view-edit { margin-top: .5rem; }
.gr-view-edit form { margin-top: .5rem; display: grid; gap: .5rem; }

/* Dokumenten-Ansicht */
.gr-docs { position: sticky; top: 1rem; }
.gr-tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 2px solid var(--ink); }
.gr-tab { font: inherit; font-weight: 700; padding: .5rem .8rem; border: 0; background: var(--bg-alt); color: var(--ink-soft); cursor: pointer; }
.gr-tab.is-active { background: var(--ink); color: #fff; }
.gr-tab-n { font-weight: 400; font-size: .8rem; opacity: .8; }
.gr-doc.is-hidden { display: none; }
.gr-doc-bar { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; font-size: .85rem; color: var(--muted); }
.gr-sheets { max-height: calc(100vh - 9rem); overflow-y: auto; padding: 1rem; background: #5c5f63; display: grid; gap: 1.2rem; scroll-behavior: smooth; }
.gr-sheet { margin: 0; scroll-margin-top: 1rem; }
.gr-sheet-btn { display: block; width: 100%; padding: 0; border: 0; background: #fff; cursor: zoom-in; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.gr-sheet-btn img { width: 100%; height: auto; }
.gr-sheet figcaption { color: #e9e9e9; font-size: .8rem; text-align: center; margin-top: .35rem; }
.gr-pagetext { display: inline; }
.gr-pagetext summary { display: inline; cursor: pointer; text-decoration: underline; }
.gr-pagetext[open] div { display: block; text-align: left; background: #fff; color: var(--ink); padding: .8rem; margin-top: .4rem; font-size: .85rem; max-height: 22rem; overflow: auto; }
.gr-sheet.is-flash .gr-sheet-btn { outline: 4px solid var(--red); outline-offset: 3px; }

/* Vollbild */
.gr-lightbox { position: fixed; inset: 0; z-index: 1000; background: #161616; display: grid; grid-template-columns: 4rem 1fr 4rem; grid-template-rows: auto 1fr auto; }
.gr-lightbox[hidden] { display: none; }
.gr-lb-top { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; padding: .6rem 1rem; color: #fff; }
.gr-lb-close, .gr-lb-prev, .gr-lb-next { background: transparent; border: 0; color: #fff; cursor: pointer; padding: .5rem; }
.gr-lightbox svg { width: 2rem; height: 2rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gr-lb-prev, .gr-lb-next { align-self: center; justify-self: center; }
.gr-lb-prev:disabled, .gr-lb-next:disabled { opacity: .25; cursor: default; }
.gr-lb-stage { overflow: auto; display: flex; justify-content: center; align-items: flex-start; touch-action: pan-y pinch-zoom; }
.gr-lb-stage img { max-height: calc(100vh - 7rem); width: auto; background: #fff; cursor: zoom-in; }
.gr-lb-stage.is-zoom { align-items: flex-start; }
.gr-lb-stage.is-zoom img { max-height: none; width: min(1400px, 160vw); cursor: zoom-out; }
.gr-lb-hint { grid-column: 1 / -1; text-align: center; color: #bbb; font-size: .8rem; margin: .3rem 0 .6rem; }
body.gr-lb-open { overflow: hidden; }

/* Navigation, Quelle, Suche */
.gr-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.gr-pager a { display: flex; flex-direction: column; font-weight: 700; }
.gr-pager a span { font-size: .8rem; font-weight: 400; color: var(--muted); }
.gr-pager-next { text-align: right; margin-left: auto; }
.gr-source { margin-top: 2rem; font-size: .8rem; color: var(--muted); }
.gr-hits { list-style: none; padding: 0; margin: 0 0 2rem; }
.gr-hits li { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.gr-hits p { margin: .3rem 0 0; color: var(--ink-soft); }
.gr-hit-meta { display: block; font-size: .85rem; color: var(--muted); }
.gr-hits mark { background: #ffe58a; color: inherit; padding: 0 .1em; }
.gr-hits-pages li { display: flex; gap: 1rem; }
.gr-hit-thumb { flex: 0 0 70px; }
.gr-hit-thumb img { border: 1px solid var(--line); }

/* Startseite */
.gr-home { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.gr-home-list { list-style: none; padding: 0; margin: 0; }
.gr-home-list li { display: flex; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.gr-home-list .gr-item-num { flex-basis: 1.8rem; height: 1.8rem; font-size: .85rem; }

@media (max-width: 900px) {
  .gr-layout, .gr-home { grid-template-columns: minmax(0, 1fr); }
  .gr-docs { position: static; }
  .gr-sheets { max-height: none; padding: .7rem; }
}
@media (max-width: 640px) {
  .gr-next { flex-wrap: wrap; }
  .gr-next-cta { width: 100%; text-align: center; }
  .gr-paper { display: none; }
  .gr-search { flex-wrap: wrap; }
  .gr-search .btn { width: 100%; }
  .gr-session-head { align-items: flex-start; }
  .gr-lightbox { grid-template-columns: 2.6rem 1fr 2.6rem; }
}
.gr-stand { margin: -.4rem 0 .6rem; font-size: .85rem; color: var(--muted); }
