/* ═══ APP THEME "noppe" (poppy) — the building brick as a part of the UI ═══
   Active with <html data-theme="noppe"> (applyTheme() in js/theme-boot.js). Every rule names TWO themes:
   "hochglanz" is the same theme as a glossy brochure, so this file is the shared base and hochglanz.css only
   adds its layers. The palette (incl. --ink and --brick-0..5) is in /tokens.css.
   Three ideas: a faint stud grid on the page (texture, not pattern); edge instead of cloud — border and offset
   shadow share one tone (--ink); the lid gives rhythm, not information (its colour cycles and means nothing,
   unlike "farbfaecher"). Tables stay quiet: white with grey dividers. */

[data-theme="noppe"],[data-theme="hochglanz"]{
  --font:'Nunito','Plus Jakarta Sans',system-ui,sans-serif;

  --bg:#eef1f6;
  --sur:#ffffff;
  --bdr:var(--ink);
  --txt:var(--ink);
  --mut:#5a6270;
  --screen-bg:#eef1f6;      /* Login/startup screen, before login */
  /* The brand is red; a red price next to a green P&L read as a loss. */
  --price:var(--ink);
  --rad:14px;

  /* Edge instead of cloud: the same tone as the border, only offset. */
  --sh0:0 3px 0 var(--ink);
  --sh1:0 4px 0 var(--ink);
  --sh2:0 6px 0 var(--ink);

  /* The stud shape is in styles.css under :root — two themes use it, so it belongs to none alone. */
}
/* Light: set number and profit in tables lie on a tinted ground; brand red and the standard green only
   reached 4.44:1 and 4.43:1 there. */
[data-theme="noppe"]:not([data-dark]),[data-theme="hochglanz"]:not([data-dark]){--b600:#c01b21;--profit:#11652f}
/* Dark: the edge is almost black; prices then use the text colour. */
[data-theme="noppe"][data-dark],[data-theme="hochglanz"][data-dark]{--price:var(--txt)}

/* ── The base plate ──
   The gradient sits on the BODY, not on an element of its own: it scrolls with the content and needs no extra box. */
[data-theme="noppe"] body,[data-theme="hochglanz"] body{
  background-color:var(--bg);
  background-image:radial-gradient(circle at 10px 10px,rgba(22,26,33,.055) 4px,transparent 4.6px);
  background-size:20px 20px;
}

/* ── Before login ──
   Must be here: login and startup screen appear before any user setting is read (see --screen-bg and theme.test.js). */
[data-theme="noppe"] #login-screen,[data-theme="hochglanz"] #login-screen,
[data-theme="noppe"] #startup-screen,[data-theme="hochglanz"] #startup-screen{
  background-color:var(--screen-bg);
  background-image:radial-gradient(circle at 10px 10px,rgba(22,26,33,.055) 4px,transparent 4.6px);
  background-size:20px 20px;
  color:var(--txt);
}
[data-theme="noppe"] #login-screen .card,[data-theme="hochglanz"] #login-screen .card,
[data-theme="noppe"] #startup-screen .card,[data-theme="hochglanz"] #startup-screen .card{
  background:var(--sur);border:2.5px solid var(--ink);box-shadow:0 4px 0 var(--ink);
}

/* ── Header and tab bar: the brick ──
   The studs are a repeated mask, not sixteen <div>s: their number follows the window width. NO position here:
   styles.css keeps the header sticky and the tab bar below it; a position:relative here once overrode that.
   sticky provides the positioned ancestor the stud row needs. */
[data-theme="noppe"] header,[data-theme="hochglanz"] header{
  background:var(--b600);
  border-bottom:3px solid var(--ink);
  padding-top:7px;
}
[data-theme="noppe"] header::before,[data-theme="hochglanz"] header::before{
  content:"";position:absolute;top:0;left:28px;right:28px;height:7px;
  background:var(--b300);
  -webkit-mask-image:var(--studs-form);mask-image:var(--studs-form);
  -webkit-mask-size:24px 7px;mask-size:24px 7px;
  -webkit-mask-repeat:repeat-x;mask-repeat:repeat-x;
}
/* ── What stands on the brick is white ──
   ALL of it, not only title and links: styles.css colours key figures with var(--b600) and labels with
   var(--mut), meant for a WHITE header, but this theme paints the header in exactly --b600 (measured 1.00:1).
   Labels are white too: no white below 100 % reaches 4.5:1 on this red; size, weight and tracking set them apart. */
[data-theme="noppe"] header,[data-theme="hochglanz"] header,
[data-theme="noppe"] header a,[data-theme="hochglanz"] header a,
[data-theme="noppe"] header .brand,[data-theme="hochglanz"] header .brand,
[data-theme="noppe"] header .logo .brand span,[data-theme="hochglanz"] header .logo .brand span{color:#fff}

[data-theme="noppe"] nav,[data-theme="hochglanz"] nav{
  background:var(--b600);border-bottom:3px solid var(--ink);
}
/* The red brick of the logo lay red on red; on a white plate with a dark border it is a sign again. */
[data-theme="noppe"] header .logo-image,[data-theme="hochglanz"] header .logo-image{
  background:#fff;border:2px solid var(--ink);border-radius:8px;padding:2px;box-sizing:content-box;
}
/* Dark: --b600 is a light red; header and tab bar take the deep red so the white text stays readable. */
[data-theme="noppe"][data-dark] header,[data-theme="hochglanz"][data-dark] header,
[data-theme="noppe"][data-dark] nav,[data-theme="hochglanz"][data-dark] nav{background:var(--b300)}
/* White instead of --b100: the light pink reached 3.74:1 on the red, white 5.0:1. */
[data-theme="noppe"] nav .ntab,[data-theme="hochglanz"] nav .ntab{color:#fff;font-weight:700}
[data-theme="noppe"] nav .ntab.active,[data-theme="hochglanz"] nav .ntab.active{
  background:var(--sur);color:var(--ink);font-weight:900;
  border:2.5px solid var(--ink);border-radius:9px;
}
[data-theme="noppe"][data-dark] nav .ntab,[data-theme="hochglanz"][data-dark] nav .ntab{color:#ffd9db}
/* Dark: the ink edge is invisible; a light border sets the active tab apart at 3:1. */
[data-theme="noppe"][data-dark] nav .ntab.active,[data-theme="hochglanz"][data-dark] nav .ntab.active{color:var(--txt);border-color:#fff}

/* ── Surfaces ───────────────────────────────────────────────────────────── */
[data-theme="noppe"] .card,[data-theme="hochglanz"] .card,
[data-theme="noppe"] .modal,[data-theme="hochglanz"] .modal{
  background:var(--sur);border:2.5px solid var(--ink);box-shadow:0 4px 0 var(--ink);
}

/* ── The tile with its lid ──
   ::before is the lid, ::after the studs on it — pseudo elements, so the tile keeps the same markup in every theme. */
[data-theme="noppe"] .sc,[data-theme="hochglanz"] .sc{
  background:var(--sur);border:2.5px solid var(--ink);border-radius:14px;
  box-shadow:0 4px 0 var(--ink);overflow:hidden;position:relative;
  padding-top:26px;
}
[data-theme="noppe"] .sc::before,[data-theme="hochglanz"] .sc::before{
  content:"";position:absolute;top:0;left:0;right:0;height:26px;
  background-color:var(--brick-0);border-bottom:2.5px solid var(--ink);
}
/* Four studs on the lid: the same shape in a rhythm of 22 instead of 24 (mask-size scales it). 3×22+14 = 80 — hence the width. */
[data-theme="noppe"] .sc::after,[data-theme="hochglanz"] .sc::after{
  content:"";position:absolute;top:6px;left:12px;height:7px;width:80px;
  background:rgba(255,255,255,.5);
  -webkit-mask-image:var(--studs-form);mask-image:var(--studs-form);
  -webkit-mask-size:22px 7px;mask-size:22px 7px;
  -webkit-mask-repeat:repeat-x;mask-repeat:repeat-x;
}
/* The rhythm: six lid colours, then from the start; the values come from tokens.css so the app carries them too.
   background-color and NOT the shorthand: the shorthand also resets background-image, and :nth-child() is
   more specific than the gloss layer in hochglanz.css — the lacquer vanished on five of six tiles. */
[data-theme="noppe"] .sc:nth-child(6n+2)::before,[data-theme="hochglanz"] .sc:nth-child(6n+2)::before{background-color:var(--brick-1)}
[data-theme="noppe"] .sc:nth-child(6n+3)::before,[data-theme="hochglanz"] .sc:nth-child(6n+3)::before{background-color:var(--brick-2)}
[data-theme="noppe"] .sc:nth-child(6n+4)::before,[data-theme="hochglanz"] .sc:nth-child(6n+4)::before{background-color:var(--brick-3)}
[data-theme="noppe"] .sc:nth-child(6n+5)::before,[data-theme="hochglanz"] .sc:nth-child(6n+5)::before{background-color:var(--brick-4)}
[data-theme="noppe"] .sc:nth-child(6n)::before,[data-theme="hochglanz"] .sc:nth-child(6n)::before{background-color:var(--brick-5)}

[data-theme="noppe"]:not([data-dark]) .sci,[data-theme="hochglanz"]:not([data-dark]) .sci{background:#f7f9fc}
[data-theme="noppe"] .sci,[data-theme="hochglanz"] .sci{border-bottom:2.5px solid var(--ink)}
[data-theme="noppe"] .sc .snum,[data-theme="hochglanz"] .sc .snum{color:var(--mut);font-weight:700}
[data-theme="noppe"] .sc .sname,[data-theme="hochglanz"] .sc .sname{font-weight:800}

/* ── Buttons and inputs ──
   The offset shadow makes them tangible without a second loud colour. Pressed, the button moves onto its
   shadow — like a brick being set down. */
[data-theme="noppe"] .btn,[data-theme="hochglanz"] .btn{
  border:2.5px solid var(--control-border);border-radius:10px;
  box-shadow:0 3px 0 var(--control-border);font-weight:800;
}
[data-theme="noppe"] .btn:active,[data-theme="hochglanz"] .btn:active{transform:translateY(3px);box-shadow:none}
[data-theme="noppe"] .btn.bp,[data-theme="hochglanz"] .btn.bp{background:var(--b600);color:var(--on-primary,#fff)}

[data-theme="noppe"] input,[data-theme="hochglanz"] input,
[data-theme="noppe"] select,[data-theme="hochglanz"] select,
[data-theme="noppe"] textarea,[data-theme="hochglanz"] textarea{
  background:var(--sur);color:var(--txt);
  border:2.5px solid var(--field-border);border-radius:10px;
}
/* Light: the field carries the ink outline like the tiles; dark, ink would be invisible. */
[data-theme="noppe"]:not([data-dark]),[data-theme="hochglanz"]:not([data-dark]){--field-border:var(--ink)}
[data-theme="noppe"] input::placeholder,[data-theme="hochglanz"] input::placeholder,
[data-theme="noppe"] textarea::placeholder,[data-theme="hochglanz"] textarea::placeholder{color:var(--mut)}

/* ── Where it gets quiet: tables ──
   Grey dividers instead of ink: a table with 2.5px black edges per row would be a grid, not text. */
[data-theme="noppe"] table td,[data-theme="hochglanz"] table td,
[data-theme="noppe"] table th,[data-theme="hochglanz"] table th{border-bottom:2px solid #e4e8ef}

/* ── Condition badges ──
   New vs. used as everywhere; they get the ink edge but carry the chart colours so badge and line belong together. */
[data-theme="noppe"] .cond-new,[data-theme="hochglanz"] .cond-new{
  background:var(--chart-new);color:#fff;border:2px solid var(--ink);font-weight:800;
}
/* Dark: the chart colour is light; the text takes the (then dark) ink. */
[data-theme="noppe"][data-dark] .cond-new,[data-theme="hochglanz"][data-dark] .cond-new{color:var(--ink)}
[data-theme="noppe"] .cond-used,[data-theme="hochglanz"] .cond-used{
  background:var(--chart-used);color:var(--ink);border:2px solid var(--ink);font-weight:800;
}

/* ── Finances: market value in the colour of its curve ──
   --b50 is a pink here, which made the highlighted tile look like a loss. The tile stays white and carries
   the chart's line colour on top, so number and curve visibly belong together. */
[data-theme="noppe"] .fstat.hi,[data-theme="hochglanz"] .fstat.hi{
  background:var(--sur);border-color:var(--bdr);border-top:6px solid var(--chart-value);
}

/* noppe dark: header and tab bar neutral dark with a red edge. Saturated red across the full width was
   garish on dark, and the hint band on dark red read like an error. */
[data-theme="noppe"][data-dark] header,[data-theme="noppe"][data-dark] nav{background:#1b1e25}
[data-theme="noppe"][data-dark] nav{border-bottom:3px solid var(--b400)}
[data-theme="noppe"][data-dark] nav .ntab{color:#e6e8ee}
[data-theme="noppe"] .hint-band{background:var(--sur);border-left:4px solid var(--chart-new)}
[data-theme="noppe"] .hint-band > .ico{color:var(--chart-new)}

/* Focus ring on the red bar white, also on the active tab: ink only reached 2.8:1 on the red. */
[data-theme="noppe"],[data-theme="hochglanz"]{--focus-header:#fff;--focus-nav:#fff;--focus-nav-active:#fff}
[data-theme="noppe"][data-dark],[data-theme="hochglanz"][data-dark]{--focus-nav-active:#fff}
