/* =====================================================================
   TAKSOPARK — one stylesheet. White, bright, yellow accent, grey ink.
   No shadows, no gradients. Local font only.
   ===================================================================== */

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/onest-cyrillic-wght-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/onest-cyrillic-ext-wght-normal.woff2) format("woff2");
  unicode-range:
    U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/onest-latin-wght-normal.woff2) format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/onest-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #ffffff;
  --panel: #f5f6f8;
  --panel-2: #eef0f3;
  --line: #eaecef;
  --ink: #2f343b;
  --ink-2: #6b727d;
  --ink-3: #a1a7b0;
  --accent: #ffcd1c;
  --accent-hover: #f7c200;
  --accent-soft: #fff6d1;
  --accent-ink: #2a2610;
  --red: #d9474c;
  --red-soft: #fcebeb;
  --red-bar: #f3c3c5;

  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 9px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t: 180ms var(--ease);
  --sidebar: 252px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.45 var(--font);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
  border-radius: 6px;
}
::selection {
  background: var(--accent-soft);
}
[hidden] {
  display: none !important;
}

/* ---------- icons ---------- */
.ic {
  width: 20px;
  height: 20px;
  flex: none;
  fill: currentColor;
  display: inline-block;
  vertical-align: middle;
}
.ic .k {
  fill: var(--ic-k, var(--bg));
}
.ic-sm {
  width: 16px;
  height: 16px;
}
.ic-xs {
  width: 14px;
  height: 14px;
}

/* =====================================================================
   LOGIN
   ===================================================================== */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fade 0.35s var(--ease);
}
.login-box {
  width: 100%;
  max-width: 360px;
}
.login-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  color: var(--accent-ink);
  --ic-k: var(--accent);
}
.login-mark .ic {
  width: 28px;
  height: 28px;
}
.login h1 {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.login p.muted {
  margin: 0 0 28px;
  color: var(--ink-2);
}
.login form {
  display: grid;
  gap: 12px;
}
.login .btn {
  height: 46px;
  margin-top: 8px;
}
.login .err {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
  margin: 0;
}

/* =====================================================================
   SHELL
   ===================================================================== */
.shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: var(--bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform 260ms var(--ease);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 22px 18px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--accent);
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  --ic-k: var(--accent);
}
.brand-name {
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 12px;
  color: var(--ink-3);
}
.nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 16px;
  scrollbar-width: thin;
}
.nav-group {
  margin-top: 14px;
}
.nav-title {
  font-size: 12px;
  color: var(--ink-3);
  padding: 0 12px 6px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-weight: 500;
  transition:
    background var(--t),
    color var(--t);
  --ic-k: var(--bg);
}
.nav a:hover {
  background: var(--panel);
  color: var(--ink);
  --ic-k: var(--panel);
}
.nav a.active {
  background: var(--accent);
  color: var(--accent-ink);
  --ic-k: var(--accent);
}
.nav a .soon {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
}
.nav a.active .soon {
  color: var(--accent-ink);
  opacity: 0.6;
}
.side-foot {
  border-top: 1px solid var(--line);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--panel-2);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-2);
  flex: none;
}
.who {
  min-width: 0;
  flex: 1;
}
.who b {
  display: block;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.who span {
  font-size: 12px;
  color: var(--ink-3);
}

.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar);
}
.topbar {
  display: none;
}
.page {
  padding: 30px 36px 64px;
  max-width: 1560px;
}
.page.enter {
  animation: rise 0.32s var(--ease);
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(31, 35, 41, 0.28);
  z-index: 35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms var(--ease);
}

/* ---------- page header ---------- */
.ph {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.ph h1 {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.022em;
  margin: 0;
}
.ph .crumb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-3);
  font-size: 13px;
  margin-bottom: 6px;
  transition: color var(--t);
}
.ph .crumb:hover {
  color: var(--ink);
}
.ph .lead {
  color: var(--ink-2);
  margin-top: 6px;
}
.ph-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* =====================================================================
   CONTROLS
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 0;
  background: var(--panel);
  color: var(--ink);
  font-weight: 550;
  white-space: nowrap;
  transition:
    background var(--t),
    transform 120ms var(--ease),
    opacity var(--t);
  --ic-k: var(--panel);
}
.btn:hover {
  background: var(--panel-2);
  --ic-k: var(--panel-2);
}
.btn:active {
  transform: scale(0.975);
}
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  --ic-k: var(--accent);
}
.btn.primary:hover {
  background: var(--accent-hover);
  --ic-k: var(--accent-hover);
}
.btn.danger {
  background: var(--red-soft);
  color: var(--red);
}
.btn.ghost {
  background: transparent;
}
.btn.ghost:hover {
  background: var(--panel);
}
.btn.sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}
.btn.icon {
  width: 38px;
  padding: 0;
}
.btn.sm.icon {
  width: 32px;
}
.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.field > span {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
}
.field .hint {
  font-size: 12px;
  color: var(--ink-3);
}
.input,
.select,
textarea.input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--panel);
  outline: none;
  transition:
    border-color var(--t),
    background var(--t);
}
textarea.input {
  height: auto;
  min-height: 84px;
  padding: 10px 13px;
  resize: vertical;
}
.input:hover,
.select:hover {
  background: var(--panel-2);
}
.input:focus,
.select:focus {
  background: var(--bg);
  border-color: var(--accent-hover);
}
.input::placeholder {
  color: var(--ink-3);
}
.select {
  appearance: none;
  padding-right: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9.5l6 6 6-6' fill='none' stroke='%23a1a7b0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 16px;
}
.input.invalid {
  border-color: var(--red);
}
input[type="number"]::-webkit-inner-spin-button {
  opacity: 0.4;
}
input[type="date"].input,
input[type="time"].input {
  min-width: 0;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.check input {
  appearance: none;
  width: 38px;
  height: 22px;
  border-radius: 22px;
  background: var(--panel-2);
  position: relative;
  cursor: pointer;
  transition: background var(--t);
  margin: 0;
  flex: none;
}
.check input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  transition: transform var(--t);
}
.check input:checked {
  background: var(--accent);
}
.check input:checked::after {
  transform: translateX(16px);
}

/* segmented control (scope switch, toggles, tabs) */
.seg {
  display: inline-flex;
  background: var(--panel);
  border-radius: 11px;
  padding: 3px;
  gap: 2px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar {
  display: none;
}
.seg button {
  border: 0;
  background: transparent;
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--ink-2);
  font-weight: 500;
  white-space: nowrap;
  transition:
    background var(--t),
    color var(--t);
}
.seg button:hover {
  color: var(--ink);
}
.seg button.on {
  background: var(--bg);
  color: var(--ink);
}
.seg.accent button.on {
  background: var(--accent);
  color: var(--accent-ink);
}
.bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.bar-row .range {
  color: var(--ink-3);
  font-size: 13px;
}

/* =====================================================================
   CARDS
   ===================================================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.cards.tight {
  margin-bottom: 18px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px 17px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
}
.card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}
.card-ic {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--panel);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  flex: none;
  --ic-k: var(--panel);
}
.card-ic .ic {
  width: 17px;
  height: 17px;
}
.card-v {
  font-size: 22px;
  font-weight: 620;
  letter-spacing: -0.015em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-s {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: -4px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.card.accent .card-top {
  color: var(--accent-ink);
}
.card.accent .card-ic {
  background: rgba(255, 255, 255, 0.55);
  color: var(--accent-ink);
  --ic-k: #fff1b3;
}
.card.accent .card-s {
  color: rgba(42, 38, 16, 0.6);
}
.card.soft {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}
.card.soft .card-ic {
  background: var(--bg);
  --ic-k: var(--bg);
}
.card.danger .card-v {
  color: var(--red);
}
.neg {
  color: var(--red);
}

/* =====================================================================
   SECTIONS / TABLES
   ===================================================================== */
.section {
  margin-bottom: 30px;
}
.section-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.section-h h2 {
  font-size: 17px;
  font-weight: 620;
  letter-spacing: -0.01em;
  margin: 0;
}
.section-h .sub {
  color: var(--ink-3);
  font-size: 13px;
}
.box {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  min-width: 0;
}
.box.pad {
  padding: 18px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.toolbar {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  align-items: center;
}
.search {
  position: relative;
  flex: 1 1 240px;
  max-width: 360px;
}
.search .ic {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  width: 16px;
  height: 16px;
}
.search .input {
  height: 36px;
  padding-left: 36px;
}
.toolbar .select {
  height: 36px;
  width: auto;
  min-width: 150px;
}
.toolbar .count {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 13px;
}

.tbl-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.tbl th {
  text-align: left;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  user-select: none;
  position: sticky;
  top: 0;
  background: var(--bg);
}
.tbl th.sortable {
  cursor: pointer;
  transition: color var(--t);
}
.tbl th.sortable:hover {
  color: var(--ink);
}
.tbl th .ic {
  width: 12px;
  height: 12px;
  margin-left: 4px;
  opacity: 0;
  transition:
    opacity var(--t),
    transform var(--t);
}
.tbl th.sorted {
  color: var(--ink);
}
.tbl th.sorted .ic {
  opacity: 1;
}
.tbl th.sorted.asc .ic {
  transform: rotate(180deg);
}
.tbl td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: middle;
}
.tbl tbody tr {
  transition: background 120ms;
}
.tbl tbody tr:last-child td {
  border-bottom: 0;
}
.tbl tbody tr.click {
  cursor: pointer;
}
.tbl tbody tr:hover {
  background: var(--panel);
}
.tbl .num {
  text-align: right;
}
.tbl .muted,
.muted {
  color: var(--ink-3);
}
.tbl .strong {
  font-weight: 600;
}
.tbl .two b {
  display: block;
  font-weight: 600;
}
.tbl .two span {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
}
.tbl tr.hl td {
  background: var(--accent-soft);
}
.tbl tfoot td {
  font-weight: 600;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
.row-actions {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
  opacity: 0.55;
  transition: opacity var(--t);
}
tr:hover .row-actions {
  opacity: 1;
}
.row-actions button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  transition:
    background var(--t),
    color var(--t);
  --ic-k: var(--panel);
}
.row-actions button:hover {
  background: var(--bg);
  color: var(--ink);
  --ic-k: var(--bg);
}
.row-actions button.danger:hover {
  color: var(--red);
}
.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--ink-3);
}
.empty .ic {
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  color: var(--panel-2);
  --ic-k: var(--bg);
}
.pager {
  display: flex;
  justify-content: center;
  padding: 12px;
  border-top: 1px solid var(--line);
}

/* horizontal month table (Прибыль по месяцам / Доля в прибыли) */
.htable td,
.htable th {
  text-align: right;
}
.htable td:first-child,
.htable th:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--bg);
  z-index: 1;
}
.htable tbody tr:hover td:first-child {
  background: var(--panel);
}
.cell2 b {
  display: block;
  font-weight: 600;
}
.cell2 span {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
}

/* badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 550;
  background: var(--panel);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge.yellow {
  background: var(--accent-soft);
  color: #7a5c00;
}
.badge.solid {
  background: var(--accent);
  color: var(--accent-ink);
}
.badge.red {
  background: var(--red-soft);
  color: var(--red);
}
.badge.dark {
  background: var(--ink);
  color: #fff;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* key-value list */
.kv {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px 24px;
}
.kv div span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: 3px;
}
.kv div b {
  font-weight: 560;
  word-break: break-word;
}

/* =====================================================================
   CHARTS
   ===================================================================== */
.chart {
  position: relative;
  padding: 18px 18px 12px;
}
.chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.chart svg {
  display: block;
}
.chart .grid line {
  stroke: var(--line);
  stroke-width: 1;
}
.chart .zero {
  stroke: var(--ink-3);
  stroke-width: 1;
}
.chart .axis text {
  fill: var(--ink-3);
  font-size: 11.5px;
}
.chart .band {
  fill: transparent;
  transition: fill 140ms;
}
.chart .band.on {
  fill: var(--panel);
}
.chart rect.bar {
  transition: opacity 140ms;
}
.chart .legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0 2px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.chart .legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}
.tip {
  position: absolute;
  pointer-events: none;
  z-index: 20;
  min-width: 200px;
  max-width: 280px;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 12.5px;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 140ms var(--ease),
    transform 140ms var(--ease);
}
.tip.on {
  opacity: 1;
  transform: none;
}
.tip h4 {
  margin: 0 0 7px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.tip h4 span {
  color: var(--accent);
}
.tip .r {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0;
  color: #d6d9de;
}
.tip .r b {
  color: #fff;
  font-weight: 550;
}
.tip .r.sub {
  color: #9ba1aa;
  padding-left: 10px;
  font-size: 12px;
}
.tip hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin: 6px 0;
}
.tip .hi {
  color: var(--accent);
}

.timeline {
  padding: 18px;
}
.timeline .ctrl {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.timeline .when {
  font-size: 13px;
  color: var(--ink-2);
  min-width: 0;
  flex: 1;
}
.timeline .when b {
  color: var(--ink);
  font-weight: 600;
}
input[type="range"].slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  margin: 8px 0 0;
  cursor: pointer;
}
input[type="range"].slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: var(--panel-2);
}
input[type="range"].slider::-moz-range-track {
  height: 6px;
  border-radius: 6px;
  background: var(--panel-2);
}
input[type="range"].slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  margin-top: -7px;
  transition: transform var(--t);
}
input[type="range"].slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
}
input[type="range"].slider:active::-webkit-slider-thumb {
  transform: scale(1.15);
}

/* =====================================================================
   MODAL / TOAST
   ===================================================================== */
.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(31, 35, 41, 0.32);
  animation: fade 0.18s var(--ease);
}
.modal-wrap.out {
  animation: fadeout 0.16s var(--ease) forwards;
}
.modal {
  width: 100%;
  max-width: 540px;
  max-height: calc(100dvh - 40px);
  background: var(--bg);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  animation: pop 0.24s var(--ease);
}
.modal.wide {
  max-width: 760px;
}
.modal-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 8px;
  gap: 12px;
}
.modal-h h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 640;
  letter-spacing: -0.01em;
}
.modal-b {
  padding: 10px 22px 8px;
  overflow-y: auto;
}
.modal-f {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px 20px;
}
.modal-f .spacer {
  flex: 1;
}
.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form .full {
  grid-column: 1 / -1;
}
.form-sep {
  grid-column: 1 / -1;
  font-weight: 600;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.form-err {
  grid-column: 1 / -1;
  color: var(--red);
  font-size: 13px;
  min-height: 0;
}
.note {
  background: var(--panel);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-2);
}
.note.yellow {
  background: var(--accent-soft);
  color: #5e4a05;
}
.note b {
  color: var(--ink);
}

.steps {
  display: flex;
  gap: 6px;
  margin: 0 0 18px;
}
.steps i {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: var(--panel-2);
  transition: background 240ms var(--ease);
}
.steps i.on {
  background: var(--accent);
}
.calc {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.calc div {
  background: var(--panel);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.calc span {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
}
.calc b {
  font-weight: 600;
}
.calc .hl {
  background: var(--accent-soft);
}

/* combobox */
.combo {
  position: relative;
}
.combo-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  max-height: 250px;
  overflow-y: auto;
  z-index: 10;
  padding: 4px;
  animation: fade 0.12s;
}
.combo-list button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
}
.combo-list button:hover,
.combo-list button.act {
  background: var(--panel);
}
.combo-list button small {
  display: block;
  color: var(--ink-3);
  font-size: 12px;
}
.combo-list .none {
  padding: 10px;
  color: var(--ink-3);
  font-size: 13px;
}

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: grid;
  gap: 8px;
  justify-items: end;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  max-width: 360px;
  animation: rise 0.24s var(--ease);
  display: flex;
  gap: 10px;
  align-items: center;
}
.toast .ic {
  color: var(--accent);
  --ic-k: var(--ink);
  width: 18px;
  height: 18px;
}
.toast.err .ic {
  color: #ff8a8e;
}
.toast.out {
  animation: fadeout 0.2s forwards;
}

/* placeholder & skeleton */
.placeholder {
  border: 1px dashed var(--panel-2);
  border-radius: var(--r-lg);
  padding: 64px 24px;
  text-align: center;
  max-width: 620px;
}
.placeholder .card-ic {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  margin: 0 auto 18px;
  background: var(--accent-soft);
  color: #7a5c00;
  --ic-k: var(--accent-soft);
}
.placeholder .card-ic .ic {
  width: 26px;
  height: 26px;
}
.placeholder h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 640;
}
.placeholder p {
  margin: 0 auto;
  color: var(--ink-2);
  max-width: 44ch;
}
.skel {
  background: var(--panel);
  border-radius: var(--r-lg);
  animation: pulse 1.2s ease-in-out infinite;
}
.skel-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.skel-cards .skel {
  height: 96px;
}
.errbox {
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--red-soft);
  color: var(--red);
}

.tabs {
  margin-bottom: 20px;
}
.split {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bar-pct {
  height: 6px;
  background: var(--panel-2);
  border-radius: 6px;
  overflow: hidden;
  min-width: 80px;
  flex: 1;
}
.bar-pct i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
}

/* =====================================================================
   MOTION
   ===================================================================== */
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes fadeout {
  to {
    opacity: 0;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}
@keyframes pulse {
  50% {
    opacity: 0.55;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1180px) {
  .page {
    padding: 26px 24px 56px;
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .shell.menu-open .sidebar {
    transform: none;
  }
  .shell.menu-open .scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .main {
    margin-left: 0;
  }
  .topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 30;
    height: 58px;
    padding: 0 12px;
    padding-top: env(safe-area-inset-top);
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .topbar b {
    font-weight: 620;
    font-size: 15px;
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .page {
    padding: 20px 14px 48px;
  }
  .ph h1 {
    font-size: 23px;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .card {
    padding: 13px 13px 14px;
    border-radius: 15px;
    gap: 8px;
  }
  .card-v {
    font-size: 17px;
  }
  .card-ic {
    display: none;
  }
  .form {
    grid-template-columns: 1fr;
  }
  .modal-wrap {
    padding: 0;
    place-items: end stretch;
  }
  .modal {
    max-width: none;
    border-radius: 22px 22px 0 0;
    max-height: 92dvh;
    animation: sheet 0.28s var(--ease);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .toolbar .select {
    flex: 1 1 140px;
  }
  .search {
    max-width: none;
  }
  .toasts {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }
  .bar-row {
    align-items: stretch;
  }
}
@keyframes sheet {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}
.ic .ks {
  fill: none;
  stroke: var(--ic-k, var(--bg));
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
