:root {
  --bg: #08111f;
  --panel: rgba(12, 25, 45, 0.9);
  --panel-soft: rgba(16, 33, 57, 0.94);
  --ink: #ebf2ff;
  --muted: #91a4c3;
  --accent: #60a5fa;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --line: rgba(148, 163, 184, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 15%, rgba(34, 211, 238, 0.12) 0, transparent 28%),
    radial-gradient(circle at 90% 10%, rgba(96, 165, 250, 0.14) 0, transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(52, 211, 153, 0.08) 0, transparent 24%),
    var(--bg);
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 18px 40px;
}

.top-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  position: relative;
}

.user-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: 0.2px;
  text-align: center;
}

.sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.banner {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  border: 1px solid transparent;
  background: rgba(96, 165, 250, 0.12);
  color: #dce9ff;
  white-space: pre-wrap;
}

.banner.ok {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.2);
  color: #d1fae5;
}

.banner.warn {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.18);
  color: #fef3c7;
}

.banner.err {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.18);
  color: #fee2e2;
}

.cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  margin-bottom: 16px;
}

.cards.cards-compact {
  grid-template-columns: repeat(2, minmax(230px, 1fr));
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 10px;
}

.card,
.table-wrap,
.line-wrap,
.handle-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(2, 8, 23, 0.28);
  backdrop-filter: blur(14px);
}

.card {
  padding: 14px 14px 12px;
}

.card.card-compact {
  padding: 10px 12px;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(2, 8, 23, 0.22);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.value {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
}

.value.value-compact {
  font-size: 24px;
  margin-bottom: 4px;
}

.status-ok {
  color: var(--ok);
}

.status-sleep {
  color: var(--accent);
}

.status-warn {
  color: var(--warn);
}

.status-bad {
  color: var(--bad);
}

.meta {
  margin: 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.menu-wrap {
  margin: 0 0 14px;
  padding: 2px 0 12px;
  border-bottom: 1px solid var(--line);
}

.menu-head {
  display: none;
}

.menu-toggle {
  display: none;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #d5e4fb;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.auth-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(2, 8, 23, 0.28);
  padding: 18px;
}

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

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

.auth-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  color: var(--ink);
  background: rgba(6, 17, 31, 0.72);
}

.menu-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  justify-content: center;
}

.menu-tab {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #c8d8ef;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.menu-tab.active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(96, 165, 250, 0.14));
  color: #f3f8ff;
  border-color: rgba(34, 211, 238, 0.22);
}

.table-wrap {
  overflow: hidden;
}

.table-title {
  margin: 0;
  padding: 12px 14px;
  font-size: 15px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
}

.table-controls,
.handle-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.handle-controls {
  justify-content: flex-end;
  padding: 10px 12px 0;
}

.table-page {
  color: var(--muted);
  font-size: 12px;
  margin-right: 6px;
  white-space: nowrap;
}

.table-btn,
.map-form button,
.handle-form button,
.line-sort-btn {
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #07111d;
  background: linear-gradient(135deg, #22d3ee, #60a5fa);
  cursor: pointer;
}

.table-btn.secondary,
.line-sort-btn {
  border-color: rgba(148, 163, 184, 0.14);
  color: #dbe8ff;
  background: rgba(255, 255, 255, 0.04);
}

.table-btn.danger {
  border-color: rgba(248, 113, 113, 0.5);
  color: #fee2e2;
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.4), rgba(220, 38, 38, 0.4));
}

.table-btn.muted,
.table-btn:disabled,
.map-form button:disabled,
.handle-form button:disabled {
  opacity: 0.55;
  cursor: default;
}

.row-delete-btn {
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  color: #fee2e2;
  background: rgba(248, 113, 113, 0.12);
  cursor: pointer;
  line-height: 1;
  font-size: 14px;
}

.row-delete-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.row-delete-btn:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.2);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(3, 9, 18, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: min(520px, 100%);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(2, 8, 23, 0.46);
  padding: 18px 18px 16px;
}

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

.modal-text {
  margin: 0;
  color: #d5e4fb;
  line-height: 1.45;
}

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

.line-sort-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.line-sort-btn.active {
  border-color: rgba(34, 211, 238, 0.22);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(96, 165, 250, 0.12));
  color: #f3f8ff;
}

.seg-toggle {
  display: inline-flex;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.seg-toggle button {
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #c8d8ef;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  cursor: pointer;
  white-space: nowrap;
}

.seg-toggle button:last-child {
  border-right: none;
}

.seg-toggle button.active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(96, 165, 250, 0.12));
  color: #f3f8ff;
}

.table-search,
.line-controls input,
.line-game-search,
.map-form input,
.handle-form textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--ink);
  background: rgba(6, 17, 31, 0.72);
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
}

.table-search::placeholder,
.line-game-search::placeholder,
.map-form input::placeholder,
.handle-form textarea::placeholder {
  color: #7f96b8;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  box-shadow: 0 0 0 1000px rgba(6, 17, 31, 0.72) inset;
  transition: background-color 9999s ease-in-out 0s;
}

.line-controls input[type="date"],
.handle-controls input[type="date"] {
  border: 1px solid var(--line);
  min-height: 42px;
  padding: 10px 40px 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--ink);
  background-color: rgba(6, 17, 31, 0.72);
  color-scheme: dark;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
}

.date-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 180px;
}

.line-controls .date-input-wrap {
  width: 100%;
}

.date-input-wrap > input[type="date"] {
  width: 100%;
}

.date-picker-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #dbe8ff;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.date-picker-btn:hover {
  color: #ffffff;
}

input[type="date"] {
  color-scheme: dark;
}

input[type="date"]::-webkit-datetime-edit {
  color: var(--ink);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
  width: 22px;
  height: 22px;
  margin-right: 10px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 0;
}

.line-controls label {
  display: grid;
  gap: 6px;
}

.line-controls label span {
  display: block;
}

.line-controls input {
  min-width: 180px;
}

.table-search {
  width: 260px;
  max-width: 55%;
}

.handle-form textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
}

.map-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.map-form input {
  width: 110px;
}

.handle-form {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.handle-form h2,
.handle-form p {
  margin: 0;
}

.data-upload-wrap {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.data-upload-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.data-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.data-upload-meta {
  margin: 0;
  color: #bfd1ed;
  font-size: 12px;
}

.handle-form p {
  color: var(--muted);
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table-scroll {
  max-height: 760px;
  overflow: auto;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: rgba(255, 255, 255, 0.025);
}

tr:last-child td {
  border-bottom: none;
}

.injury-row td {
  background: rgba(255, 255, 255, 0.015);
  border-top: 1px solid rgba(96, 165, 250, 0.1);
  border-bottom: none;
}

.snippet-row td {
  background: rgba(255, 255, 255, 0.015);
  color: #c8d8ef;
  font-size: 12.5px;
  line-height: 1.4;
  border-bottom: 1px solid rgba(96, 165, 250, 0.12);
}

.avg-row td {
  background: rgba(96, 165, 250, 0.1);
  font-weight: 700;
  border-top: 1px solid rgba(96, 165, 250, 0.28);
}

.metric-val {
  display: block;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.metric-rank {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  margin-top: 2px;
}

td.bpr-good .metric-val,
td.bpr-good .metric-rank,
td.obpr-good .metric-val,
td.obpr-good .metric-rank,
td.dbpr-good .metric-val,
td.dbpr-good .metric-rank,
td.role-good .metric-val,
td.role-good .metric-rank {
  color: #6ee7b7;
  font-weight: 700;
}

.sort-th {
  cursor: pointer;
  user-select: none;
}

.spotlight-btn {
  border: 0;
  background: transparent;
  color: #98a8bf;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.spotlight-btn.active {
  color: #fbbf24;
}

.spotlight-row {
  background: rgba(251, 191, 36, 0.08);
}

.line-wrap {
  padding: 16px 18px;
}

.audit-search-head {
  align-items: flex-start;
}

.audit-search-results {
  margin: 0 18px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.audit-search-item {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: rgba(12, 25, 45, 0.92);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  text-align: left;
}

.audit-search-item:first-child {
  border-top: 0;
}

.audit-search-item:hover {
  background: rgba(96, 165, 250, 0.08);
}

.audit-search-name {
  font-weight: 600;
}

.audit-search-team,
.audit-search-empty,
.audit-player-meta {
  color: var(--muted);
}

.audit-search-empty {
  padding: 10px 12px;
}

.audit-summary {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 14px;
  padding: 16px 18px 0;
}

.audit-summary-main {
  min-width: 0;
}

.audit-player-name {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.audit-stat-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: flex-end;
  max-width: 100%;
  flex: 0 0 auto;
}

.audit-stat-card {
  flex: 0 0 58px;
  min-width: 58px;
  text-align: right;
}

.audit-stat-value {
  color: #f3f8ff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.audit-stat-label {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: right;
  text-transform: uppercase;
}

.audit-empty-state {
  color: var(--muted);
  padding: 8px 18px 4px;
}

.audit-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  margin-top: 16px;
}


.line-layout {
  display: grid;
  grid-template-columns: 32% 68%;
  gap: 12px;
  align-items: start;
}

.line-controls,
.line-games-block {
  display: grid;
  gap: 10px;
}

.line-controls label,
.line-games-block {
  font-size: 12px;
  color: var(--muted);
}

.line-toggle {
  align-items: center;
  display: inline-flex !important;
  gap: 8px;
  justify-content: flex-start;
}

.line-toggle input {
  border: 0;
  flex: 0 0 auto;
  margin: 0;
  min-width: 0 !important;
  padding: 0;
  width: auto !important;
}

.line-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}

.line-game-cards {
  display: grid;
  gap: 8px;
  max-height: 440px;
  overflow: auto;
  padding-right: 2px;
}

.line-game-card {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  color: #ebf2ff;
}

.line-game-card.active {
  border-color: rgba(34, 211, 238, 0.22);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(96, 165, 250, 0.06));
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.12);
}

.line-game-card.delta-highlight {
  color: #d1fae5;
  border-color: rgba(52, 211, 153, 0.2);
  background: rgba(52, 211, 153, 0.08);
}

.line-game-card.kenpom-missing {
  color: #fee2e2;
  border-color: rgba(248, 113, 113, 0.18);
  background: rgba(248, 113, 113, 0.08);
}

.line-game-card-game {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
}

.line-game-card-sub {
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.3;
}

.line-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  color: var(--muted);
  font-size: 12px;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(148, 163, 184, 0.18);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.line-chart {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.015));
  padding: 12px 12px 8px;
}

.line-game-title {
  margin: 0 0 10px;
  color: #ebf2ff;
  font-size: 16px;
  font-weight: 600;
  white-space: pre-line;
}

.line-legend {
  margin-top: 10px;
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: #bfd1ed;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.line-top-players {
  margin-top: 10px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
}

.line-top-head {
  font-size: 12px;
  color: #bfd1ed;
  margin-bottom: 8px;
  font-weight: 600;
}

.line-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.line-top-card {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  padding: 8px;
}

.line-top-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #ebf2ff;
  margin-bottom: 6px;
}

.line-top-note {
  font-size: 11px;
  color: #91a4c3;
  margin-bottom: 6px;
}

.line-top-table {
  font-size: 11.5px;
}

.line-top-table th,
.line-top-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding: 4px 2px;
}

.line-top-table td.lastgp-out {
  color: #b91c1c;
  font-weight: 600;
}

.line-top-table th:nth-child(3),
.line-top-table td.line-top-status-cell {
  text-align: center;
}

.line-top-empty,
.empty-state,
.loading-state {
  font-size: 12px;
  color: var(--muted);
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.xdiag-tools {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.xdiag-top-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  gap: 14px;
  align-items: start;
}

.diag-output {
  margin: 4px 0 0;
  max-height: 440px;
  overflow: auto;
}

code {
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.85);
  outline-offset: 2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .cards,
  .bottom-grid,
  .xdiag-top-grid,
  .line-layout,
  .line-top-grid {
    grid-template-columns: 1fr;
  }

  .cards.cards-compact {
    grid-template-columns: 1fr;
    max-width: none;
  }

  h1 {
    width: 100%;
    margin: 0;
    font-size: 24px;
    text-align: center;
  }

  .top-bar {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    row-gap: 8px;
  }

  .user-meta {
    position: static;
    transform: none;
    margin: 0;
  }

  .menu-head {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .menu-tabs {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    overflow: visible;
  }

  .menu-tabs.open {
    display: flex;
  }

  .menu-tab {
    width: 100%;
    justify-content: flex-start;
    border-radius: 12px;
  }

  .table-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .audit-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .audit-stat-grid {
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
    max-width: none;
    gap: 10px 14px;
  }

  .audit-stat-card {
    flex: 0 0 auto;
    min-width: 52px;
  }

  .table-controls {
    flex-wrap: wrap;
  }

  .table-search {
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 760px) {
  .wrap {
    padding: 18px 12px 32px;
  }

  .card,
  .table-wrap,
  .line-wrap,
  .handle-form {
    border-radius: 20px;
  }

  .table-scroll {
    max-height: none;
    overflow: visible;
    padding: 0 12px 12px;
  }

  .diag-output {
    max-height: none;
  }

  .table-scroll table,
  .table-scroll thead,
  .table-scroll tbody,
  .table-scroll tr,
  .table-scroll th,
  .table-scroll td {
    display: block;
    width: 100%;
  }

  .table-scroll thead {
    display: none;
  }

  .table-scroll tbody {
    display: grid;
    gap: 12px;
  }

  .table-scroll tbody tr {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
  }

  .table-scroll td {
    padding: 0;
    border: 0;
  }

  .table-scroll td[data-label] {
    display: grid;
    grid-template-columns: minmax(92px, 36%) 1fr;
    gap: 10px;
    align-items: start;
  }

  .table-scroll td[data-label]::before {
    content: attr(data-label);
    color: #9eb2d0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .table-scroll td[colspan] {
    padding: 0;
  }

  .snippet-row {
    margin-top: -6px;
  }

  .snippet-row td {
    padding-top: 2px;
    border-bottom: 0;
  }

  .line-top-table td[data-label] {
    grid-template-columns: minmax(72px, 34%) 1fr;
  }

  .map-form {
    flex-direction: column;
    align-items: stretch;
  }

  .map-form input {
    width: 100%;
  }
}
