* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font: 16px/1.5 Arial, Helvetica, sans-serif;
  color: #202124;
  background: #f5f7f9;
}

body {
  min-height: 100%;
  margin: 0;
}

.container {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.tool {
  background: #fff;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 8px 24px rgb(20 32 48 / 8%);
}

.tool-header {
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 24px;
  padding-bottom: 18px;
}

.split-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 4px;
}

h2 {
  font-size: 1.1rem;
}

h3 {
  font-size: 1rem;
  margin-bottom: 0;
}

p {
  color: #5f6368;
  margin-bottom: 0;
}

.tool-form {
  display: grid;
  gap: 20px;
}

.admin-tool {
  margin-top: 24px;
}

.admin-grid {
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
}

.form-row {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

label,
legend {
  font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="date"],
input:not([type]) {
  width: 100%;
  min-height: 42px;
  border: 1px solid #b8c0cc;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

input:focus,
button:focus {
  outline: 3px solid #9dc7ff;
  outline-offset: 2px;
}

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
}

.option-strong {
  font-weight: 700;
}

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

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 9px 16px;
  background: #154f8f;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #0d3f76;
}

.download-button {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border-radius: 6px;
  padding: 9px 16px;
  background: #154f8f;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.download-button:hover {
  background: #0d3f76;
}

.button-muted {
  background: #6b7280;
}

.button-muted:hover {
  background: #4b5563;
}

.tariff-actions {
  display: grid;
  gap: 12px;
  border-top: 1px solid #e5e7eb;
  padding-top: 20px;
}

.secondary-actions button {
  background: #49515a;
}

.secondary-actions button:hover {
  background: #343b43;
}

.result {
  display: block;
  margin-top: 24px;
  border-radius: 6px;
  padding: 16px;
  font-family: Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

.result-success {
  border: 1px solid #89c69a;
  background: #edf8f0;
}

.result-error {
  border: 1px solid #d59696;
  background: #fff0f0;
  color: #8a1f1f;
}

.fixed-value {
  display: grid;
  gap: 4px;
  border: 1px solid #d8dee4;
  border-radius: 6px;
  padding: 12px;
  background: #f8fafc;
}

.token-form {
  margin-top: 20px;
}

.token-download-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.token-table {
  width: 100%;
  border-collapse: collapse;
}

.token-table th,
.token-table td {
  border: 1px solid #cbd5e1;
  padding: 9px 10px;
  text-align: left;
}

.token-table th {
  background: #f8fafc;
}

.token-table code {
  font-size: 1rem;
}

.user-list {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.user-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e5e7eb;
  padding: 8px 0;
}

.used-token-section {
  border-top: 1px solid #e5e7eb;
  margin-top: 24px;
  padding-top: 20px;
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 20px, 760px);
    padding: 20px 0;
  }

  .tool {
    padding: 20px;
  }

  .split-header,
  .token-download-header,
  .admin-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
}
