/* KCML Process Platform — dark-teal sidebar, cream panel, pastel tiles, serif headings (full window, plain background).
   Logical properties keep Arabic (RTL) and English (LTR) in step. */

/* ---------------- fonts (bundled, offline) ---------------- */
@font-face { font-family: "Plex"; src: url(fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format("woff2"); font-weight: 300 400; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; font-display: swap; }
@font-face { font-family: "Plex"; src: url(fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format("woff2"); font-weight: 500; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; font-display: swap; }
@font-face { font-family: "Plex"; src: url(fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format("woff2"); font-weight: 600; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; font-display: swap; }
@font-face { font-family: "Plex"; src: url(fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format("woff2"); font-weight: 700; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; font-display: swap; }
@font-face { font-family: "Plex"; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); font-weight: 300 400; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; font-display: swap; }
@font-face { font-family: "Plex"; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; font-display: swap; }
@font-face { font-family: "Plex"; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; font-display: swap; }
@font-face { font-family: "Plex"; src: url(fonts/ibm-plex-sans-latin-700-normal.woff2) format("woff2"); font-weight: 700; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; font-display: swap; }
@font-face { font-family: "Serif"; src: url(fonts/lora-latin-400-normal.woff2) format("woff2"); font-weight: 300 400; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; font-display: swap; }
@font-face { font-family: "Serif"; src: url(fonts/lora-latin-500-normal.woff2) format("woff2"); font-weight: 500; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; font-display: swap; }
@font-face { font-family: "Serif"; src: url(fonts/lora-latin-600-normal.woff2) format("woff2"); font-weight: 600 700; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; font-display: swap; }
@font-face { font-family: "Serif"; src: url(fonts/lora-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; unicode-range: U+0000-00FF, U+2000-206F; font-display: swap; }
@font-face { font-family: "Serif"; src: url(fonts/noto-naskh-arabic-arabic-400-normal.woff2) format("woff2"); font-weight: 300 400; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; font-display: swap; }
@font-face { font-family: "Serif"; src: url(fonts/noto-naskh-arabic-arabic-500-normal.woff2) format("woff2"); font-weight: 500; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; font-display: swap; }
@font-face { font-family: "Serif"; src: url(fonts/noto-naskh-arabic-arabic-600-normal.woff2) format("woff2"); font-weight: 600 700; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; font-display: swap; }

/* ---------------- tokens ---------------- */
:root, [data-theme="light"] {
  --panel: #fbf8f1;
  --card: #fffdf9;
  --card-solid: #ffffff;
  --card-2: #f5f0e6;
  --fg: #2a2f2c;
  --ink: #23302c;
  --ink-2: #2f6b62;
  --muted: #7a7d76;
  --faint: #a4a59d;
  --line: #ebe4d6;
  --line-strong: #ddd3c1;
  --accent: #2f6b62;
  --accent-2: #3d8075;
  --accent-ink: #ffffff;
  --side: #1f4c46;
  --side-2: #2b5f58;
  --side-ink: #eef3ee;
  --side-muted: rgba(238, 243, 238, .66);
  --sun: #e0aa3e;
  --sun-2: #fbefc6;
  --sun-ink: #4a3a12;
  --p-green: #e3ecdd;  --i-green: #6d9a74;
  --p-peach: #f8e2d6;  --i-peach: #d98a6c;
  --p-lilac: #e8e2f0;  --i-lilac: #8f80b3;
  --p-yellow: #fcefc6; --i-yellow: #d5a531;
  --p-teal: #dcebe7;   --i-teal: #3f8378;
  --p-rose: #f6dee3;   --i-rose: #c7798a;
  --hatch: repeating-linear-gradient(135deg, rgba(47,107,98,.14) 0 2px, transparent 2px 7px);
  --ok: #4f9461;   --ok-soft: #e1eedf;
  --warn: #b98415; --warn-soft: #fbefc8;
  --bad: #c25a48;  --bad-soft: #f8e0d9;
  --na: #8a8b85;   --na-soft: #efebe2;
  --shadow: 0 1px 2px rgba(70, 55, 30, .05), 0 6px 18px -12px rgba(70, 55, 30, .22);
  --shadow-panel: 0 40px 90px -40px rgba(80, 40, 20, .55), 0 10px 30px -14px rgba(80, 40, 20, .3);
  --input: #ffffff;
  --nav-dark: #1f4c46;
  --nav-dark-ink: #f3f6f2;
  --serif: "Serif", "Lora", Georgia, "Times New Roman", serif;
  --radius: 14px;
}

[data-theme="dark"] {
  --panel: #18211f;
  --card: #1f2a27;
  --card-solid: #24302d;
  --card-2: #1b2522;
  --fg: #e9ece6;
  --ink: #f1f3ee;
  --ink-2: #8fcbbd;
  --muted: #9aa39d;
  --faint: #6f7a74;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .14);
  --accent: #5fae9f;
  --accent-2: #74c0b1;
  --accent-ink: #0f1f1c;
  --side: #0f2a26;
  --side-2: #1b3f39;
  --side-ink: #e8efe9;
  --side-muted: rgba(232, 239, 233, .6);
  --sun: #e6b955;
  --sun-2: rgba(230, 185, 85, .18);
  --sun-ink: #f3dc9d;
  --p-green: rgba(109, 154, 116, .18);  --i-green: #84b78c;
  --p-peach: rgba(217, 138, 108, .18);  --i-peach: #e79d80;
  --p-lilac: rgba(143, 128, 179, .2);   --i-lilac: #a99ad0;
  --p-yellow: rgba(213, 165, 49, .18);  --i-yellow: #e3b94d;
  --p-teal: rgba(63, 131, 120, .22);    --i-teal: #6fb9ab;
  --p-rose: rgba(199, 121, 138, .18);   --i-rose: #d993a3;
  --hatch: repeating-linear-gradient(135deg, rgba(255,255,255,.12) 0 2px, transparent 2px 7px);
  --ok: #7cc28c;   --ok-soft: rgba(124, 194, 140, .14);
  --warn: #e3b94d; --warn-soft: rgba(227, 185, 77, .14);
  --bad: #ef8f7d;  --bad-soft: rgba(239, 143, 125, .14);
  --na: #9aa39d;   --na-soft: rgba(255, 255, 255, .06);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 20px -14px rgba(0, 0, 0, .6);
  --shadow-panel: 0 40px 90px -40px rgba(0, 0, 0, .8), 0 10px 30px -14px rgba(0, 0, 0, .5);
  --input: #16201d;
  --nav-dark: #5fae9f;
  --nav-dark-ink: #0f1f1c;
}

/* ---------------- base ---------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--fg);
  font-family: "Plex", "Segoe UI", Tahoma, system-ui, sans-serif; font-size: 14.5px; line-height: 1.55;
  background: var(--panel);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; }
p { margin: 0; }
.ico { width: 18px; height: 18px; flex: none; }
[dir="ltr"] .flip-ltr { transform: scaleX(-1); }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
.serif { font-family: var(--serif); }

/* ---------------- app shell: sidebar + main, full window ---------------- */
.shell {
  position: relative; display: grid; grid-template-columns: 250px minmax(0, 1fr);
  width: 100%; min-height: 100vh; background: var(--panel);
}
.shell.is-guest { display: block; background: none; box-shadow: none; border: 0; overflow: visible; min-height: 0; }

/* sidebar */
.side {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 26px 16px 22px;
  background: var(--side); color: var(--side-ink);
  background-image: radial-gradient(120% 60% at 0% 100%, rgba(255,255,255,.06), transparent 60%), radial-gradient(90% 50% at 100% 0%, rgba(255,255,255,.05), transparent 60%);
}
.side-inner { position: sticky; top: 26px; display: flex; flex-direction: column; gap: 6px; min-height: calc(100vh - 48px); }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 22px; }
.side-brand .logo-mark { width: 30px; height: 30px; color: var(--side-ink); }
.side-brand b { font-family: var(--serif); font-size: 25px; font-weight: 500; letter-spacing: .01em; }
.side-brand small { display: block; font-size: 11px; color: var(--side-muted); margin-top: -2px; letter-spacing: .04em; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-link { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 10px; color: var(--side-muted); font-size: 14px; font-weight: 500; transition: background .15s, color .15s; }
.side-link .ico { width: 18px; height: 18px; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: var(--side-ink); }
.side-link.is-active { background: var(--side-2); color: var(--side-ink); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.side-sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 8px; }
.side-quote { margin-top: auto; padding: 18px 12px 4px; font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.45; color: var(--side-ink); opacity: .92; }
[dir="rtl"] .side-quote { font-style: normal; font-size: 18px; }
.side-quote .leaf { display: block; width: 38px; height: 22px; margin-top: 10px; color: var(--side-muted); }

/* main panel */
.main { min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; width: 100%; padding: 26px 30px 36px; }
.topbar { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head-text { flex: 1; min-width: 220px; }
.page-title { font-family: var(--serif); font-size: 30px; font-weight: 500; color: var(--ink); letter-spacing: -.005em; line-height: 1.2; }
.page-sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.eyebrow { display: block; color: var(--muted); font-size: 13px; font-weight: 500; margin-top: 4px; }
.top-tools { display: flex; align-items: center; gap: 10px; }
.search-pill { position: relative; display: flex; align-items: center; }
.search-pill .ico { position: absolute; inset-inline-start: 13px; color: var(--faint); width: 16px; height: 16px; pointer-events: none; }
.search-pill input { width: 250px; height: 40px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card-solid); color: var(--fg); font: inherit; font-size: 13.5px; padding-inline: 38px 16px; outline: none; transition: border-color .2s, box-shadow .2s; }
.search-pill input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin: -6px 0 20px; }
.foot { padding: 14px 30px 20px; color: var(--faint); font-size: 12px; border-top: 1px solid var(--line); }
.bottom-nav { display: none; }

.round-btn, .icon-btn, .chip-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; min-width: 40px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card-solid); color: var(--fg); cursor: pointer; font: inherit; font-weight: 600;
  transition: background .15s, border-color .15s;
}
.chip-btn { padding: 0 14px; font-size: 13px; }
.round-btn:hover, .icon-btn:hover, .chip-btn:hover { border-color: var(--accent); }
.round-btn .ico, .chip-btn .ico { width: 17px; height: 17px; color: var(--muted); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding-inline: 3px 10px; border-radius: 999px; }
.user-chip:hover { background: var(--card-2); }
.user-chip .caret { width: 14px; height: 14px; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--p-peach); color: var(--i-peach); font-weight: 700; font-size: 14px; box-shadow: inset 0 0 0 2px var(--card-solid), 0 0 0 1px var(--line-strong); }
.user-chip-text { display: none; }
.only-mobile { display: none !important; }

/* ---------------- welcome strip (kept for older pages) ---------------- */
.strip { display: flex; align-items: flex-end; gap: 28px; flex-wrap: wrap; margin-bottom: 22px; }
.strip-pills { flex: 1; min-width: 320px; display: grid; grid-template-columns: 1.1fr 1fr 1.4fr 1fr; gap: 10px; }
.strip-pill { display: flex; flex-direction: column; gap: 6px; }
.strip-pill > span { font-size: 12.5px; color: var(--muted); }
.strip-bar { height: 38px; border-radius: 10px; display: flex; align-items: center; padding: 0 14px; font-size: 13.5px; font-weight: 600; }
.strip-bar.dark { background: var(--side); color: var(--side-ink); }
.strip-bar.sun { background: var(--p-yellow); color: var(--sun-ink); }
.strip-bar.hatch { background: var(--hatch), var(--card); border: 1px solid var(--line); }
.strip-bar.ghost { background: transparent; border: 1px solid var(--line-strong); }
.counters { display: flex; gap: 34px; }
.counter { display: flex; align-items: flex-end; gap: 8px; }
.counter .ico { width: 22px; height: 22px; color: var(--muted); margin-bottom: 8px; }
.counter strong { font-family: var(--serif); font-size: 44px; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
.counter span { color: var(--muted); font-size: 13px; margin-bottom: 4px; display: block; }

/* ---------------- cards ---------------- */
.card { background: var(--card); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card + .card { margin-top: 18px; }
.card.dark { background: var(--side); color: var(--side-ink); border-color: transparent; }
.card.dark .muted, .card.dark small { color: var(--side-muted); }
.card.sun { background: var(--p-yellow); color: var(--fg); border-color: transparent; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head > .ico, .card-head .head-ico { width: 18px; height: 18px; color: var(--muted); }
.card-head h2, .card-head h3 { font-family: var(--serif); font-size: 17px; font-weight: 500; flex: 1; color: var(--ink); }
.card.dark .card-head h3 { color: var(--side-ink); }
.card-head .sub { display: block; color: var(--muted); font-size: 12.5px; font-family: "Plex", system-ui, sans-serif; }
.view-all { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.view-all:hover { color: var(--accent); }
.view-all .ico { width: 14px; height: 14px; }
[dir="rtl"] .view-all .ico { transform: scaleX(-1); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-dash { grid-template-columns: 1.15fr 1fr 1fr 1.2fr; }
.grid-main { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 14px; font-family: var(--serif); font-size: 20px; font-weight: 500; color: var(--ink); }
.section-title .ico { color: var(--accent); }

.big { font-family: var(--serif); font-size: 40px; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.big small { font-family: "Plex", system-ui, sans-serif; font-size: 13.5px; color: var(--muted); margin-inline-start: 6px; }

/* stat tile: pastel card, square icon, serif number */
.stat { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px 18px; border-radius: var(--radius); background: var(--p-green); min-width: 0; }
.stat-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--i-green); color: #fff; }
.stat-icon .ico { width: 18px; height: 18px; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { color: var(--fg); font-size: 13.5px; font-weight: 500; }
.stat-value { font-family: var(--serif); font-size: 30px; font-weight: 500; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-hint { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.stat-hint .ico { width: 13px; height: 13px; }
.stat.c1, .stat.ok { background: var(--p-green); } .stat.c1 .stat-icon, .stat.ok .stat-icon { background: var(--i-green); }
.stat.c2, .stat.bad { background: var(--p-peach); } .stat.c2 .stat-icon, .stat.bad .stat-icon { background: var(--i-peach); }
.stat.c3 { background: var(--p-lilac); } .stat.c3 .stat-icon { background: var(--i-lilac); }
.stat.c4, .stat.warn, .stat.sun { background: var(--p-yellow); } .stat.c4 .stat-icon, .stat.warn .stat-icon, .stat.sun .stat-icon { background: var(--i-yellow); }
.grid > .stat:not(.ok):not(.bad):not(.warn):not(.sun):not(.c1):not(.c2):not(.c3):not(.c4):nth-child(4n+2) { background: var(--p-peach); }
.grid > .stat:not(.ok):not(.bad):not(.warn):not(.sun):not(.c1):not(.c2):not(.c3):not(.c4):nth-child(4n+2) .stat-icon { background: var(--i-peach); }
.grid > .stat:not(.ok):not(.bad):not(.warn):not(.sun):not(.c1):not(.c2):not(.c3):not(.c4):nth-child(4n+3) { background: var(--p-lilac); }
.grid > .stat:not(.ok):not(.bad):not(.warn):not(.sun):not(.c1):not(.c2):not(.c3):not(.c4):nth-child(4n+3) .stat-icon { background: var(--i-lilac); }
.grid > .stat:not(.ok):not(.bad):not(.warn):not(.sun):not(.c1):not(.c2):not(.c3):not(.c4):nth-child(4n) { background: var(--p-yellow); }
.grid > .stat:not(.ok):not(.bad):not(.warn):not(.sun):not(.c1):not(.c2):not(.c3):not(.c4):nth-child(4n) .stat-icon { background: var(--i-yellow); }
[data-theme="dark"] .stat-icon { color: #10201c; }

/* hero card (older pages) */
.hero-card { position: relative; overflow: hidden; min-height: 240px; display: flex; flex-direction: column; justify-content: flex-end; padding: 20px; border-radius: var(--radius);
  background: var(--side); color: #fff; box-shadow: var(--shadow); }
.hero-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 20%, rgba(15, 40, 36, .85)); }
.hero-card > * { position: relative; }
.hero-card .logo-mark { position: absolute; top: 20px; inset-inline-start: 20px; width: 48px; height: 48px; }
.hero-card h3 { font-family: var(--serif); font-size: 22px; font-weight: 500; }
.hero-card p { color: rgba(255,255,255,.8); font-size: 13.5px; }
.hero-card .chip { position: absolute; top: 20px; inset-inline-end: 20px; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.22); backdrop-filter: blur(6px); font-weight: 600; font-size: 12.5px; }

/* vertical bars */
.bars-v { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 18px; }
.bars-v .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars-v .b i { width: 100%; max-width: 26px; border-radius: 7px 7px 3px 3px; background: var(--p-teal); display: block; position: relative; }
.bars-v .b.hot i { background: var(--accent); }
.bars-v .b.hot i::before { content: attr(data-v); position: absolute; bottom: calc(100% + 5px); inset-inline-start: 50%; transform: translateX(-50%); background: var(--side); color: var(--side-ink); font-size: 11px; font-style: normal; font-weight: 700; padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
[dir="rtl"] .bars-v .b.hot i::before { transform: translateX(50%); }
.bars-v .b small { font-size: 11px; color: var(--muted); }

/* ring */
.ring { position: relative; width: 160px; height: 160px; margin: 6px auto 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-text { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-text strong { font-family: var(--serif); font-size: 30px; font-weight: 500; display: block; line-height: 1; }
.ring-text small { color: var(--muted); font-size: 12px; }

/* activity tiles */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px; min-height: 160px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .2s, border-color .2s; }
.tile:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.tile-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--p-green); color: var(--i-green); }
.tile:nth-child(6n+2) .tile-icon { background: var(--p-peach); color: var(--i-peach); }
.tile:nth-child(6n+3) .tile-icon { background: var(--p-lilac); color: var(--i-lilac); }
.tile:nth-child(6n+4) .tile-icon { background: var(--p-yellow); color: var(--i-yellow); }
.tile:nth-child(6n+5) .tile-icon { background: var(--p-teal); color: var(--i-teal); }
.tile:nth-child(6n) .tile-icon { background: var(--p-rose); color: var(--i-rose); }
.tile-icon .ico { width: 21px; height: 21px; }
.tile h3 { font-size: 14.5px; font-weight: 600; }
.tile p { color: var(--muted); font-size: 12.5px; }
.tile-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.tile-foot .arrow { margin-inline-start: auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--fg); }
[dir="rtl"] .tile-foot .arrow svg, [dir="rtl"] .arrow-ico { transform: scaleX(-1); }
.tile-count { font-family: var(--serif); font-size: 24px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }

/* badges: soft pill with a dot */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--na-soft); color: var(--na); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge:has(.ico)::before { display: none; }
.badge .ico { width: 13px; height: 13px; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-na { background: var(--na-soft); color: var(--na); }
.badge-accent, .badge-sun { background: var(--p-yellow); color: var(--sun-ink); }
.badge-dark { background: var(--side); color: var(--side-ink); }
.dot-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.dot-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dot-status.ok { color: var(--ok); } .dot-status.warn { color: var(--warn); } .dot-status.bad { color: var(--bad); } .dot-status.na { color: var(--na); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer; font: inherit; font-weight: 600; font-size: 13.5px;
  background: var(--side); color: var(--side-ink); transition: background .15s, border-color .15s, transform .15s; white-space: nowrap;
}
.btn:hover { background: var(--side-2); }
[data-theme="dark"] .btn { background: var(--side-2); }
.btn .ico { width: 16px; height: 16px; }
.btn-sun { background: var(--accent); color: var(--accent-ink); }
.btn-sun:hover { background: var(--accent-2); }
[data-theme="dark"] .btn-sun { background: var(--accent); }
.btn-ghost { background: var(--card-solid); color: var(--fg); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--card-2); border-color: var(--accent); }
[data-theme="dark"] .btn-ghost { background: var(--card-solid); }
.btn-ghost .ico { color: var(--muted); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: var(--bad); filter: brightness(1.06); }
.btn-sm, .btn.sm { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* forms */
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label, .label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--input); color: var(--fg); font: inherit; font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.input.sm { height: 34px; padding: 0 9px; border-radius: 8px; font-size: 13.5px; }
textarea.input { height: auto; min-height: 92px; padding: 10px 13px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.input.is-invalid { border-color: var(--bad); }
select.input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8b85' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-size: 15px; background-repeat: no-repeat; background-position: right 12px center; padding-inline-end: 34px; }
[dir="rtl"] select.input { background-position: left 12px center; }
select.input option { background: var(--card-solid); color: var(--fg); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input, input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }
.help { color: var(--faint); font-size: 12px; }
.error-text { color: var(--bad); font-size: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 18px; }
.filters .field { min-width: 150px; flex: 1; }
.unit { color: var(--faint); font-size: 12px; }
.input-unit { position: relative; direction: ltr; }
.input-unit .input { padding-inline-end: 62px; text-align: left; }
.input-unit .unit { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--card-2); border: 1px solid var(--line); gap: 3px; flex-wrap: wrap; }
.seg label { cursor: pointer; }
.seg input { display: none; }
.seg span { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 8px; font-weight: 500; font-size: 13.5px; color: var(--muted); }
.seg input:checked + span { background: var(--card-solid); color: var(--ink); box-shadow: var(--shadow); }

/* line chooser cards */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.choice { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--radius); background: var(--card-solid); border: 1px solid var(--line-strong); cursor: pointer; transition: border-color .2s, background .2s; }
.choice:hover { border-color: var(--accent); }
.choice strong { font-family: var(--serif); font-size: 18px; font-weight: 500; color: var(--ink); }
.choice small { color: var(--muted); }
.choice.is-active { border-color: var(--accent); background: var(--p-teal); box-shadow: inset 0 0 0 1px var(--accent); }

/* tables */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--card-solid); }
.card .table-wrap { background: transparent; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: start; padding: 10px 14px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; border-bottom: 1px solid var(--line); background: var(--card-2); }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--card-2) 60%, transparent); }
.table.inputs td { padding: 6px 8px; }
.table.inputs .input { min-width: 86px; }
.table tfoot td { font-weight: 600; background: var(--card-2); }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.table td.actions { white-space: nowrap; text-align: end; }
.row-link { font-weight: 600; color: var(--ink); }
.row-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* result strip */
.result-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.result { padding: 14px 16px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); min-width: 0; }
.result span { display: block; color: var(--muted); font-size: 12.5px; }
.result strong { display: block; font-family: var(--serif); font-size: 25px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; text-align: start; }
.result small { color: var(--faint); font-size: 12px; }
.result.main { background: var(--p-green); border-color: transparent; }
.result.main strong { color: var(--accent); }
[data-theme="dark"] .result.main strong { color: var(--i-green); }
.result.main span, .result.main small { color: var(--muted); }
.result.dark { background: var(--side); color: var(--side-ink); border-color: transparent; }
.result.dark strong { color: var(--side-ink); }
.result.dark span, .result.dark small { color: var(--side-muted); }

/* key-value */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.kv-item { padding: 10px 14px; border-radius: 11px; background: var(--card-2); border: 1px solid var(--line); }
.kv-item span { display: block; font-size: 12px; color: var(--muted); }
.kv-item strong { font-size: 14.5px; font-weight: 600; word-break: break-word; }
.tree { display: flex; flex-direction: column; gap: 10px; }
details.node { border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); }
details.node > summary { list-style: none; cursor: pointer; padding: 11px 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
details.node > summary::-webkit-details-marker { display: none; }
details.node > summary::before { content: "+"; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--p-teal); color: var(--accent); font-size: 14px; }
details.node[open] > summary::before { content: "−"; }
details.node > .node-body { padding: 0 14px 14px; }
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }

/* tabs */
.tabs { display: inline-flex; gap: 3px; padding: 3px; border-radius: 11px; background: var(--card-2); border: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; max-width: 100%; }
.tab { padding: 7px 16px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 13.5px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--card-solid); color: var(--ink); box-shadow: var(--shadow); }

/* alerts */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; font-weight: 500; background: var(--card-2); border: 1px solid var(--line); }
.alert .ico { width: 17px; height: 17px; }
.alert-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.alert-error { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
[data-theme="light"] .alert-warn { color: #7a5a0c; }

/* horizontal bars (Project-progress style) */
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 1.25fr) 3fr 3.2em; gap: 14px; align-items: center; font-size: 13.5px; }
.bar-row > span:last-child { text-align: end; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-track { height: 8px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--i-green); }
.bar-row:nth-child(5n+2) .bar-fill { background: #8fa79c; }
.bar-row:nth-child(5n+3) .bar-fill { background: var(--i-peach); }
.bar-row:nth-child(5n+4) .bar-fill { background: var(--i-yellow); }
.bar-row:nth-child(5n) .bar-fill { background: var(--i-teal); }

/* lists (Team-members / Recent-activity style) */
.list { display: flex; flex-direction: column; gap: 2px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; transition: background .15s; }
a.list-item:hover { background: var(--card-2); }
.card.dark a.list-item:hover { background: rgba(255,255,255,.06); }
.list-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--p-teal); color: var(--i-teal); }
.list-icon .ico { width: 17px; height: 17px; }
.list .list-item:nth-child(5n+2) .list-icon { background: var(--p-peach); color: var(--i-peach); }
.list .list-item:nth-child(5n+3) .list-icon { background: var(--p-lilac); color: var(--i-lilac); }
.list .list-item:nth-child(5n+4) .list-icon { background: var(--p-yellow); color: var(--i-yellow); }
.list .list-item:nth-child(5n) .list-icon { background: var(--p-green); color: var(--i-green); }
.card.dark .list-icon { background: rgba(255,255,255,.08); color: var(--side-ink); }
.list-body { flex: 1; min-width: 0; }
.list-body strong { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-body small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-time { color: var(--faint); font-size: 12px; white-space: nowrap; }
.list-divided .list-item { border-bottom: 1px solid var(--line); border-radius: 0; }
.list-divided .list-item:last-child { border-bottom: 0; }
.date-chip { width: 42px; flex: none; display: flex; flex-direction: column; align-items: center; border-radius: 9px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--card-solid); line-height: 1.1; }
.date-chip small { width: 100%; text-align: center; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 0; background: var(--p-peach); color: var(--i-peach); }
.date-chip b { font-family: var(--serif); font-size: 17px; font-weight: 500; padding: 3px 0 4px; color: var(--ink); }
.list .list-item:nth-child(4n+2) .date-chip small { background: var(--p-green); color: var(--i-green); }
.list .list-item:nth-child(4n+3) .date-chip small { background: var(--p-lilac); color: var(--i-lilac); }
.list .list-item:nth-child(4n) .date-chip small { background: var(--p-yellow); color: var(--i-yellow); }
.marker { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--ok); }
.marker.warn { background: var(--warn); } .marker.bad { background: var(--bad); } .marker.na { background: var(--na); }
.done-dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--p-green); color: var(--i-green); flex: none; }
.done-dot .ico { width: 12px; height: 12px; }
.todo-dot { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; }
.card.dark .todo-dot { border-color: rgba(255,255,255,.25); }

/* empty / pager */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 15px; display: grid; place-items: center; background: var(--p-teal); color: var(--i-teal); }
.empty-icon .ico { width: 26px; height: 26px; }
.empty-state h2, .empty-state h3 { font-family: var(--serif); color: var(--ink); margin-bottom: 6px; font-weight: 500; }
.empty-state .btn { margin-top: 16px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pager-link { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--card-solid); border: 1px solid var(--line); font-weight: 600; font-size: 13.5px; }
.pager-link.is-active { background: var(--side); color: var(--side-ink); border-color: transparent; }
.pager-gap { padding: 8px 4px; color: var(--faint); }

/* charts */
.chart { width: 100%; height: 220px; direction: ltr; }
.chart .grid-line { stroke: var(--line-strong); stroke-dasharray: 3 4; }
.chart .series { fill: none; stroke: var(--ink-2); stroke-width: 2.2; }
.chart .series-2 { fill: none; stroke: var(--sun); stroke-width: 2.2; }
.chart .dot { fill: var(--sun); stroke: var(--ink-2); stroke-width: 1.5; }
.chart text { fill: var(--muted); font-size: 10px; }

/* login */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; padding: 34px 30px 30px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line); }
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand .logo-mark { width: 54px; height: 54px; margin: 0 auto 10px; display: block; padding: 11px; border-radius: 15px; background: var(--side); color: var(--side-ink); }
.auth-brand h1 { font-family: var(--serif); font-size: 30px; font-weight: 500; color: var(--ink); }
.auth-brand p { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card .btn { height: 44px; }
.auth-quote { margin-top: 22px; text-align: center; font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 14.5px; }
[dir="rtl"] .auth-quote { font-style: normal; }
.auth-top { position: fixed; top: 18px; inset-inline-end: 18px; z-index: 5; }

/* logo (lotus) */
.logo-mark { color: currentColor; }
.logo-mark path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.logo-mark .lm-fill { fill: currentColor; stroke: none; opacity: .18; }

/* drawer (mobile menu) */
.drawer { display: none; }

/* month strip (SEC11) / unit tabs (SEC14) */
.month-chip { min-width: 62px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 10px; border-radius: 11px; border: 1px solid var(--line); background: var(--card-solid); color: inherit; font-size: 13px; transition: border-color .15s; }
.month-chip small { color: var(--muted); font-size: 11.5px; }
.month-chip b { font-family: var(--serif); font-weight: 500; font-size: 15px; }
.month-chip:hover { border-color: var(--accent); }
.month-chip.is-active { border-color: var(--accent); background: var(--p-teal); box-shadow: inset 0 0 0 1px var(--accent); }
.month-chip.is-off { opacity: .45; }
.unit-tab { min-width: 8rem; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-solid); color: inherit; }
.unit-tab small { font-size: 11.5px; color: var(--muted); }
.unit-tab b { font-family: var(--serif); font-weight: 500; font-size: 15px; }
.unit-tab:hover { border-color: var(--accent); }
.unit-tab.is-active { border-color: var(--accent); background: var(--p-teal); box-shadow: inset 0 0 0 1px var(--accent); }

/* liner wear rows (SEC13 / SEC14) */
.wear-rows { display: flex; flex-wrap: wrap; gap: 6px; }
.wear-chip { min-width: 54px; display: inline-flex; flex-direction: column; align-items: center; padding: 4px 8px; border-radius: 9px; background: var(--na-soft); color: var(--muted); font-size: 12px; }
.wear-chip small { font-size: 10.5px; opacity: .8; }
.wear-chip.ok { background: var(--ok-soft); color: var(--ok); }
.wear-chip.warn { background: var(--warn-soft); color: var(--warn); }
.wear-chip.bad { background: var(--bad-soft); color: var(--bad); }
.wear-cell { border: 1px solid var(--line); border-radius: 11px; padding: 6px; background: var(--card-solid); }
.wear-cell.ok { border-color: var(--ok); background: var(--ok-soft); }
.wear-cell.warn { border-color: var(--warn); background: var(--warn-soft); }
.wear-cell.bad { border-color: var(--bad); background: var(--bad-soft); }
.grid-wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* SEC14 */
.tiles-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.mini-tile { border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; display: flex; flex-direction: column; gap: 2px; min-width: 0; background: var(--card-solid); }
.mini-tile span { font-size: 12px; color: var(--muted); }
.mini-tile strong { font-family: var(--serif); font-size: 21px; font-weight: 500; color: var(--ink); }
.mini-tile small { font-size: 11.5px; color: var(--muted); }
.crash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 12px; }
.crash-block { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-width: 0; background: var(--card-solid); }
.crash-head { margin: 0; padding: 6px 12px; font-family: var(--serif); font-weight: 500; font-size: 14px; background: var(--p-teal); color: var(--ink); border-bottom: 1px solid var(--line); }
.crash-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.crash-table th { color: var(--muted); font-weight: 500; padding: 4px 6px; text-align: end; }
.crash-table th:first-child, .crash-table td:first-child { text-align: start; }
.crash-table td { padding: 2px 6px; text-align: end; }
.crash-table tfoot { border-top: 1px solid var(--line); }
.crash-table input.input { height: 30px; padding: 0 6px; font-size: 12.5px; text-align: end; }

/* ---------------- responsive ---------------- */
@media (max-width: 1360px) {
  .grid-dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-pill input { width: 190px; }
}
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .grid-wide { grid-template-columns: minmax(0, 1fr); }
  .tiles-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .only-mobile { display: inline-flex !important; }
  .drawer { display: block; position: fixed; inset: 0; z-index: 60; pointer-events: none; transition: background .25s; }
  .drawer .side { display: flex; position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(290px, 84vw); transform: translateX(-105%); transition: transform .25s; pointer-events: auto; overflow-y: auto; }
  [dir="rtl"] .drawer .side { transform: translateX(105%); }
  .drawer .side-inner { position: static; min-height: 100%; }
  body.menu-open .drawer { pointer-events: auto; background: rgba(10, 25, 22, .4); }
  body.menu-open .drawer .side { transform: none; }
  .counters { gap: 22px; }
  .counter strong { font-size: 38px; }
}
@media (max-width: 760px) {
  .content { padding: 18px 14px 104px; }
  .topbar { gap: 12px; margin-bottom: 16px; }
  .page-title { font-size: 24px; }
  .search-pill { display: none; }
  .page-actions { justify-content: flex-start; margin-top: -4px; }
  .grid-2, .grid-3, .grid-dash { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .grid-4 { gap: 12px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 26px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile { padding: 14px; min-height: 150px; }
  .tiles-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip-pills { grid-template-columns: 1fr 1fr; min-width: 0; }
  .counters { width: 100%; justify-content: space-between; }
  .counter strong { font-size: 32px; }
  .foot { display: none; }
  .bottom-nav {
    display: flex; position: fixed; inset-inline: 12px; bottom: 12px; z-index: 40; padding: 5px; gap: 3px;
    border-radius: 16px; background: var(--side); box-shadow: 0 18px 40px -16px rgba(0,0,0,.55);
    padding-bottom: calc(5px + env(safe-area-inset-bottom) / 2);
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: 52px; border-radius: 12px; color: var(--side-muted); font-size: 10.5px; font-weight: 600; }
  .bottom-nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 2px; }
  .bottom-nav a.is-active { background: var(--side-2); color: var(--side-ink); }
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-row .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .form-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice { padding: 14px; }
  .field[style*="span 2"] { grid-column: 1 / -1 !important; }
}
@media (max-width: 400px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 23px; }
}

@media print {
  .side, .drawer, .topbar .top-tools, .bottom-nav, .page-actions, .filters, .no-print, .foot { display: none !important; }
  body { background: #fff; color: #000; }
  .shell { display: block; background: #fff; }
  .card, .stat, .tile, .result { box-shadow: none; border: 1px solid #ccc; }
  .content { padding: 0; }
}
button.side-link { width: 100%; border: 0; background: none; cursor: pointer; font: inherit; font-size: 14px; font-weight: 500; text-align: start; }
.table td:first-child { white-space: nowrap; }

/* archive */
.archive-grid { grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) { .archive-grid { grid-template-columns: minmax(0, 1fr); } }
.tree { display: flex; flex-direction: column; gap: 2px; max-height: 70vh; overflow: auto; }
.tree-link { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; font-size: 13.5px; color: var(--muted); }
.tree-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-link .ico { width: 16px; height: 16px; }
.tree-link:hover { background: var(--card-2); color: var(--ink); }
.tree-link.is-active { background: var(--p-teal); color: var(--ink); font-weight: 600; }
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; cursor: pointer; font-size: 16px; line-height: 1; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 20; min-width: 210px; padding: 6px; border-radius: 12px; background: var(--card-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow-panel); display: flex; flex-direction: column; }
.menu-panel a, .menu-panel button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--fg); cursor: pointer; text-align: start; white-space: nowrap; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--card-2); }
.menu-panel .ico { width: 15px; height: 15px; color: var(--muted); }
.archive-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 16px; }
.archive-tile { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-solid); }
.archive-tile strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.archive-tile small { font-size: 11.5px; }
.archive-thumb { height: 100px; border-radius: 9px; background: var(--card-2); display: grid; place-items: center; overflow: hidden; color: var(--i-teal); position: relative; }
.archive-thumb.is-folder { background: var(--p-yellow); color: var(--i-yellow); }
.archive-thumb .ico { width: 34px; height: 34px; }
.archive-thumb small { position: absolute; bottom: 6px; font-weight: 700; font-size: 10px; color: var(--muted); }
.archive-thumb img { width: 100%; height: 100%; object-fit: cover; }
.drop-overlay { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; background: color-mix(in srgb, var(--side) 55%, transparent); color: #fff; text-align: center; pointer-events: none; }
.drop-overlay.is-on { display: grid; }
.drop-overlay > div { padding: 30px 40px; border: 2px dashed rgba(255,255,255,.7); border-radius: 20px; }
.drop-overlay .ico { width: 44px; height: 44px; }
.seg a span { cursor: pointer; }

/* ================================================================ depth & motion layer */
:root { --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1); }

/* line health strip: the stations of the line in process order, each with an animated ring */
.line-flow { overflow: hidden; }
.flow-track { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 14px 8px; margin-top: 8px; }
.station::before { content: ""; position: absolute; z-index: -1; top: 43px; inset-inline-start: 50%; width: calc(100% + 8px); height: 3px; border-radius: 3px;
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent) 0 12px, var(--line) 12px 24px); background-size: 24px 3px; animation: flow 1.4s linear infinite; }
[dir="rtl"] .station::before { animation-direction: reverse; }
.station.end::before { display: none; }
@keyframes flow { to { background-position: 24px 0; } }
@media (max-width: 760px) { .flow-track { grid-template-columns: repeat(2, minmax(0, 1fr)); } .station::before { display: none; } }
.station { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 6px 4px 10px; border-radius: 16px; color: inherit; text-decoration: none; transition: background .25s, transform .35s var(--spring); }
.station:hover, .station:focus-visible { background: var(--card-2); transform: translateY(-3px); }
.ring { position: relative; width: 74px; height: 74px; display: grid; place-items: center; border-radius: 50%; background: var(--card-solid); box-shadow: 0 0 0 6px var(--card-solid), 0 10px 22px -14px rgba(0,0,0,.45); }
.ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
[dir="rtl"] .ring > svg { transform: rotate(-90deg) scaleY(-1); }
.ring circle { fill: none; stroke-width: 5; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--na); stroke-linecap: round; stroke-dasharray: 201; stroke-dashoffset: calc(201 - 201 * var(--p, 0) / 100); transition: stroke-dashoffset 1.4s var(--ease); }
.reveal:not(.is-in) .ring .fg { stroke-dashoffset: 201; }
.ring-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--ink-2, var(--ink)); }
.ring-ico .ico { width: 22px; height: 22px; }
.station b { font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.station small { font-size: 11.5px; color: var(--muted); }
.station .pct { font-family: var(--serif); font-size: 17px; line-height: 1; color: var(--ink); }
.station.tone-ok .fg { stroke: var(--ok); } .station.tone-ok .ring-ico { background: var(--p-green); color: var(--ok); }
.station.tone-warn .fg { stroke: var(--warn); } .station.tone-warn .ring-ico { background: var(--p-yellow); color: var(--warn); }
.station.tone-bad .fg { stroke: var(--bad); } .station.tone-bad .ring-ico { background: var(--p-peach); color: var(--bad); }
.station.tone-bad .ring::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--bad); opacity: 0; animation: ping 2.6s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(.9); opacity: .6; } 80%, 100% { transform: scale(1.25); opacity: 0; } }
.station:hover .ring-ico .ico { animation: hop .6s var(--spring); }
.flow-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }

/* photo banners (activity groups, login) */
.group-hero { position: relative; display: flex; align-items: flex-end; gap: 14px; min-height: 150px; margin: 28px 0 16px; padding: 22px 24px; border-radius: var(--radius); overflow: hidden; color: #fff;
  background: var(--side) center / cover no-repeat; box-shadow: var(--shadow-panel); isolation: isolate; }
.group-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(15, 42, 38, .92) 0%, rgba(15, 42, 38, .62) 45%, rgba(15, 42, 38, .15) 100%); }
[dir="rtl"] .group-hero::before { background: linear-gradient(-100deg, rgba(15, 42, 38, .92) 0%, rgba(15, 42, 38, .62) 45%, rgba(15, 42, 38, .15) 100%); }
.group-hero .hero-bg { position: absolute; inset: -6%; z-index: -2; background: inherit; background-size: cover; background-position: center; transform: scale(1.04); transition: transform 6s var(--ease); }
.group-hero:hover .hero-bg { transform: scale(1.1); }
.group-hero .hero-ico { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(6px); }
.group-hero .hero-ico .ico { width: 26px; height: 26px; }
.group-hero h2 { font-family: var(--serif); font-size: 24px; font-weight: 500; color: #fff; }
.group-hero p { color: rgba(255,255,255,.8); font-size: 13px; margin-top: 2px; }
.group-hero .hero-count { margin-inline-start: auto; text-align: end; }
.group-hero .hero-count b { display: block; font-family: var(--serif); font-size: 34px; font-weight: 500; line-height: 1; }
.group-hero .hero-count small { color: rgba(255,255,255,.75); font-size: 12px; }

/* 3D icons in tiles and stat cards */
.stat-icon, .tile-icon { position: relative; }
.stat-icon { background-image: linear-gradient(145deg, rgba(255,255,255,.35), rgba(255,255,255,0) 55%, rgba(0,0,0,.12)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -2px 0 rgba(0,0,0,.12), 0 8px 16px -8px rgba(0,0,0,.45); }
.stat.c1 .stat-icon, .stat.ok .stat-icon { background-color: var(--i-green); } .stat.c2 .stat-icon, .stat.bad .stat-icon { background-color: var(--i-peach); }
.stat.c3 .stat-icon { background-color: var(--i-lilac); } .stat.c4 .stat-icon, .stat.warn .stat-icon, .stat.sun .stat-icon { background-color: var(--i-yellow); }
.tile-icon { box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 -2px 0 rgba(0,0,0,.06), 0 8px 18px -10px rgba(0,0,0,.35); transition: transform .45s var(--spring); }
.tile:hover .tile-icon { transform: translateY(-2px) rotate(-6deg) scale(1.08); }
[dir="rtl"] .tile:hover .tile-icon { transform: translateY(-2px) rotate(6deg) scale(1.08); }

/* hover: a soft lift and a light that follows the pointer (set by motion.js) */
.glow { transition: transform .35s var(--spring), box-shadow .3s, border-color .3s; }
.glow:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgba(30, 50, 45, .55); }
.glow::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.4), transparent 50%); }
[data-theme="dark"] .glow::after { background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.07), transparent 50%); }
.glow:hover::after { opacity: 1; }
.tile, .stat, .choice { position: relative; }

/* animated icons: hover on a tile, a menu link, a list row or a button */
.ico { transform-box: fill-box; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flicker { 0%, 100% { transform: scale(1, 1) translateY(0); } 25% { transform: scale(.94, 1.08) translateY(-1px); } 50% { transform: scale(1.04, .95); } 75% { transform: scale(.97, 1.05) translateY(-.5px); } }
@keyframes swing { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-14deg); } 70% { transform: rotate(12deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.9); } }
@keyframes drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-3px); } 60% { transform: translateY(-1px); } }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
:is(.tile, .side-link, .list-item, .stat, .btn, .group-hero, .choice, .tree-link, .round-btn):hover .i-fan { animation: spin 1.1s linear infinite; }
:is(.tile, .side-link, .list-item, .stat, .btn, .group-hero, .choice):hover .i-flame { animation: flicker .7s ease-in-out infinite; transform-origin: 50% 90%; }
:is(.tile, .side-link, .list-item, .stat, .btn, .group-hero, .choice):hover :is(.i-gauge, .i-target, .i-bell) { animation: swing .9s var(--ease) infinite; }
:is(.tile, .side-link, .list-item, .stat, .btn, .group-hero, .choice):hover :is(.i-sensor, .i-pulse) { animation: pulse 1s ease-in-out infinite; }
:is(.tile, .side-link, .list-item, .stat, .btn, .group-hero, .choice):hover :is(.i-wind, .i-route) { animation: drift 1s ease-in-out infinite; }
:is(.tile, .side-link, .list-item, .stat, .btn, .group-hero, .choice, .tree-link):hover :is(.i-cylinder, .i-box, .i-layers, .i-sieve, .i-database, .i-archive, .i-folder, .i-file, .i-calendar, .i-upload, .i-download, .i-chart, .i-trend, .i-grid, .i-home, .i-users, .i-user, .i-factory) { animation: hop .7s var(--spring); }
:is(.side-link, .btn, .round-btn):hover :is(.i-settings, .i-history) { animation: spin 2.4s linear infinite; }
:is(.tile, .view-all, .btn):hover .i-arrow { animation: nudge .8s ease-in-out infinite; }
[dir="rtl"] :is(.tile, .view-all, .btn):hover .i-arrow { animation-direction: reverse; }
.side-link .ico { transition: transform .3s var(--spring); }
.side-link.is-active .ico { color: #b9e0d6; filter: drop-shadow(0 0 6px rgba(150, 220, 200, .45)); }
.side-brand .logo-mark { animation: bloom 6s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes bloom { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.06) rotate(-3deg); } }

/* reveal on scroll and growing bars */
.reveal { opacity: 0; transform: translateY(14px) scale(.985); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity .6s var(--ease) calc(var(--i, 0) * 60ms), transform .7s var(--ease) calc(var(--i, 0) * 60ms); }
.tilt.reveal.is-in { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0)); }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.bar-fill { transform-origin: left center; animation: growX 1.1s var(--ease) both .2s; }
[dir="rtl"] .bar-fill { transform-origin: right center; }
.bars-v .b i { transform-origin: bottom; animation: growY .9s var(--ease) both; }
.bars-v .b:nth-child(2) i { animation-delay: .05s; } .bars-v .b:nth-child(3) i { animation-delay: .1s; } .bars-v .b:nth-child(4) i { animation-delay: .15s; }
.bars-v .b:nth-child(5) i { animation-delay: .2s; } .bars-v .b:nth-child(6) i { animation-delay: .25s; } .bars-v .b:nth-child(7) i { animation-delay: .3s; }
.chart path[stroke] { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: draw 1.6s var(--ease) forwards .15s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart circle { animation: pop .4s var(--spring) both 1s; transform-box: fill-box; transform-origin: center; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.stat-value, .tile-count { font-variant-numeric: tabular-nums; }
.btn { transition: background .15s, border-color .15s, transform .2s var(--spring), box-shadow .2s; }
.btn:active { transform: scale(.97); }
.btn-sun { box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-sun:hover { box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--accent) 90%, transparent); transform: translateY(-1px); }

/* login with a photo panel */
.auth-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); width: min(980px, 100%); border-radius: 22px; overflow: hidden; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-panel); }
.auth-split .auth-card { box-shadow: none; border: 0; border-radius: 0; max-width: none; padding: 44px 40px; }
.auth-photo { position: relative; min-height: 520px; background: var(--side) center / cover no-repeat; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 32px; isolation: isolate; overflow: hidden; }
.auth-photo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(15, 42, 38, .15) 0%, rgba(15, 42, 38, .55) 55%, rgba(15, 42, 38, .94) 100%); }
.auth-photo .hero-bg { position: absolute; inset: 0; z-index: -2; background: inherit; background-size: cover; animation: kenburns 24s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.14) translate(-2%, -2%); } }
.auth-photo h2 { font-family: var(--serif); font-size: 28px; font-weight: 500; line-height: 1.25; }
.auth-photo p { color: rgba(255,255,255,.82); margin-top: 8px; font-size: 14px; }
.auth-photo .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.auth-photo .chips span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(6px); font-size: 12.5px; }
.auth-photo .chips .ico { width: 15px; height: 15px; }
@media (max-width: 820px) { .auth-split { grid-template-columns: 1fr; } .auth-photo { min-height: 220px; } .auth-split .auth-card { padding: 30px 24px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .tilt { transform: none !important; }
}
@media print { .plant3d { display: none; } .reveal { opacity: 1 !important; transform: none !important; } }

/* problems of a record */
.problem-row[hidden] { display: none !important; }
.problem-list .list-item { align-items: flex-start; gap: 12px; }
.show-mobile { display: none; }
.print-only { display: none; }
@media (max-width: 760px) { .hide-mobile { display: none !important; } .show-mobile { display: flex; flex-direction: column; } }
@media print { .print-only { display: block; } }

/* =====================================================================================================
   "Sprint Control" layer (stage 12): deep navy with indigo / violet glow, glass cards, gradient icon
   tiles, bold sans headings; the photos share one grade (indigo shadows, orange glow of the gears).
   It overrides the tokens above, so every screen follows; the light theme keeps the same accents.
   ===================================================================================================== */
:root, [data-theme="light"] {
  --panel: #f3f4fb;
  --card: #ffffff;
  --card-solid: #ffffff;
  --card-2: #f1f2fa;
  --fg: #1d2240;
  --ink: #141833;
  --ink-2: #4f46e5;
  --muted: #6b7091;
  --faint: #9a9fbd;
  --line: #e4e6f3;
  --line-strong: #d3d6ea;
  --accent: #5b5bf0;
  --accent-2: #7c4dff;
  --accent-ink: #ffffff;
  --grad: linear-gradient(135deg, #4f6bff 0%, #7c4dff 55%, #a855f7 100%);
  --glow: 0 10px 30px -12px rgba(99, 91, 255, .55);
  --side: #0c1130;
  --side-2: rgba(99, 102, 241, .22);
  --side-ink: #eef0ff;
  --side-muted: rgba(220, 224, 255, .62);
  --sun: #f97316;
  --sun-2: rgba(249, 115, 22, .14);
  --sun-ink: #9a3f06;
  --p-green: #e3f6ec;  --i-green: #16a36a;
  --p-peach: #ffeadc;  --i-peach: #f26b2a;
  --p-lilac: #ece8ff;  --i-lilac: #7c4dff;
  --p-yellow: #fff4d6; --i-yellow: #e9a400;
  --p-teal: #e2f1ff;   --i-teal: #2f7cf6;
  --p-rose: #ffe4ef;   --i-rose: #e5487d;
  --ok: #12a26a;   --ok-soft: #e2f6ec;
  --warn: #d98a00; --warn-soft: #fff3d6;
  --bad: #e5484d;  --bad-soft: #ffe5e6;
  --na: #8e93b0;   --na-soft: #eff0f7;
  --shadow: 0 1px 2px rgba(20, 24, 60, .05), 0 10px 26px -16px rgba(30, 36, 90, .28);
  --input: #ffffff;
  --nav-dark: #5b5bf0;
  --nav-dark-ink: #ffffff;
  --serif: "Plex", "Segoe UI", Tahoma, system-ui, sans-serif;
  --radius: 16px;
  --glass-blur: none;
}
[data-theme="dark"] {
  --panel: #070b1f;
  --card: rgba(19, 25, 58, .72);
  --card-solid: #141a3d;
  --card-2: rgba(255, 255, 255, .04);
  --fg: #dfe3ff;
  --ink: #f4f5ff;
  --ink-2: #a5b4ff;
  --muted: #8f96c4;
  --faint: #626a9c;
  --line: rgba(140, 150, 255, .12);
  --line-strong: rgba(140, 150, 255, .22);
  --accent: #6c6cff;
  --accent-2: #8b5cf6;
  --accent-ink: #ffffff;
  --side: rgba(10, 14, 40, .86);
  --side-2: rgba(99, 102, 241, .22);
  --side-ink: #eef0ff;
  --side-muted: rgba(200, 206, 255, .6);
  --sun: #fb923c;
  --sun-2: rgba(251, 146, 60, .15);
  --sun-ink: #fed7aa;
  --p-green: rgba(34, 197, 130, .12);  --i-green: #22c582;
  --p-peach: rgba(251, 146, 60, .13);  --i-peach: #fb923c;
  --p-lilac: rgba(139, 92, 246, .15);  --i-lilac: #a78bfa;
  --p-yellow: rgba(250, 204, 21, .12); --i-yellow: #facc15;
  --p-teal: rgba(59, 130, 246, .15);   --i-teal: #60a5fa;
  --p-rose: rgba(236, 72, 153, .14);   --i-rose: #f472b6;
  --ok: #34d399;   --ok-soft: rgba(52, 211, 153, .13);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .13);
  --bad: #fb7185;  --bad-soft: rgba(251, 113, 133, .13);
  --na: #8f96c4;   --na-soft: rgba(255, 255, 255, .05);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 18px 40px -24px rgba(0, 0, 0, .8);
  --input: rgba(8, 12, 34, .7);
  --nav-dark: #6c6cff;
  --nav-dark-ink: #ffffff;
  --glow: 0 12px 34px -12px rgba(108, 108, 255, .7);
  --glass-blur: blur(14px) saturate(140%);
}

/* background: navy with soft indigo / violet light, as the reference */
[data-theme="dark"] body, [data-theme="dark"] .shell { background:
  radial-gradient(900px 600px at 0% 0%, rgba(79, 70, 229, .22), transparent 60%),
  radial-gradient(800px 600px at 100% 100%, rgba(147, 51, 234, .16), transparent 60%),
  radial-gradient(700px 500px at 100% 0%, rgba(37, 99, 235, .12), transparent 60%), #070b1f; background-attachment: fixed; }
[data-theme="light"] body, [data-theme="light"] .shell { background:
  radial-gradient(900px 500px at 0% 0%, rgba(99, 102, 241, .09), transparent 60%),
  radial-gradient(700px 500px at 100% 100%, rgba(168, 85, 247, .07), transparent 60%), #f3f4fb; background-attachment: fixed; }

/* headings: bold sans instead of the serif */
h1, h2, h3 { font-weight: 700; letter-spacing: -.01em; }
.page-head-text h1 { font-size: 26px; font-weight: 800; }
.stat-value, .tile-count, .group-hero h2, .group-hero .hero-count b, .auth-brand h1, .auth-photo h2, .station .pct { font-weight: 700; letter-spacing: -.02em; }

/* sidebar: navy glass, active item in the indigo gradient with a glow */
.side { background: var(--side); border-inline-end: 1px solid rgba(140, 150, 255, .12); backdrop-filter: var(--glass-blur); }
[data-theme="light"] .side { background: linear-gradient(180deg, #0f1538 0%, #0b1030 100%); }
.side-brand b { font-family: inherit; font-weight: 800; font-size: 22px; letter-spacing: .02em; }
.side-brand .logo-mark { color: #a5b4ff; filter: drop-shadow(0 0 10px rgba(124, 77, 255, .55)); }
.side-link { border-radius: 12px; }
.side-link:hover { background: rgba(124, 135, 255, .1); }
.side-link.is-active { background: var(--grad, linear-gradient(135deg, #4f6bff, #7c4dff)); color: #fff; box-shadow: 0 10px 24px -12px rgba(108, 108, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .18); }
.side-link.is-active .ico { color: #fff; filter: none; }
.side-sep { background: rgba(140, 150, 255, .12); }
.side-quote { position: relative; overflow: hidden; isolation: isolate; margin: auto 4px 0; padding: 18px 16px; border-radius: 16px; font-family: inherit; font-style: normal; font-weight: 600; font-size: 15px;
  border: 1px solid rgba(140, 150, 255, .25); background: linear-gradient(150deg, #4338ca 0%, #6d28d9 55%, #1e1b4b 100%); box-shadow: 0 16px 36px -18px rgba(109, 40, 217, .9); }
.side-quote::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(160deg, rgba(79, 70, 229, .78), rgba(12, 17, 48, .55) 60%, rgba(251, 146, 60, .25)); }
.side-quote .leaf { color: #fed7aa; }

/* cards: glass with a hairline border */
.card, .tile, .choice, .unit-tab { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: var(--glass-blur); border-radius: var(--radius); }
.card-head .head-ico { color: var(--ink-2); }
.table thead th { background: var(--card-2); color: var(--muted); font-weight: 600; text-transform: none; }
[data-theme="dark"] .table tbody tr:hover td { background: rgba(124, 135, 255, .05); }
.input, select.input, textarea.input { border-radius: 12px; background: var(--input); border-color: var(--line-strong); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.search-pill input { background: var(--input); border-color: var(--line-strong); height: 42px; }
[data-theme="dark"] .round-btn { background: rgba(255, 255, 255, .04); border-color: var(--line-strong); color: var(--fg); }

/* buttons: primary in the gradient */
.btn-sun, [data-theme="dark"] .btn-sun { background: var(--grad, linear-gradient(135deg, #4f6bff, #7c4dff)); color: #fff; border: 0; box-shadow: var(--glow); }
.btn-sun:hover, [data-theme="dark"] .btn-sun:hover { background: var(--grad, linear-gradient(135deg, #4f6bff, #7c4dff)); filter: brightness(1.08); }
[data-theme="dark"] .btn { background: rgba(108, 108, 255, .16); color: var(--ink); border: 1px solid rgba(140, 150, 255, .25); }
[data-theme="dark"] .btn-ghost { background: rgba(255, 255, 255, .04); border: 1px solid var(--line-strong); color: var(--fg); }
.tab.is-active { background: var(--grad, linear-gradient(135deg, #4f6bff, #7c4dff)); color: #fff; border-color: transparent; box-shadow: var(--glow); }

/* stat tiles: one card, a gradient icon square with its own glow, value and trend */
.stat, .stat.c1, .stat.c2, .stat.c3, .stat.c4, .stat.ok, .stat.bad, .stat.warn, .stat.sun { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: var(--glass-blur);
  flex-direction: row; align-items: center; gap: 14px; padding: 18px; }
.stat .stat-icon { width: 48px; height: 48px; border-radius: 14px; color: #fff !important; background-color: transparent !important; }
.stat .stat-icon .ico { width: 23px; height: 23px; }
.stat.c1 .stat-icon, .stat.ok .stat-icon { background: linear-gradient(135deg, #3b82f6, #4f46e5) !important; box-shadow: 0 10px 22px -10px rgba(59, 130, 246, .8); }
.stat.c2 .stat-icon, .stat.sun .stat-icon { background: linear-gradient(135deg, #fb923c, #ea580c) !important; box-shadow: 0 10px 22px -10px rgba(249, 115, 22, .8); }
.stat.c3 .stat-icon { background: linear-gradient(135deg, #22c55e, #0d9488) !important; box-shadow: 0 10px 22px -10px rgba(34, 197, 94, .7); }
.stat.c4 .stat-icon, .stat.bad .stat-icon, .stat.warn .stat-icon { background: linear-gradient(135deg, #a855f7, #ec4899) !important; box-shadow: 0 10px 22px -10px rgba(168, 85, 247, .8); }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 28px; }
.stat-hint { color: var(--muted); }

/* activity tiles: icon squares in the same family */
.tile-icon { border-radius: 13px; background: var(--p-lilac); color: var(--i-lilac); box-shadow: none; }
.tile:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

/* photo banners and the sign-in photo in the indigo grade */
.group-hero { border: 1px solid var(--line); }
.group-hero::before { background: linear-gradient(100deg, rgba(8, 11, 33, .94) 0%, rgba(30, 27, 90, .72) 45%, rgba(79, 70, 229, .12) 100%); }
[dir="rtl"] .group-hero::before { background: linear-gradient(260deg, rgba(8, 11, 33, .94) 0%, rgba(30, 27, 90, .72) 45%, rgba(79, 70, 229, .12) 100%); }
.group-hero .hero-ico { background: linear-gradient(135deg, rgba(99, 102, 241, .55), rgba(168, 85, 247, .45)); border-color: rgba(255, 255, 255, .25); }
.auth-photo::before { background: linear-gradient(180deg, rgba(8, 11, 33, .1) 0%, rgba(30, 27, 90, .55) 55%, rgba(8, 11, 33, .95) 100%); }
.auth-brand .logo-mark { background: var(--grad, linear-gradient(135deg, #4f6bff, #7c4dff)); color: #fff; box-shadow: var(--glow); }
.auth-split { background: var(--card-solid); }

/* progress bars, rings and badges in the new colours */
.bar-fill { background: var(--grad, linear-gradient(90deg, #4f6bff, #a855f7)); box-shadow: 0 0 12px -2px rgba(124, 77, 255, .6); }
.ring { background: var(--card-solid); box-shadow: 0 0 0 6px var(--card-solid), 0 12px 26px -14px rgba(0, 0, 0, .7); }
[data-theme="dark"] .ring { background: #111737; box-shadow: 0 0 0 6px #10163a, 0 0 26px -8px rgba(108, 108, 255, .45); }
.station.tone-ok .fg { filter: drop-shadow(0 0 4px rgba(52, 211, 153, .6)); }
.station.tone-warn .fg { filter: drop-shadow(0 0 4px rgba(251, 191, 36, .6)); }
.station.tone-bad .fg { filter: drop-shadow(0 0 4px rgba(251, 113, 133, .6)); }
.station::before { background: repeating-linear-gradient(90deg, rgba(124, 135, 255, .75) 0 12px, rgba(124, 135, 255, .14) 12px 24px); background-size: 24px 3px; }
.badge { border-radius: 8px; font-weight: 600; }
.view-all { color: var(--ink-2); }

/* the dashboard greeting: name, date and the gears photo fading in from the side */
.dash-hero { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; min-height: 150px; margin-bottom: 18px; padding: 26px 28px;
  border-radius: 20px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.dash-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--card-solid) 52%, color-mix(in srgb, var(--card-solid) 55%, transparent) 70%, transparent 100%); }
[dir="rtl"] .dash-hero::before { background: linear-gradient(270deg, var(--card-solid) 52%, color-mix(in srgb, var(--card-solid) 55%, transparent) 70%, transparent 100%); }
[data-theme="dark"] .dash-hero::before { background: linear-gradient(90deg, #0d1233 50%, rgba(13, 18, 51, .55) 70%, rgba(13, 18, 51, 0) 100%); }
[dir="rtl"][data-theme="dark"] .dash-hero::before, [data-theme="dark"] [dir="rtl"] .dash-hero::before { background: linear-gradient(270deg, #0d1233 50%, rgba(13, 18, 51, .55) 70%, rgba(13, 18, 51, 0) 100%); }
.dash-hero h2 { font-size: 28px; font-weight: 800; color: var(--ink); }
.dash-hero h2 .wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out 1s 2; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
.dash-hero p { color: var(--muted); margin-top: 6px; }
.dash-hero .hero-side { margin-inline-start: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; text-align: end; }
.dash-hero .hero-date { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; font-weight: 600; font-size: 13px; color: #fff;
  background: rgba(10, 14, 40, .55); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(8px); }
.dash-hero .hero-quote { font-size: 13px; font-style: italic; color: #ffe2c4; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
@media (max-width: 760px) { .dash-hero .hero-side { margin-inline-start: 0; align-items: flex-start; text-align: start; } }

/* scrollbar in the theme */
* { scrollbar-color: rgba(124, 135, 255, .35) transparent; }

/* no photos: glowing gradient orbs and a faint grid instead (dashboard greeting, group banners, sign-in panel) */
.orb { position: absolute; z-index: -1; border-radius: 50%; filter: blur(42px); opacity: .75; pointer-events: none; animation: drift 18s ease-in-out infinite alternate; }
.orb.o1 { width: 280px; height: 280px; inset-inline-end: -60px; top: -120px; background: #4f46e5; }
.orb.o2 { width: 220px; height: 220px; inset-inline-end: 160px; bottom: -150px; background: #9333ea; animation-delay: -6s; }
.orb.o3 { width: 140px; height: 140px; inset-inline-end: 40px; bottom: -40px; background: #f97316; opacity: .45; animation-delay: -11s; }
[data-theme="light"] .orb { opacity: .28; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-30px, 18px) scale(1.12); } }
.dash-hero::after, .group-hero .hero-bg, .auth-photo .hero-grid { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(140, 150, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(140, 150, 255, .07) 1px, transparent 1px); background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 100%); mask-image: linear-gradient(90deg, transparent 30%, #000 100%); transform: none; animation: none; }
[dir="rtl"] .dash-hero::after, [dir="rtl"] .group-hero .hero-bg { -webkit-mask-image: linear-gradient(270deg, transparent 30%, #000 100%); mask-image: linear-gradient(270deg, transparent 30%, #000 100%); }
.dash-hero::before, [dir="rtl"] .dash-hero::before, [data-theme="dark"] .dash-hero::before, [data-theme="dark"] [dir="rtl"] .dash-hero::before { display: none; }
.dash-hero { background: var(--card); }
.dash-hero .hero-date { white-space: nowrap; color: var(--ink); background: var(--card-2); border-color: var(--line-strong); }
.dash-hero .hero-quote { color: var(--muted); text-shadow: none; }

.group-hero { background: linear-gradient(110deg, #10153a 0%, #1e1b5e 55%, #3b1d7a 100%); min-height: 120px; }
.group-hero.tone-cement { background: linear-gradient(110deg, #10153a 0%, #172a66 55%, #1d4ed8 100%); }
.group-hero.tone-tools { background: linear-gradient(110deg, #10153a 0%, #3a1d5e 55%, #9a3412 100%); }
.group-hero::before, [dir="rtl"] .group-hero::before { background: radial-gradient(420px 220px at 85% 120%, rgba(249, 115, 22, .28), transparent 70%), radial-gradient(380px 260px at 70% -40%, rgba(168, 85, 247, .45), transparent 70%); }
[dir="rtl"] .group-hero::before { background: radial-gradient(420px 220px at 15% 120%, rgba(249, 115, 22, .28), transparent 70%), radial-gradient(380px 260px at 30% -40%, rgba(168, 85, 247, .45), transparent 70%); }
.group-hero:hover .hero-bg { transform: none; }

.auth-photo { background: linear-gradient(160deg, #0d1233 0%, #1e1b5e 50%, #3b1d7a 100%); }
.auth-photo::before { background: linear-gradient(180deg, transparent 40%, rgba(7, 11, 31, .85) 100%); }
.auth-photo .orb.o1 { top: -60px; inset-inline-end: -80px; width: 340px; height: 340px; }
.auth-photo .orb.o2 { bottom: 120px; inset-inline-end: 140px; }
.auth-photo .orb.o3 { bottom: 40px; inset-inline-end: 30px; }
.auth-photo .hero-grid { -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 80%); mask-image: linear-gradient(180deg, #000 0%, transparent 80%); }

/* area chart (records per month) */
.chart-card .chart-legend { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.chart-legend .k { display: inline-block; width: 16px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #4f8bff, #a855f7); }
.chart-legend .k-dash { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); margin-inline-start: 8px; }
.area-chart { display: block; width: 100%; height: 230px; overflow: visible; }
.area-chart .grid-l { stroke: var(--line); stroke-width: 1; }
.area-chart .ax { fill: var(--faint); font-size: 11px; font-family: inherit; }
.area-chart .line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; filter: drop-shadow(0 4px 10px rgba(108, 108, 255, .55)); vector-effect: non-scaling-stroke; }
.reveal:not(.is-in) .area-chart .line { stroke-dashoffset: 1; }
.area-chart .line { transition: stroke-dashoffset 1.8s var(--ease); }
.area-chart .area { opacity: 1; transition: opacity 1.2s .5s; }
.reveal:not(.is-in) .area-chart .area { opacity: 0; }
.area-chart .avg { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 5; opacity: .7; vector-effect: non-scaling-stroke; }
.area-chart .pt { fill: #c7d2fe; stroke: #6c6cff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.area-chart .pt.hot { fill: #fff; stroke: #a855f7; stroke-width: 3; filter: drop-shadow(0 0 6px rgba(168, 85, 247, .9)); }
[data-theme="light"] .area-chart .pt { fill: #fff; }

/* status ring */
.donut-card { display: flex; flex-direction: column; }
.donut-wrap { position: relative; width: 170px; height: 170px; margin: 6px auto 14px; }
.donut { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 14; }
.donut .track { stroke: var(--card-2); }
[data-theme="dark"] .donut .track { stroke: rgba(255, 255, 255, .06); }
.donut .seg { stroke-dasharray: var(--len) 100; stroke-dashoffset: var(--off); stroke-linecap: butt; transition: stroke-dasharray 1.3s var(--ease) var(--d); }
.reveal:not(.is-in) .donut .seg { stroke-dasharray: 0 100; }
.donut .seg-ok { stroke: #34d399; filter: drop-shadow(0 0 6px rgba(52, 211, 153, .55)); }
.donut .seg-warn { stroke: #fbbf24; filter: drop-shadow(0 0 6px rgba(251, 191, 36, .5)); }
.donut .seg-bad { stroke: #f472b6; filter: drop-shadow(0 0 6px rgba(244, 114, 182, .55)); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center strong { font-size: 32px; font-weight: 800; color: var(--ink); line-height: 1; }
.donut-center small { color: var(--muted); font-size: 12px; margin-top: 4px; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.donut-legend li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.donut-legend b { color: var(--ink); }
.dash-hero .hero-side { flex: none; } .dash-hero .hero-date .ico { width: 16px; height: 16px; }
.btn.btn-sun, [data-theme="dark"] .btn.btn-sun { background: var(--grad, linear-gradient(135deg, #4f6bff, #7c4dff)); color: #fff; border: 0; box-shadow: var(--glow); }

/* stage 15: plain text buttons (roles matrix headings) */
.link-btn { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: inherit; }
.link-btn:hover { color: var(--accent); }

/* DEMO band (demonstration database) */
.demo-banner { position: fixed; inset-inline: 0; top: 0; z-index: 70; height: 28px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px;
  background: repeating-linear-gradient(135deg, #facc15 0 18px, #fde047 18px 36px); border-bottom: 2px solid #000; color: #000; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; }
.demo-banner .demo-tag { background: #000; color: #facc15; border-radius: 4px; padding: 1px 6px; }
.is-demo { padding-top: 28px; }
.is-demo .side-inner { top: 54px; }
.is-demo .drawer { top: 28px; }
@media print { .demo-banner { position: static; -webkit-print-color-adjust: exact; print-color-adjust: exact; } .is-demo { padding-top: 0; } }

/* ============ Plant scene (dashboard hero) ============ */
.plant { margin-bottom: 22px; animation: ps-up .7s cubic-bezier(.2, .7, .2, 1) both; }
.plant-stage { position: relative; overflow: hidden; isolation: isolate; border-radius: 24px; min-height: 380px; display: flex; flex-direction: column; justify-content: flex-end;
  background: #070b1c; border: 1px solid rgba(167, 139, 250, .25); box-shadow: 0 30px 60px -20px rgba(15, 18, 60, .55); color: #eef0fb; }
.plant-canvas { position: relative; width: 100%; aspect-ratio: 1800 / 800; }
.plant-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.plant-top { z-index: 2; }
.plant-shade { z-index: 1; }
.plant-shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 11, 28, .86), rgba(7, 11, 28, .25) 34%, rgba(7, 11, 28, 0) 52%), linear-gradient(0deg, rgba(7, 11, 28, .85), rgba(7, 11, 28, 0) 26%); }
.plant-top { position: absolute; inset: clamp(16px, 2.4vw, 30px) clamp(16px, 2.4vw, 32px) auto; display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; justify-content: space-between; }
.plant-head { min-width: 0; max-width: 640px; }
.plant-live { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: rgba(52, 211, 153, .14); border: 1px solid rgba(52, 211, 153, .35); color: #6ee7b7; }
.plant-live .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; animation: ps-blink 1.6s infinite; }
.plant-head h2 { margin: 12px 0 4px; font-size: clamp(26px, 3.4vw, 46px); line-height: 1.12; font-weight: 800; color: #fff; text-shadow: 0 4px 30px rgba(0, 0, 0, .6); letter-spacing: -.01em; }
.plant-head p { margin: 0; color: #d6d9ee; font-size: clamp(13px, 1.15vw, 16px); text-shadow: 0 2px 12px rgba(0, 0, 0, .7); }
.plant-side { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.plant-lines, .plant-fig { background: rgba(11, 16, 36, .62); border: 1px solid rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: 14px; }
.plant-lines { display: flex; gap: 4px; padding: 4px; }
.plant-lines a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 10px; color: #c7cbe6; font-weight: 700; font-size: 13.5px; text-decoration: none; }
.plant-lines a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.plant-lines a.on { background: #7c3aed; color: #fff; }
.plant-fig { padding: 7px 14px; min-width: 92px; }
.plant-fig span { display: block; font-size: 12px; color: #c7cbe6; }
.plant-fig strong { display: block; font-size: 22px; font-weight: 700; color: #fff; }
.plant .tone-ok { --tone: #34d399; } .plant .tone-warn { --tone: #fbbf24; } .plant .tone-bad { --tone: #f87171; } .plant .tone-na { --tone: #a5adcf; } .plant .tone-accent { --tone: #c4b5fd; }
.plant-fig strong[class*="tone-"], .plant-nums dd[class*="tone-"] { color: var(--tone); }
.plant-spot { position: absolute; z-index: 3; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .22); background: rgba(11, 16, 36, .72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; font: inherit; font-size: 13px; font-weight: 700;
  white-space: nowrap; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); transition: background .2s, border-color .2s, transform .2s; }
[dir="rtl"] .plant-spot { padding: 5px 6px 5px 12px; }
.plant-spot:hover { transform: translate(-50%, -50%) scale(1.06); border-color: rgba(255, 255, 255, .45); }
.plant-spot.on { background: rgba(124, 58, 237, .9); border-color: #c4b5fd; }
.plant-spot:focus-visible { outline: 3px solid #fde047; outline-offset: 3px; }
.plant-spot .ring { position: relative; width: 28px; height: 28px; flex: none; display: grid; place-items: center; }
.plant-spot .ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--tone); animation: ps-ring 1.8s ease-out infinite; }
.plant-spot .ring span { width: 13px; height: 13px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 14px var(--tone); }
.plant-spot .fig { color: var(--tone); }
.plant-spot.on .fig { color: #fff; }
.plant-bar { position: absolute; inset: auto clamp(12px, 2vw, 24px) clamp(12px, 1.6vw, 20px); z-index: 2; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; }
.plant-legend { display: flex; align-self: center; padding: 8px 14px; border-radius: 12px; background: rgba(11, 16, 36, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: #c7cbe6; }
.plant-legend li { display: inline-flex; align-items: center; gap: 6px; }
.plant-legend li span { width: 9px; height: 9px; border-radius: 50%; background: var(--tone); }
.plant-panel { position: relative; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 14px; animation: ps-up .45s cubic-bezier(.2, .7, .2, 1) both; }
.plant-panel[hidden] { display: none; }
.plant-panel-main { flex: 2 1 520px; min-width: 0; padding: 20px; border-radius: 20px; background: var(--card-solid); border: 1px solid var(--line); box-shadow: 0 24px 50px -18px rgba(15, 18, 60, .45); }
.plant-panel-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.plant-panel-head h3 { margin: 0 0 6px; font-size: 20px; }
.plant-panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.plant-tone { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--tone); background: color-mix(in srgb, var(--tone) 16%, transparent); }
.plant-tone span { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }
.plant .plant-tone.tone-ok { --tone: var(--ok); } .plant .plant-tone.tone-warn { --tone: var(--warn); } .plant .plant-tone.tone-bad { --tone: var(--bad); } .plant .plant-tone.tone-na { --tone: var(--muted); }
.plant-progress { height: 8px; margin: 14px 0 4px; border-radius: 8px; background: var(--line); overflow: hidden; }
.plant-progress span { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #7c3aed, #a78bfa); animation: ps-grow 1s cubic-bezier(.2, .7, .2, 1) both; transform-origin: 0 50%; }
[dir="rtl"] .plant-progress span { transform-origin: 100% 50%; }
.plant-acts { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.plant-acts li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 3%, transparent); transition: border-color .2s, transform .2s; }
.plant-acts li:hover { border-color: #a78bfa; transform: translateY(-2px); }
.plant-acts a { flex: 1; min-width: 0; color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.plant-act-name { font-weight: 700; font-size: 14px; }
.plant-nums { flex: 1 1 260px; min-width: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plant-nums div { padding: 16px; border-radius: 18px; background: var(--card-solid); border: 1px solid var(--line); box-shadow: 0 24px 50px -24px rgba(15, 18, 60, .4); }
.plant-nums dt { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.plant-nums dd { margin: 6px 0 0; font-size: 28px; font-weight: 700; line-height: 1.1; }
.plant .plant-nums dd.tone-ok { color: var(--ok); } .plant .plant-nums dd.tone-bad { color: var(--bad); }
/* motion of the drawing */
.ps-belt { stroke-dasharray: 6 12; animation: ps-belt 1.1s linear infinite; }
.ps-smoke, .ps-steam { transform-box: fill-box; transform-origin: center; }
.ps-smoke { animation: ps-smoke 7s linear infinite; opacity: 0; }
.ps-steam { animation: ps-steam 5s linear infinite; opacity: 0; }
.ps-d1 { animation-delay: 1s !important; } .ps-d2 { animation-delay: 1.75s !important; } .ps-d3 { animation-delay: 3.5s !important; } .ps-d4 { animation-delay: 5.25s !important; }
.ps-hot { animation: ps-hot 2.2s ease-in-out infinite; } .ps-fast { animation-duration: .8s; }
.ps-blink { animation: ps-blink 2s infinite; }
.ps-win { animation: ps-win 6s ease-in-out infinite; }
.ps-stars circle { animation: ps-twinkle 4s ease-in-out infinite; } .ps-stars circle:nth-child(2n) { animation-delay: 1.3s; } .ps-stars circle:nth-child(3n) { animation-delay: 2.4s; }
.ps-truck { animation: ps-truck 14s ease-in-out infinite; }
@keyframes ps-smoke { 0% { transform: translate(0, 0) scale(.5); opacity: 0 } 15% { opacity: .55 } 100% { transform: translate(-120px, -150px) scale(2.6); opacity: 0 } }
@keyframes ps-steam { 0% { transform: translate(0, 0) scale(.4); opacity: 0 } 20% { opacity: .4 } 100% { transform: translate(-60px, -90px) scale(2); opacity: 0 } }
@keyframes ps-hot { 0%, 100% { opacity: .72 } 50% { opacity: 1 } }
@keyframes ps-blink { 0%, 60%, 100% { opacity: .15 } 70%, 90% { opacity: 1 } }
@keyframes ps-twinkle { 0%, 100% { opacity: .2 } 50% { opacity: .9 } }
@keyframes ps-win { 0%, 100% { opacity: .5 } 50% { opacity: .9 } }
@keyframes ps-belt { to { stroke-dashoffset: -36 } }
@keyframes ps-ring { 0% { transform: scale(.6); opacity: .9 } 100% { transform: scale(2.1); opacity: 0 } }
@keyframes ps-truck { 0%, 100% { transform: translateX(0) } 50% { transform: translateX(-40px) } }
@keyframes ps-up { from { opacity: 0; transform: translateY(12px) } }
@keyframes ps-grow { from { transform: scaleX(0) } }
@media (min-width: 761px) and (max-width: 1000px) { .plant-spot .name { display: none; } .plant-side .plant-fig { display: none; } }
@media (max-width: 760px) {
  .plant-stage { min-height: 0; justify-content: flex-start; }
  .plant-top { position: relative; inset: auto; padding: 18px 16px 6px; order: -1; }
  .plant-scroll { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .plant-scroll::-webkit-scrollbar { display: none; }
  .plant-canvas { width: 900px; }
  .plant-shade { display: none; }
  .plant-spot .name { display: inline; font-size: 12px; } .plant-spot .fig { display: none; }
  .plant-bar { position: relative; inset: auto; padding: 10px 12px 14px; }
  .plant-side .plant-fig { display: block; flex: 1 1 80px; }
  .plant-lines { flex: 1 1 100%; overflow-x: auto; }
  .plant-legend { display: none; }
}
@media (prefers-reduced-motion: reduce) { .plant *, .plant *::before { animation: none !important; } .ps-smoke, .ps-steam { opacity: .3; } }
@media print { .plant-stage { min-height: 0; } .plant-spot .ring::before { display: none; } .plant-panel[hidden] { display: none; } }

/* ============ Login: full-screen plant ============ */
.login-bg { position: fixed; inset: 0; z-index: 0; background: #070b1c; overflow: hidden; }
.login-bg .plant-art { position: absolute; inset: 0; width: 100%; height: 100%; animation: login-zoom 40s ease-in-out infinite alternate; transform-origin: 55% 70%; }
.login-shade { position: absolute; inset: 0; background:
  linear-gradient(90deg, rgba(7, 11, 28, .2) 0%, rgba(7, 11, 28, .1) 45%, rgba(7, 11, 28, .78) 100%),
  linear-gradient(180deg, rgba(7, 11, 28, .7) 0%, rgba(7, 11, 28, 0) 30%, rgba(7, 11, 28, 0) 70%, rgba(7, 11, 28, .8) 100%); }
[dir="rtl"] .login-shade { background:
  linear-gradient(270deg, rgba(7, 11, 28, .2) 0%, rgba(7, 11, 28, .1) 45%, rgba(7, 11, 28, .78) 100%),
  linear-gradient(180deg, rgba(7, 11, 28, .7) 0%, rgba(7, 11, 28, 0) 30%, rgba(7, 11, 28, 0) 70%, rgba(7, 11, 28, .8) 100%); }
.login-page { position: relative; z-index: 1; min-height: 100vh; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); align-items: center; gap: clamp(24px, 5vw, 80px); padding: clamp(70px, 8vh, 100px) clamp(20px, 5vw, 80px) clamp(24px, 6vh, 60px); color: #fff; }
.login-hero { align-self: start; max-width: 720px; animation: ps-up .8s cubic-bezier(.2, .7, .2, 1) both; }
.login-live { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; background: rgba(52, 211, 153, .14); border: 1px solid rgba(52, 211, 153, .35); color: #6ee7b7; }
.login-live .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; animation: ps-blink 1.6s infinite; }
.login-hero h2 { margin: 18px 0 10px; font-size: clamp(32px, 4.4vw, 62px); line-height: 1.08; font-weight: 800; letter-spacing: -.02em; text-shadow: 0 6px 40px rgba(0, 0, 0, .6); }
.login-hero h2 span { display: block; background: linear-gradient(90deg, #fde68a, #fb923c 45%, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero p { margin: 16px 0 0; max-width: 560px; color: #d6d9ee; font-size: clamp(14px, 1.2vw, 17px); line-height: 1.7; text-shadow: 0 2px 16px rgba(0, 0, 0, .7); }
.login-flow { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 0; align-items: center; }
.login-flow li { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(11, 16, 36, .62); border: 1px solid rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: ps-up .6s cubic-bezier(.2, .7, .2, 1) both, login-step 7s ease-in-out infinite; animation-delay: calc(.3s + var(--i) * .08s), calc(var(--i) * 1s); }
[dir="rtl"] .login-flow li { padding: 8px 8px 8px 14px; }
.login-flow li:not(:last-child) { margin-inline-end: 26px; }
.login-flow li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: calc(100% + 4px); top: 50%; width: 18px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(251, 191, 36, .1), #fbbf24, rgba(251, 191, 36, .1)); background-size: 200% 100%; animation: login-flowline 1.4s linear infinite; }
.login-flow .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(167, 139, 250, .22); color: #ddd6fe; }
.login-flow .ic .ico { width: 15px; height: 15px; }
.login-card.auth-card { width: 100%; max-width: 440px; justify-self: end; padding: 34px 32px 28px; border-radius: 24px; animation: ps-up .7s cubic-bezier(.2, .7, .2, 1) both .1s;
  background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); border: 1px solid rgba(255, 255, 255, .6); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .6); color: var(--ink); }
[data-theme="dark"] .login-card.auth-card { background: rgba(14, 19, 44, .78); border-color: rgba(167, 139, 250, .28); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-inline-end: 46px; width: 100%; }
.pw-eye { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover, .pw-eye[aria-pressed="true"] { color: var(--accent, #7c3aed); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.auth-top .btn, .auth-top a { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
@keyframes login-zoom { from { transform: scale(1) } to { transform: scale(1.08) translateX(-1.5%) } }
@keyframes login-flowline { to { background-position: -200% 0 } }
@keyframes login-step { 0%, 12%, 100% { border-color: rgba(255, 255, 255, .16); box-shadow: none } 4% { border-color: #fbbf24; box-shadow: 0 0 0 4px rgba(251, 191, 36, .18) } }
@media (max-width: 960px) and (min-width: 641px) {
  .login-page { grid-template-columns: 1fr; align-items: start; gap: 22px; padding-top: 80px; }
  .login-flow { display: none; }
  .login-card.auth-card { justify-self: center; }
  .login-shade { background: linear-gradient(180deg, rgba(7, 11, 28, .75), rgba(7, 11, 28, .35) 40%, rgba(7, 11, 28, .85)) !important; }
}
.login-wave { display: none; }
/* phones: plant on top, a wavy sheet with the form underneath */
@media (max-width: 640px) {
  .login-bg { position: absolute; height: 46vh; min-height: 300px; }
  .login-bg .plant-art { animation: none; }
  .login-shade { background: linear-gradient(180deg, rgba(7, 11, 28, .55), rgba(7, 11, 28, .1) 45%, rgba(7, 11, 28, .45)) !important; }
  .login-page { display: block; padding: 0; min-height: 100vh; width: 100vw; margin-inline: calc(50% - 50vw); overflow-x: hidden; }
  .login-hero { position: relative; height: 40vh; min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px 20px 30px; box-sizing: border-box; }
  .login-hero p, .login-flow { display: none; }
  .login-card.auth-card { position: relative; max-width: none; margin: 0; min-height: 60vh; border-radius: 0; border: 0; box-shadow: none; padding: 20px 26px 40px;
    background: var(--login-sheet); -webkit-backdrop-filter: none; backdrop-filter: none; --login-sheet: #eef0f7; animation: ps-up .6s cubic-bezier(.2, .7, .2, 1) both; }
  [data-theme="dark"] .login-card.auth-card { --login-sheet: #0e1330; background: var(--login-sheet); }
  .login-wave { display: block; position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); width: 100%; height: 56px; fill: var(--login-sheet); filter: drop-shadow(0 -6px 10px rgba(7, 11, 28, .25)); }
  .login-card .field label { font-size: 12.5px; }
  .login-card .pw-wrap .in-ico { display: grid; place-items: center; position: absolute; inset-inline-start: 0; top: 50%; transform: translateY(-50%); width: 26px; color: #7c3aed; pointer-events: none; }
  .login-card .pw-wrap .in-ico .ico { width: 17px; height: 17px; }
  .login-card .input { height: 46px; border: 0; border-bottom: 1.5px solid color-mix(in srgb, #7c3aed 45%, transparent); border-radius: 0; background: transparent !important; padding-inline-start: 34px; box-shadow: none !important; }
  .login-card .input:focus { border-bottom-color: #7c3aed; outline: none; }
  .login-card .btn-block { height: 48px; border-radius: 12px; margin-top: 8px; }
  .auth-top { top: 12px; inset-inline-end: 12px; }
}

@media (prefers-reduced-motion: reduce) { .login-bg *, .login-page * { animation: none !important; } }

/* compact login card (laptop and desktop): small plant header with a wave, underlined fields */
.login-card.auth-card { --login-sheet: #f3f4fa; max-width: 380px; padding: 0; overflow: hidden; background: var(--login-sheet); -webkit-backdrop-filter: none; backdrop-filter: none; }
[data-theme="dark"] .login-card.auth-card { --login-sheet: #0e1330; background: var(--login-sheet); }
.login-card-head { position: relative; height: 150px; overflow: hidden; isolation: isolate; background: #070b1c; }
.login-card-head .plant-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.login-card-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(7, 11, 28, .25), rgba(7, 11, 28, .55)); }
.login-card-head .auth-brand { margin: 0; padding-top: 22px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.login-card-head .auth-brand .logo-mark { width: 40px; height: 40px; padding: 8px; margin: 0; border-radius: 12px; }
.login-card-head .auth-brand h1 { color: #fff; font-size: 24px; text-shadow: 0 2px 14px rgba(0, 0, 0, .6); }
.login-card-wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 46px; fill: var(--login-sheet); }
.login-intro { text-align: center; padding: 0 26px; margin-top: -6px; }
.login-welcome { margin: 0; font-size: 22px; font-weight: 800; color: #6d28d9; }
[data-theme="dark"] .login-welcome { color: #c4b5fd; }
.login-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.login-card form { padding: 16px 26px 0; gap: 12px; }
.login-card .alert { margin: 12px 26px 0; }
.login-card .field label { font-size: 12.5px; }
.login-card .pw-wrap .in-ico { display: grid; place-items: center; position: absolute; inset-inline-start: 0; top: 50%; transform: translateY(-50%); width: 26px; color: #7c3aed; pointer-events: none; }
[data-theme="dark"] .login-card .pw-wrap .in-ico { color: #a78bfa; }
.login-card .pw-wrap .in-ico .ico { width: 17px; height: 17px; }
.login-card .input { height: 42px; border: 0; border-bottom: 1.5px solid color-mix(in srgb, #7c3aed 40%, transparent); border-radius: 0; background: transparent !important; padding-inline-start: 34px; box-shadow: none !important; }
.login-card .input:focus { border-bottom-color: #7c3aed; outline: none; }
.login-card .check { font-size: 13px; }
.login-card .btn-block { height: 44px; border-radius: 12px; margin-top: 4px; }
.login-card > .help { margin: 12px 26px 22px !important; font-size: 11.5px; }
.login-card .auth-quote { display: none; }
@media (max-width: 640px) {
  .login-card.auth-card { max-width: none; overflow: visible; padding: 20px 26px 40px; }
  .login-card-head { height: auto; background: none; overflow: visible; }
  .login-card-head .plant-art, .login-card-shade, .login-card-wave { display: none; }
  .login-card-head .auth-brand { padding-top: 0; flex-direction: column; gap: 6px; }
  .login-card-head .auth-brand h1 { color: var(--ink); text-shadow: none; font-size: 20px; }
  .login-intro { margin-top: 10px; padding: 0; }
  .login-welcome { font-size: 24px; }
  .login-card form { padding: 18px 0 0; }
  .login-card .alert { margin: 12px 0 0; }
  .login-card > .help { margin: 14px 0 0 !important; }
  .login-card .input { height: 46px; }
}
/* smaller login box on laptops */
@media (min-width: 641px) {
  .login-page { align-items: center; padding-top: clamp(56px, 7vh, 90px); padding-bottom: 24px; }
  .login-card.auth-card { max-width: 340px; border-radius: 20px; }
  .login-card-head { height: 104px; }
  .login-card-head .auth-brand { padding-top: 16px; gap: 8px; }
  .login-card-head .auth-brand .logo-mark { width: 34px; height: 34px; padding: 7px; border-radius: 10px; }
  .login-card-head .auth-brand h1 { font-size: 20px; }
  .login-card-wave { height: 34px; }
  .login-intro { margin-top: -2px; padding: 0 22px; }
  .login-welcome { font-size: 18px; }
  .login-sub { font-size: 11.5px; margin-top: 2px; }
  .login-card form { padding: 10px 22px 0; gap: 8px; }
  .login-card .field { gap: 2px; }
  .login-card .field label { font-size: 11.5px; }
  .login-card .input { height: 36px; font-size: 14px; }
  .login-card .pw-eye { width: 32px; height: 32px; }
  .login-card .check { font-size: 12.5px; margin: 0 0 2px !important; }
  .login-card .btn-block { height: 40px; font-size: 14px; }
  .login-card > .help { margin: 10px 22px 16px !important; font-size: 11px; }
}
/* the process chips sit at the bottom, over the ground, so the kiln stays in view */
@media (min-width: 961px) {
  .login-hero { align-self: stretch; display: flex; flex-direction: column; min-height: calc(100vh - clamp(56px, 7vh, 90px) - 24px); box-sizing: border-box; padding-bottom: 6px; }
  .login-flow { margin-top: auto; gap: 8px 0; }
  .login-live { align-self: flex-start; }
  .login-flow li { padding: 6px 12px 6px 6px; font-size: 12px; }
  [dir="rtl"] .login-flow li { padding: 6px 6px 6px 12px; }
  .login-flow li:not(:last-child) { margin-inline-end: 20px; }
  .login-flow li:not(:last-child)::after { width: 14px; inset-inline-start: calc(100% + 3px); }
  .login-flow .ic { width: 24px; height: 24px; }
}

/* formula results (burner audit): coloured values, ƒx tag; tones from limits / guide values */
:root { --fx: #6d28d9; --fx-bg: #f3effe; }
[data-theme="dark"] { --fx: #b08cff; --fx-bg: rgba(139, 92, 246, .14); }
.fx-val { color: var(--fx); font-weight: 700; }
.fx-val.fx-ok { color: var(--ok); } .fx-val.fx-warn { color: var(--warn); } .fx-val.fx-bad { color: var(--bad); }
.fx-tag { display: inline-block; margin-inline-start: 4px; padding: 0 5px; border-radius: 6px; font-style: italic; font-weight: 700; font-size: 10.5px; line-height: 16px; color: var(--fx); background: var(--fx-bg); vertical-align: 1px; }
.fx-box { background: var(--fx-bg); border: 1px dashed color-mix(in srgb, var(--fx) 35%, transparent); }
.result.fx-result strong { color: var(--fx); }
.result.fx-result.main strong, .result.fx-result.dark strong { color: inherit; }
.result.fx-ok { box-shadow: inset 0 -3px 0 var(--ok); } .result.fx-ok strong { color: var(--ok) !important; }
.result.fx-warn { box-shadow: inset 0 -3px 0 var(--warn); } .result.fx-warn strong { color: var(--warn) !important; }
.result.fx-bad { box-shadow: inset 0 -3px 0 var(--bad); } .result.fx-bad strong { color: var(--bad) !important; }
/* messages that lead to their field */
a.alert-go { display: flex; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s; }
a.alert-go:hover { transform: translateX(-2px); box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .3); }
[dir="ltr"] a.alert-go:hover { transform: translateX(2px); }
.alert-go-arrow { margin-inline-start: auto; font-weight: 700; opacity: .7; }
[dir="rtl"] .alert-go-arrow { transform: scaleX(-1); }
.goto-flash { animation: goto-flash 1.8s ease-out; }
@keyframes goto-flash { 0%, 40% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 45%, transparent); border-color: var(--bad); } 100% { box-shadow: none; } }
[id^="burner-radial-"]:target, [id^="burner-gas-"]:target { color: var(--bad); animation: goto-flash 1.8s ease-out; border-radius: 8px; }

/* burner audit inputs: per-audit values clear, line data calm */
:root { --var: #d97706; --var-bg: #fffaf0; --var-line: #f5c26b; --const-bg: #f6f8fc; --const-line: #e3e8f2; --const-ink: #475069; }
[data-theme="dark"] { --var: #fbbf24; --var-bg: rgba(251, 191, 36, .07); --var-line: rgba(251, 191, 36, .45); --const-bg: rgba(255, 255, 255, .025); --const-line: rgba(255, 255, 255, .08); --const-ink: #b9c0d8; }
.inp-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin: -6px 0 18px; padding: 10px 14px; border-radius: 12px; background: var(--card-solid, var(--card)); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.inp-legend span { display: inline-flex; align-items: center; gap: 7px; }
.inp-legend .sw { display: inline-grid; place-items: center; width: 22px; height: 16px; border-radius: 5px; font-style: italic; font-weight: 700; font-size: 10px; }
.sw-var { background: var(--var-bg); border: 1.5px solid var(--var-line); }
.sw-const { background: var(--const-bg); border: 1px solid var(--const-line); }
.sw-fx { background: var(--fx-bg); color: var(--fx); border: 1px dashed color-mix(in srgb, var(--fx) 40%, transparent); }
.inp-var .input { background: var(--var-bg); border: 1.5px solid var(--var-line); font-weight: 600; }
.inp-var .input:focus { border-color: var(--var); box-shadow: 0 0 0 3px color-mix(in srgb, var(--var) 18%, transparent); }
.inp-var .input:placeholder-shown { background-image: linear-gradient(90deg, color-mix(in srgb, var(--var) 10%, transparent), transparent 60%); }
.inp-const .input { background: var(--const-bg); border: 1px solid var(--const-line); color: var(--const-ink); }
.inp-const .input:focus { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.inp-const.is-changed .input { border-style: dashed; border-color: var(--fx); color: var(--ink); }
.inp-kind { display: inline-block; margin-inline-start: 6px; padding: 0 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; line-height: 17px; color: var(--var); background: color-mix(in srgb, var(--var) 12%, transparent); vertical-align: 1px; }
.inp-kind.inp-changed { color: var(--fx); background: var(--fx-bg); }
td.inp-var, td.inp-const { padding-top: 8px; padding-bottom: 8px; }
/* formula cards under each section */
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 14px; }
.fx-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--fx-bg); border: 1px dashed color-mix(in srgb, var(--fx) 35%, transparent); min-width: 0; }
.fx-card-wide { grid-column: span 2; }
.fx-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fx-label .fx-tag { margin: 0; }
.fx-card strong { font-size: 20px; line-height: 1.2; }
.fx-formula { display: block; font: 11.5px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; color: color-mix(in srgb, var(--fx) 75%, var(--muted)); white-space: normal; overflow-wrap: anywhere; text-align: start; }
[dir="rtl"] .fx-formula { text-align: right; }
@media (max-width: 640px) { .fx-card-wide { grid-column: auto; } }
/* burner operational data: channels table + stand-alone estimation side by side, as the sheet */
.op-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.op-side { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 2%, transparent); }
.op-est { margin-top: 12px; }
.op-est td, .op-est th { padding: 7px 8px; }
.op-est td.num { font-size: 15px; }
.op-table td [data-flow-used] { font-size: 15px; }
.fx-formula-text { font-family: inherit; font-size: 12px; }
@media (max-width: 900px) { .op-grid { grid-template-columns: 1fr; } }

/* formulas next to each value: red */
:root { --fx-formula: #c0262d; } [data-theme="dark"] { --fx-formula: #ff7b7b; }
.fx-formula, .fx-formula-text, .fx-f { color: var(--fx-formula) !important; }
.fx-f { display: block; font: 11px/1.4 ui-monospace, Consolas, monospace; font-weight: 500; margin-top: 2px; white-space: normal; }

/* SEC11 hot meal chart */
.hm-card{background:var(--card-solid);border:1px solid var(--line);border-radius:14px;padding:10px 8px 4px}
.hm-chart .hm-g{stroke:var(--line)}
.hm-chart .hm-t{fill:var(--ink-2)}
.hm-chart .hm-dot{fill:var(--ink);stroke:var(--card-solid)}
.hm-zones{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.hm-zones li{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--line);border-radius:10px;font-size:.86rem;color:var(--ink-2)}
.hm-zones li i{flex:none;width:22px;height:4px;border-radius:3px;background:var(--zc)}
.hm-zones li b{margin-inline-start:auto;font-size:.75rem;color:var(--zc);white-space:nowrap}
.hm-zones li.is-on{border-color:var(--zc);color:var(--ink);background:color-mix(in srgb,var(--zc) 10%,transparent);font-weight:600}
.hm-chart .hm-lbl{stroke:var(--card-solid)}

/* SEC11 form tables: inputs in the row, clinker-basis results under it, formulas in red */
.table.vt { border-collapse: separate; border-spacing: 0; min-width: 880px; }
.table.vt thead th { font-size: 11.5px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.table.vt thead th small { text-transform: none; letter-spacing: 0; }
.table.vt tr.vt-sub th { font-size: 10.5px; text-transform: none; color: var(--fx); background: var(--fx-bg); padding-top: 4px; padding-bottom: 4px; font-weight: 600; }
.table.vt th.vt-row { text-align: start; font-weight: 700; color: var(--ink); white-space: nowrap; vertical-align: middle; min-width: 150px; }
.table.vt td { vertical-align: top; padding: 6px 6px; min-width: 96px; }
.table.vt td.inp-var .input { width: 100%; min-width: 80px; }
.table.vt tr.vt-in td, .table.vt tr.vt-in th { border-bottom: 0; padding-bottom: 3px; }
.table.vt tr.vt-out td { padding-top: 2px; padding-bottom: 10px; }
.table.vt td.vt-res > div { background: var(--fx-bg); border: 1px dashed color-mix(in srgb, var(--fx) 30%, transparent); border-radius: 10px; padding: 6px 9px; min-height: 34px; transition: box-shadow .4s; }
.table.vt td.vt-res .fx-val { display: block; font-size: 13.5px; }
.table.vt td.vt-res .fx-val small { font-weight: 500; color: var(--muted); font-size: 10.5px; }
.table.vt td.vt-res .fx-f { font-size: 10.5px; line-height: 1.35; margin-top: 2px; text-align: start; }
.table.vt td.vt-none, .table.vt td.vt-unit { color: var(--faint, var(--muted)); text-align: center; vertical-align: middle; }
.table.vt td.vt-unit { font-size: 12px; white-space: nowrap; min-width: 70px; }
.table.vt tr.vt-total th, .table.vt tr.vt-total td { border-top: 2px solid var(--line-strong, var(--line)); padding-top: 10px; }
.table.vt tr.vt-total .fx-val { font-size: 15px; }
.table.vt tr.vt-diff th, .table.vt tr.vt-diff td { border-top: 1px solid var(--line); }
.table.vt .vt-fuel { display: grid; grid-template-columns: 62px minmax(90px, 1fr) auto; gap: 6px; align-items: center; min-width: 230px; }
.table.vt tr.vt-in + tr.vt-out td { border-bottom: 1px solid var(--line); }
.vt-flash { box-shadow: 0 0 0 3px color-mix(in srgb, var(--fx) 25%, transparent); }
.table.vt .vt-note { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.3; margin-top: 1px; }
.table.vt .vt-note.is-warn { color: var(--warn); font-weight: 600; }
.table.vt td { min-width: 82px; padding: 5px 4px; }
.table.vt th.vt-row { white-space: normal; min-width: 120px; max-width: 170px; line-height: 1.3; }
.table.vt .vt-fuel { grid-template-columns: 56px minmax(70px, 1fr) auto; min-width: 190px; gap: 4px; }
.table.vt td.vt-res > div { padding: 5px 7px; }
.table.vt .input.sm { padding-inline: 8px; }

/* SEC11 form (stage 32): results with their formula in red under each block */
.vol-fx .fx-val { display: block; font-size: 18px; line-height: 1.25; }
.vol-fx .fx-val small { font-size: 11px; font-weight: 500; color: var(--muted); }
.vol-fx .fx-f { font-size: 11px; margin-top: 3px; }
.vol-fx .vt-note { display: block; font-size: 11px; color: var(--muted); }
.vol-fx .vt-note.is-warn { color: var(--warn); font-weight: 600; }
.vol-fx-row { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); margin-top: 10px; }
.vol-fx-row .fx-card { padding: 9px 11px; }
.vol-fx-row .vol-fx .fx-val { font-size: 15px; }
.vol-total-h { margin: 18px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.vol-consts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 16px; padding: 10px 12px; border-radius: 12px; background: var(--const-bg); border: 1px solid var(--const-line); }
.vol-consts .fx-label { margin-inline-end: 6px; }
.vol-const { font: 11.5px/1.6 ui-monospace, Consolas, monospace; color: var(--const-ink); background: var(--card-solid); border: 1px solid var(--const-line); border-radius: 8px; padding: 1px 8px; direction: ltr; }
.vol-const small { color: var(--muted); }
.vol-fx-row { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; }
.vol-fx-row .fx-label { font-size: 11.5px; }
.vt-flash { box-shadow: none; animation: vt-flash 1.1s ease-out; border-radius: 8px; }
@keyframes vt-flash { from { box-shadow: 0 0 0 3px color-mix(in srgb, var(--fx) 30%, transparent); background: color-mix(in srgb, var(--fx) 10%, transparent); } to { box-shadow: 0 0 0 0 transparent; background: transparent; } }

/* SEC09 form: O₂ readings (input colour), the false air of each part with its formula in red */
.fa-item { padding: 14px; border-radius: 18px; background: var(--card-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.fa-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fa-item-head p { font-weight: 600; margin: 0; }
.fa-fx .vol-fx .fx-val { font-size: 18px; }
.vol-fx .vt-note.is-bad { color: var(--bad); font-weight: 600; }
.vol-fx .vt-note.is-ok { color: var(--ok); font-weight: 600; }

/* SEC02 form: field / CCR readings in the input colour, difference and error with their formula in red */
.inp-var .input.num { background: var(--var-bg); border: 1.5px solid var(--var-line); font-weight: 600; }
.inp-var .input.num:focus { border-color: var(--var); }
.gas-res { padding: 10px 12px; gap: 6px; }
.gas-fx-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gas-fx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gas-fx .fx-val { font-size: 16px; }
.gas-fx .fx-f { font-size: 11px; }

/* Stage 35: flow tables and fixed-value boxes */
.inp-var .table.inputs .input.num { background: var(--var-bg); border: 1.5px solid var(--var-line); font-weight: 600; }
.table td.fx-cell { background: var(--fx-bg); color: var(--fx); font-weight: 700; }
.inp-const-box { background: var(--const-bg); border-color: var(--const-line); }
.inp-const-box .kv-item strong { color: var(--const-ink); }
.inp-const .input { background: var(--const-bg); border-color: var(--const-line); color: var(--const-ink); }
.fx-card-main { border-color: color-mix(in srgb, var(--fx) 45%, transparent); }
.fx-card-main .fx-val { font-size: 20px; }

/* Activities → Calendar */
.tab svg, .tab-cal svg { width: 16px; height: 16px; vertical-align: -3px; }
.tab-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-inline-start: 4px; border-radius: 10px; background: var(--warn); color: #fff; font-size: 11.5px; }
.cal-card { padding: 18px; }
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-nav .round-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; }
.cal-arrow { font-size: 22px; line-height: 1; margin-top: -3px; }
.cal-title { font-size: 24px; margin: 0 8px; letter-spacing: -.01em; }
.seg a span.is-on { background: var(--card-solid); color: var(--accent); font-weight: 700; box-shadow: var(--shadow); }
.cal-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-filter { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card-solid); color: var(--ink); font-weight: 500; font-size: 14px; }
.cal-filter i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.cal-filter b { min-width: 26px; height: 24px; padding: 0 8px; border-radius: 12px; display: inline-grid; place-items: center; background: var(--card-2); font-size: 12.5px; }
.cal-filter.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cal-filter.is-active b { background: color-mix(in srgb, #fff 22%, transparent); color: inherit; }
.is-open { --c: #2f6fdf; --c-soft: color-mix(in srgb, #2f6fdf 12%, var(--card-solid)); }
.is-overdue { --c: #e07a10; --c-soft: color-mix(in srgb, #e07a10 14%, var(--card-solid)); }
.is-closed { --c: #1f8a4c; --c-soft: color-mix(in srgb, #1f8a4c 13%, var(--card-solid)); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--line); gap: 1px; }
.cal-dow { background: var(--card-2); text-align: center; padding: 10px 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cal-day { position: relative; background: var(--card-solid); min-height: 128px; padding: 8px; display: flex; flex-direction: column; gap: 6px; cursor: default; transition: background .15s; }
.cal-grid.is-week .cal-day { min-height: 340px; }
.cal-day:hover { background: color-mix(in srgb, var(--accent) 4%, var(--card-solid)); }
.cal-day.is-out { background: color-mix(in srgb, var(--card-2) 60%, var(--card-solid)); }
.cal-day.is-out .cal-num { color: var(--muted); opacity: .6; }
.cal-day-head { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.cal-day-head small { color: var(--muted); font-size: 11px; }
.cal-num { font-weight: 700; font-size: 15px; min-width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 50%; }
.cal-day.is-today .cal-num { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.cal-items { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cal-chip { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; padding: 4px 8px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); background: var(--c-soft); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600; text-align: start; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.cal-chip:hover { transform: translateY(-1px); box-shadow: 0 4px 12px -6px var(--c); }
.cal-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip.is-closed span { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); color: var(--muted); }
.cal-chip.is-overdue { border-style: dashed; }
.cal-badge { flex: none; display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--c); color: #fff; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.cal-more { font-size: 12px; font-weight: 600; color: var(--accent); padding: 0 4px; }
.cal-add { position: absolute; inset-inline-start: 8px; top: 8px; width: 28px; height: 28px; border-radius: 50%; border: 1.5px dashed var(--line-strong); background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.cal-add svg { width: 15px; height: 15px; }
.cal-day:hover .cal-add, .cal-add:focus { opacity: 1; }
@media (hover: none) { .cal-add { opacity: .7; } }
.cal-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--c-soft); color: var(--c); font-weight: 700; font-size: 12px; white-space: nowrap; }
.cal-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.cal-list-h { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; }
.cal-list-h i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.cal-actions { white-space: nowrap; text-align: end; }
.cal-actions .btn span { margin-inline-start: 4px; }
.cal-btn-close { color: var(--ok); }
.cal-btn-del { color: var(--bad); }
.cal-attention { border: 1px solid color-mix(in srgb, #e07a10 45%, transparent); background: color-mix(in srgb, #e07a10 6%, var(--card-solid)); margin-bottom: 18px; }
.cal-attention h3 svg { width: 18px; height: 18px; color: #e07a10; vertical-align: -3px; }
.cal-empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.cal-empty svg { width: 40px; height: 40px; opacity: .5; }
.cal-dialog { border: 0; border-radius: 20px; padding: 0; width: min(560px, calc(100vw - 24px)); background: var(--card-solid); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); }
.cal-dialog::backdrop { background: rgba(10, 20, 30, .45); backdrop-filter: blur(3px); }
.cal-dialog[open] { animation: cal-pop .18s ease-out; }
@keyframes cal-pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.cal-form { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.cal-dialog-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 4px; }
.cal-dialog-head h3 { margin: 0; font-size: 19px; }
.cal-dialog-foot { display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.cal-del { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
@media (max-width: 760px) {
  .cal-grid.is-month .cal-day { min-height: 84px; padding: 5px; }
  .cal-grid.is-month .cal-chip span { display: none; }
  .cal-grid.is-month .cal-chip { justify-content: center; padding: 3px; }
  .cal-grid.is-week { grid-template-columns: 1fr; }
  .cal-grid.is-week .cal-dow { display: none; }
  .cal-grid.is-week .cal-day { min-height: 0; }
  .cal-title { font-size: 19px; }
}
.cal-attention td.num, .cal-table td.num { white-space: nowrap; }
/* stage 37: days with actions are tinted; an action spans its days, start to due date */
.cal-day.has-tasks { background: color-mix(in srgb, var(--c) 7%, var(--card-solid)); box-shadow: inset 0 3px 0 var(--c); }
.cal-day.has-tasks:hover { background: color-mix(in srgb, var(--c) 11%, var(--card-solid)); }
.cal-day.has-tasks .cal-num { color: var(--c); }
.cal-day.is-today .cal-num { color: var(--accent-ink); }
.cal-day.has-tasks.is-out { background: color-mix(in srgb, var(--c) 4%, var(--card-2)); }
.cal-chip.at-first { border-start-end-radius: 3px; border-end-end-radius: 3px; margin-inline-end: -9px; width: calc(100% + 9px); }
.cal-chip.at-mid { border-radius: 3px; margin-inline: -9px; width: calc(100% + 18px); }
.cal-chip.at-last { border-start-start-radius: 3px; border-end-start-radius: 3px; margin-inline-start: -9px; width: calc(100% + 9px); }
.cal-chip.at-mid span, .cal-chip.at-last span { opacity: .75; font-weight: 500; }
.cal-chip.is-overdue { background: color-mix(in srgb, var(--c) 18%, var(--card-solid)); }
.cal-chip.is-overdue .cal-badge { animation: cal-pulse 1.8s ease-in-out infinite; }
@keyframes cal-pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .cal-chip.is-overdue .cal-badge { animation: none; } }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin: 10px 2px 0; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 14px; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--c) 18%, var(--card-solid)); box-shadow: inset 0 2px 0 var(--c); }
@media (max-width: 760px) { .cal-chip.at-first, .cal-chip.at-mid, .cal-chip.at-last { margin-inline: 0; width: 100%; border-radius: 6px; } }
/* stage 38: an action shows on its own day only; overdue is red */
.is-overdue { --c: #d93025; --c-soft: color-mix(in srgb, #d93025 13%, var(--card-solid)); }
.cal-attention { border-color: color-mix(in srgb, #d93025 45%, transparent); background: color-mix(in srgb, #d93025 5%, var(--card-solid)); }
.cal-attention h3 svg { color: #d93025; }
.cal-chip.is-overdue { border-style: solid; border-color: #d93025; }
