:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #202124;
  --muted: #666b73;
  --border: #d8dadd;
  --accent: #2457a6;
  --accent-strong: #143f7d;
  --danger: #a33a2a;
  --code-bg: #111418;
  --code-text: #eef1f4;
  --focus: #8a5a12;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

button,
.button-link {
  min-height: 2.5rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  padding: 0.55rem 0.85rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

button:hover,
.button-link:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 55%);
  outline-offset: 2px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0.65rem clamp(1rem, 4vw, 2rem);
}

.brand {
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.95rem;
}

.shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 1.25rem auto 2rem;
}

.workspace,
.paste-view,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.paste-form {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

label {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

input {
  height: 2.45rem;
  padding: 0 0.65rem;
}

textarea {
  min-height: min(68vh, 48rem);
  resize: vertical;
  padding: 0.85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.55;
  tab-size: 4;
}

.limit,
.meta,
.raw-link {
  color: var(--muted);
  font-size: 0.92rem;
}

.notice {
  margin: 0;
  border-left: 4px solid var(--danger);
  background: #fff5f2;
  color: var(--danger);
  padding: 0.7rem 0.85rem;
}

.action-row {
  display: flex;
  justify-content: flex-end;
}

.paste-view {
  overflow: hidden;
}

.paste-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding: 1rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin: 0.4rem 0 0;
}

.paste-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.paste-actions a {
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  background: #ffffff;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
}

.paste-actions a:hover {
  border-color: var(--accent);
}

.copy-source {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

pre {
  min-height: 24rem;
  margin: 0;
  overflow: auto;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.55;
  tab-size: 4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.raw-link {
  margin: 0;
  border-top: 1px solid var(--border);
  padding: 0.85rem 1rem;
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
}

.empty-state p {
  color: var(--muted);
}

@media (max-width: 720px) {
  .topbar,
  .paste-header,
  .form-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .topbar,
  .paste-header {
    flex-direction: column;
  }

  .paste-actions,
  .action-row {
    justify-content: stretch;
  }

  .paste-actions > *,
  .action-row button {
    width: 100%;
    justify-content: center;
  }

  .shell {
    width: calc(100% - 1rem);
    margin-top: 0.5rem;
  }
}
