html {
  color-scheme: light;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-muted: #f8f9fb;
  --text: #141826;
  --muted: #5c6370;
  --border: #e4e7ee;
  --border-strong: #d1d6e0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --ok: #059669;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --radius2: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    "Noto Sans",
    "Liberation Sans",
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 12px 32px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius2);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
  user-select: none;
}

.btn:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
}

.btn:active {
  background: #eef0f4;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

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

.panel {
  margin-top: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

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

.panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel-desc {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.panel-results {
  margin-top: 20px;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

.sms-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.field-full {
  display: block;
}

.field-full .textarea {
  min-height: 200px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.field .label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.input {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius2);
  outline: none;
  font-size: 14px;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.45;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    "Courier New",
    monospace;
  font-size: 13px;
}

.grow {
  margin-top: 14px;
}

.status {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  min-height: 16px;
}

.error-recovery {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius2);
  background: var(--surface-muted);
}

.error-recovery .btn {
  width: 100%;
}

@media (min-width: 480px) {
  .error-recovery .btn {
    width: auto;
  }
}

.error-recovery-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

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

.total-card--copy {
  cursor: pointer;
  outline: none;
  transition:
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

.total-card--copy:hover:not([aria-disabled="true"]) {
  box-shadow: 0 0 0 2px var(--primary);
}

.total-card--copy:focus-visible:not([aria-disabled="true"]) {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.total-card--copy:active:not([aria-disabled="true"]) {
  transform: scale(0.992);
}

.total-card--copy[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.65;
}

.total-card--copy.total-card--copied {
  animation: totalCardCopiedPulse 0.55s ease;
}

@keyframes totalCardCopiedPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35);
  }
  40% {
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.15);
  }
  100% {
    box-shadow: none;
  }
}

.total-card {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.total-accent {
  background: var(--surface-muted);
  border-color: var(--border);
}

.total-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.total-value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.results {
  margin-top: 14px;
  display: grid;
  gap: 28px;
}

.window {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 3px solid #cbd5e1;
}

.window-head {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  border-radius: var(--radius) var(--radius) 0 0;
}

.window-head > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.window-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.window-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.items {
  padding: 0 14px 16px;
  display: grid;
  gap: 12px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
}

.items-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 2px 4px;
  margin: 0 -2px;
}

.items-heading-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.items-heading-hint {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  opacity: 0.9;
}

.item {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius2);
  padding: 14px;
  border-left: 3px solid #e2e8f0;
  box-shadow: none;
}

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

.item-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

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

.item-section {
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 10px 12px;
  background: var(--surface-muted);
  min-width: 0;
}

.item-section--price {
  background: var(--surface-muted);
  border-color: var(--border);
}

.item-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}

.mono-block {
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    "Courier New",
    monospace;
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  word-break: break-word;
}

.kv-stack {
  display: grid;
  gap: 6px;
}

.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.kv-label {
  font-size: 12px;
  color: var(--muted);
}

.kv-val {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.kv-val-strong {
  font-weight: 700;
  color: var(--text);
}

.kv-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  line-height: 1.35;
}

.price-block {
  display: grid;
  gap: 8px;
}

.price-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.price-line--rub {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.price-label {
  font-size: 12px;
  color: var(--muted);
}

.price-usd {
  font-size: 15px;
  font-weight: 700;
}

.price-rub {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.item-controls {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.item-controls-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.control-pair {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.control-label {
  font-size: 12px;
  color: var(--muted);
  min-width: 6.5em;
}

.control-summary {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  padding: 6px 8px;
  background: var(--surface-muted);
  border-radius: 8px;
  line-height: 1.35;
}

.badge-muted {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}

.footer-inner {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: var(--surface);
  line-height: 1.45;
}

.total-num-usd {
  font-variant-numeric: tabular-nums;
}

.total-num-rub {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.mini-select {
  padding: 8px 10px;
  border-radius: var(--radius2);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.badge.ok {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.badge.bad {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.footer {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.muted {
  color: var(--muted);
}

@media (max-width: 840px) {
  .controls {
    grid-template-columns: 1fr 1fr;
  }

  .item-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  /* iOS Safari: не зумит поля с font-size >= 16px */
  .input,
  .textarea,
  textarea.input,
  select.input {
    font-size: 16px;
  }
}

@media (pointer: coarse) {
  .input,
  .textarea,
  textarea.input,
  select.input {
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  .header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    justify-content: stretch;
  }

  .btn {
    width: 100%;
  }

  .app-actions .btn {
    width: auto;
    flex: 1 1 0;
    padding: 10px 8px;
    font-size: 13px;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .totals {
    grid-template-columns: 1fr;
  }
}

/* —— Minimal client layout —— */
.app--minimal {
  max-width: 560px;
}

.header--minimal {
  align-items: center;
}

.panel-minimal {
  padding: 14px;
}

.textarea--minimal {
  min-height: 120px;
}

.details-params {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 8px 12px;
  background: var(--surface-muted);
}

.details-params-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
}

.controls--minimal {
  margin-top: 10px;
  grid-template-columns: 1fr;
  gap: 10px;
}

.controls--minimal .usd-rates-block {
  grid-column: 1 / -1;
}

.usd-rates-block > .label {
  margin-bottom: 8px;
}

.usd-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 10px;
}

.usd-mode-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}

.usd-mode-option input {
  width: auto;
  margin: 0;
  accent-color: var(--primary);
}

.field-inline .label {
  margin-bottom: 6px;
}

.usd-unified-wrap .field-inline {
  margin-bottom: 0;
}

.usd-rates-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 0;
  align-items: start;
}

.usd-rates-grid .field .label {
  font-size: 11px;
  margin-bottom: 4px;
}

.usd-rates-grid .input {
  padding: 8px 10px;
  font-size: 13px;
}

@media (min-width: 520px) {
  .controls--minimal {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.panel-results--minimal {
  padding-top: 12px;
}

.results--minimal {
  gap: 16px;
  margin-top: 0;
}

.minimal-window {
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: var(--surface);
  overflow: hidden;
}

.minimal-window-head {
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 12px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}

.minimal-window-title {
  font-weight: 700;
  font-size: 15px;
}

.minimal-window-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
  flex: 1;
  min-width: min(12rem, 100%);
  line-height: 1.35;
}

.minimal-glasses {
  padding: 8px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.glass-card {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.35em;
  font-size: 14px;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.glass-card--warn {
  border-color: #fecaca;
  background: #fffbfb;
}

.glass-card-sep {
  color: var(--muted);
  opacity: 0.55;
  user-select: none;
}

.glass-card-title {
  font-weight: 600;
  color: var(--text);
}

.glass-card-size {
  font-weight: 500;
}

.glass-card-qty {
  color: var(--muted);
  font-weight: 500;
}

.glass-card-rub {
  font-weight: 700;
}

.glass-card-usd {
  color: var(--muted);
  font-weight: 500;
}

.glass-card-warn {
  color: var(--danger);
  font-weight: 600;
}

.panel-results--minimal .minimal-total-line:not(:empty) {
  cursor: pointer;
}

.panel-results--minimal .minimal-total-line:not(:empty):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.minimal-total-line {
  margin-bottom: 14px;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius2);
  border: 1px solid var(--border-strong);
  background: var(--surface-muted);
  font-variant-numeric: tabular-nums;
}

.panel-results--minimal .minimal-total-line:empty {
  display: none;
}

/* Тач: без синего контура фокуса после нажатия (outline остаётся для клавиатуры на hover-устройствах) */
@media (hover: none) and (pointer: coarse) {
  .btn:focus,
  .btn:focus-visible {
    outline: none;
  }

  .panel-results--minimal .minimal-total-line:not(:empty):focus,
  .panel-results--minimal .minimal-total-line:not(:empty):focus-visible {
    outline: none;
  }

  .details-params-summary:focus-visible {
    outline: none;
  }
}

@keyframes copyFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35);
  }
  35% {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
  }
  100% {
    box-shadow: none;
  }
}

.minimal-total-line.is-copied {
  animation: copyFlash 0.75s ease;
}

.btn.is-copied {
  animation: copyFlash 0.75s ease;
}

/* --- Общая шапка (index + fabric) --- */

.app-sticky-top {
  position: sticky;
  top: 0;
  z-index: 200;
  margin: 0 -12px 14px;
  padding: 10px 12px 12px;
  background: rgba(244, 245, 248, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

body.app-nav-loading #app-root {
  opacity: 0.72;
  transition: opacity 0.15s ease;
}

.app-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #e8ebf1;
  border: 1px solid var(--border);
}

.app-nav-item {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    box-shadow 0.12s ease;
}

.app-nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-nav-item:hover {
  color: var(--text);
}

.app-nav-item.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.app-nav-item.is-active .app-shell-svg {
  color: var(--primary);
}

@media (max-width: 380px) {
  .app-nav-item {
    flex-direction: column;
    gap: 4px;
    padding: 8px 6px;
    font-size: 11px;
  }

  .app-nav-item .app-shell-svg {
    width: 20px;
    height: 20px;
  }
}

.app-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.app-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  padding: 10px 12px;
  font-size: 14px;
  white-space: nowrap;
}

.app-actions .btn:not(.btn-primary) {
  background: var(--surface);
}

.app-actions .btn-primary {
  flex: 1.25 1 0;
  font-weight: 700;
}

/* --- Закупка ткани (fabric.html) --- */

.fabric-controls {
  align-items: flex-end;
}

.fabric-hint {
  margin: 0;
  flex: 1 1 220px;
  font-size: 13px;
  line-height: 1.4;
}

.fabric-results {
  margin-top: 8px;
}

.fabric-grand {
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}

.fabric-grand-line {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

.fabric-grand-sub {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

.fabric-uni-note {
  margin: -8px 0 14px;
  font-size: 13px;
  line-height: 1.4;
}

.fabric-alerts {
  border-radius: var(--radius2);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 14px;
}

.fabric-alerts--error {
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.06);
}

.fabric-alerts--warn {
  border: 1px solid rgba(180, 140, 0, 0.35);
  background: rgba(250, 204, 21, 0.08);
}

.fabric-alerts-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.fabric-alerts ul {
  margin: 0;
  padding-left: 1.2em;
}

.fabric-src {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  word-break: break-all;
}

.fabric-groups {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.fabric-group {
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: var(--surface);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.fabric-group-head {
  margin-bottom: 12px;
}

.fabric-group-head--combined {
  margin-bottom: 10px;
}

.fabric-group-sub {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
}

.fabric-group-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
}

.fabric-group-total {
  font-size: 15px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.fabric-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--muted);
  vertical-align: middle;
}

.fabric-shelves {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fabric-shelf {
  margin: 0;
}

.fabric-shelf-card {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.fabric-shelf-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.fabric-shelf-num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.fabric-shelf-head-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  min-width: 0;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.fabric-shelf-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.fabric-shelf-dims strong {
  font-weight: 700;
  color: var(--text);
}

.fabric-shelf-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 8px 10px;
}

.fabric-shelf-waste-track {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  min-height: 1.35em;
  margin-bottom: 4px;
  padding: 0 2px;
  box-sizing: border-box;
}

.fabric-shelf-waste {
  display: inline-block;
  max-width: min(100%, max(var(--fabric-waste-pct, 20%), 9.5em));
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  padding: 0 0 2px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.fabric-shelf-waste strong {
  font-weight: 700;
  color: var(--text);
}

.fabric-roll-bar {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}

.fabric-scrap-w {
  flex: 0 0 auto;
  box-sizing: border-box;
  min-width: 0;
  border-left: 1px dashed var(--border-strong);
  background: repeating-linear-gradient(
    -45deg,
    rgba(148, 163, 184, 0.35),
    rgba(148, 163, 184, 0.35) 5px,
    rgba(241, 245, 249, 0.9) 5px,
    rgba(241, 245, 249, 0.9) 10px
  );
}

.fabric-col {
  flex: 0 0 auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--border-strong);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  line-height: 1.15;
}

.fabric-piece-vis {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.fabric-piece-scrap-h {
  flex: 0 0 auto;
  min-height: 0;
  border-top: 1px dashed rgba(37, 99, 235, 0.35);
  background: repeating-linear-gradient(
    45deg,
    rgba(148, 163, 184, 0.28),
    rgba(148, 163, 184, 0.28) 4px,
    rgba(248, 250, 252, 0.95) 4px,
    rgba(248, 250, 252, 0.95) 8px
  );
}

.fabric-piece-used {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 2px;
  background: rgba(37, 99, 235, 0.16);
}

.fabric-piece-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  max-width: 100%;
  min-width: 0;
  padding: 0 1px;
}

.fabric-piece-line {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fabric-piece-btn {
  width: 100%;
  margin: 0;
  padding: 2px;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: center;
  transition: background 0.12s ease;
}

.fabric-piece-btn:hover,
.fabric-piece-btn:focus-visible {
  background: rgba(37, 99, 235, 0.28);
  outline: none;
}

.fabric-hardware-totals {
  margin: 14px 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
}

.fabric-hardware-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
}

.fabric-hardware-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.fabric-hardware-table th,
.fabric-hardware-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.fabric-hardware-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.fabric-hardware-table tfoot td {
  border-bottom: 0;
  font-weight: 600;
}

.fabric-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
}

.fabric-modal[hidden] {
  display: none !important;
}

.fabric-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.fabric-modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  max-height: min(88vh, 640px);
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.fabric-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.fabric-modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.fabric-modal-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.fabric-modal-close:hover {
  background: var(--surface);
  color: var(--text);
}

.fabric-modal-body {
  padding: 14px 16px 16px;
}

.fabric-modal-src {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.35;
}

body.fabric-modal-open {
  overflow: hidden;
}

/* —— Auth / Admin (mobile-first) —— */
.auth-body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
}

.auth-page {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  margin-top: 0;
}

.auth-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.auth-subtitle {
  margin: 6px 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.auth-error {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: var(--radius2);
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 14px;
  line-height: 1.4;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  font-size: 16px;
}

.auth-contact {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.auth-contact-lead {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.4;
}

.auth-contact-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-contact-actions--preview {
  max-width: 320px;
  margin: 0 auto;
}

.auth-contact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: var(--radius2);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  border: 1px solid var(--border-strong);
  transition: background 0.15s ease;
}

.auth-contact-btn .app-shell-svg,
.auth-contact-btn .auth-contact-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.auth-contact-btn--phone {
  background: var(--surface);
  color: var(--text);
}

.auth-contact-btn--wa {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.auth-contact-btn:active {
  opacity: 0.92;
}

.auth-contact-phone {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.admin-settings-preview {
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius2);
  background: var(--surface-muted);
  text-align: center;
}

.admin-settings-preview-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.admin-settings-preview-num {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.input-phone {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.app-shell-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 12px;
}

.app-shell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-shell-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.app-shell-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.app-shell-user .app-shell-svg {
  color: var(--primary);
}

.app-shell-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.app-shell-logout {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition:
    background 0.12s ease,
    color 0.12s ease,
    border-color 0.12s ease;
}

.app-shell-logout:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.app-shell-logout:active {
  opacity: 0.85;
}

.app-shell-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #e8ebf1;
  border: 1px solid var(--border);
}

.app-shell-tab {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    box-shadow 0.12s ease;
}

.app-shell-tab:hover:not(.is-active) {
  color: var(--text);
}

.app-shell-tab.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.app-shell-tab.is-active .app-shell-svg {
  color: var(--primary);
}

.app-shell-tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 380px) {
  .app-shell-logout-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .app-shell-logout {
    padding: 8px 10px;
  }

  .app-shell-tab {
    flex-direction: column;
    gap: 4px;
    padding: 8px 6px;
    font-size: 11px;
  }

  .app-shell-tab .app-shell-svg {
    width: 20px;
    height: 20px;
  }
}

.app--admin {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 12px 32px;
}

.app--admin .admin-page {
  max-width: none;
  margin: 0;
  padding: 0;
}

.admin-section-nav {
  margin-bottom: 0;
}

.app-sticky-top--admin {
  margin-bottom: 12px;
}

.admin-body {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.admin-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0;
}

.admin-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 6px 2px;
  min-height: 44px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  transition: opacity 0.12s ease;
}

.admin-back:hover {
  color: var(--primary-hover);
}

.admin-back:active {
  opacity: 0.75;
}

.admin-back .app-shell-svg {
  color: currentColor;
}

.admin-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-page-head--actions-only {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.admin-page-head-main {
  min-width: 0;
  flex: 1 1 auto;
}

.admin-page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.admin-page-lead {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.admin-page-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  box-shadow: var(--shadow);
  white-space: nowrap;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

.admin-action-btn:active {
  opacity: 0.85;
}

.admin-action-btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.admin-action-btn--primary .app-shell-svg {
  color: #fff;
}

@media (max-width: 480px) {
  .admin-page-head--actions-only .admin-page-actions {
    width: 100%;
  }

  .admin-page-head--actions-only .admin-action-btn {
    flex: 1 1 auto;
    width: 100%;
  }
}

.admin-card {
  margin-top: 16px;
}

.admin-stats-panel,
.admin-sessions-panel {
  margin-top: 16px;
}

.admin-card-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
}

.admin-section-lead {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-stat-card {
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: var(--surface);
  text-align: center;
}

.admin-stat-card--accent {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.admin-stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.admin-stat-card--accent .admin-stat-value {
  color: var(--primary);
}

.admin-stat-label {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
}

.admin-empty-note {
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius2);
  background: var(--surface-muted);
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.admin-device-totals {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: var(--surface);
}

.admin-device-totals-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.admin-device-totals-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-device-totals-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.admin-pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.admin-pill--muted {
  background: var(--surface-muted);
  border-color: var(--border-strong);
  color: var(--text);
}

.admin-user-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.admin-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  min-height: 64px;
  min-width: 0;
}

.admin-metric--compact {
  min-height: 52px;
  padding: 8px 6px;
}

.admin-metric--total {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.admin-metric-num {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.admin-metric--compact .admin-metric-num {
  font-size: 18px;
}

.admin-metric--total .admin-metric-num {
  color: var(--primary);
}

.admin-metric-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.admin-msg {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--radius2);
  font-size: 14px;
}

.admin-msg--ok {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.admin-msg--err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.admin-user-item {
  display: block;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: var(--surface-muted);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.admin-user-item:active {
  background: #eef0f4;
}

.admin-user-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-user-login {
  font-weight: 800;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}

.admin-badge--role {
  color: #1e40af;
  border-color: #bfdbfe;
  background: #eff6ff;
  text-transform: lowercase;
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 3px 8px;
}

.admin-badge--on {
  color: #065f46;
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.admin-badge--off {
  color: #991b1b;
  border-color: #fecaca;
  background: #fef2f2;
}

.admin-badge--access {
  color: #334155;
  border-color: #cbd5e1;
  background: #f8fafc;
}

.admin-badge--access-sms {
  color: #1e40af;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.admin-badge--access-fabric {
  color: #5b21b6;
  border-color: #ddd6fe;
  background: #f5f3ff;
}

.admin-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.admin-user-meta-item {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

@media (max-width: 639px) {
  .admin-user-item {
    padding: 12px;
  }

  .admin-user-login {
    font-size: 16px;
  }

  .admin-user-badges {
    gap: 5px;
  }

  .admin-badge {
    font-size: 10px;
    padding: 4px 8px;
  }

  .admin-user-stats {
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
  }

  .admin-metric--compact {
    min-height: 48px;
    padding: 6px 4px;
  }

  .admin-metric--compact .admin-metric-num {
    font-size: 16px;
  }

  .admin-metric-name {
    font-size: 10px;
  }

  .admin-user-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}

@media (min-width: 640px) {
  .admin-user-head {
    justify-content: space-between;
  }

  .admin-user-badges {
    margin-top: 8px;
  }
}

.admin-user-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.admin-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: var(--surface-muted);
}

.admin-check-row input {
  width: 20px;
  height: 20px;
}

.admin-check-row span {
  font-size: 15px;
  font-weight: 600;
}

.admin-session-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-session-item {
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.admin-session-head {
  padding: 14px 14px 12px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}

.admin-session-device {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.35;
}

.admin-session-when {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.admin-session-block {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.admin-session-block:last-of-type {
  border-bottom: none;
}

.admin-session-block-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.admin-session-activity {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.admin-session-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.admin-session-actions {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
}

.admin-session-end {
  margin: 0;
}

.admin-session-end-btn {
  width: 100%;
  min-height: 44px;
}

.admin-session-tech {
  margin: 0;
  padding: 0 14px 12px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
}

.admin-session-tech summary {
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  padding: 10px 0 6px;
}

.admin-session-tech-body {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  line-height: 1.45;
  word-break: break-word;
}

.admin-session-all {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
}

.admin-session-all .btn {
  width: 100%;
  min-height: 44px;
}

@media (min-width: 520px) {
  .admin-session-end-btn,
  .admin-session-all .btn {
    width: auto;
  }
}

@media (min-width: 640px) {
  .admin-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.admin-sticky-actions {
  position: sticky;
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
  margin-top: 16px;
  padding-top: 8px;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}

.admin-sticky-actions .btn {
  width: 100%;
  min-height: 48px;
  font-size: 16px;
}

@media (min-width: 640px) {
  .admin-form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-sticky-actions .btn {
    width: auto;
    min-width: 200px;
  }
}

