:root {
  color-scheme: dark;
  --bg: #0e0f11;
  --surface: #17181b;
  --sunken: #121316;
  --line: #2a2c30;
  --text: #e6e8ea;
  --muted: #9aa0a6;
  --accent: #66ccff;
  --accent-ink: #06131a;
  --danger: #ff7b72;
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  max-width: 44rem;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* header ------------------------------------------------------------------ */

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.account {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.account button {
  align-self: auto;
  margin-top: 0;
  padding: 0.35rem 0.7rem;
  background: none;
  border-color: var(--line);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 400;
}

.account button:hover:not(:disabled) {
  background: var(--surface);
  color: var(--text);
  filter: none;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

header h1 a {
  color: var(--text);
}

header h1 a:hover {
  color: var(--text);
  text-decoration: none;
}

nav {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.5rem;
  font-size: 0.9375rem;
}

nav a {
  color: var(--muted);
}

nav a:hover {
  color: var(--text);
}

/* page -------------------------------------------------------------------- */

main {
  margin-top: 2.5rem;
}

h2 {
  margin: 0 0 1.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Message states: loading, empty, not found, page missing. */
main > p:not(.error) {
  margin: 0;
  padding: 2.25rem 0;
  color: var(--muted);
  text-align: center;
}

footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8125rem;
}

footer a {
  color: var(--muted);
}

/* snippets ---------------------------------------------------------------- */

.snippet {
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.metadata {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.metadata strong {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 0.9375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metadata strong a {
  color: var(--text);
}

.metadata span,
.metadata time {
  flex: none;
  color: var(--muted);
}

pre {
  margin: 0;
  padding: 0.9rem;
  background: var(--sunken);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* forms ------------------------------------------------------------------- */

form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

label {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.875rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  color: inherit;
}

textarea {
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.65;
  resize: vertical;
}

select {
  appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239aa0a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--accent);
}

button {
  align-self: flex-start;
  margin-top: 1.4rem;
  padding: 0.7rem 1.2rem;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  color: var(--accent-ink);
  cursor: pointer;
}

button:hover:not(:disabled) {
  filter: brightness(1.08);
}

button:disabled {
  opacity: 0.55;
  cursor: progress;
}

/* The delete control is the one place quiet is wrong: it is the button you need
   to find after a mistake, so it stays legible and turns red on approach. */
main > button {
  align-self: auto;
  margin-top: 0;
  background: none;
  border-color: var(--line);
  color: var(--muted);
  font-weight: 400;
}

main > button:hover:not(:disabled) {
  background: rgba(255, 123, 114, 0.12);
  border-color: #7a2b2b;
  color: var(--danger);
  filter: none;
}

/* validation -------------------------------------------------------------- */

/* Page-level: a failed action, which needs to be hard to miss. */
main > .error {
  margin: 0 0 1rem;
  padding: 0.6rem 0.75rem;
  background: #2a1618;
  border: 1px solid #7a2b2b;
  border-radius: var(--radius);
  color: #ffb4ac;
  font-size: 0.875rem;
}

/* Field-level: enough to find the input, not enough to shout. */
form .error {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  color: #ff9b93;
  font-size: 0.8125rem;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
