.nbs-root { --nbs-accent: #0b5c7a; --nbs-sand: #f7f2e8; --nbs-bg: #fffdf9; --nbs-fg: #1b1b1b; --nbs-muted: #666; font-family: inherit; }
.nbs-root * { box-sizing: border-box; }
.nbs-panel { display: flex; flex-direction: column; background: var(--nbs-bg); color: var(--nbs-fg); border: 1px solid #d0d7de; border-radius: 18px; overflow: hidden; height: var(--nbs-height, 760px); max-height: 92vh; }
.nbs-panel[hidden] { display: none; }
.nbs-head { background: linear-gradient(135deg, var(--nbs-accent), #0e7490); color: #fff; padding: 12px 16px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nbs-reset { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; padding: 3px 12px; font-size: 13px; cursor: pointer; font-weight: 500; }
.nbs-reset:hover { background: rgba(255,255,255,.32); }
.nbs-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.nbs-msg { max-width: 88%; padding: 8px 12px; border-radius: 12px; line-height: 1.45; font-size: 15px; overflow-wrap: anywhere; }
.nbs-msg p { margin: 0 0 6px; } .nbs-msg p:last-child { margin: 0; }
.nbs-msg ul { margin: 4px 0 4px 18px; padding: 0; }
.nbs-msg a { color: var(--nbs-accent); text-decoration: underline; }
.nbs-user { align-self: flex-end; background: var(--nbs-accent); color: #fff; }
.nbs-bot { align-self: flex-start; background: var(--nbs-sand); border: 1px solid #ece3d0; }
.nbs-wait { color: var(--nbs-muted); font-style: italic; }
.nbs-roles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.nbs-role { flex: 1 1 140px; display: flex; flex-direction: column; gap: 2px; text-align: left; background: #fff; color: var(--nbs-fg); border: 1px solid var(--nbs-accent); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.nbs-role strong { color: var(--nbs-accent); font-size: 15px; }
.nbs-role span { font-size: 12px; color: var(--nbs-muted); }
.nbs-role:hover { background: var(--nbs-sand); }
.nbs-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; max-height: 190px; overflow-y: auto; border-top: 1px solid #eee; background: var(--nbs-sand); }
.nbs-chips[hidden] { display: none; }
.nbs-chips-title { width: 100%; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--nbs-muted); margin-top: 2px; }
.nbs-chip { background: #fff; color: var(--nbs-accent); border: 1px solid var(--nbs-accent); border-radius: 999px; padding: 4px 10px; font-size: 13px; line-height: 1.3; cursor: pointer; text-align: left; }
.nbs-chip:hover { background: var(--nbs-accent); color: #fff; }
.nbs-chip-scn { border-style: dashed; font-weight: 600; }
.nbs-chip-switch { color: var(--nbs-muted); border-color: #bbb; }
.nbs-chip-switch:hover { background: #666; border-color: #666; }
.nbs-notice { margin: 0; padding: 6px 12px; font-size: 11px; color: var(--nbs-muted); border-top: 1px solid #eee; }
.nbs-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid #eee; }
.nbs-form input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid #c4c9ce; border-radius: 8px; font-size: 15px; }
.nbs-form button { background: var(--nbs-accent); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.nbs-form button:focus-visible, .nbs-form input:focus-visible, .nbs-toggle:focus-visible, .nbs-chip:focus-visible, .nbs-role:focus-visible, .nbs-reset:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
.nbs-inline { width: 100%; max-width: var(--nbs-width, 720px); margin: 1em auto; }
/* The floating wrapper spans the viewport (minus 16px gutters) and lets clicks through, so a percentage
   --nbs-width resolves against the screen and not against the shrink-to-fit wrapper (was 155px on phones). */
.nbs-floating { --nbs-bottom: 16px; position: fixed; left: 16px; right: 16px; bottom: var(--nbs-bottom); z-index: 99999; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.nbs-floating > * { pointer-events: auto; }
.nbs-floating.nbs-pos-left { align-items: flex-start; }
.nbs-floating.nbs-pos-right-above { --nbs-bottom: 88px; }
/* Never narrower than 440px (tablets), never wider than the screen, never taller than the space above the toggle. */
.nbs-floating .nbs-panel { width: min(max(var(--nbs-width, 720px), 440px), 100%); max-height: min(92vh, calc(var(--nbs-vh, 100vh) - var(--nbs-bottom) - 80px)); box-shadow: 0 6px 24px rgba(0,0,0,.22); }
.nbs-toggle { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--nbs-accent); color: #fff; font-size: 26px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.nbs-chip, .nbs-reset, .nbs-role, .nbs-form button { text-transform: none; letter-spacing: normal; }
.nbs-links p { margin: 0 0 6px; font-size: 13px; color: var(--nbs-muted); }
.nbs-linkrow { display: flex; flex-wrap: wrap; gap: 6px; }
.nbs-linkbtn { display: inline-block; background: var(--nbs-accent); color: #fff !important; text-decoration: none !important; border-radius: 8px; padding: 5px 10px; font-size: 13px; }
.nbs-linkbtn:hover { filter: brightness(1.15); }

/* visuals */
.nbs-msg:has(.nbs-visual) { width: 94%; max-width: 94%; }
.nbs-visual { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #d9cfb8; }
.nbs-vtitle { margin: 0 0 4px; font-size: 14px; }
.nbs-vsub, .nbs-vsrc, .nbs-vread { margin: 2px 0 6px; font-size: 12px; color: var(--nbs-muted); }
.nbs-map { height: 280px; border-radius: 10px; border: 1px solid #d0d7de; background: #e8eef0; z-index: 0; }
.nbs-map-fail { display: flex; align-items: center; justify-content: center; color: var(--nbs-muted); font-size: 13px; }
.nbs-maplinks { font-size: 12px; margin: 4px 0 0 16px; padding: 0; }
.nbs-visual .leaflet-container { font-family: inherit; }
.nbs-matrix-wrap { overflow-x: auto; max-height: 340px; overflow-y: auto; }
.nbs-matrix { border-collapse: collapse; font-size: 12px; width: 100%; }
.nbs-matrix th { text-align: center; font-weight: 600; padding: 4px 6px; position: sticky; top: 0; background: var(--nbs-sand); }
.nbs-matrix tr > th:first-child { text-align: left; position: static; background: none; font-weight: 400; }
.nbs-matrix td { text-align: center; width: 64px; border: 1px solid #ece3d0; height: 24px; }
.nbs-matrix td.on { color: #fff; }
.nbs-matrix td.on-0 { background: #1976d2; } .nbs-matrix td.on-1 { background: #ef6c00; } .nbs-matrix td.on-2 { background: #3949ab; } .nbs-matrix td.on-3 { background: #bf360c; }
.nbs-rowbtn, .nbs-barlab { background: none; border: 0; padding: 2px 0; font: inherit; text-align: left; color: var(--nbs-accent); cursor: pointer; text-transform: none; letter-spacing: normal; }
.nbs-rowbtn:hover, .nbs-barlab:hover { text-decoration: underline; }
.nbs-bars { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.nbs-bar { display: grid; grid-template-columns: 110px 1fr 70px; gap: 8px; align-items: center; font-size: 12px; }
.nbs-track { background: #ece3d0; border-radius: 4px; height: 14px; }
.nbs-fill { background: var(--nbs-accent); height: 14px; border-radius: 4px; }
.nbs-range { min-width: 4px; } .nbs-range.nbs-open { background: repeating-linear-gradient(90deg, var(--nbs-accent) 0 8px, transparent 8px 12px); }
.nbs-tablewrap { overflow-x: auto; max-height: 340px; overflow-y: auto; border: 1px solid #ece3d0; border-radius: 8px; background: #fff; }
.nbs-cmp { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.nbs-cmp th, .nbs-cmp td { border-bottom: 1px solid #ece3d0; padding: 6px 8px; vertical-align: top; text-align: left; min-width: 150px; }
.nbs-cmp thead th { position: sticky; top: 0; background: var(--nbs-sand); color: var(--nbs-accent); }
.nbs-cmp .nbs-rowhead { min-width: 90px; background: var(--nbs-sand); font-weight: 600; position: sticky; left: 0; }
.nbs-barval { text-align: right; color: var(--nbs-muted); }
.nbs-line { width: 100%; height: auto; background: #fff; border: 1px solid #ece3d0; border-radius: 8px; }
.nbs-line .ax { stroke: #999; stroke-width: 1; } .nbs-line .tk { font-size: 10px; fill: #666; }
.nbs-line .ln { fill: none; stroke: var(--nbs-accent); stroke-width: 2; } .nbs-line .dot { fill: #ef6c00; }
.nbs-vdata { font-size: 12px; margin-top: 4px; } .nbs-vdata table { border-collapse: collapse; margin-top: 4px; }
.nbs-vdata td, .nbs-vdata th { border: 1px solid #ece3d0; padding: 2px 6px; text-align: left; }
@media (max-width: 520px) { .nbs-bar { grid-template-columns: 80px 1fr 56px; } }

.nbs-headbtns { display: inline-flex; gap: 6px; align-items: center; }
.nbs-lang { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; cursor: pointer; text-transform: none; letter-spacing: normal; }
.nbs-lang:hover { background: rgba(255,255,255,.32); }
.nbs-chip-map { border-color: #1976d2; color: #0d47a1; }
.nbs-chip-chart { border-color: var(--nbs-accent); }
.nbs-chip-compare { border-color: #8d6e63; color: #5d4037; }
.nbs-chip-help { border-color: #b0a58c; color: #4e4a3d; }
.nbs-chip-map:hover { background: #1976d2; color: #fff; } .nbs-chip-compare:hover { background: #8d6e63; color: #fff; } .nbs-chip-help:hover { background: #6d6650; color: #fff; }
.nbs-chips-legend { width: 100%; font-size: 11px; color: var(--nbs-muted); }
.nbs-chips { max-height: 150px; }
.nbs-chips-toggle { display: block; width: 100%; text-align: left; padding: 6px 12px; border: 0; border-top: 1px solid #eee; background: var(--nbs-sand); color: var(--nbs-accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; text-transform: none; letter-spacing: normal; }
.nbs-chips-toggle[hidden] { display: none; }

.nbs-legend { background: rgba(255,255,255,.94); border: 1px solid #b8c4cc; border-radius: 8px; font-size: 11px; max-width: min(260px, 70%); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.nbs-legend-btn { display: block; width: 100%; background: none; border: 0; padding: 4px 8px; font: inherit; font-weight: 600; color: var(--nbs-accent); text-align: left; cursor: pointer; text-transform: none; letter-spacing: normal; }
.nbs-legend-body { max-height: 150px; overflow: auto; padding: 0 8px 6px; }
.nbs-legend-body[hidden], .nbs-legend-item[hidden] { display: none; }
.nbs-legend-item.nbs-off { display: none; }
.nbs-legend-title { font-weight: 600; margin: 4px 0 2px; }
.nbs-legend img { max-width: 100%; height: auto; display: block; }

/* ---- responsive: phones, tablets, touch (0.8.1) ---- */
.nbs-head > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbs-headbtns { flex-shrink: 0; }
.nbs-reset, .nbs-lang, .nbs-close { white-space: nowrap; }
.nbs-close { display: none; width: 30px; height: 30px; padding: 0; background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; font-size: 14px; line-height: 1; cursor: pointer; }
.nbs-close:hover { background: rgba(255,255,255,.32); }
.nbs-close:focus-visible, .nbs-lang:focus-visible, .nbs-chips-toggle:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
.nbs-log { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.nbs-inline .nbs-panel { max-height: 92dvh; }

/* Phones (portrait) and any very short screen (phone landscape): the floating chat becomes a full-screen sheet. */
@media (max-width: 600px), (max-height: 500px) {
	.nbs-floating.nbs-open { z-index: 100000; }
	.nbs-floating .nbs-panel { position: fixed; left: 0; right: 0; top: var(--nbs-vt, 0px); width: 100%; height: var(--nbs-vh, 100vh); max-height: none; border: 0; border-radius: 0; box-shadow: none; }
	.nbs-floating .nbs-close { display: inline-flex; align-items: center; justify-content: center; }
	.nbs-floating .nbs-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
	.nbs-floating .nbs-form { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
	html.nbs-lock, html.nbs-lock body { overflow: hidden; }
	.nbs-msg { max-width: 94%; }
	.nbs-msg:has(.nbs-visual) { width: 100%; max-width: 100%; }
	.nbs-chips { max-height: 38vh; }
	.nbs-map { height: 240px; }
	.nbs-cmp th, .nbs-cmp td { min-width: 120px; }
	.nbs-matrix td { width: 48px; }
}
@media (max-width: 600px) {
	.nbs-inline { margin: .5em auto; }
	.nbs-inline .nbs-panel { border-radius: 12px; }
}
/* Phone landscape: keep as much room as possible for the conversation. */
@media (max-height: 500px) {
	.nbs-head { padding-top: 6px; padding-bottom: 6px; }
	.nbs-notice { padding: 3px 12px; font-size: 10px; line-height: 1.25; }
	.nbs-roles { gap: 6px; }
	.nbs-role { flex-basis: 30%; padding: 6px 10px; }
	.nbs-map { height: 200px; }
}
@media (max-width: 380px) {
	.nbs-head { padding-left: 12px; padding-right: 10px; }
	.nbs-reset { padding-left: 9px; padding-right: 9px; }
}
/* Touch screens: larger tap targets; 16px text field stops iOS zooming the page on focus. */
@media (pointer: coarse) {
	.nbs-form input { font-size: 16px; padding: 10px 12px; }
	.nbs-form button { padding: 10px 16px; }
	.nbs-chip { padding: 8px 12px; font-size: 14px; }
	.nbs-chips { gap: 8px; }
	.nbs-chips-toggle { padding: 10px 12px; font-size: 13px; }
	.nbs-reset, .nbs-lang { padding: 6px 12px; }
	.nbs-close { width: 34px; height: 34px; }
	.nbs-linkbtn { padding: 8px 12px; }
	.nbs-legend-btn { padding: 8px 10px; }
	.nbs-rowbtn, .nbs-barlab { padding: 6px 0; }
}

/* ---- 0.9.0 ---- */
/* Suggested questions: room for more than two rows on every screen. */
.nbs-chips { max-height: min(40vh, 320px); }
@media (max-height: 500px) { .nbs-chips { max-height: 38vh; } }
/* Phones: charts and tables grow to their full height and scroll with the conversation (no scroll box inside a scroll box). */
@media (max-width: 600px) {
	.nbs-matrix-wrap, .nbs-bars, .nbs-tablewrap { max-height: none; }
}

/* One launcher for both assistants (html.nbs-merged is set by chat.js when the GeoPortal Chat floats on the same page). */
html.nbs-merged .cgc-floating .cgc-toggle { display: none; }
html.nbs-merged .cgc-floating { bottom: 80px; }
html.nbs-merged-left .cgc-floating { align-items: flex-start; }
html.nbs-merged .nbs-floating { --nbs-bottom: 16px; flex-direction: column-reverse; }
.nbs-menu { display: flex; flex-direction: column; gap: 4px; width: min(290px, 100%); padding: 6px; background: #fff; border: 1px solid #d0d7de; border-radius: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.22); }
.nbs-menu[hidden] { display: none; }
.nbs-menu-item { display: grid; grid-template-columns: 38px 1fr; column-gap: 10px; align-items: center; width: 100%; text-align: left; background: #fff; color: var(--nbs-fg); border: 1px solid transparent; border-radius: 10px; padding: 8px 10px; font: inherit; cursor: pointer; text-transform: none; letter-spacing: normal; }
.nbs-menu-item:hover { background: var(--nbs-sand); border-color: #ece3d0; }
.nbs-menu-item:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
.nbs-menu-ico { grid-row: 1 / span 2; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 19px; background: var(--nbs-accent); }
.nbs-menu-geo .nbs-menu-ico { background: #2e7d32; }
.nbs-menu-item strong { font-size: 14px; line-height: 1.25; }
.nbs-menu-desc { font-size: 12px; line-height: 1.25; color: var(--nbs-muted); }

/* Profile cards (Steckbriefe) */
.nbs-steck { display: flex; flex-direction: column; gap: 8px; }
.nbs-steck-card { background: #fff; border: 1px solid #ece3d0; border-radius: 10px; padding: 10px 12px; }
.nbs-steck-head { display: flex; align-items: baseline; gap: 8px; font-size: 14px; line-height: 1.3; color: var(--nbs-accent); }
.nbs-steck-rank { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--nbs-accent); color: #fff; font-size: 12px; font-weight: 700; align-self: flex-start; }
.nbs-steck-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.nbs-steck-tag { font-size: 11px; line-height: 1.4; padding: 1px 8px; border-radius: 999px; background: #e0f0f5; color: #0b5c7a; }
.nbs-tag-starkregen { background: #e3f2fd; color: #0d47a1; }
.nbs-tag-hitze { background: #fff3e0; color: #b84300; }
.nbs-tag-hochwasser { background: #e8eaf6; color: #283593; }
.nbs-tag-duerre { background: #fbe9e7; color: #a93200; }
.nbs-msg .nbs-steck-sum { margin: 6px 0 0; font-size: 13px; }
.nbs-steck-facts { display: grid; grid-template-columns: minmax(84px, max-content) 1fr; gap: 3px 10px; margin: 8px 0 0; font-size: 12px; line-height: 1.4; }
.nbs-steck-facts dt { font-weight: 600; color: var(--nbs-muted); margin: 0; }
.nbs-steck-facts dd { margin: 0; }
.nbs-steck-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.nbs-msg a.nbs-steck-link { font-size: 12px; }
@media (max-width: 380px) { .nbs-steck-facts { grid-template-columns: 1fr; gap: 0; } .nbs-steck-facts dd { margin-bottom: 4px; } }
/* Phones: a narrower label column leaves room for two measures side by side in the comparison table. */
@media (max-width: 600px) {
	.nbs-cmp th.nbs-rowhead { min-width: 78px; max-width: 92px; padding: 6px; font-size: 11px; overflow-wrap: anywhere; hyphens: auto; }
	.nbs-cmp th, .nbs-cmp td { min-width: 112px; }
}
.nbs-legend-btn { white-space: nowrap; overflow-wrap: normal; }
