:root {
  --ink: #000;
  --text: #F5F1ED;
  --muted: #948D86;
  --line: rgba(255, 255, 255, .13);
  --glass: rgba(255, 255, 255, .055);
  --accent: #D97757;
  --bad: #E4674F;
  --ok: #6FCF97;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 16px/1.55 "Golos Text", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 60vh;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(60% 60% at 50% 0%, rgba(217, 119, 87, .18), transparent 70%);
}

h1 {
  font-size: clamp(24px, 5vw, 32px);
  letter-spacing: -.02em;
  margin: 0 0 8px;
}

h2 {
  font-size: 18px;
  margin: 36px 0 12px;
  font-weight: 600;
}

a {
  color: var(--accent);
}

.muted {
  color: var(--muted);
}

small.muted {
  display: block;
  font-size: 13px;
}

/* ---------- Вход и табы ---------- */
.centered {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 400px;
  padding: 28px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 22px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.tabs {
  position: relative;
  display: flex;
  gap: 6px;
  margin: 22px 0 18px;
  background: rgba(255, 255, 255, .05);
  padding: 4px;
  border-radius: 12px;
}

.tab-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  width: calc(50% - 7px);
  background: rgba(255, 255, 255, .1);
  border-radius: 9px;
  transition: transform .25s ease;
  pointer-events: none;
  z-index: 1;
}

.tab {
  position: relative;
  z-index: 2;
  flex: 1;
  padding: 9px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  background: none;
  color: var(--muted);
  font: 500 14px/1 inherit;
  transition: color .2s;
}

.tab.is-active {
  color: var(--text);
}

.panes-viewport {
  position: relative;
  overflow: hidden;
  transition: height .25s ease;
}

.panes-track {
  display: flex;
  width: 200%;
  transition: transform .25s ease;
}

.pane {
  width: 50%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}

.pane.is-active {
  opacity: 1;
  pointer-events: auto;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  color: var(--muted);
}

input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .35);
  color: var(--text);
  font: 400 16px/1.2 inherit;
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.hint {
  font-size: 12.5px;
  color: var(--muted);
}

.hint.ok {
  color: var(--ok);
}

.hint.bad {
  color: var(--bad);
}

.error {
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(228, 103, 79, .14);
  border: 1px solid rgba(228, 103, 79, .4);
  font-size: 14px;
  margin-top: 16px;
}

.primary {
  padding: 13px 18px;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  background: var(--accent);
  color: #1a0f0a;
  font: 600 15px/1 inherit;
}

.primary:hover {
  filter: brightness(1.07);
}

.ghost {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 10px;
  padding: 7px 12px;
  cursor: pointer;
  font: 500 13px/1 inherit;
}

.ghost:hover {
  color: var(--text);
}

/* ---------- Шапка и профиль ---------- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 600;
  letter-spacing: -.01em;
}

.profile {
  position: relative;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  background: var(--accent);
  color: #1a0f0a;
  border: 0;
  font: 600 16px/1 inherit;
}

.menu {
  position: absolute;
  right: 0;
  top: 48px;
  min-width: 216px;
  z-index: 20;
  background: #0a0a0a;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 30px 60px -30px #000;
  transform-origin: top right;
  animation: fadeScale .2s ease;
}

.menu-head {
  padding: 8px 10px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
  font-size: 14px;
}

.menu-head span {
  display: block;
  font-size: 12.5px;
}

.submenu {
  animation: fadeIn .2s ease;
}

.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text);
  font: 400 14.5px/1.2 inherit;
  cursor: pointer;
  text-decoration: none;
}

.menu-item:hover {
  background: rgba(255, 255, 255, .07);
}

.menu-item.sub {
  padding-left: 22px;
  color: var(--muted);
}

.menu-item.sub:hover {
  color: var(--text);
}

/* ---------- Секции и загрузчик ---------- */
.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

section {
  animation: fadeIn .25s ease;
}

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 40px 20px;
  cursor: pointer;
  text-align: center;
  border: 1.5px dashed var(--line);
  border-radius: 18px;
  background: var(--glass);
  transition: border-color .2s, background .2s;
}

.drop.over {
  border-color: var(--accent);
  background: rgba(217, 119, 87, .1);
}

.bar-track {
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .15s linear;
}

.result {
  margin-top: 20px;
  animation: fadeIn .25s ease;
}

.link-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.link-row input {
  flex: 1;
  min-width: 0;
  font-size: 14px;
}

.files {
  width: 100%;
  border-collapse: collapse;
}

.files tr {
  animation: fadeIn .25s ease;
  transition: opacity .2s ease, transform .2s ease;
}

.files tr.removing {
  opacity: 0;
  transform: translateX(12px);
}

.files td {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 14.5px;
}

.files td.right {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}

.files a {
  text-decoration: none;
  word-break: break-all;
}

.empty {
  font-size: 14px;
}

/* ---------- Анимации keyframes ---------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeScale {
  from {
    opacity: 0;
    transform: scale(.95) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 420px) {
  .card {
    padding: 22px;
  }
  .link-row {
    flex-direction: column;
  }
}

/* ---------- мастер создания ключа ---------- */
.step {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass);
  animation: fadeIn .25s ease;
}

.step h2 {
  margin-top: 0;
}

.step label {
  margin-bottom: 14px;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9em;
}

#key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
