* {
  box-sizing: border-box;
}
:root {
  --border: #dfe3e8;
  --text: #20252b;
  --muted: #68727d;
  --bg: #f5f7f9;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}
button,
input {
  font: inherit;
}
.table-app {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 15px;
}
.app-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 5px 22px rgba(0, 0, 0, 0.04);
}

.subtitle {
  margin: 0;
  color: var(--muted);
}
.controls {
  margin-top: 22px;
}
.title-field {
  display: block;
  max-width: 520px;
}
.title-field span {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
  font-size: 14px;
}
.title-field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 12px;
  outline: none;
}
.title-field input:focus,
.cell-input:focus,
.column-name:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
}

button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
А button.primary:hover {
  background: var(--primary-hover);
}
button.danger {
  color: var(--danger);
}
.message {
  min-height: 22px;
  margin: 12px 0 2px;
  color: var(--muted);
  font-size: 13px;
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: 8px;
  padding-bottom: 9px;
  -webkit-overflow-scrolling: touch;
}
.table-scroll::-webkit-scrollbar {
  height: 12px;
}
.table-scroll::-webkit-scrollbar-track {
  background: #edf0f3;
  border-radius: 10px;
}
.table-scroll::-webkit-scrollbar-thumb {
  background: #aab2bb;
  border-radius: 10px;
}
table {
  width: 100%;
  min-width: 680px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
}
th,
td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 7px;
  background: #fff;
  vertical-align: middle;
}
th:last-child,
td:last-child {
  border-right: 0;
}
tbody tr:last-child td {
  border-bottom: 0;
}
thead th {
  background: #f1f4f7;
  font-weight: 700;
  white-space: nowrap;
}
.place-col {
  width: 75px;
  min-width: 75px;
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 3;
  background: #f1f4f7;
}
tbody .place-col {
  background: #fff;
  font-weight: 700;
}
.points-col {
  min-width: 115px;
}
.header-content {
  display: flex;
  align-items: center;
  gap: 6px;
}
.column-name {
  width: 100%;
  min-width: 75px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 5px;
  padding: 6px;
  font-weight: 700;
}
.sort-column,
.remove-column,
.remove-row {
  padding: 4px 7px;
}
.remove-column,
.remove-row {
  color: var(--danger);
  border-color: transparent;
  background: transparent;
}
.cell-input {
  width: 100%;
  min-width: 90px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 7px;
  background: transparent;
  outline: none;
}
.cell-input:hover {
  border-color: var(--border);
}
.points-input {
  font-weight: 700;
}
.row-actions {
  width: 45px;
  min-width: 45px;
  text-align: center;
}
.rank-1 .place-col,
.rank-2 .place-col,
.rank-3 .place-col {
  font-size: 16px;
}
.bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 12px;
}
.limits {
  color: var(--muted);
  font-size: 12px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
@media (max-width: 700px) {
  .table-app {
    margin: 12px auto;
    padding: 0 8px;
  }
  .app-card {
    padding: 15px;
    border-radius: 10px;
  }
  h1 {
    font-size: 25px;
  }
  .buttons button {
    flex: 1 1 auto;
  }
  .bottom-bar {
    display: block;
  }
  .actions {
    margin-top: 10px;
  }
  .actions button {
    flex: 1 1 auto;
  }
  table {
    min-width: 700px;
  }
}
@media print {
  body {
    background: #fff;
  }
  .app-card {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .controls,
  .message,
  .bottom-bar {
    display: none !important;
  }
  .table-scroll {
    overflow: visible;
  }
  table {
    min-width: 0;
  }
  .remove-column,
  .remove-row,
  .row-actions,
  .sort-column {
    display: none !important;
  }
  .cell-input,
  .column-name {
    border: 0;
    box-shadow: none;
  }
}
