:root {
  --bg: #f6f7f9; --card: #ffffff; --ink: #14181f; --muted: #5b6574; --line: #e2e6ec;
  --brand: #0f766e; --brand-ink: #ffffff;
  --bull: #15803d; --bull-bg: #e8f6ec; --bear: #b91c1c; --bear-bg: #fdecec; --neutral: #5b6574;
  --warn-bg: #fff7e0; --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116; --card: #171b22; --ink: #e8ebf0; --muted: #9aa4b2; --line: #2a303a;
    --brand: #2dd4bf; --brand-ink: #062a27;
    --bull: #4ade80; --bull-bg: #12301c; --bear: #f87171; --bear-bg: #3a1618; --neutral: #9aa4b2;
    --warn-bg: #3a3012;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.45; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.topbar { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 960px; margin: 0 auto; padding: .6rem 1rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.brand { font-weight: 700; margin-right: auto; }
nav { display: flex; gap: .25rem; flex-wrap: wrap; }
nav button { background: none; border: 0; padding: .45rem .7rem; border-radius: 8px; color: var(--muted); font-weight: 600; }
nav button[aria-current="page"] { background: var(--brand); color: var(--brand-ink); }
main { max-width: 960px; margin: 0 auto; padding: 1rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: .75rem; }
.card.narrow { max-width: 420px; margin: 2rem auto; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 12rem; }
.muted { color: var(--muted); font-size: .9rem; }
.stack > * + * { margin-top: .75rem; }

input, select { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; width: 100%; }
label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .2rem; }
.btn { background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 8px; padding: .55rem 1rem; font-weight: 600; }
.btn.secondary { background: none; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--bear); color: #fff; }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: .3rem .8rem; font-size: .9rem; }
.chip[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.article h3 a { color: var(--ink); text-decoration: none; }
.article h3 a:hover { text-decoration: underline; }
.meta { display: flex; gap: .5rem; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-bottom: .3rem; }
.badge { border-radius: 999px; padding: 0 .55rem; font-weight: 600; border: 1px solid var(--line); }
.badge.bull { color: var(--bull); background: var(--bull-bg); border-color: transparent; }
.badge.bear { color: var(--bear); background: var(--bear-bg); border-color: transparent; }
.badge.neutral { color: var(--neutral); }

.notice { background: var(--warn-bg); border-radius: 8px; padding: .6rem .8rem; font-size: .9rem; }
.error { color: var(--bear); font-weight: 600; min-height: 1.2em; }
.ok { color: var(--bull); font-weight: 600; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem; letter-spacing: .05em; background: var(--bg); border: 1px dashed var(--line); padding: .35rem .6rem; border-radius: 8px; display: inline-block; user-select: all; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .4rem .3rem; border-bottom: 1px solid var(--line); vertical-align: top; }

/* Bulle/Bär */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 640px) { .split { grid-template-columns: 1fr; } }
.col-head { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: var(--radius); margin-bottom: .6rem; }
.col-head.bull { background: var(--bull-bg); color: var(--bull); }
.col-head.bear { background: var(--bear-bg); color: var(--bear); }
.col-head .count { margin-left: auto; font-size: 1.5rem; font-weight: 800; }
.icon { width: 44px; height: 44px; flex: none; overflow: visible; }
.icon.small { width: 24px; height: 24px; }
.icon .face, .icon .ear, .icon .horn { fill: currentColor; }
.icon .snout, .icon .paw { fill: var(--card); opacity: .9; }
.icon .eye, .icon .nostril, .icon .nose { fill: var(--ink); }
.bull-head, .bear-head, .bear-paw { transform-box: fill-box; }
.bull-head { transform-origin: 50% 90%; animation: butt 1.8s ease-in-out infinite; }
.icon-bull .horn { transform-box: fill-box; transform-origin: 50% 100%; animation: horns 1.8s ease-in-out infinite; }
.bear-head { transform-origin: 50% 100%; animation: sway 2.4s ease-in-out infinite; }
.bear-paw { transform-origin: 50% 0%; animation: swipe 2.4s ease-in-out infinite; }
@keyframes butt { 0%, 55%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-7px) rotate(-6deg); } 40% { transform: translateY(-3px) rotate(4deg); } }
@keyframes horns { 0%, 55%, 100% { transform: scale(1); } 25% { transform: scale(1.12); } }
@keyframes sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes swipe { 0%, 45%, 100% { transform: rotate(-12deg) translateY(0); } 25% { transform: rotate(35deg) translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .icon *, .icon { animation: none !important; } }
body.no-motion .icon *, body.no-motion .icon { animation: none !important; }

.quote { font-variant-numeric: tabular-nums; font-weight: 700; }
.up { color: var(--bull); } .down { color: var(--bear); }
.hidden { display: none; }

/* Hilfsklassen (statt Inline-Styles wegen CSP) */
.end { align-self: end; }
.mt { margin-top: .75rem; }
label input[type="checkbox"] { width: auto; margin-right: .4rem; }
td input[type="checkbox"] { width: auto; }

/* Einschätzungen, Ausblick, Firmenseite */
.small { font-size: .8rem; }
.assess { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: baseline; padding: .45rem .6rem; border-radius: 8px; background: var(--bg); margin-top: .5rem; }
.assess.bull { border-left: 3px solid var(--bull); }
.assess.bear { border-left: 3px solid var(--bear); }
.assess.neutral { border-left: 3px solid var(--line); }
.plans { flex-basis: 100%; margin: .2rem 0 0; padding-left: 1.2rem; font-size: .9rem; }
.badge.plan { color: var(--brand); border-color: var(--brand); }
.outlook { list-style: none; padding: 0; margin: 0; }
.outlook li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.outlook li:last-child { border-bottom: 0; }
.outlook time { font-variant-numeric: tabular-nums; color: var(--muted); margin-right: .3rem; }
.bar { width: 100%; height: 14px; border-radius: 7px; overflow: hidden; display: block; }
.mood .col-head { flex: 1 1 10rem; margin-bottom: 0; }
.mood .col-head:not(.bull):not(.bear) { background: var(--bg); }
td { overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.split > * { min-width: 0; }
.tablewrap { overflow-x: auto; }
