/* ==========================================================================
   ACS-15 JPOS Web Tool — оформление: лаванда, серый, голубой
   ========================================================================== */

:root {
  --bg: #f2f0fb;
  --bg-2: #e9e5f8;
  --panel: #ffffff;
  --panel-2: #f7f5fe;
  --line: #ded8f1;
  --line-2: #ece8f8;
  --text: #262a3a;
  --muted: #6f7288;
  --blue: #3b5bdb;
  --blue-2: #2f4bc4;
  --blue-soft: #e8edff;
  --lavender: #b6aaf0;
  --lavender-soft: #f0ecff;
  --gray: #9aa0b4;
  --gray-soft: #f1f2f7;
  --danger: #d64545;
  --danger-2: #b53434;
  --warn: #b7791f;
  --warn-soft: #fff7e6;
  --ok: #2f9e6b;
  --ok-soft: #e7f7ef;
  --log-bg: #1f2433;
  --mono: "Cascadia Mono", "JetBrains Mono", Consolas, "SFMono-Regular", ui-monospace, monospace;
  --radius: 16px;
  --shadow: 0 18px 40px -30px rgba(48, 38, 110, 0.55);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 8% -10%, #e6e0ff, transparent 62%),
    radial-gradient(820px 420px at 100% 0%, #dfe6ff, transparent 58%),
    var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/* ------------------------------------------------------------------ topbar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

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

.logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: #ffffff;
  background: linear-gradient(140deg, var(--blue), #7b93ff);
  box-shadow: 0 12px 24px -14px rgba(59, 91, 219, 0.9);
}

.logo span {
  opacity: 0.6;
}

.brand-text h1 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0.2px;
}

.brand-text p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.pill .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gray);
  box-shadow: 0 0 0 3px rgba(154, 160, 180, 0.18);
}

.pill.online {
  color: var(--ok);
  border-color: #bfe6d2;
  background: var(--ok-soft);
}

.pill.online .dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(47, 158, 107, 0.18);
}

.pill.error {
  color: var(--danger);
  border-color: #f0c2c2;
  background: #fdf0f0;
}

.pill.error .dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.16);
}

/* ------------------------------------------------------------------- tabs */

.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px 0;
  max-width: 1380px;
  margin: 0 auto;
}

.tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
  background: var(--lavender-soft);
}

.tab.is-active {
  color: var(--blue-2);
  background: var(--panel);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.tabs-info {
  margin-left: auto;
}

/* ----------------------------------------------------------------- layout */

.layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  max-width: 1380px;
  margin: 0 auto;
  padding: 16px 24px 96px;
}

.connect-card,
.info-card {
  grid-column: span 6;
}

.device-card {
  grid-column: span 7;
}

.methods-card {
  grid-column: span 5;
}

.log-card {
  grid-column: span 12;
}

@media (max-width: 1080px) {
  .connect-card,
  .info-card,
  .device-card,
  .methods-card {
    grid-column: span 12;
  }
}

/* ------------------------------------------------------------------ cards */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow);
}

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

.card-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--lavender-soft);
  border: 1px solid #e0d9fb;
  color: #5b4bb0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tag.warn {
  background: var(--warn-soft);
  border-color: #f3e0b6;
  color: var(--warn);
}

.tag.ok {
  background: var(--ok-soft);
  border-color: #bfe6d2;
  color: var(--ok);
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.08s;
}

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

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
  box-shadow: 0 14px 24px -16px rgba(59, 91, 219, 0.9);
}

.btn.primary:hover:not(:disabled) {
  background: var(--blue-2);
  border-color: var(--blue-2);
}

.btn.ghost {
  background: var(--panel);
  color: var(--blue-2);
  border-color: #cdd7f7;
}

.btn.ghost:hover:not(:disabled) {
  background: var(--blue-soft);
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

.btn.danger:hover:not(:disabled) {
  background: var(--danger-2);
  border-color: var(--danger-2);
}

.btn.small {
  padding: 8px 13px;
  font-size: 13px;
  border-radius: 9px;
}

.btn.icon {
  padding: 8px 12px;
  font-size: 16px;
}

.btn:focus-visible,
.key:focus-visible,
.tab:focus-visible,
.fab:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ----------------------------------------------------------------- fields */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > span {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}

.field.grow {
  flex: 1 1 200px;
}

.field select,
.field input,
input[type="text"],
input[type="password"],
input[type="search"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.field select:focus,
.field input:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="search"]:focus {
  outline: none;
  border-color: var(--lavender);
  box-shadow: 0 0 0 3px rgba(182, 170, 240, 0.28);
}

.field select:disabled,
.field input:disabled {
  opacity: 0.55;
}

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

.row {
  display: flex;
  align-items: center;
}

.row.gap {
  gap: 10px;
}

.row.wrap {
  flex-wrap: wrap;
}

.row + .row,
.grid-2 + .row,
.row + .grid-2,
.callout {
  margin-top: 12px;
}

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

.small {
  font-size: 12.5px;
}

.mono {
  font-family: var(--mono);
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--gray-soft);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 1px 5px;
}

/* --------------------------------------------------------- connection card */

.connect-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 720px) {
  .connect-body {
    grid-template-columns: 1fr;
  }
}

.usbcom {
  margin: 0;
  text-align: center;
}

.usbcom img {
  width: 100%;
  max-width: 230px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.usbcom figcaption {
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.callout {
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 12.5px;
  line-height: 1.45;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
}

.callout b {
  color: var(--text);
}

.callout.warn {
  background: var(--warn-soft);
  border-color: #f3e0b6;
  color: #7a5716;
}

/* ------------------------------------------------------------- info card */

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

.info-item {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 9px 12px;
  min-width: 0;
}

.info-item dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.info-item dd {
  margin: 3px 0 0;
  font-size: 15px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.info-item dd.hex {
  font-size: 12.5px;
  line-height: 1.5;
  font-family: var(--mono);
  color: var(--blue-2);
}

.info-wide {
  grid-column: span 2;
}

.info-card .muted.small {
  margin: 12px 0 0;
}

/* ----------------------------------------------------------- scale panel */

.scale-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #39404f, #262b36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 20px 30px -26px rgba(24, 26, 44, 0.9);
}

.scale-lcd {
  border-radius: 12px;
  background: linear-gradient(180deg, #d7e8d9, #c3d9c7);
  padding: 14px 16px 10px;
  box-shadow: inset 0 2px 10px rgba(20, 34, 26, 0.28);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 122px;
  justify-content: center;
}

.scale-digits {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: flex-end;
}

.seg {
  width: 30px;
  height: 52px;
  display: block;
}

.seg rect {
  fill: #c9dccd;
  transition: fill 0.12s;
}

.seg rect.on {
  fill: #1e2a24;
}

.seg .dot {
  fill: #c9dccd;
}

.seg .dot.on {
  fill: #1e2a24;
}

.scale-lcd-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 650;
  color: #38473d;
}

.scale-unit {
  letter-spacing: 0.06em;
}

.scale-state.unstable {
  color: #8a5a13;
}

.scale-keys {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.key {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 82px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #4e5669;
  background: linear-gradient(180deg, #444c5e, #353b49);
  color: #e8ebf5;
  font: inherit;
  cursor: pointer;
  transition: transform 0.08s, border-color 0.15s;
}

.key:hover:not(:disabled) {
  border-color: #7c879f;
}

.key:active:not(:disabled) {
  transform: translateY(1px);
}

.key:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.key b {
  font-size: 13px;
  letter-spacing: 0.04em;
}

.key-num {
  position: absolute;
  top: 5px;
  left: 7px;
  font-size: 9.5px;
  font-weight: 700;
  color: #8a93a8;
}

.key small {
  font-size: 10px;
  color: #aab2c6;
}

.key-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.15);
}

.key-set .key-dot {
  background: radial-gradient(circle at 35% 30%, #ffd166, #dfa127);
}

.key-zero .key-dot {
  background: radial-gradient(circle at 35% 30%, #7aa2ff, #3b5bdb);
}

.key-peel .key-dot {
  background: radial-gradient(circle at 35% 30%, #6ee7a8, #2f9e6b);
}

.device-actions {
  margin-top: 14px;
}

/* --------------------------------------------------------------- methods */

.responses {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 34px;
}

.responses:empty::after {
  content: "Ответы появятся здесь";
  color: var(--muted);
  font-size: 12.5px;
}

.responses li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  font-size: 13px;
}

.responses li.ok {
  border-color: #c8e9d7;
  background: var(--ok-soft);
}

.responses li.fail {
  border-color: #f2cccc;
  background: #fdf1f1;
}

.responses .rt {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------------------------------------------------------------- switch */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.switch input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.switch.vertical {
  align-items: flex-start;
  max-width: 340px;
}

.switch.compact {
  font-size: 12px;
}

/* ------------------------------------------------------------------- log */

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

.counters {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--gray-soft);
}

.log {
  height: 300px;
  overflow-y: auto;
  border-radius: 12px;
  background: var(--log-bg);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  color: #cfd6ea;
}

.log-line {
  display: flex;
  gap: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-line .t {
  color: #6f7a99;
  flex: 0 0 auto;
}

.log-line .tag {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 11px;
  min-width: 34px;
  color: #8f9ac0;
  letter-spacing: 0.04em;
}

.log-line .msg {
  flex: 1 1 auto;
}

.log-line.success .msg {
  color: #7fe0b0;
}

.log-line.warn .msg {
  color: #f2c46a;
}

.log-line.error .msg {
  color: #ff8f8f;
}

.log-line.tx .msg {
  color: #9db4ff;
}

.log-line.rx .msg {
  color: #c3a7ff;
}

.log-line.hex .msg {
  color: #8be9fd;
}

/* ------------------------------------------------------------------- fab */

.fab {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 17px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #ffffff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 20px 32px -14px rgba(59, 91, 219, 0.75);
  transition: background 0.15s, transform 0.08s;
}

.fab:hover {
  background: var(--blue-2);
}

.fab:active {
  transform: translateY(1px);
}

.fab-icon {
  font-size: 16px;
}

/* --------------------------------------------------------- special view */

.special {
  max-width: 1380px;
  margin: 0 auto;
  padding: 18px 24px 90px;
}

.special-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.special-title h1 {
  margin: 0;
  font-size: 22px;
}

.special-title p {
  margin: 2px 0 0;
}

.special-head .tag {
  margin-left: auto;
}

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

.special-grid .hex-card,
.special-grid .special-log-card {
  grid-column: span 2;
}

.special-log-card .log {
  height: 240px;
}

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

  .special-grid .hex-card,
  .special-grid .special-log-card {
    grid-column: span 1;
  }
}

/* ------------------------------------------------------------ hex table */

.hex-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.hex-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.9fr) minmax(0, 1.7fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--panel-2);
}

.hex-name {
  font-weight: 650;
  font-size: 13.5px;
}

.hex-bytes {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue-2);
  overflow-wrap: anywhere;
}

.hex-desc {
  font-size: 12.5px;
  color: var(--muted);
}

.hex-row .btn {
  padding: 7px 12px;
  font-size: 12.5px;
}

@media (max-width: 900px) {
  .hex-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* -------------------------------------------------------------- dropzone */

.dropzone {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1.5px dashed #c9c1ef;
  border-radius: 14px;
  background: var(--lavender-soft);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone.drag {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.dropzone.has-file {
  border-style: solid;
  border-color: #bfe6d2;
  background: var(--ok-soft);
}

.dz-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--panel);
  color: var(--blue);
  font-size: 19px;
  border: 1px solid var(--line);
}

.dz-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dz-text b {
  font-size: 14px;
}

.dz-file {
  margin-left: auto;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.dz-file .sha {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gray);
}

.progress-wrap {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress {
  flex: 1 1 auto;
  height: 9px;
  border-radius: 999px;
  background: var(--gray-soft);
  overflow: hidden;
  border: 1px solid var(--line-2);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), #7b93ff);
  transition: width 0.2s;
}

.progress-text {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  min-width: 44px;
  text-align: right;
}

/* ---------------------------------------------------------- docs view */

.docs-view {
  max-width: 1380px;
  margin: 0 auto;
  padding: 18px 24px 90px;
}

.docs-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.docs-head h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.docs-tools {
  display: flex;
  gap: 10px;
  align-items: center;
}

.docs-tools input[type="search"] {
  width: 300px;
}

.doc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.doc-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.1s;
}

.doc-card:hover {
  border-color: var(--lavender);
  transform: translateY(-1px);
}

.doc-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue-2);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
}

.doc-body-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.doc-title-link {
  font-weight: 650;
  font-size: 14.5px;
}

.doc-desc {
  font-size: 12.5px;
  color: var(--muted);
}

.doc-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gray);
  overflow-wrap: anywhere;
}

.docs-empty {
  margin-top: 16px;
}

.docs-loading {
  padding: 16px;
}

/* --------------------------------------------------------------- footer */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1380px;
  margin: 0 auto;
  padding: 8px 24px 28px;
  font-size: 12px;
  color: var(--gray);
}

/* ---------------------------------------------------------------- modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(34, 28, 66, 0.42);
  backdrop-filter: blur(3px);
  padding: 20px;
}

.modal-card {
  width: min(520px, 100%);
  background: var(--panel);
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 22px 22px 18px;
  box-shadow: 0 30px 60px -30px rgba(30, 22, 70, 0.6);
}

.modal-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.modal-text {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.modal-text p {
  margin: 0 0 8px;
}

.modal-field {
  margin-top: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 70;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--text);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 18px 30px -18px rgba(20, 16, 50, 0.8);
  max-width: min(560px, 90vw);
}

.toast.error {
  background: var(--danger);
}

.toast.success {
  background: var(--ok);
}

.toast.warn {
  background: var(--warn);
}

/* -------------------------------------------------------------- special */

body.is-special .tabs,
body.is-special #viewTool,
body.is-special .docs-view,
body.is-special .fab {
  display: none;
}


/* ------------------------------------------------------------ мобильная версия */

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    padding: 12px 14px;
    gap: 10px;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
    gap: 10px;
  }

  .logo {
    width: 42px;
    height: 42px;
    font-size: 12.5px;
    border-radius: 12px;
  }

  .brand-text h1 {
    font-size: 16px;
  }

  .brand-text p {
    display: none;
  }

  .topbar-right {
    gap: 8px;
  }

  .topbar-right .btn {
    padding: 8px 10px;
    font-size: 12.5px;
  }

  .pill {
    padding: 6px 10px;
    font-size: 12px;
  }

  .tabs {
    padding: 10px 14px 0;
    overflow-x: auto;
  }

  .tab {
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .layout {
    padding: 12px 14px 110px;
    gap: 14px;
  }

  .card {
    padding: 14px 14px 16px;
    border-radius: 14px;
  }

  .fab {
    right: 14px;
    bottom: 14px;
    padding: 12px 16px;
    font-size: 13.5px;
  }

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

  .info-wide {
    grid-column: span 1;
  }

  .scale-digits {
    gap: 4px;
  }

  .seg {
    width: 26px;
    height: 46px;
  }

  .key {
    min-width: 0;
    flex: 1 1 0;
    padding: 9px 8px;
  }

  .special {
    padding: 14px 14px 90px;
  }

  .special-head {
    flex-wrap: wrap;
    gap: 10px;
  }

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

  .docs-head {
    align-items: flex-start;
  }

  .docs-tools input[type="search"] {
    width: 100%;
  }

  .doc-list {
    grid-template-columns: 1fr;
  }
}
