:root {
  color-scheme: dark;
  --bg: #111214;
  --card: #1b1d21;
  --line: #2c2f36;
  --fg: #e9eaec;
  --muted: #9aa0aa;
  --accent: #3b82f6;
  --danger: #ef4444;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-text-size-adjust: 100%;
}

main { max-width: 46rem; margin: 0 auto; padding: 0 1rem 4rem; }

.bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; max-width: 46rem; margin: 0 auto; padding: 1rem;
}
.bar h1 { font-size: 1.15rem; margin: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.card h2 { font-size: 1rem; margin: 0 0 .75rem; }
.card h3 { font-size: .9rem; margin: 0 0 .5rem; }

label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }

input, textarea {
  width: 100%; padding: .7rem; border-radius: 10px;
  border: 1px solid var(--line); background: #0f1012; color: var(--fg);
  font: inherit; font-size: 16px; /* prevents iOS zoom on focus */
  resize: vertical;
}

button {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: .65rem 1rem; border-radius: 10px; border: 1px solid transparent;
  min-height: 44px; /* iOS touch target */
}
.primary { background: var(--accent); color: #fff; }
.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.danger { background: transparent; color: var(--danger); border-color: var(--line); }
.big { width: 100%; font-size: 1.1rem; padding: 1.1rem; margin-top: .5rem; }
button:disabled { opacity: .5; cursor: not-allowed; }

.row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; align-items: center; }
.row.space { justify-content: space-between; margin-top: 0; }

.muted { color: var(--muted); font-size: .85rem; }
.hidden { display: none !important; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

.hint {
  margin-top: .75rem; padding: .75rem; border-radius: 10px;
  background: #1f2937; border: 1px solid #334155; font-size: .9rem;
}

.clip-body {
  white-space: pre-wrap; word-break: break-word; margin: 0;
  max-height: 40vh; overflow: auto; padding: .75rem;
  background: #0f1012; border: 1px solid var(--line); border-radius: 10px;
  font: .9rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.clips { list-style: none; margin: 0; padding: 0; }
.clips li { border-top: 1px solid var(--line); padding: .75rem 0; }
.clips li:first-child { border-top: 0; }
.clip-preview {
  margin: 0 0 .5rem; word-break: break-word;
  font: .9rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.clip-meta { font-size: .75rem; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #22262d; border: 1px solid var(--line);
  padding: .7rem 1.1rem; border-radius: 999px; font-size: .9rem;
  box-shadow: 0 10px 30px rgb(0 0 0 / .45); z-index: 50; max-width: 90vw;
}
