/*
 * Shared stylesheet for the static richtfest site (landing pages, legal pages
 * and the Ratgeber content pages).
 *
 * The design mirrors `src/components/templates/LandingPage/index.tsx`: same
 * brand colours as `--primary` / `--secondary` in `src/app/global.css`, same
 * Outfit headings. Kept in one cacheable file rather than inlined per page,
 * because every page shares it.
 */

@font-face {
  font-family: "Outfit";
  /* Variable font, one file for every weight the page uses. */
  src: url("outfit.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --sage: rgb(139, 166, 120);
  --sage-deep: rgb(61, 79, 48);
  --sage-tint: rgba(139, 166, 120, 0.14);

  --ink: rgb(23, 23, 23);
  --muted: rgb(115, 115, 115);
  --line: rgba(0, 0, 0, 0.1);
  --surface: #fff;
  --surface-muted: rgb(245, 245, 245);

  --heading: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --content: 1120px;
  --pad: 20px;
}

@media (min-width: 600px) {
  :root {
    --pad: 24px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3 {
  font-family: var(--heading);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.15;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/*
 * The inlined icon sprite. It carries no visible geometry, but it must be taken
 * out of the flow, or its 0x0 inline box still opens a line box at the top of
 * the page. This lives here rather than in a `style` attribute on the element
 * because the site's Content-Security-Policy sets `style-src 'self'` with no
 * `'unsafe-inline'`, which blocks inline style attributes.
 */
.sprite {
  position: absolute;
}

.wrap {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* Skip link — keyboard users should not tab through the header every page. */
.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--pad);
  top: 12px;
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
}

/* Header ------------------------------------------------------------------ */

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding-block: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--heading);
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  width: 77px;
  height: 40px;
  object-fit: contain;
}

.nav {
  display: none;
  gap: 36px;
}

.nav a {
  font-family: var(--heading);
  font-size: 15px;
  font-weight: 500;
  color: var(--sage);
  text-decoration: none;
}

.nav a:hover {
  text-decoration: underline;
}

@media (min-width: 900px) {
  .nav {
    display: flex;
  }
}

.btn {
  display: inline-block;
  background: var(--sage);
  color: #fff;
  font-family: var(--heading);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 22px;
  border-radius: 9999px;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.btn:hover {
  opacity: 0.85;
}

/* Below 600px the brand and the button share one line with ~40px to spare, so
   both shrink rather than wrapping onto two rows. */
@media (max-width: 599px) {
  .brand {
    font-size: 19px;
    gap: 10px;
  }

  .brand img {
    width: 60px;
    height: 31px;
  }

  .header .btn {
    font-size: 13px;
    padding: 9px 16px;
  }
}

/* Language switcher ------------------------------------------------------- */

.langs {
  display: flex;
  gap: 4px;
}

.langs a {
  font-family: var(--heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 9px;
  border-radius: 9999px;
  line-height: 1.4;
}

.langs a:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

.langs a[aria-current] {
  color: var(--sage-deep);
  background: var(--sage-tint);
}

/* On a phone the brand and the button already fill the row (see above), so the
   languages take a centred row of their own rather than pushing the button
   onto a second line. */
@media (max-width: 599px) {
  .langs {
    order: 3;
    flex-basis: 100%;
    justify-content: center;
  }
}

/* Hero -------------------------------------------------------------------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 40px;
  padding-block: 32px 32px;
}

.hero h1 {
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.5px;
}

.hero p {
  max-width: 620px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: clamp(17px, 2.2vw, 19px);
  line-height: 1.6;
}

/* The phone mockup has no baked-in text (unlike the Play Store screenshots
   it's cropped from), so the same file works on all five language pages. */
.hero-visual {
  display: flex;
  justify-content: center;
  width: 100%;
}

.hero-visual img {
  width: 100%;
  max-width: 280px;
  height: auto;
}

@media (min-width: 600px) {
  .hero {
    padding-block: 64px 40px;
  }
}

@media (min-width: 900px) {
  .hero {
    flex-direction: row;
    text-align: left;
    gap: 56px;
  }

  .hero-content {
    flex: 1 1 0;
    min-width: 0;
  }

  .hero p {
    margin-inline: 0;
  }

  .hero .stores {
    justify-content: flex-start;
  }

  .hero-visual {
    flex: none;
    width: auto;
  }

  .hero-visual img {
    max-width: 320px;
  }
}

/* Promo video (German landing page only) ---------------------------------- */

.video {
  padding-block: 32px 0;
  text-align: center;
}

.video h2 {
  font-size: clamp(26px, 4vw, 34px);
  margin-bottom: 24px;
}

.video video {
  display: block;
  width: 100%;
  max-width: 960px;
  height: auto;
  margin-inline: auto;
  border-radius: 16px;
  background: #0b0b0b;
}

/* Store buttons ----------------------------------------------------------- */

.stores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 36px;
}

.store {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgb(10, 10, 10);
  color: #fff;
  border-radius: 12px;
  padding: 10px 18px;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.store:hover {
  opacity: 0.8;
}

.store svg {
  width: 22px;
  height: 22px;
  fill: #fff;
  flex: none;
}

.store-top {
  display: block;
  font-size: 10px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.8);
}

.store-name {
  display: block;
  font-family: var(--heading);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

/* The App Store listing does not exist yet (see the TODO by `#download`), so
   this variant renders as an inert placeholder rather than a link to nowhere:
   no href, muted colours, no hover state. */
.store-soon {
  background: var(--surface-muted);
  color: var(--muted);
  cursor: default;
}

.store-soon:hover {
  opacity: 1;
}

.store-soon svg {
  fill: var(--muted);
}

.store-soon .store-top {
  color: var(--muted);
}

/* Brand story ("Why richtfest?") -------------------------------------------
   A narrow prose column rather than the wide `.grid` sections above it: this
   is read top to bottom, not scanned. */
.story {
  padding-block: 88px 96px;
  border-top: 1px solid var(--line);
}

.story .wrap {
  max-width: 680px;
}

.story h2 {
  text-align: center;
  font-size: clamp(26px, 4vw, 34px);
  margin-bottom: 40px;
}

.story p {
  color: var(--muted);
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.7;
  margin: 0 0 24px;
}

.story p:last-child {
  margin-bottom: 0;
}

.story .story-lead {
  color: var(--ink);
  font-weight: 600;
  font-size: clamp(18px, 2.4vw, 21px);
}

.story .story-highlight {
  text-align: center;
  color: var(--ink);
  font-family: var(--heading);
  font-weight: 700;
  font-size: clamp(19px, 2.6vw, 23px);
  line-height: 1.5;
  margin-block: 36px;
}

/* Closing call-to-action -------------------------------------------------- */

.cta {
  background: linear-gradient(to bottom, var(--sage), var(--sage-deep));
  color: #fff;
  text-align: center;
  padding-block: 96px;
}

.cta h2 {
  font-size: clamp(26px, 4vw, 34px);
}

.cta p {
  max-width: 480px;
  margin: 16px auto 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(15px, 2vw, 17px);
}

/* Feature grid ------------------------------------------------------------ */

.section {
  padding-block: 32px 96px;
}

@media (min-width: 600px) {
  .section {
    padding-block: 56px 96px;
  }
}

.section-head {
  text-align: center;
  margin-bottom: 48px;
}

.section-head h2 {
  font-size: clamp(26px, 4vw, 34px);
}

.section-head p {
  max-width: 620px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 17px);
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--sage-tint);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon svg {
  width: 24px;
  height: 24px;
  fill: var(--sage);
}

.plus {
  font-family: var(--heading);
  font-size: 12px;
  font-weight: 700;
  color: var(--sage);
  background: var(--sage-tint);
  border-radius: 9999px;
  padding: 4px 12px;
}

/* Plus section -------------------------------------------------------------
   Full-bleed tint so the paid features read as a distinct group below the
   free ones, without a second `.section`'s worth of empty padding. */
.section-plus {
  background: var(--surface-muted);
  padding-block: 56px 96px;
}

.card h3 {
  font-size: 19px;
  margin-bottom: 12px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.47;
}

/* Legal pages ------------------------------------------------------------- */

.legal {
  max-width: 760px;
  padding-block: 32px 96px;
}

.legal h1 {
  font-size: clamp(28px, 4vw, 36px);
}

.legal .meta {
  color: var(--muted);
  font-size: 14px;
  margin: 6px 0 0;
}

.legal section {
  margin-top: 32px;
}

.legal h2 {
  font-size: 19px;
  margin-bottom: 8px;
}

.legal p {
  margin: 0;
  color: var(--muted);
}

/* `white-space: pre-line` keeps the address block's line breaks without <br>. */
.legal .address {
  white-space: pre-line;
}

/* Content pages ----------------------------------------------------------- */

/* Ratgeber-style pages (`/bauphasen-checkliste/` and friends). Narrower than
   the feature grid, because these are read top to bottom rather than scanned. */
.article {
  max-width: 760px;
  padding-block: 32px 80px;
}

.article h1 {
  font-size: clamp(28px, 4.5vw, 40px);
}

.article h2 {
  font-size: clamp(21px, 3vw, 26px);
  margin-top: 56px;
}

.article p {
  margin: 16px 0 0;
}

.article .lead {
  color: var(--muted);
  font-size: clamp(17px, 2.2vw, 19px);
  margin-top: 20px;
}

/* Checklist --------------------------------------------------------------- */

/* Real checkboxes, so the list can be ticked off while reading without a line
   of JavaScript. The state is not persisted anywhere — this is a reading aid,
   not a to-do list; that one lives in the app. The numbering comes from a CSS
   counter so the markup stays a plain <ol>. */
.phases {
  list-style: none;
  counter-reset: phase;
  display: grid;
  gap: 12px;
  margin: 32px 0 0;
  padding: 0;
}

.phase {
  counter-increment: phase;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.phase-check {
  width: 20px;
  height: 20px;
  margin: 3px 0 0;
  accent-color: var(--sage);
}

.phase-body {
  min-width: 0;
}

.phase-title {
  display: block;
  font-family: var(--heading);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
}

.phase-title::before {
  content: counter(phase) ". ";
  color: var(--sage);
}

.phase p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.phase-check:checked ~ .phase-body {
  opacity: 0.5;
}

.phase-check:checked ~ .phase-body .phase-title {
  text-decoration: line-through;
}

/* Product callout --------------------------------------------------------- */

.callout {
  display: grid;
  gap: 24px;
  background: var(--sage-tint);
  border-radius: 16px;
  padding: 24px;
  margin-top: 32px;
}

.callout h3 {
  font-size: 19px;
}

/* Heading row for a callout describing a Plus feature — the chip is the same
   one the landing page's feature cards use. */
.callout-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.callout p {
  margin: 12px 0 0;
}

.callout .stores {
  margin-top: 24px;
  justify-content: flex-start;
}

/* App screenshot beside the copy. Stacked on a phone, where the text column
   would otherwise be too narrow for the two store buttons on one line. */
.shot {
  margin: 0;
}

.shot img {
  width: 100%;
  max-width: 240px;
  height: auto;
  margin-inline: auto;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.shot figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

@media (min-width: 600px) {
  .callout {
    padding: 32px;
  }
}

/* Two columns only where there actually is a screenshot — an opt-in modifier
   rather than `:has(.shot)`, so a callout without one does not reserve the
   image column and squeeze its own copy. */
@media (min-width: 700px) {
  .callout-split {
    grid-template-columns: 1fr 240px;
    gap: 32px;
    /* The screenshot column is the taller one; centring the copy splits the
       leftover space instead of stacking it all under the store buttons. */
    align-items: center;
  }
}

/* Bullet list of what an entry must contain ("Was in jeden Eintrag gehört").
   Custom markers rather than `list-style`, so the dot sits on the first line's
   baseline no matter how long the item wraps. */
.checks {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
}

.checks li {
  position: relative;
  padding-left: 26px;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
}

.checks strong {
  font-family: var(--heading);
}

/* Worked example. A <dl> rather than the source text's blockquote: the entries
   are label/value pairs, and the grid keeps the values in one column. */
.example {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  margin: 24px 0 0;
  padding: 20px 24px;
  background: var(--surface-muted);
  border-left: 3px solid var(--sage);
  border-radius: 0 14px 14px 0;
  font-size: 15px;
}

.example dt {
  font-family: var(--heading);
  font-weight: 700;
}

.example dd {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 520px) {
  .example {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 20px;
  }

  .example dd {
    margin-bottom: 12px;
  }

  .example dd:last-child {
    margin-bottom: 0;
  }
}

/* Numbered procedure ("Der typische Ablauf"). */
.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 14px;
  margin: 24px 0 0;
  padding: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 46px;
  min-height: 30px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sage-tint);
  color: var(--sage-deep);
  font-family: var(--heading);
  font-size: 14px;
  font-weight: 700;
}

.steps strong {
  font-family: var(--heading);
}

/* Further reading --------------------------------------------------------- */

.further {
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
}

.further a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  text-decoration: none;
}

.further a:hover {
  border-color: var(--sage);
}

.further strong {
  display: block;
  font-family: var(--heading);
  font-size: 17px;
}

.further span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
}

/* Footer ------------------------------------------------------------------ */

.footer {
  border-top: 1px solid var(--line);
  padding-block: 48px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer .brand {
  font-size: 16px;
  gap: 10px;
}

.footer .brand img {
  width: 54px;
  height: 28px;
}

.footer-copy {
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

/* PV-Dachplaner ------------------------------------------------------------
   The one interactive tool on the site (see the scoped CSP note in
   customHttp.yml). Everything here is namespaced under `.pv-calc` so it can't
   collide with `.grid`/`.panel`/`.result`/… used elsewhere, and reuses the
   site's own tokens (`--sage`, `--ink`, `--muted`, `--line`, `--surface`)
   wherever the meaning matches 1:1. `--roof`/`--cell`/… have no sitewide
   equivalent (nothing else draws a roof or a solar panel) and are scoped
   here rather than added to `:root`. `--accent` stays a separate alias for
   `--sage` rather than using it directly, because the SVG drawing functions
   in pv-dachplaner.js read it back out via `fill="var(--accent)"` and a
   second name makes that intent explicit at the call site. Tabular figures
   (module counts, kWp, chart axes) get a system monospace stack — no new
   font load for the one page that needs it. */
.pv-calc {
  --roof: #a9775c;
  --roof-edge: #7c5640;
  --margin: #cbab93;
  --cell: #2c4a6b;
  --cell-line: #51708f;
  --cell-alt: #2f6358;
  --accent: var(--sage);
  --accent-soft: var(--sage-tint);
  --fg: var(--ink);
  --grid: var(--line);
  --panel: var(--surface);
  --pv-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo,
    Consolas, monospace;
  padding-block: 32px 48px;
}

.pv-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 820px) {
  .pv-grid {
    grid-template-columns: 1fr;
  }
}

.pv-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pv-calc fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pv-calc fieldset:last-of-type {
  margin-bottom: 0;
}

.pv-calc legend {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
  padding: 0;
}

.pv-calc label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 0;
}

.pv-calc label small {
  font-weight: 400;
  color: var(--muted);
}

.pv-calc input,
.pv-calc select {
  font: inherit;
  font-family: var(--pv-mono);
  font-size: 0.95rem;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  min-width: 0;
}

.pv-calc input[type="range"] {
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--sage);
}

.pv-calc input:focus-visible,
.pv-calc select:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 1px;
  border-color: transparent;
}

.pv-full {
  grid-column: 1 / -1;
}

.pv-dirs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pv-dirs button {
  font: inherit;
  font-size: 0.78rem;
  font-family: var(--pv-mono);
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.pv-dirs button[aria-pressed="true"] {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}

.pv-dirs button:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 1px;
}

.pv-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.pv-result {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: flex-end;
}

.pv-big {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 4rem;
  line-height: 0.9;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pv-big span {
  font-size: 1.4rem;
  color: var(--muted);
  font-weight: 500;
  margin-left: 6px;
}

.pv-stat {
  display: flex;
  flex-direction: column;
}

.pv-stat b {
  font-family: var(--pv-mono);
  font-weight: 500;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.pv-stat em {
  font-style: normal;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pv-desc {
  margin: 4px 0 0;
  color: var(--muted);
  max-width: 65ch;
}

.pv-drawing {
  overflow-x: auto;
}

#svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
}

.pv-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 10px;
}

.pv-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}

.pv-swatch-cell {
  background: var(--cell);
}

.pv-swatch-cell-alt {
  background: var(--cell-alt);
}

.pv-swatch-margin {
  background: var(--margin);
}

.pv-swatch-roof {
  background: var(--roof);
}

/* Set via class rather than a `style` attribute (even one pv-dachplaner.js
   builds through innerHTML) — the site's CSP has no `style-src
   'unsafe-inline'`, so an inline `style=""` is silently dropped by the
   browser, not just a lint nit. */
.pv-hit {
  cursor: crosshair;
}

.pv-chart .pv-month-sel {
  fill: var(--fg);
  font-weight: 500;
}

.pv-calc .pv-desc-cell {
  color: var(--muted);
  font-weight: 400;
}

.pv-calc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.pv-calc th,
.pv-calc td {
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
}

.pv-calc th {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pv-calc td.n {
  font-family: var(--pv-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pv-calc th.n {
  text-align: right;
}

.pv-calc tr.best td {
  font-weight: 600;
}

.pv-calc tr.best td:first-child::before {
  content: "★ ";
  color: var(--sage);
}

.pv-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 10px 0 0;
  max-width: 75ch;
}

.pv-err {
  color: #b3432f;
  font-weight: 500;
}

.pv-yield-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.pv-controls {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 16px;
  align-items: end;
  margin-bottom: 14px;
}

@media (max-width: 520px) {
  .pv-controls {
    grid-template-columns: 1fr;
  }
}

.pv-timeval {
  font-family: var(--pv-mono);
  font-weight: 500;
}

.pv-chart {
  position: relative;
  min-width: 0;
}

.pv-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.pv-chart text {
  font-family: var(--pv-mono);
  fill: var(--muted);
}

.pv-tip {
  position: absolute;
  pointer-events: none;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--pv-mono);
  font-size: 0.78rem;
  padding: 5px 8px;
  border-radius: 4px;
  white-space: nowrap;
  transform: translate(-50%, -110%);
}

.pv-chart-title {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 16px 0 6px;
}

.pv-calc h2 {
  font-size: 1.4rem;
  margin: 0;
}

@media (min-width: 600px) {
  .pv-panel {
    padding: 28px;
  }
}
