:root {
  --bg: #f4f5f8;
  --card: #ffffff;
  --text: #1c2030;
  --muted: #6b7388;
  --line: #dfe2ea;
  --accent: #3b6cf6;
  --accent-text: #ffffff;
  --danger: #c93b3b;
  --warn-bg: #fff6df;
  --warn-text: #7a5a05;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --card: #181c25;
    --text: #e8eaf0;
    --muted: #8d95a8;
    --line: #2a3040;
    --accent: #5b87ff;
    --accent-text: #0b0e14;
    --danger: #ff7a7a;
    --warn-bg: #2b2410;
    --warn-text: #e8c872;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 6vh 16px 32px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.card {
  width: 100%;
  max-width: 640px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
}

h1 { margin: 0 0 8px; font-size: 24px; letter-spacing: -0.01em; }
.lead { margin: 0 0 20px; color: var(--muted); }
.muted { color: var(--muted); font-size: 14px; }
.label { margin-bottom: 6px; font-weight: 600; }

.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tab {
  padding: 8px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

textarea, input[readonly], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
textarea { resize: vertical; min-height: 140px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
select { width: auto; }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 32px 16px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  word-break: break-all;
}
.drop:hover, .drop.over { border-color: var(--accent); }

.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.ttl { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }

button {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }

.bar { height: 8px; margin-top: 18px; overflow: hidden; border-radius: 4px; background: var(--line); }
#bar-fill { width: 0; height: 100%; background: var(--accent); transition: width 0.15s linear; }
#progress-text { margin-top: 6px; }

.error { margin-top: 14px; color: var(--danger); }
.warn { padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-text); font-size: 14px; }

.linkrow { display: flex; gap: 8px; }
.linkrow input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
#result { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

.info { margin-bottom: 14px; }
.what { font-size: 18px; font-weight: 600; word-break: break-all; }

#insecure { margin-bottom: 16px; font-size: 15px; line-height: 1.45; }

/* админка */
.card.wide { max-width: 760px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top h1 { margin: 0; }
h2 { margin: 28px 0 12px; font-size: 18px; }
input[type="password"] {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.items { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.item .main { min-width: 0; flex: 1 1 220px; }
.item .what { font-size: 16px; }
.item .actions { display: flex; flex-wrap: wrap; gap: 6px; }
.item button { padding: 6px 12px; font-size: 14px; }
button.danger { color: var(--danger); }
.empty { padding: 16px 0; color: var(--muted); }

[hidden] { display: none !important; }
