
:root {
  --ink-900: #16181c;
  --ink-800: #22252b;
  --ink-700: #32363e;
  --ink-500: #5b6270;
  --ink-400: #7b8393;
  --surface: #ffffff;
  --surface-sunk: #f3f4f6;
  --page: #eceef1;
  --line: rgba(22, 24, 28, 0.10);
  --line-soft: rgba(22, 24, 28, 0.06);

  --text: var(--ink-900);
  --text-2: #4a515d;
  --text-3: #5f6673;

  --accent: #f2c200;
  --danger: #a4262c;

  --alloc: #2e9e63;
  --free: #9b1c1c;
  --back: #1172c7;
  --off: #a528b8;
  --alloc-tint: rgba(46, 158, 99, 0.07);
  --alloc-line: rgba(46, 158, 99, 0.28);
  --free-tint: rgba(155, 28, 28, 0.07);
  --free-line: rgba(155, 28, 28, 0.28);
  --good-text: #006300;

  --r-ctl: 10px;
  --r-card: 14px;
  --r-panel: 18px;

  --ease: cubic-bezier(0.2, 0, 0.2, 1);
  --t-fast: 120ms;
  --t-mid: 200ms;

  --on-ink: #ffffff;

  --scrim-bg: rgba(22, 24, 28, 0.42);
  --shadow-fab: 0 4px 16px rgba(22, 24, 28, 0.20);
  --shadow-pop: 0 1px 2px rgba(22, 24, 28, 0.06), 0 12px 28px rgba(22, 24, 28, 0.12);
  --shadow-sheet: 0 1px 2px rgba(22, 24, 28, 0.05), 0 12px 32px rgba(22, 24, 28, 0.07);

  --nav-bar: var(--accent);
  --nav-ring: #ffffff;
  --nav-pill: var(--accent);
  --nav-ink-on: #ffffff;
  --nav-ink-off: var(--text-2);
  --nav-label-on: var(--text);

  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

:root[data-theme="dark"] {
  --ink-900: #f1f3f6;
  --ink-800: #e0e4ea;
  --ink-700: #c3c9d3;
  --ink-500: #8c94a2;
  --ink-400: #6e7684;
  --surface: #1b1e24;
  --surface-sunk: #252932;
  --page: #131519;
  --line: rgba(255, 255, 255, 0.13);
  --line-soft: rgba(255, 255, 255, 0.07);

  --text: #f1f3f6;
  --text-2: #b7bec9;
  --text-3: #98a0ac;

  --accent: #f2c200;
  --danger: #e8776c;

  --alloc: #03ae7b;
  --free: #b14e3f;
  --back: #4aa3ff;
  --off: #c77dff;
  --alloc-tint: rgba(3, 174, 123, 0.13);
  --alloc-line: rgba(3, 174, 123, 0.34);
  --free-tint: rgba(177, 78, 63, 0.15);
  --free-line: rgba(177, 78, 63, 0.36);
  --good-text: #4ecf96;

  --on-ink: #15171c;

  --scrim-bg: rgba(0, 0, 0, 0.58);
  --shadow-fab: 0 4px 16px rgba(0, 0, 0, 0.55);
  --shadow-pop: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 28px rgba(0, 0, 0, 0.5);
  --shadow-sheet: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.45);

  --nav-bar: var(--surface);

  --nav-ring: var(--page);
  --nav-pill: #ffffff;
  --nav-ink-on: #16181c;
  --nav-ink-off: #ffffff;

  --nav-label-on: #ffffff;
}

:root[data-theme="dark"] .brand-mark {
  background-image: url("assets/icon-dark.svg");
}

:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.scroll-area {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scroll-area::-webkit-scrollbar { width: 0; height: 0; }

body {
  background: var(--page);
  color: var(--text);
  font: 400 15px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

svg.ico {
  width: 18px; height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:where(button, input, select, a):focus-visible {
  outline: 2px solid var(--ink-900);
  outline-offset: 2px;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 720px;
  margin: 0 auto;
  background: var(--page);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: 16px;
  background: var(--page);
  border-bottom: 1px solid var(--line-soft);
}

.brand { display: flex; align-items: center; gap: 9px; }

.brand-logo {
  display: block;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
}

.bl-tile { fill: var(--ink-900); }
.bl-sq { fill: var(--on-ink); }
.bl-dot { fill: var(--accent); }

.brand-logo .bl-tile,
.brand-logo .bl-sq { transform-box: fill-box; transform-origin: center; }

.brand-logo .bl-tile {
  animation: bl-tile 420ms cubic-bezier(.21, .83, .26, 1) both,
             bl-breath 4.2s 1200ms ease-in-out infinite;
}

.brand-logo .bl-sq {
  animation: bl-sq 380ms cubic-bezier(.21, .83, .26, 1) both,
             bl-wave 4.2s ease-in-out infinite;
}

.brand-logo .bl-1 { animation-delay: 120ms, 1200ms; }
.brand-logo .bl-2 { animation-delay: 190ms, 1320ms; }
.brand-logo .bl-3 { animation-delay: 260ms, 1440ms; }
.brand-logo .bl-4 { animation-delay: 330ms, 1560ms; }
.brand-logo .bl-dot { animation-delay: 400ms, 1680ms; }

.brand:hover .bl-dot { transform: scale(1.18); transition: transform 180ms var(--ease); }

@keyframes bl-tile {
  0% { transform: scale(0.72); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

@keyframes bl-sq {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.12); opacity: 1; }
  100% { transform: none; opacity: 1; }
}

@keyframes bl-wave {
  0% { transform: none; }
  6% { transform: scale(1.22); }
  14% { transform: none; }
  100% { transform: none; }
}

@keyframes bl-breath {
  0% { transform: none; }
  50% { transform: scale(1.04); }
  100% { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-logo .bl-tile,
  .brand-logo .bl-sq { animation: none; }
  .brand:hover .bl-dot { transform: none; }
}

.brand-mark {
  width: 18px; height: 18px;
  background: url("assets/icon-light.svg") center / contain no-repeat;
}

.brand-name { font-size: 15px; font-weight: 500; letter-spacing: 0.01em; }

.page {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 16px 112px;
}

.head { margin-bottom: 20px; }

.h1 { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 500; letter-spacing: -0.01em; }

.sub { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }

.kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 13px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
}

.kpi-lead {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-items: center;
  column-gap: 20px;
  row-gap: 2px;
}

.kpi-lead .kpi-label { grid-column: 1; align-self: end; }
.kpi-lead .kpi-value { grid-column: 1; }
.kpi-lead .kpi-foot { grid-column: 1; align-self: start; }

.kpi-lead .spark {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  margin-top: 0;
}

.kpi-label {
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 400;
}

.kpi-value {
  margin: 0;
  font-size: 30px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.kpi-lead .kpi-value { font-size: 40px; }

.kpi-foot {
  margin: 0;
  color: var(--text-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.kpi > .kpi-foot:last-child { margin-top: auto; }

.delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.delta-up { color: var(--good-text); font-weight: 500; }

.delta-up::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-bottom: 5px solid currentColor;
}

.meter {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-sunk);
  overflow: hidden;
}

.meter-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  transition: width var(--t-mid) var(--ease);
}

.meter-alloc { background: var(--alloc); }
.meter-free { background: var(--free); }
.meter-warn { background: var(--ink-500); }

.spark { margin-top: 2px; line-height: 0; }
.spark svg { display: block; overflow: visible; }
.spark-area { fill: var(--line-soft); stroke: none; }

.spark-line {
  fill: none;
  stroke: var(--ink-400);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spark-dot {
  fill: none;
  stroke: var(--ink-900);
  stroke-width: 7;
  stroke-linecap: round;
}

.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.dot-alloc { background: var(--alloc); }
.dot-free { background: var(--free); }

.controls { display: grid; gap: 8px; margin-bottom: 16px; }

.field-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
}

.field-search .ico-search { color: var(--text-3); }

.field-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
}

.field-search input:focus { outline: none; }
.field-search:focus-within { border-color: var(--ink-700); }

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

.chip {
  flex: 1 1 0;
  height: 36px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.chip:hover { border-color: var(--ink-400); }

.chip.is-active {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: var(--on-ink);
}

.field-select {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
}

.field-select-label { color: var(--text-2); font-size: 13px; flex: 0 0 auto; }

.field-select select {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
}

.field-select select:focus { outline: none; }
.field-select:focus-within { border-color: var(--ink-700); }

.list { display: grid; gap: 6px; }

.card {

  min-width: 0;
  padding: 10px 12px;
  background: var(--surface);
  border: 0;
  border-radius: var(--r-card);
}

.card.is-alloc {
  background: linear-gradient(var(--alloc-tint), var(--alloc-tint)), var(--surface);
}

.card.is-free {
  background: linear-gradient(var(--free-tint), var(--free-tint)), var(--surface);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  flex: 0 0 auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text-2);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.icon-btn:hover { background: var(--surface); color: var(--text); border-color: var(--ink-700); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn:focus-visible { outline: 2px solid var(--ink-700); outline-offset: 2px; }
.icon-btn svg { pointer-events: none; }

.card-id { min-width: 0; }

.card-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
}

.card-employer,
.card-project { padding-left: 17px; }

.card-employer { margin: 1px 0 0; color: var(--text-2); font-size: 12px; }

.card-name-t,
.card-employer,
.card-project {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.live-dot {
  position: relative;
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--dot-color);
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--dot-color);
  animation: live-pulse 1.8s var(--ease-out, ease-out) infinite;
}

.live-alloc { --dot-color: var(--alloc); }
.live-free { --dot-color: var(--free); }

@keyframes live-pulse {
  0% { transform: scale(1); opacity: 0.55; }
  70% { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot::after { animation: none; opacity: 0; }
}

.card-body { display: none; }
.card.is-open .card-body { display: block; }

.card.is-open .icon-btn[data-act="info"] {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: var(--on-ink);
}

.meta {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 2px 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  line-height: 1.4;
}

.meta dt { color: var(--text-3); }
.meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.cnp-value {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.added {
  margin-top: 6px;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 11px;
}

.empty {
  padding: 32px 16px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  text-align: center;
}

.empty-title { margin: 0 0 4px; font-size: 15px; font-weight: 500; }
.empty-body { margin: 0; color: var(--text-2); font-size: 13px; }

.list-note { margin: 12px 0 0; color: var(--text-3); font-size: 12px; text-align: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.btn:hover { border-color: var(--ink-400); }
.btn:active { transform: scale(0.98); }

.btn-ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface); border-color: var(--line); color: var(--text); }

.btn-icon { padding: 0; width: 36px; justify-content: center; }

.btn-primary {
  height: 44px;
  padding: 0 16px;
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: var(--on-ink);
  font-size: 14px;
}

.btn-primary:hover { background: var(--ink-800); border-color: var(--ink-800); }

.btn-danger { height: 44px; padding: 0 16px; color: var(--danger); font-size: 14px; }
.btn-danger:hover { border-color: var(--danger); }

.fab {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 25;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  background: var(--ink-900);
  color: var(--on-ink);
  border: 0;
  border-radius: 24px;
  box-shadow: var(--shadow-fab);
  font: 500 14px/1 var(--sans);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.fab:hover { background: var(--ink-800); }
.fab:active { transform: translateX(-50%) scale(0.98); }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--scrim-bg);
  opacity: 0;
  transition: opacity var(--t-mid) var(--ease);
}

.scrim.is-open { opacity: 1; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  max-width: 720px;
  margin: 0 auto;
  max-height: 92dvh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-radius: var(--r-panel) var(--r-panel) 0 0;
  transform: translateY(16px);
  opacity: 0;
  transition: transform var(--t-mid) var(--ease), opacity var(--t-mid) var(--ease);
}

.sheet::-webkit-scrollbar { width: 0; height: 0; }

.sheet.is-open { transform: translateY(0); opacity: 1; }

.sheet-grip {
  width: 36px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 2px;
  background: var(--line);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.h2 { margin: 0; font-size: 18px; font-weight: 500; }

.form { display: grid; gap: 12px; }

.row-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field input,
.field select {
  min-width: 0;
  max-width: 100%;
}

.label { color: var(--text-2); font-size: 13px; }

.field input {
  height: 44px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  font: inherit;
}

.field input:focus { outline: none; border-color: var(--ink-700); }
.field input.is-bad { border-color: var(--danger); }

.hint { color: var(--text-3); font-size: 12px; }

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

.seg-opt { position: relative; }

.seg-opt input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.seg-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  color: var(--text-2);
  font-size: 13px;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.seg-opt input:checked + span {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: var(--on-ink);
}

.seg-opt input:focus-visible + span { outline: 2px solid var(--ink-900); outline-offset: 2px; }

.form-error { margin: 0; color: var(--danger); font-size: 13px; }

.sheet-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.sheet-actions .btn-primary { flex: 1 1 auto; justify-content: center; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 40;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  background: var(--ink-900);
  color: var(--on-ink);
  border-radius: var(--r-ctl);
  font-size: 13px;
  opacity: 0;
  transition: opacity var(--t-mid) var(--ease);
}

.toast.is-open { opacity: 1; }

@media (min-width: 560px) {
  .page { padding: 24px 24px 112px; }
  .kpi-lead .kpi-value { font-size: 44px; }
  .topbar { padding: 16px 24px; }
  .h1 { font-size: 30px; }
  .meta { grid-template-columns: 104px 1fr 104px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 1ms !important; }
}

.navmenu-item {
  width: 100%;
  height: 40px;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 10px;
  color: var(--text);
  text-decoration: none;
}

#nav-switch:empty { display: none; }

.sr-file {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

label.btn { cursor: pointer; }
label.btn:focus-within { outline: 2px solid var(--ink-900); outline-offset: 2px; }

.section-label {
  margin: 0 0 8px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 400;
}

.btn-more {
  display: flex;
  width: 100%;
  margin-top: 12px;
  justify-content: center;
}

.picker-who { margin: 0 0 12px; color: var(--text-2); font-size: 13px; }

.pick-list { display: grid; gap: 4px; margin-bottom: 12px; }

.pick-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.pick-opt:hover { border-color: var(--ink-400); }
.pick-opt:active { background: var(--surface-sunk); }

.pick-opt.is-current { border-color: var(--ink-700); }

.pick-opt-count {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  font-size: 12px;
}

.pick-new { display: flex; gap: 8px; }

.pick-new input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  font: inherit;
}

.pick-new input:focus { outline: none; border-color: var(--ink-700); }
.pick-new .btn { height: 44px; }

.field select {
  height: 44px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  font: inherit;
}

.field select:focus { outline: none; border-color: var(--ink-700); }

.card-project {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 12px;
}

.import-note {
  margin: 0 0 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  font-size: 13px;
  line-height: 1.5;
}

.import-note b { font-weight: 500; }

.projects { margin-bottom: 20px; }

.filters-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 0.78fr);
  gap: 6px;
}

.filters-row .field-select { padding: 0 6px 0 10px; gap: 2px; }
.filters-row select { font-size: 12px; }

.menu-select { position: relative; min-width: 0; }

.ms-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: 44px;
  padding: 0 6px 0 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.ms-btn:hover { border-color: var(--ink-400); }
.ms-btn:focus-visible { outline: 2px solid var(--ink-900); outline-offset: 2px; }

.ms-face {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ms-ico {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ms-caret {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--text-3);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ms-btn[aria-expanded="true"] { border-color: var(--ink-700); }
.ms-btn[aria-expanded="true"] .ms-caret { transform: rotate(180deg); }

.ms-pop {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 25;
  display: grid;
  gap: 2px;
  min-width: 168px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  box-shadow: var(--shadow-pop);
}

.ms-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 38px;
  padding: 0 8px;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.ms-opt:hover { background: var(--page); }
.ms-opt[aria-selected="true"] { background: var(--ink-900); color: var(--on-ink); }
.ms-opt .ms-t { flex: 1 1 auto; }

.filters-row .field-select { min-width: 0; }
.filters-row .field-select-label { flex: 0 0 auto; }

.field-select select { text-overflow: ellipsis; }

.sheet-half {
  display: flex;
  flex-direction: column;
  height: 50dvh;
  max-height: 50dvh;
  overflow: hidden;
}

.sheet-half .sheet-head { flex: 0 0 auto; }

.sheet-half .form {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  margin: 0 -16px;
  padding: 0 16px 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sheet-body::-webkit-scrollbar { width: 0; height: 0; }

.sheet-half .sheet-actions,
.sheet-half .pick-new {
  flex: 0 0 auto;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.sheet-half .pick-list { max-height: none; }

.sheet-tall { max-height: 88dvh; }

.diff-sub {
  margin: 0 0 16px;
  color: var(--text-2);
  font-size: 13px;
}

.diff-body {
  max-height: 52dvh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin: 0 -16px 16px;
  padding: 0 16px;
}

.diff-body::-webkit-scrollbar { width: 0; height: 0; }

.diff-group {
  position: sticky;
  top: 0;
  margin: 16px 0 8px;
  padding: 4px 0;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 400;
}

.diff-group:first-child { margin-top: 0; }

.diff-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }

.diff-row {
  padding: 10px 12px;
  background: var(--surface-sunk);
  border-radius: var(--r-ctl);
}

.diff-who { margin: 0; font-size: 14px; }

.diff-meta { margin: 2px 0 0; color: var(--text-2); font-size: 12px; }

.diff-changes {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.diff-change {
  display: grid;
  grid-template-columns: 88px 1fr auto 1fr;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
}

.diff-field { color: var(--text-3); }

.diff-from {
  color: var(--text-3);
  text-decoration: line-through;
  overflow-wrap: anywhere;
}

.diff-arrow { color: var(--text-3); }

.diff-to { color: var(--text); overflow-wrap: anywhere; }

.diff-none { margin: 0; color: var(--text-2); font-size: 13px; }

.diff-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  font-size: 13px;
  cursor: pointer;
}

.diff-opt input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ink-900);
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn:disabled:hover { border-color: var(--line); }

#diff-cancel { height: 44px; padding: 0 16px; font-size: 14px; }

@media (max-width: 400px) {
  .diff-change { grid-template-columns: 1fr; gap: 2px; }
  .diff-arrow { display: none; }
  .diff-from { font-size: 11px; }
}

.auth-body {
  display: block;
  min-height: 100dvh;
  overflow-y: auto;
  background: var(--page);
}

.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}

.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 24px 22px 20px;
  background: var(--surface);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-sheet);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.auth-brand-name { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }

.footer__credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-3);
  font-size: 12px;
}

.footer__credit img { display: block; border-radius: 4px; }

.footer__credit a { color: var(--text-2); text-decoration: none; }
.footer__credit a:hover { color: var(--text); text-decoration: underline; }

.auth-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.auth-sub { margin: 5px 0 20px; color: var(--text-2); font-size: 13px; }

.auth-form { display: grid; gap: 14px; }

.btn-block { width: 100%; justify-content: center; }

.btn-link {
  height: 32px;
  padding: 0;
  background: none;
  border-color: transparent;
  color: var(--text-2);
  font-size: 13px;
  justify-self: center;
}

.btn-link:hover { background: none; border-color: transparent; color: var(--text); text-decoration: underline; }

.pw { position: relative; display: block; }
.pw input { width: 100%; padding-right: 46px; }

.pw-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--text-3);
  cursor: pointer;
}

.pw-toggle:hover { background: var(--surface-sunk); color: var(--text); }
.pw-toggle.is-on { color: var(--text); }
.pw-toggle .ico { width: 18px; height: 18px; }

.form-ok { margin: 0; color: var(--good-text); font-size: 13px; line-height: 1.45; }

.auth-card code {
  padding: 1px 5px;
  background: var(--surface-sunk);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 12px;
}

.whoami-role {
  padding: 3px 8px;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 11px;
  white-space: nowrap;
}

.whoami-mail {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-2);
  font-size: 12px;
}

.brand-tag {
  padding: 3px 8px;
  background: var(--ink-900);
  border-radius: 999px;
  color: var(--on-ink);
  font-size: 11px;
  letter-spacing: 0.01em;
}

.btn-switch { white-space: nowrap; }

.panel {
  margin-bottom: 12px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--r-card);
}

.panel-head { margin-bottom: 14px; }

.panel-title { margin: 0; font-size: 15px; font-weight: 500; }

.panel-note { margin: 3px 0 0; color: var(--text-3); font-size: 12px; }

.panel-empty { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.5; }

.user-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
}

.user-row:first-child { border-top: 0; }

.user-id { display: grid; gap: 1px; min-width: 0; }

.user-mail {
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-meta { color: var(--text-3); font-size: 11px; }

.user-role { flex: 0 0 auto; }
.user-role select { font-size: 13px; }
.user-role select:disabled { color: var(--text-3); cursor: not-allowed; }

.boot-error {
  max-width: 380px;
  margin: 80px auto;
  padding: 0 16px;
  color: var(--text-2);
  font-size: 14px;
  text-align: center;
}

.body-shell { background: var(--page); }

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  height: 100dvh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 248px;
  padding: 18px 12px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  height: 36px;
}

.sidenav { display: grid; gap: 2px; }

.sidenav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-ctl);
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.sidenav-item:hover { background: var(--surface-sunk); color: var(--text); }

.sidenav-item.is-active {
  background: var(--ink-900);
  color: var(--on-ink);
}

.sidenav-item .ico { flex: 0 0 auto; }

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.sidebar-who {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 8px 10px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink-900);
  color: var(--on-ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  user-select: none;
}

.theme-pair { display: flex; gap: 2px; flex: 0 0 auto; }

.theme-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 7px;
  color: var(--text-3);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.theme-btn svg {
  width: 15px; height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-btn:hover { background: var(--surface-sunk); color: var(--text); }

.theme-btn.is-on {
  background: var(--ink-900);
  color: var(--on-ink);
}

.sidebar-foot .js-signout { color: var(--text-2); }
.sidebar-foot .js-signout:hover { background: var(--surface-sunk); color: var(--danger); }

.sidebar-foot .btn-switch {
  width: 100%;
  height: 38px;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 10px;
  margin-bottom: 4px;
}

#nav-switch:empty { display: none; }

.work {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.workbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--page);
  border-bottom: 1px solid var(--line-soft);
}

.workbar-title { min-width: 0; }
.workbar .h1 { font-size: 22px; }
.workbar .sub { margin-top: 2px; }

.workspace {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
}

.view { display: grid; gap: 16px; align-content: start; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }

.barlist { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }

.barlist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 28px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.barlist-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text);
}

.barlist-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-sunk);
  overflow: hidden;
}

.barlist-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ink-700);
}

.barlist-val {
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.toolbar .field-search { flex: 1 1 240px; min-width: 200px; }
.toolbar .field-select { flex: 0 0 auto; }
.toolbar .chips { flex: 0 0 auto; }
.toolbar .chip { flex: 0 0 auto; padding: 0 14px; }

.table-count { margin: 0; color: var(--text-2); font-size: 13px; }

.table-wrap {
  background: var(--surface);
  border-radius: var(--r-card);
  overflow: auto;
  max-height: calc(100dvh - 268px);
}

#view-setari { max-width: 880px; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.table tbody th,
.table tbody td {
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
  font-weight: 400;
  vertical-align: middle;
}

.table tbody tr:first-child th,
.table tbody tr:first-child td { border-top: 0; }

.table tbody tr:hover th,
.table tbody tr:hover td { background: var(--surface-sunk); }

.t-name { min-width: 180px; }
.t-who { display: block; color: var(--text); }
.t-sub { display: block; color: var(--text-3); font-family: var(--mono); font-size: 11px; }

.state { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }

.deflist {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0;
  font-size: 13px;
}

.deflist dt { color: var(--text-3); }
.deflist dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 34;
  border: 0;
  padding: 0;
  background: var(--scrim-bg);
  cursor: pointer;
}

@media (max-width: 999px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 35;
    transform: translateX(-100%);
    transition: transform var(--t-mid) var(--ease);
  }
  .shell.is-nav-open .sidebar { transform: none; }
}

@media (min-width: 1000px) {
  .shell { grid-template-columns: 248px minmax(0, 1fr); }
  .workbar-burger { display: none; }
  .nav-scrim { display: none; }

  .workbar { padding: 22px 28px 18px; }
  .workbar .h1 { font-size: 26px; }
  .workspace { padding: 24px 28px 48px; }

  .view { gap: 20px; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .kpis-4 { grid-template-columns: 1.7fr 1fr 1fr 1fr; margin-bottom: 0; }
  .kpis-4 .kpi-lead { grid-column: auto; }
}

:root[data-theme="light"] .ico-moon { display: none; }
:root[data-theme="dark"] .ico-sun { display: none; }

.auth-theme {
  position: absolute;
  top: 12px;
  right: 12px;
}

.auth-card { position: relative; }

.auth-brand { gap: 12px; margin-bottom: 26px; }
.auth-brand-name { font-size: 17px; }

.auth-logo { display: block; flex: 0 0 auto; overflow: visible; }

.auth-plate { fill: var(--ink-900); }
.auth-cell { fill: var(--surface); }
.auth-cell.cell-5 { fill: var(--accent); }

.auth-plate,
.auth-cell {
  transform-box: fill-box;
  transform-origin: center;
}

.auth-plate {
  animation: plate-in 460ms var(--ease) both,
             plate-breath 4.6s 1400ms ease-in-out infinite;
}

.auth-cell {
  animation: cell-in 380ms var(--ease) both,
             cell-wave 4.6s ease-in-out infinite;
}

.auth-cell.cell-1 { animation-delay: 190ms, 1400ms; }
.auth-cell.cell-2 { animation-delay: 265ms, 1540ms; }
.auth-cell.cell-3 { animation-delay: 340ms, 1680ms; }
.auth-cell.cell-4 { animation-delay: 430ms, 1820ms; }

.auth-cell.cell-5 {
  animation: cell-drop 560ms cubic-bezier(0.16, 1, 0.3, 1) both,
             cell-wave 4.6s ease-in-out infinite;
  animation-delay: 520ms, 1960ms;
}

.auth-brand-name {
  animation: name-in 420ms var(--ease) both;
  animation-delay: 620ms;
}

@keyframes plate-in {
  from { opacity: 0; transform: scale(0.84); }
  to   { opacity: 1; transform: none; }
}

@keyframes cell-in {
  from { opacity: 0; transform: translateY(-5px) scale(0.7); }
  to   { opacity: 1; transform: none; }
}

@keyframes cell-drop {
  0%   { opacity: 0; transform: translateY(-16px) scale(0.6); }
  100% { opacity: 1; transform: none; }
}

@keyframes cell-wave {
  0% { transform: none; }
  5% { transform: translateY(-3px) scale(1.16); }
  13% { transform: none; }
  100% { transform: none; }
}

@keyframes plate-breath {
  0% { transform: none; }
  50% { transform: scale(1.03); }
  100% { transform: none; }
}

@keyframes name-in {
  from { opacity: 0; transform: translateX(-7px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-plate,
  .auth-cell,
  .auth-brand-name { animation: none; }
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 12px;
}

.form-row .btn {
  height: 44px;
  justify-self: start;
  min-width: 150px;
}

@media (min-width: 720px) {
  .form-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.row-actions .btn { height: 34px; font-size: 13px; }

.credbox {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
}

.credbox-note { margin: 0 0 8px; color: var(--text-2); font-size: 12px; line-height: 1.5; }

.credbox-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 13px;
}

.credbox-pair code {
  padding: 4px 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 13px;
  user-select: all;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim-bg);
}

.modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;

  max-height: calc(100dvh - 40px);
  background: var(--surface);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-pop);
  animation: modal-in 200ms var(--ease) both;
}

.modal-narrow { max-width: 420px; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .modal-card { animation: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-title { margin: 0; font-size: 16px; font-weight: 500; }

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line-soft);
}

.modal-foot .btn { height: 40px; padding: 0 16px; }

.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

@media (min-width: 560px) {
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid .field-wide { grid-column: 1 / -1; }
}

.field-group-title {
  margin: 4px 0 0;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.danger-text { margin: 0; font-size: 14px; line-height: 1.5; }

.danger-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

.btn-danger-solid {
  background: var(--free);
  border-color: var(--free);
  color: #fff;
  font-weight: 500;
}

.btn-danger-solid:hover { filter: brightness(0.92); border-color: var(--free); }
.btn-danger-solid:disabled { filter: none; opacity: 0.6; }

.btn-danger-ghost:hover { color: var(--free); }

.panel-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.log-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }

.log-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}

.log-row:first-child { border-top: 0; }

.log-ico {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--surface-sunk);
  color: var(--text-2);
}

.log-ico svg {
  width: 16px; height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.log-del .log-ico { background: var(--free-tint); color: var(--free); }

.log-text { display: grid; gap: 2px; min-width: 0; }
.log-what { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.log-who { color: var(--text-3); font-size: 11px; }

#log-more { margin-top: 12px; }

.pick-person {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .pick-person { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); }
}

.field-note { margin: 8px 0 0; color: var(--text-3); font-size: 12px; }
.field-note:empty { display: none; }

.hits {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  padding: 4px;
  background: var(--surface-sunk);
  border-radius: var(--r-ctl);
}

.hit {
  display: grid;
  gap: 1px;
  justify-items: start;
  padding: 8px 10px;
  background: none;
  border: 0;
  border-radius: 8px;
  font: inherit;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.hit:hover { background: var(--surface); }
.hit:focus-visible { outline: 2px solid var(--ink-900); outline-offset: -2px; }

.hit-who { font-size: 13px; }
.hit-meta { color: var(--text-3); font-size: 11px; font-family: var(--mono); }

.chosen {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 8px 8px 10px;
  background: var(--surface-sunk);
  border-radius: var(--r-ctl);
}

.avatar-sm { width: 28px; height: 28px; font-size: 11px; }

.chosen-text { display: grid; gap: 1px; min-width: 0; flex: 1 1 auto; }
.chosen-who { font-size: 13px; }
.chosen-meta {
  color: var(--text-3);
  font-size: 11px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.form-row-sep {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.avatar-link { text-decoration: none; cursor: pointer; }
.avatar-link:hover { filter: brightness(1.25); }
.avatar-link:focus-visible { outline: 2px solid var(--ink-900); outline-offset: 2px; }

.avatar-lg { width: 52px; height: 52px; font-size: 18px; }

.profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.profile-head .deflist { flex: 1 1 260px; }

#view-profil { max-width: 720px; }

.modal-rule {
  height: 0;
  margin: 4px 0;
  border: 0;
  border-top: 1px solid var(--line-soft);
}

.modal-body .field-grid .btn { justify-self: start; min-width: 160px; }

.motion-nav {

  --paper: var(--nav-bar);
  --quiet: var(--nav-ink-off);
  --active-x: 10%;

  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  isolation: isolate;
  flex: 0 0 auto;
  width: 100%;
  height: 96px;
  background: linear-gradient(to bottom, transparent 8px, var(--nav-bar) 8px);
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}

.motion-nav .cutout {
  position: absolute;
  pointer-events: none;
  top: 7px;
  left: var(--active-x);
  width: 108px;
  height: 59px;
  transform: translateX(-50%);

  fill: var(--nav-ring);
  transition: left 360ms cubic-bezier(.48, 0, .19, 1);
}

.motion-nav .nav-tab {
  position: relative;
  display: grid;
  grid-template-rows: 62px auto;
  justify-items: center;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 96px;
  margin: 0;
  padding: 0;
  border: 0;
  appearance: none;
  background: transparent;
  color: var(--quiet);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.motion-nav .nav-tab::before {
  content: "";
  position: absolute;
  top: 7px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--nav-pill);
  transform: scale(0);
  transition: transform 135ms ease-in;
}

.motion-nav .nav-tab[aria-pressed="true"] {
  color: var(--nav-ink-on);
  --paper: var(--nav-pill);
}

.motion-nav .nav-tab[aria-pressed="true"] .nav-label { color: var(--nav-label-on); }

.motion-nav .nav-tab[aria-pressed="true"]::before {
  transform: scale(1);
  transition: transform 280ms cubic-bezier(.21, .83, .26, 1);
}

.motion-nav .icon {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.15;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.motion-nav .nav-label {
  position: relative;
  grid-row: 2;
  font-size: 11px;
  letter-spacing: 0.01em;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 2px;
}

.motion-nav .nav-tab:focus-visible { outline: none; }
.motion-nav .nav-tab:focus-visible .icon {
  outline: 1.5px solid var(--text);
  outline-offset: 4px;
  border-radius: 4px;
}

.motion-nav .muted-fill { fill: currentColor; opacity: 0.45; stroke: none; }
.motion-nav .muted-line { stroke: currentColor; opacity: 0.45; }

.motion-nav .icon g,
.motion-nav .icon path,
.motion-nav .icon circle { transform-box: fill-box; transform-origin: center; }

.appbar .nav-add {

  position: absolute;
  left: 50%;
  bottom: calc(50px + env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  place-items: center;

  width: 62px;
  height: 62px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink-900);
  color: var(--on-ink);
  box-shadow: 0 10px 22px rgba(12, 14, 18, 0.28);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transform: translateX(-50%);
  transition: transform var(--t-fast) var(--ease);
  animation: fab-float 3.4s ease-in-out infinite;
}

@keyframes fab-float {
  0% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
  100% { transform: translateX(-50%) translateY(0); }
}

.appbar .nav-add svg path {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 220ms var(--ease);
}

.appbar .nav-add:hover svg path { transform: rotate(90deg); }

.motion-nav .nav-slot { display: block; }

.appbar .nav-add svg {
  width: 24px; height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.appbar .nav-add:hover { animation-play-state: paused; transform: translateX(-50%) scale(1.06); }
.appbar .nav-add:active { animation-play-state: paused; transform: translateX(-50%) scale(0.95); }
.appbar .nav-add:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.motion-nav [aria-pressed="true"] .grp-left { animation: nav-gather-l 460ms ease-out; }
.motion-nav [aria-pressed="true"] .grp-right { animation: nav-gather-r 460ms ease-out; }

.motion-nav .chk,
.motion-nav .ban-slash { stroke-dasharray: 1; stroke-dashoffset: 0; }

.motion-nav [aria-pressed="true"] .chk { animation: nav-draw 420ms ease-out; }
.motion-nav [aria-pressed="true"] .chk-ring { animation: nav-pop 440ms cubic-bezier(.21,.83,.26,1); }

.motion-nav [aria-pressed="true"] .ban-ring { animation: nav-pop 400ms cubic-bezier(.21,.83,.26,1); }
.motion-nav [aria-pressed="true"] .ban-slash { animation: nav-draw 360ms ease-out 170ms both; }

.motion-nav .nav-menu-tab[aria-expanded="true"] .men-1 { animation: nav-slide 340ms ease-out; }
.motion-nav .nav-menu-tab[aria-expanded="true"] .men-2 { animation: nav-slide 340ms ease-out 70ms both; }
.motion-nav .nav-menu-tab[aria-expanded="true"] .men-3 { animation: nav-slide 340ms ease-out 140ms both; }

@keyframes nav-gather-l {
  0%, 18% { transform: translateX(5px); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
@keyframes nav-gather-r {
  0%, 18% { transform: translateX(-5px); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
@keyframes nav-draw {
  0%, 20% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes nav-pop {
  0% { transform: scale(.55); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
@keyframes nav-slide {
  0% { transform: translateX(-6px); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .motion-nav *, .motion-nav *::before { animation: none !important; transition: none !important; }
  .appbar .nav-add { animation: none; }
}

.appbar {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
  background: linear-gradient(to bottom, transparent 8px, var(--nav-bar) 8px);

  border-radius: 16px 16px 0 0;
}

.card-since {
  flex: 0 0 100%;
  margin-top: 1px;
  color: var(--text-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.topbar .theme-pair { margin-left: auto; }

.acc-who {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
}

.acc-who .who-text { display: grid; gap: 3px; justify-items: start; min-width: 0; }

.acc-block {
  display: grid;
  gap: 10px;
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
}

.acc-block:first-of-type { border-top: 0; }

.acc-title { margin: 0; font-size: 14px; font-weight: 500; }
.acc-note { margin: 0; color: var(--text-3); font-size: 12px; line-height: 1.45; }

.acc-item { justify-content: flex-start; gap: 10px; height: 44px; }
.acc-item.js-signout { color: var(--danger); }

.acc-block .btn-switch {
  width: 100%;
  height: 44px;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--text);
}

#nav-switch:empty { display: none; }

.acc-who .whoami-role {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--text-3);
  font-size: 12px;
}

.pick-list { display: grid; gap: 2px; }

.pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 4px;
  border-radius: var(--r-ctl, 10px);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.pick-row:hover { background: var(--page); }
.pick-row input { width: 18px; height: 18px; accent-color: var(--ink-900); flex: 0 0 auto; }
.pick-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-all { font-weight: 500; }

.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.pick-card { cursor: pointer; }
.pick-card input { position: absolute; opacity: 0; pointer-events: none; }

.pick-card-in {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 12px 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl, 10px);
  background: var(--surface);
  text-align: center;
  transition: border-color var(--t-fast, 120ms) var(--ease, ease),
              background var(--t-fast, 120ms) var(--ease, ease);
}

.pick-card-in .ico { color: var(--text-2); }
.pick-card-t { color: var(--text); font-size: 13px; font-weight: 500; }
.pick-card-s { color: var(--text-3); font-size: 11px; }

.pick-card:hover .pick-card-in { border-color: var(--ink-400); }

.pick-card input:checked + .pick-card-in {
  border-color: var(--ink-900);
  box-shadow: inset 0 0 0 1px var(--ink-900);
}

.pick-card input:checked + .pick-card-in .ico { color: var(--text); }
.pick-card input:focus-visible + .pick-card-in { outline: 2px solid var(--ink-900); outline-offset: 2px; }

#export-sheet .sheet-actions { margin-top: 16px; }
#export-sheet .sheet-actions .btn-primary { flex: 1 1 auto; justify-content: center; }
#exp-file { margin-top: 8px; word-break: break-all; }
#exp-employers { max-height: 220px; overflow-y: auto; }

.reges-load {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 18px 0 10px;
}

.ring-wrap { position: relative; width: 132px; height: 132px; }

.ring { width: 132px; height: 132px; transform: rotate(-90deg); }

.ring-track {
  fill: none;
  stroke: var(--line);
  stroke-width: 8;
}

.ring-bar {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 160ms linear;
}

.ring-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 30px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.ring-note {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  text-align: center;
}

.reges-sum {
  margin: 0 0 12px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
}

.reges-group { margin-bottom: 16px; }

.reges-group-head {
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}

.reges-group-head .pick-row { min-height: 32px; font-weight: 500; }

.reges-note { margin: 2px 0 0 28px; color: var(--text-3); font-size: 12px; }

.reges-items { display: grid; gap: 2px; padding-top: 4px; }

.reges-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 6px;
  border-radius: var(--r-ctl);
  cursor: pointer;
}

.reges-item:hover { background: var(--page); }

.reges-item input {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--ink-900);
  flex: 0 0 17px;
}

.reges-item-txt {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.reges-cnp {
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.reges-sub { color: var(--text-3); font-size: 12px; }

.reges-diff { display: grid; gap: 1px; }

.reges-chg { color: var(--text-2); font-size: 12px; }
.reges-chg b { color: var(--text-3); font-weight: 500; }
.reges-chg s { color: var(--text-3); text-decoration-thickness: 1px; }

@media (prefers-reduced-motion: reduce) {
  .ring-bar { transition: none; }
}

.live-back { --dot-color: var(--back); }
.live-off { --dot-color: var(--off); }

.live-off::after { animation-duration: 1.1s; }

.acc-item .live-dot { flex: 0 0 9px; }

.acc-item-t { flex: 1 1 auto; text-align: left; }

.acc-count {
  min-width: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--page);
  color: var(--text-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

#btn-inactive.has-off .acc-count { background: var(--off); color: #ffffff; }

.off-list { display: grid; gap: 2px; }

.off-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line-soft);
}

.off-row:last-child { border-bottom: 0; }

.off-txt { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }

.off-name {
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.off-sub {
  color: var(--text-3);
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.off-when {
  flex: 0 0 auto;
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pick-drop { display: block; }

.pick-drop-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  cursor: pointer;
  list-style: none;
}

.pick-drop-head::-webkit-details-marker { display: none; }

.pick-drop-head:hover { border-color: var(--ink-400); }

.pick-drop[open] .pick-drop-head {
  border-color: var(--ink-700);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.pick-drop-t {
  flex: 0 0 auto;
  color: var(--text-2);
  font-size: 13px;
}

.pick-drop-v {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  text-align: right;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pick-drop-caret {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-3);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms var(--ease);
}

.pick-drop[open] .pick-drop-caret { transform: rotate(180deg); }

.pick-drop-body {
  padding: 6px 8px 8px;
  border: 1px solid var(--ink-700);
  border-top: 0;
  border-radius: 0 0 var(--r-ctl) var(--r-ctl);
}

.pick-drop-body .pick-list { max-height: 220px; overflow-y: auto; }

.pick-drop-head:focus-visible { outline: 2px solid var(--ink-900); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .pick-drop-caret { transition: none; }
}

.rtabs {
  display: flex;
  gap: 6px;
  margin: 4px 0 10px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.rtab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.rtab:hover { border-color: var(--ink-400); color: var(--text); }

.rtab.is-active {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: var(--on-ink);
}

.rtab-n {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--page);
  color: var(--text-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.rtab.is-active .rtab-n { background: rgba(255, 255, 255, 0.18); color: var(--on-ink); }

.rtab-warn {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--off);
  color: #ffffff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}

.table th.t-act, .table td.t-act { width: 44px; text-align: right; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
