:root {
  --bg: #0b0f14;
  --bg-soft: #0f151d;
  --panel: #121a24;
  --panel-2: #17202c;
  --border: #223041;
  --text: #e6eef7;
  --muted: #93a4b8;
  --accent: #38bdf8;
  --accent-ink: #04121c;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.38);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #16283a 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100%;
}

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

.hidden {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12.5px;
}
.mono {
  font-family: var(--mono);
}
.center {
  text-align: center;
}
.nowrap {
  white-space: nowrap;
}

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 22px;
  background: rgba(11, 15, 20, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.02em;
  font-size: 17px;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), #6366f1);
  color: #04121c;
  font-size: 15px;
}
.nav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
  flex-wrap: wrap;
}
.nav a {
  padding: 7px 11px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.nav a:hover {
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
}
.nav a.active {
  background: var(--panel-2);
  color: var(--text);
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.balance {
  font-family: var(--mono);
  font-size: 13px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.pill {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

/* ----------------------------------------------------------------- buttons */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover:not(:disabled) {
  border-color: #33475e;
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.primary:hover:not(:disabled) {
  background: #5cc9fb;
}
.btn.ghost {
  background: transparent;
}
.btn.danger {
  color: var(--danger);
  border-color: #45232a;
}
.btn.danger:hover:not(:disabled) {
  background: #2a1418;
}
.btn.tiny {
  padding: 5px 9px;
  font-size: 12.5px;
  border-radius: 8px;
}
.btn.wide {
  width: 100%;
  justify-content: center;
}

/* ------------------------------------------------------------------ layout */
.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 22px 60px;
}
.footer {
  border-top: 1px solid var(--border);
  padding: 18px 22px 40px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}
.grid {
  display: grid;
  gap: 18px;
}
.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.panel.tight {
  padding: 14px;
}
.panel h2,
.panel h3 {
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.panel h2 {
  font-size: 19px;
}
.panel h3 {
  font-size: 16px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hero h1 {
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 6px 0 12px;
}
.hero p {
  color: var(--muted);
  max-width: 62ch;
  font-size: 16px;
}
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.stat-label {
  color: var(--muted);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------------------------------------------------------------- catalogue */
.price-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.price-card .domain {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text);
}
.price {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.price small {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.feature-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13.5px;
}
.notice {
  border: 1px solid #2c4257;
  background: #101e2a;
  border-radius: 10px;
  padding: 10px 12px;
  color: #b9d5e8;
  font-size: 12.5px;
}
.notice.warn {
  border-color: #4a3a12;
  background: #241c08;
  color: #f2d99a;
}
.notice.good {
  border-color: #1f4a33;
  background: #0b2018;
  color: #9fe3bd;
}

/* ------------------------------------------------------------------ rentals */
.inbox-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .inbox-layout {
    grid-template-columns: 1fr;
  }
}
.rental-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.rental-card:hover {
  border-color: #3a5570;
}
.rental-card.active {
  border-color: var(--accent);
  background: #10202c;
}
.address-line {
  font-family: var(--mono);
  font-size: 13.5px;
  word-break: break-all;
}
.rental-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}
.status {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status.active {
  background: rgba(52, 211, 153, 0.16);
  color: var(--ok);
}
.status.expired,
.status.released {
  background: rgba(147, 164, 184, 0.16);
  color: var(--muted);
}
.tag {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}
.tag.label-only {
  border-color: #4a3a12;
  color: var(--warn);
}

/* ----------------------------------------------------------------- messages */
.message-list {
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.message-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  align-items: center;
}
.message-row:last-child {
  border-bottom: none;
}
.message-row:hover {
  background: var(--panel-2);
}
.message-row.selected {
  background: #10202c;
}
.message-row.unread .msg-subject {
  font-weight: 650;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.dot.read {
  background: transparent;
}
.msg-subject {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-from {
  color: var(--muted);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.reader {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  padding: 16px;
  min-height: 260px;
}
.reader header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.reader h2 {
  margin: 0 0 6px;
  font-size: 18px;
  word-break: break-word;
}
.body-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.6;
}
.html-frame {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.attachment {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12.5px;
}
.raw-headers {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px;
}

/* ------------------------------------------------------------------- inputs */
label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
input,
select,
textarea {
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #0d141c;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(56, 189, 248, 0.35);
  border-color: var(--accent);
}
.mini-input {
  width: 92px;
  display: inline-block;
  margin: 0;
  padding: 5px 8px;
  font-size: 12.5px;
}
.form-error {
  color: var(--danger);
  font-size: 13px;
  margin: 0 0 10px;
}
.search {
  max-width: 260px;
}

/* -------------------------------------------------------------------- table */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
th,
td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
tbody tr:hover {
  background: var(--panel-2);
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* ------------------------------------------------------------------- modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 8, 12, 0.72);
  backdrop-filter: blur(4px);
}
.modal {
  position: relative;
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.modal h2 {
  margin: 0 0 14px;
  font-size: 19px;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.tab {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 8px;
}
.tab.active {
  background: var(--panel-2);
  color: var(--text);
  font-weight: 600;
}

/* ------------------------------------------------------------------- toasts */
.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}
.toast {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--panel-2);
  border-radius: 10px;
  padding: 11px 13px;
  box-shadow: var(--shadow);
  font-size: 13.5px;
  animation: toast-in 0.18s ease;
}
.toast.ok {
  border-left-color: var(--ok);
}
.toast.err {
  border-left-color: var(--danger);
}
.toast .t-title {
  font-weight: 650;
  margin-bottom: 2px;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.empty {
  padding: 26px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  font-size: 13px;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  font-family: var(--mono);
  word-break: break-all;
}
.step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.step-num {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}