/* Arvi Master — Apple-style UI taken 1:1 from the ARVILAB panel (system font, translucent bars, 44 px targets,
   press feedback scale .97 / 100 ms, spring easing, light/dark, prefers-reduced-motion).
   Master-only additions are at the end of the file (Home: .needs, .project-card, .traffic, .kpi-mini). */

:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Inter, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  --bg: #f2f2f7;            /* grupuotas fonas */
  --surface: #ffffff;       /* kortelės, sąrašai */
  --surface-2: #f2f2f7;     /* įvedimo laukai ant surface */
  --elevated: #ffffff;
  --text: #1c1c1e;
  --text-2: #6c6c70;        /* antrinis */
  --text-3: #aeaeb2;        /* tretinis */
  --sep: rgba(60, 60, 67, .18);
  --sep-strong: rgba(60, 60, 67, .3);
  --fill: rgba(120, 120, 128, .12);
  --fill-2: rgba(120, 120, 128, .2);
  --accent: #007aff;
  --accent-tint: rgba(0, 122, 255, .12);
  --green: #34c759; --orange: #ff9500; --red: #ff3b30; --yellow: #ffcc00; --purple: #af52de; --teal: #30b0c7; --indigo: #5856d6; --pink: #ff2d55; --gray: #8e8e93;
  --glass: rgba(249, 249, 251, .78);
  --glass-strong: rgba(242, 242, 247, .9);
  --shadow-1: 0 1px 2px rgba(0,0,0,.05), 0 0 0 .5px rgba(0,0,0,.04);
  --shadow-2: 0 8px 28px rgba(0,0,0,.12), 0 1px 3px rgba(0,0,0,.08);
  --shadow-3: 0 24px 60px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.1);

  --r-s: 8px; --r: 12px; --r-l: 18px; --r-xl: 26px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.32, 1.18, .42, 1);  /* lengva „spyruoklė“ be perlėkimo apačioje */
  --t-fast: 120ms; --t: 240ms; --t-slow: 380ms;

  --sidebar-w: 236px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --elevated: #2c2c2e;
    --text: #f5f5f7; --text-2: #98989f; --text-3: #636366;
    --sep: rgba(84, 84, 88, .6); --sep-strong: rgba(84, 84, 88, .8);
    --fill: rgba(120, 120, 128, .24); --fill-2: rgba(120, 120, 128, .36);
    --accent: #0a84ff; --accent-tint: rgba(10, 132, 255, .2);
    --green: #30d158; --orange: #ff9f0a; --red: #ff453a; --yellow: #ffd60a; --purple: #bf5af2; --teal: #40c8e0; --indigo: #5e5ce6; --pink: #ff375f; --gray: #98989f;
    --glass: rgba(22, 22, 24, .72); --glass-strong: rgba(28, 28, 30, .9);
    --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 0 0 .5px rgba(255,255,255,.06);
    --shadow-2: 0 8px 28px rgba(0,0,0,.5), 0 0 0 .5px rgba(255,255,255,.08);
    --shadow-3: 0 24px 60px rgba(0,0,0,.7), 0 0 0 .5px rgba(255,255,255,.1);
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --elevated: #2c2c2e;
  --text: #f5f5f7; --text-2: #98989f; --text-3: #636366;
  --sep: rgba(84, 84, 88, .6); --sep-strong: rgba(84, 84, 88, .8);
  --fill: rgba(120, 120, 128, .24); --fill-2: rgba(120, 120, 128, .36);
  --accent: #0a84ff; --accent-tint: rgba(10, 132, 255, .2);
  --green: #30d158; --orange: #ff9f0a; --red: #ff453a; --yellow: #ffd60a; --purple: #bf5af2; --teal: #40c8e0; --indigo: #5e5ce6; --pink: #ff375f; --gray: #98989f;
  --glass: rgba(22, 22, 24, .72); --glass-strong: rgba(28, 28, 30, .9);
  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 0 0 .5px rgba(255,255,255,.06);
  --shadow-2: 0 8px 28px rgba(0,0,0,.5), 0 0 0 .5px rgba(255,255,255,.08);
  --shadow-3: 0 24px 60px rgba(0,0,0,.7), 0 0 0 .5px rgba(255,255,255,.1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 15px/1.45 var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent-tint); }
:focus-visible { outline: 3px solid var(--accent-tint); outline-offset: 2px; border-radius: var(--r-s); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
hr { border: 0; border-top: .5px solid var(--sep); margin: 4px 0; }
kbd { font: 11px/1 var(--mono); background: var(--fill); padding: 3px 5px; border-radius: 5px; color: var(--text-2); }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }
.empty { color: var(--text-2); text-align: center; padding: 40px 16px; }
.empty .big-icon { font-size: 40px; opacity: .5; margin-bottom: 8px; }

/* ---------- pressable (atsakas paspaudus, ne atleidus) ---------- */
.pressable, .btn, .icon-btn, .row.tappable, .card, .nav a, .tabbar a, .seg button, .chip, .user-chip, .menu button, .ctx button {
  transition: transform var(--t-fast) ease-out, background-color var(--t-fast) ease-out, opacity var(--t-fast) ease-out, box-shadow var(--t-fast) ease-out;
}
.btn:active, .icon-btn:active, .card:active, .chip:active, .user-chip:active, .tabbar a:active { transform: scale(.97); }
.row.tappable:active { background: var(--fill); }
.nav a:active, .menu button:active, .ctx button:active { background: var(--fill-2); }

/* ---------- mygtukai ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border-radius: 10px; font-weight: 600; font-size: 15px; background: var(--fill); color: var(--accent); white-space: nowrap; line-height: 1;
}
.btn:hover { background: var(--fill-2); text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.tint { background: var(--accent-tint); }
.btn.plain { background: transparent; }
.btn.plain:hover { background: var(--fill); }
.btn.danger { color: var(--red); }
.btn.danger.primary { background: var(--red); color: #fff; }
.btn.big { min-height: 50px; font-size: 17px; border-radius: 14px; width: 100%; }
.btn.pill { border-radius: 999px; }
.btn.small { min-height: 30px; font-size: 13px; padding: 0 10px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--fill); color: var(--text); font-size: 17px; line-height: 1;
}
.icon-btn:hover { background: var(--fill-2); }
.icon-btn[aria-pressed="true"] { background: var(--accent-tint); color: var(--accent); }
.icon-btn.plain { background: transparent; }
.icon-btn svg, .btn svg { width: 18px; height: 18px; }
@media (pointer: coarse) { .btn { min-height: 44px; } .icon-btn { width: 44px; height: 44px; } .btn.small { min-height: 36px; } }

/* ---------- segmented control ---------- */
.seg { display: inline-flex; padding: 2px; background: var(--fill); border-radius: 9px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { min-height: 30px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--elevated); box-shadow: 0 1px 3px rgba(0,0,0,.14), 0 0 0 .5px rgba(0,0,0,.04); }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: #636366; } }
.seg button .cnt { color: var(--text-2); font-weight: 500; margin-left: 4px; font-size: 12px; }
@media (pointer: coarse) { .seg button { min-height: 36px; } }

/* ---------- chips, pills, badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--fill); font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.chip.on { background: var(--accent-tint); color: var(--accent); }
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em; background: var(--fill); color: var(--text-2); white-space: nowrap; }
.pill.blue { background: var(--accent-tint); color: var(--accent); }
.pill.green { background: rgba(52,199,89,.16); color: #1f9e46; }
.pill.orange { background: rgba(255,149,0,.16); color: #b86500; }
.pill.red { background: rgba(255,59,48,.14); color: var(--red); }
.pill.purple { background: rgba(175,82,222,.16); color: var(--purple); }
.pill.gray { background: var(--fill); color: var(--text-2); }
.pill.teal { background: rgba(48,176,199,.16); color: #117a8b; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; }
.badge.quiet { background: var(--fill-2); color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--gray); flex: none; }
.dot.laukia { background: var(--gray); } .dot.daroma { background: var(--accent); } .dot.blokuota { background: var(--red); } .dot.padaryta { background: var(--green); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--accent); flex: none; letter-spacing: .02em; }
.avatar.s { width: 22px; height: 22px; font-size: 10px; }

/* ---------- laukai ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea, .input {
  min-height: 40px; padding: 8px 12px; border-radius: 10px; border: .5px solid transparent; background: var(--fill); color: var(--text); font-size: 15px; width: 100%;
  transition: box-shadow var(--t-fast) ease-out, background-color var(--t-fast) ease-out;
}
.field textarea { resize: vertical; min-height: 72px; line-height: 1.4; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 3.5px var(--accent-tint), 0 0 0 .5px var(--accent); }
.field select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field-group { display: grid; gap: 10px; }
.field-row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
@media (pointer: coarse) { .field input, .field select, .input { min-height: 44px; font-size: 16px; } }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; margin: 6px 0 0; }

.toggle { position: relative; width: 51px; height: 31px; border-radius: 999px; background: var(--fill-2); transition: background-color var(--t) var(--ease-out); flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 0 0 .5px rgba(0,0,0,.04); transition: transform var(--t) var(--spring); }
.toggle[aria-checked="true"] { background: var(--green); }
.toggle[aria-checked="true"]::after { transform: translateX(20px); }

.search { position: relative; flex: 1 1 200px; max-width: 420px; }
.search input { padding-left: 34px; min-height: 36px; border-radius: 10px; background: var(--fill); border: 0; width: 100%; font-size: 15px; }
.search input:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 3.5px var(--accent-tint); }
.search::before { content: ""; position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center/contain no-repeat; }
:root[data-theme="dark"] .search::before { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .search::before { filter: invert(1); } }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
@media (pointer: coarse) { .search kbd { display: none; } }

/* ---------- prisijungimas ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 50% -10%, rgba(0,122,255,.14), transparent 60%), var(--bg); }
.login-card { width: min(380px, 100%); background: var(--surface); border-radius: var(--r-xl); padding: 36px 28px 28px; box-shadow: var(--shadow-2); display: grid; gap: 14px; text-align: center; animation: pop var(--t-slow) var(--spring) both; }
.login-title { font-size: 26px; letter-spacing: -.02em; }
.login-sub { margin: -8px 0 6px; color: var(--text-2); }
.login-card .field-group { text-align: left; }
.app-icon { width: 64px; height: 64px; margin: 0 auto 4px; border-radius: 16px; display: grid; place-items: center; font-weight: 800; font-size: 32px; color: #fff; letter-spacing: -.03em;
  background: linear-gradient(135deg, #5ac8fa, #007aff 70%); box-shadow: 0 8px 24px rgba(0,122,255,.3), inset 0 1px 0 rgba(255,255,255,.35); }
.app-icon.small { width: 28px; height: 28px; border-radius: 8px; font-size: 15px; margin: 0; box-shadow: 0 2px 6px rgba(0,122,255,.3); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- išdėstymas: šoninė juosta + turinys ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; padding: 14px 10px; display: flex; flex-direction: column; gap: 10px;
  background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border-right: .5px solid var(--sep);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; color: var(--text); font-weight: 700; letter-spacing: -.01em; font-size: 15px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: 8px; color: var(--text); font-weight: 500; font-size: 14px; }
.nav a:hover { background: var(--fill); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent); color: #fff; }
.nav a[aria-current="page"] .ico { color: #fff; }
.nav a[aria-current="page"] .badge.quiet { background: rgba(255,255,255,.28); color: #fff; }
.nav .ico { width: 18px; height: 18px; color: var(--accent); flex: none; }
.nav .ico svg { width: 18px; height: 18px; display: block; }
.nav a .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; }
.user-chip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 10px; text-align: left; }
.user-chip:hover { background: var(--fill); }
.user-chip .user-name { font-weight: 600; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .chev { color: var(--text-3); }

.content { min-width: 0; padding-bottom: calc(24px + var(--safe-b)); }
.view { max-width: 1240px; margin: 0 auto; padding: 0 28px 40px; }

/* didelė antraštė + permatoma įrankių juosta */
.page-head { position: sticky; top: 0; z-index: 5; margin: 0 -28px; padding: 14px 28px 10px; background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%); }
.page-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; pointer-events: none; background: linear-gradient(to bottom, rgba(0,0,0,.05), transparent); opacity: 0; transition: opacity var(--t); }
.page-head.scrolled::after { opacity: 1; }
.page-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 30px; font-weight: 800; letter-spacing: -.025em; line-height: 1.1; }
.page-title .sub { display: block; font-size: 14px; font-weight: 500; color: var(--text-2); letter-spacing: 0; margin-top: 4px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.toolbar .spacer { flex: 1; }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 14px; color: var(--text-2); }
.crumbs a { color: var(--text-2); padding: 3px 6px; border-radius: 6px; }
.crumbs a:hover { background: var(--fill); text-decoration: none; color: var(--text); }
.crumbs .cur { color: var(--text); font-weight: 600; padding: 3px 6px; }
.crumbs .sepr { color: var(--text-3); }

/* ---------- grupuoti sąrašai (iOS inset grouped) ---------- */
.section { margin-top: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 4px 8px; }
.section-head h2 { font-size: 20px; letter-spacing: -.02em; }
.section-head h3 { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.section-head .more { font-size: 14px; font-weight: 600; }
.list { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 9px 14px; position: relative; color: inherit; }
.row + .row::before { content: ""; position: absolute; left: 14px; right: 0; top: 0; border-top: .5px solid var(--sep); }
.row.indent + .row.indent::before { left: 54px; }
.row.tappable { cursor: pointer; }
.row.tappable:hover { background: var(--fill); }
.row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .title.done { color: var(--text-2); text-decoration: line-through; }
.row .sub { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub .over { color: var(--red); font-weight: 600; }
.row .sub .today { color: var(--orange); font-weight: 600; }
.row .trail { display: flex; align-items: center; gap: 8px; flex: none; color: var(--text-2); font-size: 13px; }
.row .chevron { color: var(--text-3); font-size: 18px; line-height: 1; margin-left: -2px; }
.row .thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--fill); flex: none; }
.row .ficon { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; font-size: 22px; background: var(--fill); flex: none; }
.check { width: 24px; height: 24px; border-radius: 50%; border: 1.6px solid var(--text-3); display: inline-grid; place-items: center; flex: none; color: #fff; font-size: 13px; transition: background-color var(--t-fast), border-color var(--t-fast), transform var(--t-fast); }
.check:hover { border-color: var(--accent); }
.check.on { background: var(--accent); border-color: var(--accent); }
.check:active { transform: scale(.9); }
.row.hidden-done { display: none; }

/* ---------- kortelės, tinklelis, KPI ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden; position: relative; cursor: pointer; display: flex; flex-direction: column; color: inherit; }
.card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); text-decoration: none; }
.card .media { aspect-ratio: 4/3; background: var(--fill); display: grid; place-items: center; overflow: hidden; position: relative; }
.card .media img { width: 100%; height: 100%; object-fit: cover; }
.card .media .big-ico { font-size: 40px; opacity: .8; }
.card .media .mosaic { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 0; }
.card .media .mosaic img { width: 100%; height: 100%; object-fit: cover; }
.card .media .mosaic.one { grid-template-columns: 1fr; }
.card .body { padding: 10px 12px 11px; display: flex; flex-direction: column; gap: 3px; }
.card .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta { font-size: 12px; color: var(--text-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card .lock { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 999px; backdrop-filter: blur(8px); }
.card .star { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 17px; background: rgba(0,0,0,.35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity var(--t-fast); }
.card:hover .star, .card .star.on, .card .star:focus-visible { opacity: 1; }
.card .star.on { color: var(--yellow); }
@media (pointer: coarse) { .card .star { opacity: 1; } }
.card .reacts { position: absolute; bottom: 58px; left: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity var(--t-fast); }
.card:hover .reacts, .card .reacts.has { opacity: 1; }
.card .reacts button { height: 26px; min-width: 30px; padding: 0 7px; border-radius: 999px; background: rgba(0,0,0,.42); color: #fff; font-size: 12.5px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: inline-flex; align-items: center; gap: 3px; }
.card .reacts button.on { background: var(--accent); }
.card.sel { box-shadow: 0 0 0 3px var(--accent), var(--shadow-1); }
.card .selbox { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.3); display: grid; place-items: center; color: #fff; font-size: 13px; }
.card.sel .selbox { background: var(--accent); border-color: var(--accent); }

.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-height: 92px; color: inherit; }
.kpi.tappable { cursor: pointer; }
.kpi.tappable:hover { box-shadow: var(--shadow-2); text-decoration: none; }
.kpi .label { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin-top: auto; font-variant-numeric: tabular-nums; }
.kpi .value.red { color: var(--red); } .kpi .value.green { color: var(--green); } .kpi .value.orange { color: var(--orange); } .kpi .value.blue { color: var(--accent); } .kpi .value.purple { color: var(--purple); }
.kpi .hint { font-size: 12px; color: var(--text-2); }
.two-col { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }

/* piltuvėlis (klientai pagal stadiją) */
.funnel { display: flex; gap: 6px; }
.funnel a { flex: 1; min-width: 0; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-1); padding: 10px 10px 9px; color: inherit; display: flex; flex-direction: column; gap: 2px; border-top: 3px solid var(--c, var(--gray)); }
.funnel a:hover { box-shadow: var(--shadow-2); text-decoration: none; }
.funnel .n { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.funnel .l { font-size: 11.5px; color: var(--text-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-naujas { --c: var(--gray); } .stage-kontaktas { --c: var(--accent); } .stage-susitikimas { --c: var(--purple); } .stage-pasiulymas { --c: var(--orange); } .stage-laimeta { --c: var(--green); } .stage-prarasta { --c: var(--red); }
.pill.stage { background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }

/* ---------- lentelė (Excel tipo) ---------- */
.sheet-wrap { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: auto; max-height: calc(100dvh - 220px); }
table.grid-table { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 14px; }
.grid-table th, .grid-table td { border-right: .5px solid var(--sep); border-bottom: .5px solid var(--sep); padding: 0; position: relative; }
.grid-table th { position: sticky; top: 0; z-index: 2; background: var(--glass-strong); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-weight: 600; color: var(--text-2); font-size: 12.5px; text-align: left; height: 34px; }
.grid-table th .th { display: flex; align-items: center; gap: 4px; padding: 0 8px; height: 34px; cursor: default; }
.grid-table th .th button { color: var(--text-3); width: 20px; height: 20px; border-radius: 5px; opacity: 0; }
.grid-table th:hover .th button { opacity: 1; }
.grid-table th .rz { position: absolute; right: -3px; top: 0; width: 6px; height: 100%; cursor: col-resize; }
.grid-table td.num { width: 44px; min-width: 44px; text-align: center; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; background: var(--bg); position: sticky; left: 0; z-index: 1; cursor: context-menu; }
.grid-table th.num { left: 0; z-index: 3; }
.grid-table td .cell { min-height: 34px; padding: 7px 8px; outline: none; white-space: pre-wrap; word-break: break-word; }
.grid-table td .cell:focus { box-shadow: inset 0 0 0 2px var(--accent); background: var(--surface); }
.grid-table td .cell a { pointer-events: auto; }
.grid-table td.type-number .cell { text-align: right; font-variant-numeric: tabular-nums; }
.grid-table tr:hover td { background: color-mix(in srgb, var(--fill) 50%, transparent); }

/* išlaidų lentelė */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden; font-size: 14px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: .5px solid var(--sep); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.table tr:last-child td { border-bottom: 0; }
.table td.r, .table th.r { text-align: right; font-variant-numeric: tabular-nums; }
.table td[contenteditable] { outline: none; border-radius: 6px; }
.table td[contenteditable]:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.table-wrap { overflow-x: auto; border-radius: var(--r); }

/* ---------- meniu, kontekstinis meniu ---------- */
.menu, .ctx {
  position: fixed; z-index: 60; min-width: 220px; padding: 6px; border-radius: 14px; background: var(--glass-strong);
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; gap: 1px; transform-origin: var(--ox, 50%) var(--oy, 0%); animation: menu-in var(--t) var(--spring) both;
}
.menu button, .ctx button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 12px; border-radius: 8px; text-align: left; font-size: 14px; }
.menu button:hover, .ctx button:hover { background: var(--accent); color: #fff; }
.menu button.danger, .ctx button.danger { color: var(--red); }
.menu button.danger:hover, .ctx button.danger:hover { background: var(--red); color: #fff; }
.menu hr, .ctx hr { margin: 4px 8px; }
@keyframes menu-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

/* ---------- sheet / modal (iš apačios telefone, centre darbalaukyje) ---------- */
.sheet-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.32); animation: fade var(--t) ease-out both; }
.sheet {
  position: fixed; z-index: 71; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 48px);
  background: var(--elevated); border-radius: var(--r-l); box-shadow: var(--shadow-3); display: flex; flex-direction: column; overflow: hidden;
  animation: sheet-in var(--t-slow) var(--spring) both;
}
.sheet.wide { width: min(820px, calc(100% - 32px)); }
.sheet.closing { animation: sheet-out var(--t) ease-in both; }
.sheet-scrim.closing { animation: fade-out var(--t) ease-in both; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.sheet-head h2 { font-size: 18px; letter-spacing: -.015em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { padding: 4px 16px 16px; overflow: auto; display: grid; gap: 14px; }
.sheet-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 16px 16px; border-top: .5px solid var(--sep); background: var(--elevated); }
.sheet-foot .left { margin-right: auto; }
.sheet .handle { display: none; width: 36px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 8px auto 0; }
@keyframes sheet-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.94); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes sheet-out { to { opacity: 0; transform: translate(-50%, -50%) scale(.96); } }
@keyframes fade { from { opacity: 0; } } @keyframes fade-out { to { opacity: 0; } }
.note-list { display: flex; flex-direction: column; gap: 10px; }
.note { background: var(--surface-2); border-radius: 12px; padding: 9px 12px; font-size: 14px; }
.note .who { font-size: 12px; color: var(--text-2); display: flex; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.note .who button { color: var(--text-3); font-size: 12px; }
.note .who button:hover { color: var(--red); }
.timeline { display: grid; gap: 0; }
.detail-grid { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 14px; }
.detail-grid dt { color: var(--text-2); } .detail-grid dd { margin: 0; }

/* ---------- peržiūra ---------- */
.viewer { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column; animation: fade var(--t) ease-out both; }
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%); border-bottom: .5px solid var(--sep); padding-top: max(10px, env(safe-area-inset-top)); }
.viewer-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.viewer-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.viewer-title span { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-actions { display: flex; gap: 6px; }
.viewer-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 340px; }
.viewer-body.no-side { grid-template-columns: 1fr; }
.viewer-body.no-side .viewer-side { display: none; }
.viewer-stage { min-width: 0; min-height: 0; overflow: auto; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.viewer-stage img, .viewer-stage video { max-width: 100%; max-height: calc(100dvh - 100px); object-fit: contain; border-radius: 6px; box-shadow: var(--shadow-2); }
.viewer-stage iframe { width: 100%; height: 100%; min-height: calc(100dvh - 100px); border: 0; background: #fff; border-radius: 8px; }
.viewer-stage .doc { align-self: start; width: min(820px, 100%); background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); padding: 28px 32px; line-height: 1.6; }
.viewer-stage .doc pre { white-space: pre-wrap; font: 13px/1.5 var(--mono); }
.viewer-stage .doc h1, .viewer-stage .doc h2, .viewer-stage .doc h3 { margin: 1.2em 0 .5em; } .viewer-stage .doc h1:first-child { margin-top: 0; }
.viewer-stage .doc table { border-collapse: collapse; font-size: 13.5px; } .viewer-stage .doc th, .viewer-stage .doc td { border: .5px solid var(--sep-strong); padding: 6px 9px; vertical-align: top; }
.viewer-stage .doc code { background: var(--fill); padding: 1px 5px; border-radius: 5px; font-size: 90%; }
.viewer-stage .doc img { border-radius: 8px; }
.viewer-stage .doc blockquote { margin: 0; padding: 2px 14px; border-left: 3px solid var(--accent); color: var(--text-2); }
.viewer-side { border-left: .5px solid var(--sep); display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.reactions { display: flex; gap: 6px; padding: 12px; border-bottom: .5px solid var(--sep); flex-wrap: wrap; }
.reactions button { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--fill); font-weight: 600; font-size: 13.5px; }
.reactions button.on { background: var(--accent-tint); color: var(--accent); }
.reactions .stars { margin-left: auto; display: inline-flex; gap: 1px; }
.reactions .stars button { padding: 0 3px; min-width: 0; height: 34px; background: none; font-size: 20px; color: var(--text-3); }
.reactions .stars button.on { color: var(--yellow); }
.comments { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.comment { background: var(--surface-2); border-radius: 14px 14px 14px 4px; padding: 8px 12px; font-size: 14px; }
.comment .who { font-size: 12px; color: var(--text-2); display: flex; justify-content: space-between; margin-bottom: 2px; }
.comment .who button { color: var(--text-3); font-size: 12px; }
.comment.mine { background: var(--accent-tint); border-radius: 14px 14px 4px 14px; }
.comment-form { display: flex; gap: 8px; padding: 10px 12px; border-top: .5px solid var(--sep); padding-bottom: max(12px, var(--safe-b)); }
.comment-form textarea { flex: 1; resize: none; min-height: 40px; max-height: 120px; padding: 9px 12px; border-radius: 14px; border: 0; background: var(--fill); }
.comment-form textarea:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-tint); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 90; background: var(--glass-strong); color: var(--text); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--shadow-2); border-radius: 999px; padding: 10px 16px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity var(--t) var(--ease-out), transform var(--t) var(--spring); display: flex; align-items: center; gap: 12px; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { color: var(--accent); font-weight: 700; }

/* ---------- apatinė skirtukų juosta (telefonas) ---------- */
.tabbar { display: none; }
.drop { position: fixed; inset: 0; z-index: 50; pointer-events: none; display: grid; place-items: center; background: rgba(0,122,255,.12); border: 3px dashed var(--accent); font-weight: 700; color: var(--accent); font-size: 18px; }

/* ---------- tasks list specifics ---------- */
.task-row .prio { width: 3px; align-self: stretch; border-radius: 2px; background: transparent; margin: -9px 0 -9px -6px; }
.task-row .prio.aukštas { background: var(--red); }
.task-row .prio.žemas { background: var(--text-3); }
.who-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-2); }

.selbar { position: fixed; left: 50%; bottom: calc(20px + var(--safe-b)); transform: translateX(-50%); z-index: 45; display: flex; gap: 8px; align-items: center; padding: 8px 10px 8px 14px; border-radius: 999px; background: var(--glass-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--shadow-2); font-weight: 600; animation: pop var(--t) var(--spring) both; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .view { padding: 0 16px calc(90px + var(--safe-b)); }
  .page-head { margin: 0 -16px; padding: 10px 16px 8px; padding-top: max(10px, env(safe-area-inset-top)); }
  .page-title { font-size: 26px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; justify-content: space-around; padding: 6px 4px calc(6px + var(--safe-b)); background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border-top: .5px solid var(--sep); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 56px; padding: 4px 6px; border-radius: 10px; color: var(--text-2); font-size: 10.5px; font-weight: 600; position: relative; }
  .tabbar a .ico svg { width: 24px; height: 24px; display: block; }
  .tabbar a[aria-current="page"] { color: var(--accent); }
  .tabbar a .badge { position: absolute; top: 0; right: 6px; }
  .viewer-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .viewer-side { border-left: 0; border-top: .5px solid var(--sep); max-height: 45dvh; }
  .viewer-body.no-side { grid-template-rows: 1fr; }
  .viewer-stage img, .viewer-stage video { max-height: 50dvh; }
  .sheet { top: auto; bottom: 0; left: 0; transform: none; width: 100%; max-height: calc(100dvh - 40px); border-radius: var(--r-xl) var(--r-xl) 0 0; animation: sheet-up var(--t-slow) var(--spring) both; }
  .sheet .handle { display: block; }
  .sheet-foot { padding-bottom: calc(14px + var(--safe-b)); }
  .sheet.closing { animation: sheet-down var(--t) ease-in both; }
  .detail-grid { grid-template-columns: 1fr; gap: 2px; } .detail-grid dt { margin-top: 6px; }
  .funnel { overflow-x: auto; scrollbar-width: none; } .funnel a { min-width: 92px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .kpi .value { font-size: 26px; }
  .menu { left: 16px !important; right: 16px; min-width: 0; }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { to { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
  .btn:active, .icon-btn:active, .card:active, .chip:active { transform: none; }
  .sheet, .login-card, .menu, .ctx { animation: fade var(--t) ease-out both; }
}
@media (prefers-reduced-transparency: reduce) {
  .sidebar, .page-head, .tabbar, .viewer-bar, .menu, .ctx, .toast { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) { .list, .card, .kpi { box-shadow: 0 0 0 1px var(--sep-strong); } }
@media print { .sidebar, .tabbar, .page-head .toolbar { display: none; } }

/* ---------- Patikrinti (To check) ---------- */
.cv-decision { padding: 12px; border-bottom: .5px solid var(--sep); background: var(--surface); }
.cv-decision .field > span { color: var(--green); }
.cv-decision textarea { min-height: 56px; }
.ck-body { font: 13px/1.5 var(--mono); min-height: 260px; }
.ck-note-hint { font-size: 12px; color: var(--text-2); padding: 0 12px 8px; }
.row .ficon.ck { font-size: 20px; }

/* ======================================================================
   Arvi Master additions
   ====================================================================== */
.app-icon { background: linear-gradient(135deg, #7d7aff, #5856d6 55%, #3634a3); box-shadow: 0 8px 24px rgba(88,86,214,.32), inset 0 1px 0 rgba(255,255,255,.35); }
.app-icon.small { box-shadow: 0 2px 6px rgba(88,86,214,.32); }
.login { background: radial-gradient(1200px 600px at 50% -10%, rgba(88,86,214,.16), transparent 60%), var(--bg); }

/* sidebar: ⌘K button */
.search-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; padding: 0 8px 0 12px; margin: 0 0 4px; border-radius: 9px; background: var(--fill); color: var(--text-2); font-size: 14px; text-align: left; }
.search-btn:hover { background: var(--fill-2); }
.keys-hint { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; font-size: 12.5px; color: var(--text-2); }
.pal-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); flex: none; }
.pal-ico svg { width: 18px; height: 18px; }
#pal-list .row.hot { background: var(--fill); }
.row .title.wrap { white-space: normal; overflow: visible; }

/* phone account button (sidebar is hidden there) */
.me-btn { display: none; width: 44px; height: 44px; border-radius: 50%; place-items: center; }
.me-btn .avatar { width: 32px; height: 32px; font-size: 12px; }
.icon-btn.spin svg { animation: spin .7s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

/* "coming soon" placeholder for N2/N3/N4 tabs */
.soon { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1); padding: 40px 24px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.soon-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); }
.soon-ico svg { width: 30px; height: 30px; }
.soon h2 { font-size: 20px; letter-spacing: -.02em; }
.soon p { margin: 0; color: var(--text-2); max-width: 520px; }

/* ---------- Home: Needs you ---------- */
.needs .row { min-height: 56px; }
.need-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; background: var(--gray); }
.need-ico svg { width: 18px; height: 18px; }
.need-ico.red { background: var(--red); } .need-ico.yellow { background: var(--orange); } .need-ico.blue { background: var(--accent); } .need-ico.green { background: var(--green); }
.needs .row .sub { white-space: normal; }

/* ---------- Home: project cards ---------- */
.projects { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }
.project-card { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; position: relative; overflow: hidden; }
.project-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--lc, var(--green)); }
.project-card.l-yellow { --lc: var(--yellow); } .project-card.l-red { --lc: var(--red); }
.pc-head { display: flex; align-items: center; gap: 10px; min-height: 32px; width: 100%; text-align: left; }
.pc-name { font-size: 20px; font-weight: 750; letter-spacing: -.022em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-why { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-align: left; font-size: 13px; line-height: 1.38; color: var(--text-2); min-height: calc(2 * 1.38em); width: 100%; border-radius: 6px; }
.pc-why:hover { color: var(--text); }
.pc-why .more-n { display: inline-block; padding: 0 6px; margin-left: 2px; border-radius: 999px; background: var(--fill); font-size: 11.5px; font-weight: 700; color: var(--text-2); }

.traffic { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px 0 9px; border-radius: 999px; font-size: 13px; font-weight: 700; flex: none;
  background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--ct); }
.traffic .lamp { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.traffic.green { --c: var(--green); --ct: #1d8f40; } .traffic.yellow { --c: var(--yellow); --ct: #8a6a00; } .traffic.red { --c: var(--red); --ct: #d70015; }
:root[data-theme="dark"] .traffic.green { --ct: var(--green); } :root[data-theme="dark"] .traffic.yellow { --ct: var(--yellow); } :root[data-theme="dark"] .traffic.red { --ct: #ff6961; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .traffic.green { --ct: var(--green); } :root:not([data-theme="light"]) .traffic.yellow { --ct: var(--yellow); } :root:not([data-theme="light"]) .traffic.red { --ct: #ff6961; } }

.kpi-mini { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-mini.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi-mini .k { background: var(--bg); border-radius: 11px; padding: 9px 10px 8px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kpi-mini .k.wide { grid-column: 1 / -1; }
.kpi-mini .kl { font-size: 11.5px; font-weight: 600; color: var(--text-2); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-mini .kv { font-size: 22px; font-weight: 750; letter-spacing: -.025em; line-height: 1.15; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.kpi-mini .kh { font-size: 11.5px; color: var(--text-2); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kv.t-red { color: var(--red); } .kv.t-orange { color: var(--orange); } .kv.t-green { color: var(--green); } .kv.t-blue { color: var(--accent); } .kv.t-muted { color: var(--text-3); }

.stage-row { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  background: color-mix(in srgb, var(--c, var(--gray)) 13%, transparent); }
.stage-chip b { color: var(--c, var(--text)); font-variant-numeric: tabular-nums; }
.stage-chip.zero { background: var(--fill); } .stage-chip.zero b { color: var(--text-3); }
.st-naujas { --c: var(--gray); } .st-kontaktas { --c: var(--accent); } .st-susitikimas { --c: var(--purple); } .st-pasiulymas { --c: var(--orange); } .st-laimeta { --c: var(--green); } .st-prarasta { --c: var(--red); }

.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); padding-top: 8px; border-top: .5px solid var(--sep); }
.pc-foot .appr { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--text-2); font-weight: 500; border-radius: 8px; }
.pc-foot .appr svg { width: 16px; height: 16px; }
.pc-foot .appr b { font-variant-numeric: tabular-nums; color: var(--text); }
.pc-foot .appr.on, .pc-foot .appr.on b { color: var(--accent); font-weight: 700; }
.pc-foot .upd { font-variant-numeric: tabular-nums; }

/* System card */
.cons { display: flex; flex-wrap: wrap; gap: 6px; }
.con { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--fill); font: 12px/1 var(--mono); color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.con .lamp { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
.con.down { color: var(--red); background: rgba(255,59,48,.12); } .con.down .lamp { background: var(--red); }

/* Lessons */
.lesson-doc { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); padding: 18px 22px; line-height: 1.55; overflow-wrap: anywhere; }
.lesson-doc h1, .lesson-doc h2, .lesson-doc h3 { margin: 1em 0 .4em; } .lesson-doc > :first-child { margin-top: 0; }
.lesson-doc h1 { font-size: 22px; } .lesson-doc h2 { font-size: 18px; } .lesson-doc h3 { font-size: 15px; }
.lesson-doc ul { padding-left: 1.2em; margin: .4em 0; } .lesson-doc li { margin: .2em 0; }
.lesson-doc p { margin: .5em 0; }
.lesson-doc code { font: 12.5px var(--mono); background: var(--fill); padding: 1px 5px; border-radius: 5px; }
.lesson-doc pre { white-space: pre-wrap; font: 12.5px/1.5 var(--mono); background: var(--fill); padding: 10px 12px; border-radius: 8px; }
.lesson-doc blockquote { margin: .5em 0; padding: 2px 12px; border-left: 3px solid var(--accent); color: var(--text-2); }
.lesson-doc hr { margin: 1em 0; }

@media (max-width: 1100px) { .kpi-mini.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .me-btn { display: inline-grid; margin-left: auto; }
  .page-title-row { flex-wrap: nowrap; align-items: center; }
  .page-title-row .toolbar { flex-wrap: nowrap; }
  .projects { gap: 12px; }
  .project-card { padding: 13px 14px 10px; }
  .kpi-mini { gap: 6px; }
  .kpi-mini .k { padding: 8px 9px 7px; }
  .kpi-mini .kv { font-size: 20px; }
  .tabbar a { min-width: 0; flex: 1; }
  .lesson-doc { padding: 14px 16px; }
}

/* Home fit-to-phone tweaks: labels may wrap to two lines, "ago" suffix is lighter, footer drops the word "Updated" */
.kpi-mini .kl { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kpi-mini .kv small.ago { font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--text-2); }
@media (max-width: 900px) {
  .kpi-mini .kv small.ago { display: none; }
  .pc-foot .upd-word { display: none; }
  .pc-foot { flex-wrap: nowrap; }
  .pc-foot .appr { min-width: 0; white-space: nowrap; }
}
#sheet .search { max-width: none; flex: none; }

/* ======================================================================
   Feed (N4) — command-center events, jobs, run logs. Only .fd-* classes.
   ====================================================================== */
.fd-view button { min-width: 64px; }
.fd-filters { display: grid; gap: 10px; margin-top: 14px; }
.fd-frow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-width: 0; }
.fd-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--gray); }
.fd-dot-red { background: var(--red); } .fd-dot-yellow { background: var(--yellow); } .fd-dot-green { background: var(--green); }
.fd-levels .cnt:empty, .fd-chip-n:empty { display: none; }
.fd-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 1px 0; }
.fd-chips::-webkit-scrollbar { display: none; }
.fd-chip { flex: none; height: auto; min-height: 32px; padding: 0 12px; font-size: 13px; }
.fd-chip-n { font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.fd-chip.on .fd-chip-n { color: var(--accent); opacity: .75; }
.fd-chip-n.fd-red::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red); margin-left: 4px; vertical-align: 1px; }
.fd-search { flex: 1 1 240px; max-width: 420px; }
.fd-search input::-webkit-search-cancel-button { display: none; }
.fd-noise { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; margin-left: auto; }
.fd-noise .toggle { transform: scale(.82); transform-origin: right center; }
.fd-noise-n { color: var(--text-3); }

.fd-files { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fd-list { display: grid; gap: 10px; }

/* one group = one card with a level stripe */
.fd-g { --lc: var(--gray); position: relative; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); padding: 11px 14px 6px 18px; display: grid; gap: 4px; min-width: 0; overflow: hidden; }
.fd-g::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--lc); }
.fd-g.fd-red { --lc: var(--red); } .fd-g.fd-yellow { --lc: var(--yellow); } .fd-g.fd-green { --lc: var(--green); }
.fd-g.fd-info { --lc: var(--fill-2); } .fd-g.fd-debug { --lc: var(--fill); }
.fd-g.fd-is-muted { opacity: .72; box-shadow: none; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.fd-g-top { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 24px; }
.fd-lv { width: 9px; height: 9px; border-radius: 50%; background: var(--lc); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--lc) 22%, transparent); }
.fd-g.fd-info .fd-lv { background: var(--text-3); box-shadow: none; } .fd-g.fd-debug .fd-lv { background: var(--fill-2); box-shadow: none; }
.fd-job { font-weight: 650; font-size: 14.5px; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.005em; }
.fd-job:hover { color: var(--accent); text-decoration: none; }
.fd-proj { flex: none; display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .01em;
  background: color-mix(in srgb, var(--pc, var(--gray)) 14%, transparent); color: var(--pc, var(--text-2)); }
.fd-p-hom { --pc: var(--orange); } .fd-p-prayerly { --pc: var(--indigo); } .fd-p-christeta { --pc: var(--pink); } .fd-p-arvilab { --pc: var(--teal); } .fd-p-system { --pc: var(--gray); }
.fd-about { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fd-n { margin-left: auto; flex: none; font-size: 12.5px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: 999px; background: var(--fill); }
.fd-n.fd-one { background: none; color: var(--text-3); font-weight: 600; padding-right: 0; }
.fd-n.fd-many { color: var(--text); background: color-mix(in srgb, var(--lc) 18%, var(--fill)); }
.fd-g.fd-info .fd-n.fd-many, .fd-g.fd-debug .fd-n.fd-many { background: var(--fill-2); }
.fd-msg { margin: 2px 0 0; font-size: 14px; line-height: 1.42; color: var(--text); white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fd-msg.fd-full { display: block; -webkit-line-clamp: unset; }
.fd-msg.fd-clickable { cursor: pointer; }
.fd-g.fd-info .fd-msg, .fd-g.fd-debug .fd-msg { color: var(--text-2); }
.fd-short { display: none; }
.fd-block { display: block; }
.fd-g-foot { display: flex; align-items: center; justify-content: space-between; gap: 2px 10px; flex-wrap: wrap; min-width: 0; }
.fd-when { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 0; }
.fd-ago { color: var(--text-3); }
.fd-acts { display: flex; gap: 2px; margin-left: auto; margin-right: -8px; flex-wrap: wrap; justify-content: flex-end; }
.fd-acts .btn { font-weight: 600; padding: 0 8px; }
.fd-acts .fd-c { margin-left: 5px; font-size: 11.5px; color: var(--text-2); background: var(--fill); padding: 1px 6px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.fd-acts .fd-mute-btn { color: var(--text-2); }
.fd-entries { margin: 4px 0 8px; border-top: .5px solid var(--sep); padding-top: 8px; }
.fd-entries ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fd-entries li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; font-size: 13px; line-height: 1.4; }
.fd-entries time { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fd-e-msg { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12px; background: var(--bg); border-radius: 8px; padding: 6px 9px; max-height: 260px; overflow: auto; }
.fd-e-cwd { display: block; color: var(--text-3); margin-top: 2px; }
.fd-e-note { margin: 8px 0 0; font-size: 12px; color: var(--text-3); }

.fd-empty, .fd-state { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1); padding: 28px 20px; text-align: center; color: var(--text-2); display: grid; justify-items: center; gap: 8px; }
.fd-empty p, .fd-state p { margin: 0; max-width: 560px; }
.fd-empty-ico, .fd-state-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--green); }
.fd-empty-ico svg, .fd-state-ico svg { width: 22px; height: 22px; }
.fd-state { text-align: left; grid-template-columns: auto 1fr; justify-items: start; align-items: start; margin-top: 18px; }
.fd-state .fd-state-ico { background: var(--orange); }
.fd-state h2 { font-size: 16px; color: var(--text); margin-bottom: 4px; }
.fd-state code { font: 12px var(--mono); background: var(--fill); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }

/* muted */
.fd-mutedbox { margin-top: 22px; }
.fd-mutedbox > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border-radius: var(--r); background: var(--fill); cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text-2); }
.fd-mutedbox > summary::-webkit-details-marker { display: none; }
.fd-mutedbox > summary::before { content: "›"; font-size: 18px; color: var(--text-3); transition: transform var(--t-fast) ease-out; }
.fd-mutedbox[open] > summary::before { transform: rotate(90deg); }
.fd-mutedsub { margin-left: auto; font-weight: 500; font-size: 12.5px; color: var(--text-3); }
.fd-mutedbox > .fd-list { margin-top: 10px; }
.fd-rules { margin-top: 10px; display: grid; gap: 6px; }
.fd-rule { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); border-radius: 10px; padding: 6px 6px 6px 12px; box-shadow: var(--shadow-1); }
.fd-rule code { font: 12px var(--mono); overflow-wrap: anywhere; flex: 1 1 260px; min-width: 0; }
.fd-rule-sub { font-size: 12px; color: var(--text-3); }

/* run log */
.fd-logbox { display: grid; gap: 8px; min-width: 0; }
.fd-logbar { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; }
.fd-logdate select { min-height: 32px; padding: 4px 30px 4px 10px; font-size: 13px; width: auto; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.fd-logmeta { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.fd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fd-log { margin: 0; font: 12px/1.5 var(--mono); background: #1c1c1e; color: #e5e5ea; border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; max-height: 420px; min-height: 120px; tab-size: 4; }
.fd-in-sheet .fd-log { max-height: calc(100dvh - 220px); }
.fd-l-run { color: #64d2ff; font-weight: 700; } .fd-l-run.fd-l-bad { color: #ff6961; }
.fd-l-err { color: #ff6961; } .fd-l-warn { color: #ffd60a; } .fd-l-note { color: #98989f; font-style: italic; }

/* jobs */
.fd-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fd-tile { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.fd-tile-n { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fd-tile-l { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.fd-tile-red .fd-tile-n { color: var(--red); } .fd-tile-yellow .fd-tile-n { color: var(--orange); } .fd-tile-gray .fd-tile-n { color: var(--text-3); }
.fd-legend { margin: 8px 4px 0; font-size: 12px; color: var(--text-3); }
.fd-st { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--gray); }
.fd-st-green { background: var(--green); } .fd-st-yellow { background: var(--yellow); } .fd-st-red { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 22%, transparent); }
.fd-st-gray { background: transparent; box-shadow: inset 0 0 0 1.6px var(--text-3); } .fd-st-src { background: var(--fill-2); }
.fd-stt { font-weight: 600; } .fd-stt-red { color: var(--red); } .fd-stt-yellow { color: var(--orange); } .fd-stt-gray { color: var(--text-3); }
.fd-jr .fd-jc { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.fd-jr-ev { display: inline-flex; gap: 4px; justify-content: flex-end; flex: none; }
.fd-none { color: var(--text-3); }
.fd-jr-head { min-height: 32px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.fd-jr-head:hover { background: none; }
.fd-m-only { display: none; }
@media (min-width: 901px) {
  .fd-jobs .fd-jr { display: grid; grid-template-columns: 12px minmax(0, 1fr) 190px 104px 64px 12px; gap: 12px; }
  .fd-jr-head > :nth-child(5) { text-align: right; }
}

/* one job */
.fd-back { font-weight: 800; }
.fd-crumb { color: var(--text-3); margin: 0 8px; font-weight: 500; }
.fd-jobcard { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1); padding: 14px 16px; margin-top: 18px; display: grid; gap: 12px; }
.fd-jobcard-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fd-jobcard-txt { font-size: 14px; color: var(--text-2); }
.traffic.fd-tr-gray { --c: var(--gray); --ct: var(--text-2); }
.fd-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.fd-fact { background: var(--bg); border-radius: 11px; padding: 8px 11px; min-width: 0; }
.fd-fact dt { font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.fd-fact dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fd-fact dd.fd-bad { color: var(--red); }
.fd-dim { color: var(--text-3); font-weight: 500; }
.fd-jrange button { min-width: 44px; }

@media (max-width: 900px) {
  .fd-filters { margin-top: 10px; gap: 8px; }
  .fd-levels { width: 100%; }
  .fd-levels button { flex: 1 1 auto; padding: 0 8px; }
  .fd-levels .fd-lw { display: none; }
  .fd-levels .fd-dot { margin-right: 4px; width: 9px; height: 9px; }
  .fd-chips { margin: 0 -16px; padding: 1px 16px; scroll-padding: 0 16px; }
  .fd-search { flex: 1 1 100%; max-width: none; }
  .fd-noise { margin-left: 0; width: 100%; justify-content: space-between; min-height: 44px; }
  .fd-g { padding: 10px 12px 4px 16px; }
  .fd-entries li { grid-template-columns: 1fr; gap: 2px; }
  .fd-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fd-d-only { display: none !important; }
  .fd-m-only { display: block; }
  .fd-viewrow { margin-top: 10px; display: flex; gap: 8px; }
  .fd-viewrow .seg { display: flex; flex: 1 1 0; min-width: 0; }
  .fd-viewrow .seg button { flex: 1; padding: 0 6px; }
  .fd-long { display: none; } .fd-short { display: inline; }
  .fd-acts { margin-left: -8px; justify-content: flex-start; width: calc(100% + 16px); }
  .fd-log { max-height: 55dvh; }
  .fd-in-sheet .fd-log { max-height: calc(100dvh - 290px); }
  .fd-jtitle { font-size: 22px; letter-spacing: -.02em; }
  .fd-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (pointer: coarse), (max-width: 900px) {   /* phones: 44 px targets (seg buttons sit in a 2 px track) */
  .fd-filters .seg button, .fd-viewrow .seg button, .fd-jrange button, .fd-logbar .seg button { min-height: 40px; }
  .fd-chip { min-height: 44px; padding: 0 14px; }
  .fd-search input { min-height: 44px; font-size: 16px; }
  .fd-acts .btn, .fd-more, #fd-log-full { min-height: 44px; }
  .fd-logdate select { min-height: 44px; font-size: 16px; }
  .fd-mutedbox > summary { min-height: 48px; }
}

/* ======================================================================
   Approve (N2) — every class starts with .ap-
   ====================================================================== */
.ap-s-draft { --c: var(--gray); --ct: var(--text-2); } .ap-s-pending { --c: var(--accent); --ct: var(--accent); } .ap-s-approved { --c: var(--green); --ct: #1d8f40; }
.ap-s-redo { --c: var(--orange); --ct: #b86500; } .ap-s-rejected { --c: var(--red); --ct: var(--red); } .ap-s-published { --c: var(--indigo); --ct: var(--indigo); }
.ap-st { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; flex: none;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--ct, var(--c)); }
.ap-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
:root[data-theme="dark"] .ap-st, :root[data-theme="dark"] .ap-btn:not(.cm) { --ct: var(--c); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ap-st, :root:not([data-theme="light"]) .ap-btn:not(.cm) { --ct: var(--c); } }
.ap-tag { font: 600 .86em var(--mono); color: var(--purple); background: color-mix(in srgb, var(--purple) 12%, transparent); padding: 0 4px; border-radius: 5px; white-space: nowrap; }
.ap-sep { color: var(--text-3); margin: 0 8px; font-weight: 500; }

/* filters */
.ap-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 14px; }
.ap-frow { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 340px; justify-content: flex-end; min-width: 0; }
.ap-sel { width: auto; max-width: 200px; min-height: 32px; padding: 4px 30px 4px 12px; border: 0; border-radius: 9px; background-color: var(--fill); font-size: 13.5px; font-weight: 600; color: var(--text);
  appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.ap-sel:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-tint); }
.ap-search { flex: 1 1 200px; max-width: 300px; }
.ap-search input { min-height: 32px; }
.ap-mode button { display: inline-flex; align-items: center; gap: 5px; }
.ap-mode svg { width: 15px; height: 15px; }

/* batch list */
.ap-batches { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }
.ap-batch { display: flex; gap: 14px; align-items: stretch; padding: 12px; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1); color: inherit; min-width: 0;
  scroll-margin: 150px 0 100px; transition: box-shadow var(--t-fast) ease-out, transform var(--t-fast) ease-out; }
.ap-batch:hover { text-decoration: none; box-shadow: var(--shadow-2); }
.ap-batch:active { transform: scale(.985); }
.ap-batch.sel { box-shadow: 0 0 0 2.5px var(--accent), var(--shadow-2); }
.ap-bcover { width: 88px; height: 88px; border-radius: 12px; overflow: hidden; flex: none; background: var(--fill); display: grid; place-items: center; color: var(--accent); }
.ap-bcover img { width: 100%; height: 100%; object-fit: cover; }
.ap-bico svg { width: 34px; height: 34px; display: block; }
.ap-bmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ap-btitle { font-weight: 700; font-size: 16px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-bsub { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-bar { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; margin-top: 6px; background: var(--fill); }
.ap-bar span { background: var(--c); }
.ap-bar .ap-s-none { background: transparent; }
.ap-bcounts { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12.5px; color: var(--text-2); }
.ap-n b { color: var(--c, var(--text)); font-variant-numeric: tabular-nums; }
.ap-bwhen { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.ap-keys { margin: 22px 4px 0; }

/* empty states */
.ap-empty .soon-ico.green { background: rgba(52,199,89,.15); color: var(--green); }
.ap-empty.small { padding: 28px 20px; }
.ap-emptyact { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.ap-code { text-align: left; font: 12px/1.5 var(--mono); background: var(--fill); padding: 10px 12px; border-radius: 10px; max-width: 100%; overflow-x: auto; white-space: pre; margin: 4px 0 0; }

/* one batch: info line */
.ap-binfo { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 12.5px; color: var(--text-2); margin-top: 10px; }
.ap-binfo span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.ap-binfo svg { width: 14px; height: 14px; flex: none; }
.ap-binfo code { font: 12px var(--mono); overflow-wrap: anywhere; }
.ap-note { color: var(--text); }

/* card grid */
.ap-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; }
.ap-card { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1); overflow: hidden; display: flex; flex-direction: column; position: relative;
  scroll-margin: 160px 0 110px; transition: box-shadow var(--t-fast) ease-out; }
.ap-card::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c); z-index: 2; pointer-events: none; }
.ap-card.ap-s-pending::after, .ap-card.ap-s-draft::after { display: none; }
.ap-card.sel { box-shadow: 0 0 0 3px var(--accent), var(--shadow-2); }
.ap-media { display: block; position: relative; aspect-ratio: 4 / 3; background: var(--fill); overflow: hidden; }
.ap-media > img, .ap-media > video { width: 100%; height: 100%; object-fit: contain; display: block; }
.ap-html { position: absolute; inset: 0; overflow: hidden; background: #fff; }
.ap-html iframe { position: absolute; top: 0; left: 0; width: 1280px; height: calc(100% / var(--s, .25)); border: 0; transform: scale(var(--s, .25)); transform-origin: 0 0; pointer-events: none; }
.ap-fileph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px; text-align: center; color: var(--text-2); font-size: 13px; font-weight: 600; }
.ap-fileph svg { width: 34px; height: 34px; }
.ap-fileph.bad { color: var(--red); }
.ap-fileph code { font: 11px var(--mono); overflow-wrap: anywhere; color: var(--text-2); font-weight: 400; }
.ap-cbody { padding: 12px 14px 4px; display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.ap-chead { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); min-width: 0; }
.ap-ctype { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; white-space: nowrap; }
.ap-ctype svg { width: 14px; height: 14px; }
.ap-num { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text-3); font-weight: 600; }
.ap-ctitle { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; color: var(--text); overflow-wrap: anywhere; }
.ap-ctitle:hover { text-decoration: none; color: var(--accent); }
.ap-headline { font-weight: 650; font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.ap-text { font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.ap-text.big { -webkit-line-clamp: 12; }
.ap-text.full { display: block; -webkit-line-clamp: unset; overflow: visible; }
.ap-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ap-chip { font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--fill); border-radius: 999px; padding: 2px 9px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-last { display: flex; gap: 7px; align-items: flex-start; font-size: 13px; line-height: 1.4; border-radius: 10px; padding: 7px 10px; background: color-mix(in srgb, var(--orange) 11%, var(--surface)); overflow-wrap: anywhere; }
.ap-last svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--orange); }
.ap-mail { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: 13px; }
.ap-mail dt { color: var(--text-2); } .ap-mail dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* decision buttons */
.ap-actions { container: apact / inline-size; display: flex; gap: 6px; padding: 10px 12px 12px; align-items: center; }
.ap-btn { flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 8px; border-radius: 10px; font-weight: 650; font-size: 14px; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--ct, var(--c)); position: relative;
  transition: transform var(--t-fast) ease-out, background-color var(--t-fast) ease-out, color var(--t-fast) ease-out; }
.ap-btn svg { width: 17px; height: 17px; flex: none; }
.ap-btn:hover { background: color-mix(in srgb, var(--c) 22%, transparent); }
.ap-btn:active { transform: scale(.96); }
.ap-btn.ok { --c: var(--green); --ct: #1d8f40; } .ap-btn.redo { --c: var(--orange); --ct: #b86500; } .ap-btn.no { --c: var(--red); --ct: var(--red); }
.ap-btn.cm { --c: var(--gray); --ct: var(--text-2); flex: 0 0 auto; padding: 0 11px; }
.ap-btn.on, .ap-btn.on:hover { background: var(--c); color: #fff; }
.ap-btn kbd { background: rgba(127,127,127,.18); color: inherit; opacity: .85; margin-left: 2px; }
.ap-btn.on kbd { background: rgba(255,255,255,.25); }
.ap-cn { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.ap-actions.big .ap-btn { min-height: 44px; font-size: 15px; }
.ap-actions.done { justify-content: flex-end; }
.ap-subact { display: flex; gap: 4px; padding: 0 8px 8px; margin-top: -6px; }
.ap-pubnote { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; font-size: 13px; font-weight: 600; color: var(--indigo); }
.ap-pubnote svg { width: 16px; height: 16px; }
@container apact (max-width: 379px) { .ap-btn:not(.cm) svg { display: none; } }
@media (pointer: coarse) { .ap-btn { min-height: 44px; } }

/* compact list + side preview */
.ap-split { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
.ap-listcol { min-width: 0; }
.ap-listhead { display: flex; align-items: center; gap: 10px; padding: 0 14px 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.ap-listhead .ap-hidephone { margin-left: auto; font-weight: 500; }
.ap-row { cursor: pointer; min-height: 58px; scroll-margin: 160px 0 110px; }
.ap-row:hover { background: var(--fill); }
.ap-row.sel { background: var(--accent-tint); }
.ap-row.sel::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.ap-rico { color: var(--text-2); flex: none; } .ap-rico svg { width: 18px; height: 18px; display: block; }
.ap-rc { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; } .ap-rc svg { width: 14px; height: 14px; }
.ap-pane { position: sticky; top: 96px; max-height: calc(100dvh - 116px); overflow: auto; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1); }
.ap-pane-in { padding: 14px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.ap-pane-in .ap-num { margin-left: 0; }
.ap-open { margin-left: auto; font-weight: 600; font-size: 13px; }
.ap-ptitle { font-size: 19px; letter-spacing: -.015em; overflow-wrap: anywhere; }
.ap-pmedia img, .ap-pmedia video { width: 100%; max-height: 420px; object-fit: contain; border-radius: 10px; background: var(--fill); }
.ap-pmedia .ap-frame iframe { height: 420px; min-height: 0; }
.ap-pane-in .ap-actions { position: sticky; bottom: 0; padding: 10px 0 12px; background: var(--surface); margin-top: 4px; }
.ap-pane-in .ap-subact { padding: 0 0 10px; margin: -8px 0 0; }
.sheet .ap-pane-in { padding: 0; }
.sheet .ap-pane-in .ap-actions { background: var(--elevated); }
.ap-panempty { padding: 48px 16px; text-align: center; color: var(--text-2); }
.ap-bulkbar { gap: 6px; padding: 6px 8px 6px 16px; bottom: calc(76px + var(--safe-b)); }   /* above the toast */
.ap-bulkbar .ap-bn { margin-right: 4px; white-space: nowrap; font-size: 14px; }
.ap-bulkbar .ap-okbtn { background: var(--green); }
.ap-bulkbar .ap-okbtn svg { width: 15px; height: 15px; }

/* item detail */
.ap-detail { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; margin-top: 16px; align-items: start; }
.ap-stage { min-width: 0; position: sticky; top: 96px; display: flex; flex-direction: column; align-items: center; }
.ap-bigmedia { width: 100%; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1); padding: 12px; display: grid; place-items: center; }
.ap-bigmedia img, .ap-bigmedia video { max-width: 100%; max-height: calc(100dvh - 150px); object-fit: contain; border-radius: 8px; }
.ap-frame { width: 100%; display: flex; justify-content: center; }
.ap-frame iframe { width: 100%; height: calc(100dvh - 190px); min-height: 460px; border: 0; border-radius: 8px; background: #fff; box-shadow: 0 0 0 .5px var(--sep-strong); }
.ap-frame[data-dev="phone"] iframe { width: 390px; max-width: 100%; }
.ap-dev { margin-bottom: 10px; align-self: flex-start; }
.ap-pdf { width: 100%; height: calc(100dvh - 170px); border: 0; border-radius: 8px; }
.ap-preview { width: 100%; max-width: 680px; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1); padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.ap-headline.big { font-size: 20px; letter-spacing: -.015em; }
.ap-text.full.big { font-size: 16px; line-height: 1.6; }
.ap-mdfile { display: flex; align-items: center; gap: 6px; } .ap-mdfile svg { width: 15px; height: 15px; }
.ap-cta { align-self: flex-start; display: inline-flex; flex-direction: column; padding: 9px 16px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; }
.ap-cta small { font-weight: 500; opacity: .85; font-size: 11.5px; }
.ap-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ap-dstatus { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ap-side > .ap-actions { padding: 0; }
.ap-side > .ap-subact { padding: 0; margin: -6px 0 0; }
.ap-box { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ap-box .section-head { padding: 0; flex-wrap: wrap; }
.ap-box .field > span kbd { margin-left: 4px; }
.ap-edit #ap-body { min-height: 180px; font-size: 14.5px; line-height: 1.5; }
.ap-savebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ap-hist { display: flex; flex-direction: column; gap: 10px; max-height: 380px; overflow: auto; }
.ap-ev { display: flex; gap: 8px; }
.ap-evm { min-width: 0; flex: 1; }
.ap-evh { font-size: 13px; }
.ap-evc { margin-top: 3px; padding: 7px 10px; border-radius: 12px 12px 12px 4px; background: var(--surface-2); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ap-ev-redo .ap-evc { background: color-mix(in srgb, var(--orange) 13%, var(--surface)); }
.ap-ev-reject .ap-evc { background: color-mix(in srgb, var(--red) 10%, var(--surface)); }
.ap-ev-approve .ap-evc { background: color-mix(in srgb, var(--green) 12%, var(--surface)); }
.ap-cform { display: flex; gap: 8px; align-items: flex-end; }
.ap-cform textarea { flex: 1; resize: none; min-height: 40px; max-height: 160px; padding: 9px 12px; border-radius: 14px; border: 0; background: var(--fill); line-height: 1.4; }
.ap-cform textarea:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 3px var(--accent-tint), 0 0 0 .5px var(--accent); }
.ap-files { font-size: 12.5px; gap: 4px; }
.ap-files code { font: 11.5px var(--mono); overflow-wrap: anywhere; }

/* decision sheet */
.ap-lessonnote { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 13px; color: var(--text-2); }
.ap-lessonnote svg { width: 16px; height: 16px; flex: none; color: var(--accent); margin-top: 1px; }
.btn.primary.ap-orange { background: var(--orange); } .btn.primary.ap-green { background: var(--green); }

/* page title: small breadcrumb line + big title */
.ap-crumbs { display: block; font-size: 13px; font-weight: 600; letter-spacing: 0; line-height: 1.3; margin-bottom: 2px; color: var(--text-2); }
.ap-crumbs a { color: var(--accent); }
.ap-crumbs .ap-sep { margin: 0 6px; }
.ap-ttl { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ap-pane-in, .ap-pane-in > * { min-width: 0; }
.ap-side .ap-keys { margin: 4px 2px 0; }
@media (max-width: 1100px) { .ap-detail { grid-template-columns: minmax(0, 1fr) 340px; } }
@media (max-width: 900px) {
  .ap-hidephone, .ap-keys { display: none !important; }
  .ap-mode span { display: none; }
  .ap-filters { gap: 8px; }
  .ap-frow { flex-basis: 100%; justify-content: flex-start; }
  .ap-sel { flex: 1 1 28%; max-width: none; min-width: 0; }
  .ap-search { flex-basis: 100%; max-width: none; }
  .ap-search kbd { display: none; }
  .ap-batch { padding: 10px; gap: 12px; }
  .ap-bcover { width: 64px; height: 64px; border-radius: 10px; }
  .ap-bwhen { display: none; }
  .ap-grid { gap: 12px; }
  .ap-split { grid-template-columns: 1fr; }
  .ap-pane { display: none; }
  .ap-detail { grid-template-columns: 1fr; gap: 14px; margin-top: 12px; }
  .ap-stage { position: static; }
  .ap-bigmedia { padding: 8px; }
  .ap-bigmedia img, .ap-bigmedia video { max-height: 70dvh; }
  .ap-frame iframe { height: 70dvh; min-height: 0; }
  .ap-preview { padding: 16px; }
  .ap-bulkbar { bottom: calc(80px + var(--safe-b)); max-width: calc(100% - 24px); }
  .ap-row.sel { background: none; } .ap-row.sel::after { display: none; }
  .ap-ttl { font-size: 22px; line-height: 1.2; }
  .ap-seg button { padding: 0 10px; }
  .ap-card.sel, .ap-batch.sel { box-shadow: var(--shadow-1); }
  .ap-btn, .ap-actions .btn, .ap-seg button, .ap-mode button, .ap-sel, .ap-search input, .ap-subact .btn, .ap-cform .btn, .ap-savebar .btn, .ap-emptyact .btn, .ap-bulkbar .btn, .ap-pane-in .ap-open { min-height: 44px; }
  .ap-sel, .ap-search input { font-size: 16px; }
  .ap-nav, .ap-bulkbar .icon-btn { width: 44px; height: 44px; }
  .ap-pane-in .ap-open { display: inline-flex; align-items: center; }
  .ap-row .check { width: 28px; height: 28px; }
}
@media (pointer: coarse) { .ap-sel, .ap-search input { min-height: 44px; font-size: 16px; } .ap-row .check { width: 28px; height: 28px; } }

/* Lessons (minimal upgrade in N2): files left, content right, search with highlights */
.ap-ls-split { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.ap-ls-left { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ap-ls-right { min-width: 0; }
.ap-ls-search { max-width: none; flex: none; }
.ap-ls-files .row.ap-ls-on { background: var(--accent-tint); }
.ap-ls-files .sub b { color: var(--accent); }
.ap-ls-files .ficon { color: var(--accent); } .ap-ls-files .ficon svg { width: 22px; height: 22px; }
.ap-ls-hits { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--yellow); color: #1c1c1e; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.lesson-doc mark { background: color-mix(in srgb, var(--yellow) 55%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.ap-ls-path { margin: 16px 0 0; }
@media (max-width: 900px) { .ap-ls-search { margin-bottom: 10px; } .ap-ls-search input { min-height: 44px; font-size: 16px; } }

/* ---------- Ventures (N3): .vn- only ---------- */
.vn-sec .section-head { flex-wrap: wrap; }
.vn-rule { font-size: 12.5px; color: var(--text-2); }
.vn-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.vn-grid.big { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.vn-card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; min-width: 0; transition: box-shadow var(--t-fast), transform var(--t-fast), opacity var(--t-fast); }
.vn-card:hover { box-shadow: var(--shadow-2); }
.vn-card.big { padding: 16px 18px 12px; gap: 8px; }
.vn-card.dragging { opacity: .45; transform: scale(.98); }
.vn-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vn-grip { color: var(--text-3); cursor: grab; font-size: 13px; letter-spacing: -2px; user-select: none; flex: none; }
.vn-name { flex: 1; min-width: 0; font-weight: 650; font-size: 15.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vn-card.big .vn-name { font-size: 18px; letter-spacing: -.01em; }
.vn-name:hover { text-decoration: none; color: var(--accent); }
.vn-stagebtn { flex: none; padding: 0; background: none; border: 0; border-radius: 999px; min-height: 28px; display: inline-flex; align-items: center; cursor: pointer; }
.vn-stagebtn:disabled { cursor: default; }
.vn-stage { height: 22px; }
.vn-angle { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vn-card.big .vn-angle { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.vn-day { align-self: flex-start; font-size: 12.5px; font-weight: 700; color: #b86500; background: rgba(255,149,0,.14); border-radius: 6px; padding: 2px 7px; font-variant-numeric: tabular-nums; }
.vn-day.over { color: var(--red); background: rgba(255,59,48,.12); }
.vn-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--surface-2); border-radius: var(--r-s); padding: 6px 8px; }
.vn-nums[role=button] { cursor: pointer; }
.vn-nums[role=button]:hover { background: var(--fill); }
.vn-nums span { display: flex; flex-direction: column; min-width: 0; }
.vn-nums b { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.vn-nums.big b { font-size: 22px; letter-spacing: -.02em; }
.vn-nums small { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.vn-foot { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.vn-last { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vn-move { display: flex; gap: 2px; flex: none; }
.vn-move .icon-btn { width: 32px; height: 32px; font-size: 16px; color: var(--text-2); }
.vn-empty { color: var(--text-2); background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); padding: 18px 16px; font-size: 14px; }
.vn-killed > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; padding: 6px 4px 10px; list-style: none; }
.vn-killed > summary::before { content: "›"; display: inline-block; margin-right: 6px; transition: transform var(--t-fast); }
.vn-killed[open] > summary::before { transform: rotate(90deg); }
.vn-killed .vn-card { opacity: .75; }
.vn-hint { margin-top: 18px; }
.vn-strow { width: 100%; text-align: left; background: none; border: 0; font: inherit; color: inherit; min-height: 52px; }
.vn-strow.cur { background: var(--accent-tint); }
.vn-rulebox { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--r-s); background: var(--accent-tint); font-size: 14px; }
.vn-tick { display: flex; align-items: center; gap: 10px; margin-top: 14px; min-height: 44px; font-weight: 500; cursor: pointer; }
.vn-tick input { width: 20px; height: 20px; accent-color: var(--accent); }
/* venture page */
.vn-back { display: inline-grid; place-items: center; width: 32px; height: 32px; margin: 0 6px 0 -6px; border-radius: 8px; font-size: 26px; line-height: 1; color: var(--accent); vertical-align: 2px; }
.vn-back:hover { background: var(--fill); text-decoration: none; }
.vn-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 16px; align-items: center; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1); padding: 16px 18px; margin-top: 12px; }
.vn-hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.vn-hero-angle { margin: 8px 0 0; font-size: 15px; line-height: 1.45; }
.vn-hero .vn-rule { margin: 8px 0 0; }
.vn-met { color: var(--green); }
.vn-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 16px 0 12px; padding: 2px; background: var(--fill); border-radius: 10px; }
.vn-tabs::-webkit-scrollbar { display: none; }
.vn-tabs a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; }
.vn-tabs a:hover { text-decoration: none; background: var(--fill); }
.vn-tabs a[aria-current] { background: var(--elevated); box-shadow: 0 1px 3px rgba(0,0,0,.14), 0 0 0 .5px rgba(0,0,0,.04); }
.vn-tc { font-size: 11.5px; font-weight: 700; color: var(--text-2); background: var(--fill-2); border-radius: 999px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.vn-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; margin: 0 0 14px; }
.vn-fact { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); padding: 10px 14px; }
.vn-fact dt { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.vn-fact dd { margin: 4px 0 0; font-size: 14px; line-height: 1.45; }
.vn-panel { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); padding: 16px 20px; }
.vn-md { font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.vn-md > :first-child { margin-top: 0; }
.vn-md h2 { font-size: 21px; margin: 18px 0 8px; letter-spacing: -.01em; } .vn-md h3 { font-size: 17px; margin: 16px 0 6px; } .vn-md h4, .vn-md h5, .vn-md h6 { font-size: 15px; margin: 14px 0 6px; }
.vn-md p, .vn-md ul, .vn-md ol, .vn-md blockquote { margin: 0 0 10px; }
.vn-md ul, .vn-md ol { padding-left: 22px; }
.vn-md li { margin: 3px 0; } .vn-md .vn-li-box { list-style: none; margin-left: -18px; }
.vn-md blockquote { border-left: 3px solid var(--sep-strong); padding: 2px 12px; color: var(--text-2); }
.vn-md code { font-family: var(--mono); font-size: .88em; background: var(--fill); border-radius: 4px; padding: 1px 4px; }
.vn-md pre { background: var(--surface-2); border-radius: var(--r-s); padding: 10px 12px; overflow-x: auto; }
.vn-md pre code { background: none; padding: 0; }
.vn-md hr { border: 0; border-top: .5px solid var(--sep); margin: 14px 0; }
.vn-tablewrap { overflow-x: auto; margin: 0 0 12px; }
.vn-md table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.vn-md th, .vn-md td { border-bottom: .5px solid var(--sep); padding: 6px 10px 6px 0; text-align: left; vertical-align: top; }
.vn-md th { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.vn-fk { flex: none; min-width: 48px; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; border-radius: 6px; padding: 3px 6px; background: var(--fill); color: var(--text-2); }
.vn-k-image { background: rgba(48,176,199,.16); color: #117a8b; } .vn-k-md { background: var(--accent-tint); color: var(--accent); }
.vn-k-html { background: rgba(175,82,222,.16); color: var(--purple); } .vn-k-pdf { background: rgba(255,59,48,.12); color: var(--red); }
.vn-file { width: 100%; text-align: left; background: none; border: 0; font: inherit; color: inherit; }
.vn-path { margin: 10px 4px 0; overflow-wrap: anywhere; }
.vn-pimg { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: var(--r-s); }
.vn-pframe { width: 100%; height: 70vh; border: 0; border-radius: var(--r-s); background: #fff; }
.vn-pre { white-space: pre-wrap; font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border-radius: var(--r-s); padding: 12px; margin: 0; max-height: 70vh; overflow: auto; }
.vn-add { display: flex; gap: 8px; margin-bottom: 12px; align-items: stretch; }
.vn-add .input { flex: 1; min-width: 0; min-height: 40px; }
.vn-add .vn-due { flex: 0 0 160px; }
.vn-cform textarea { resize: vertical; }
.vn-check { background: none; cursor: pointer; }
.vn-com { align-items: flex-start; }
.vn-cbody { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.45; }
.vn-leads { display: flex; flex-direction: column; gap: 6px; }
.vn-leads p { margin: 0; }
.vn-leads-n { display: flex; align-items: baseline; gap: 8px; } .vn-leads-n b { font-size: 34px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; } .vn-leads-n span { color: var(--text-2); }
.vn-tl { list-style: none; margin: 0; padding: 4px 0 0 4px; }
.vn-tl li { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.vn-tl li:not(:last-child)::before { content: ""; position: absolute; left: 4px; top: 14px; bottom: 0; border-left: 1.5px solid var(--sep); }
.vn-tdot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; }
.vn-tl li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.vn-tl small { color: var(--text-2); font-size: 12.5px; }
:root[data-theme="dark"] .vn-day { color: var(--orange); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .vn-day { color: var(--orange); } }
@media (max-width: 900px) {
  .vn-grid, .vn-grid.big { grid-template-columns: 1fr; }
  .vn-hero { grid-template-columns: 1fr; }
  .vn-tabs a { min-height: 44px; }
  .vn-move .icon-btn { width: 44px; height: 44px; }
  .vn-stagebtn { min-height: 44px; }
  .vn-add { flex-wrap: wrap; } .vn-add .input { min-height: 44px; font-size: 16px; } .vn-add .vn-due { flex: 1 1 140px; } .vn-add .btn { min-height: 44px; }
  .vn-hint { display: none; }
}
.vn-chg { margin-left: 6px; font-size: 13px; font-weight: 600; color: var(--accent); }
@media (max-width: 900px) { .vn-syncbtn { min-height: 44px; } }
@media (max-width: 900px) { .vn-add input[name=title] { flex: 1 1 100%; } .vn-add .vn-due { flex: 1 1 0; } }
.vn-body .row > .pill:first-child { min-width: 78px; justify-content: center; }

/* ---------- Project hierarchy: Home card → #project/<id> → project panel / children ---------- */
a.pc-head, a.kpi-mini { color: inherit; text-decoration: none; }
a.pc-head:hover .pc-name, a.pc-head:focus-visible .pc-name { color: var(--accent); }
.pc-name .chevron { margin-left: 6px; color: var(--text-3); font-weight: 600; }
.pc-foot .pc-panel { margin-left: auto; }
.pc-foot .pc-panel + .upd { flex-basis: 100%; text-align: right; }
.pj-main .btn.big { margin-top: 2px; }
.pj-status { display: flex; flex-direction: column; gap: 18px; }
