/* Один шрифт, два цвета текста. Синий значит действие,
   зелёный значит «дошло», красный значит ошибку. */

:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #15171c;
  --muted: #6b7280;
  --line: #e2e5ea;
  --soft: #f8fafc;
  --accent: #2481cc;
  --accent-hover: #1d6fb0;
  --ok: #15803d;
  --err: #c62828;
  --fresh: #e8f2fb;
  --radius: 12px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1013;
    --card: #171a20;
    --text: #e6e8ec;
    --muted: #9198a3;
    --line: #2a2e36;
    --soft: #1b1f26;
    --accent: #3a95e0;
    --accent-hover: #5aa8ea;
    --ok: #4ade80;
    --err: #f87171;
    --fresh: #1d2a38;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }
h1, h2 { margin: 0 0 12px; font-weight: 600; }
h2 { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center-text { text-align: center; }
.ok-text { color: var(--ok); }
.err-text { color: var(--err); }

/* Шапка */

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
}
.brand { font-weight: 600; }
.who { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.who .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}

/* Две колонки, на телефоне одна */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}
.card {
  min-width: 0;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; padding: 0 16px; }
  .top { padding: 14px 16px; }
  .foot { padding-left: 16px; padding-right: 16px; }
}

/* Куда бросать файлы */

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 150px;
  padding: 20px;
  text-align: center;
  background: var(--soft);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); }
.drop input { display: none; }
.drop-title { font-weight: 600; }

/* Списки файлов */

.list { list-style: none; margin: 12px 0 0; padding: 0; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row.fresh { animation: fresh 2.5s ease-out; }
@keyframes fresh { from { background: var(--fresh); } to { background: transparent; } }

.main { flex: 1; min-width: 0; }
.name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Синей остаётся только кнопка «Скачать», имя файла обычным текстом. */
a.name { color: var(--text); text-decoration: none; }
a.name:hover { text-decoration: underline; }
.text {
  display: block;
  max-height: 7.5em;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}
.caption { color: var(--muted); font-size: 13px; }
.meta { color: var(--muted); font-size: 13px; }
.actions { display: flex; flex-shrink: 0; align-items: center; gap: 6px; }

.state { color: var(--muted); font-size: 13px; white-space: nowrap; }
.row.ok .state { color: var(--ok); }
.row.err .state { color: var(--err); }

.bar {
  height: 4px;
  margin-top: 6px;
  overflow: hidden;
  background: var(--line);
  border-radius: 2px;
}
.fill { width: 0; height: 100%; background: var(--accent); transition: width .2s; }
.row.ok .fill { background: var(--ok); }
.row.err .bar { display: none; }

/* Кнопки */

.btn {
  display: inline-block;
  padding: 9px 16px;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent-hover); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.ghost {
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--line);
}
.btn.ghost:hover { border-color: var(--accent); }
.icon {
  padding: 2px 6px;
  color: var(--muted);
  background: none;
  border: 0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.icon:hover { color: var(--err); }

/* Текст в Telegram */

.text-form { margin-top: 16px; }
textarea {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  resize: vertical;
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.row-end {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.empty { margin: 12px 0 0; }
.foot {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px 32px;
  color: var(--muted);
  font-size: 13px;
}

/* Вход */

.login {
  max-width: 420px;
  margin: 0 auto;
  padding: 56px 24px 8px;
  text-align: center;
}
.brand-big { font-size: 26px; margin-bottom: 4px; }
.qr {
  display: inline-block;
  margin: 20px 0 8px;
  padding: 10px;
  line-height: 0;
  background: #fff;
  border-radius: var(--radius);
}
.qr svg { width: 232px; height: 232px; }
.status { font-weight: 600; }

/* Простые страницы */

.page { max-width: 640px; margin: 0 auto; padding: 32px 24px; }
.page h2 { margin-top: 24px; }
.page li { margin-bottom: 6px; }
