:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --panel: #ffffff;
  --text: #17211f;
  --muted: #65716d;
  --line: #d9e1de;
  --primary: #176b87;
  --primary-dark: #10546b;
  --success: #2f7d4f;
  --success-dark: #25613f;
  --danger: #b42318;
  --shadow: 0 16px 50px rgba(31, 48, 44, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.panel,
.topbar,
.actions {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-panel {
  width: min(420px, 100%);
  margin: 12vh auto 0;
  padding: 28px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.25;
}

h2 {
  font-size: 18px;
  line-height: 1.3;
  margin-bottom: 16px;
}

.form {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  font: inherit;
}

input:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(23, 107, 135, 0.16);
}

.button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.primary {
  background: var(--primary);
}

.primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

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

.success:hover:not(:disabled) {
  background: var(--success-dark);
}

.ghost {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
}

.dashboard {
  display: grid;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
}

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

.current-ip {
  display: block;
  margin-top: 6px;
  color: var(--primary-dark);
  font-size: clamp(28px, 6vw, 46px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.actions {
  display: grid;
  grid-template-columns: 1.2fr repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  align-items: end;
}

.ip-field {
  gap: 6px;
}

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

.lists .panel {
  padding: 20px;
}

.list {
  display: grid;
  gap: 10px;
}

.row {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.delete-button {
  justify-self: start;
  min-height: 34px;
  border: 1px solid #f1b8b2;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--danger);
  background: #fff7f6;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.delete-button:hover {
  background: #ffe9e6;
}

.row.expired {
  color: var(--danger);
  background: #fff5f4;
}

.ip {
  font-weight: 800;
  overflow-wrap: anywhere;
}

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

.expired .meta {
  color: var(--danger);
}

.empty {
  color: var(--muted);
  padding: 18px 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 14px;
  color: #ffffff;
  background: #17211f;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .shell {
    padding: 16px;
  }

  .auth-panel {
    margin-top: 8vh;
    padding: 22px;
  }

  .topbar,
  .actions,
  .lists {
    grid-template-columns: 1fr;
  }

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