:root {
  --bg: #000;
  --card: #141416;
  --line: #26262a;
  --txt: #f2f2f4;
  --muted: #8e8e95;
  --accent: #5b8cff;
  --ok: #34c759;
  --err: #ff6b6b;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--txt); }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: max(14px, env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom));
  -webkit-text-size-adjust: 100%;
}
h1 { font-size: 22px; margin: 6px 0 2px; letter-spacing: -.4px; }
.sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px; margin-bottom: 14px;
}
.label { font-size: 11px; letter-spacing: .8px; color: var(--muted); text-transform: uppercase; margin-bottom: 10px; }

button, .btn {
  font: inherit; font-weight: 600; color: #fff; background: var(--accent);
  border: 0; border-radius: 12px; padding: 14px 16px; width: 100%;
  display: block; text-align: center; cursor: pointer;
}
button:disabled { opacity: .45; }
.btn.sec { background: #24242a; color: var(--txt); }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

input[type=password], input[type=text], select {
  font: inherit; width: 100%; background: #0d0d0f; color: var(--txt);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px;
}
label.field { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 6px; }

.pick { display: block; border: 1.5px dashed #34343a; border-radius: 16px; padding: 26px 16px; text-align: center; }
.pick .big { font-size: 32px; }
.pick .hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
input[type=file] { display: none; }

.file { display: flex; align-items: center; gap: 10px; }
.file .nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .meta { color: var(--muted); font-size: 12px; }

.bar { height: 4px; background: #24242a; border-radius: 3px; overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.status { color: var(--muted); font-size: 13px; margin-top: 8px; text-align: center; }
.erro { color: var(--err); font-size: 13px; margin-top: 8px; }

.texto {
  white-space: pre-wrap; word-wrap: break-word; -webkit-user-select: text; user-select: text;
  font-size: 15.5px; line-height: 1.55; max-height: 46vh; overflow: auto;
}
.hist { padding: 12px 0; border-bottom: 1px solid var(--line); }
.hist:last-child { border-bottom: 0; }
.hist .quando { color: var(--muted); font-size: 11.5px; }
.hist .trecho { font-size: 14px; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vazio { color: var(--muted); font-size: 13px; }

.link { color: var(--accent); font-size: 13px; text-align: center; margin-top: 6px; cursor: pointer; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(26px + env(safe-area-inset-bottom));
  background: #e8e8ea; color: #111; padding: 10px 16px; border-radius: 20px;
  font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.on { opacity: 1; }
