:root {
  color-scheme: dark;
  --bg: #121212;
  --surface: #1e1e1e;
  --surface-2: #262626;
  --text: #f4f4f4;
  --muted: #9aa0a6;
  --accent: #4aa3ff;
  --accent-bg: #007acc;
  --accent-bg-hover: #005b9f;
  --border: #333;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #eef0f2;
  --text: #1f1f1f;
  --muted: #5f6368;
  --accent: #0b6cf2;
  --accent-bg: #0b6cf2;
  --accent-bg-hover: #094fb3;
  --border: #d8dcdf;
}

body {
  transition: background-color 0.15s ease, color 0.15s ease;
}

* { box-sizing: border-box; }

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

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 600;
}

a { color: var(--accent); }
kbd {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.card {
  background: var(--surface);
  padding: 20px;
  border-radius: 8px;
  margin: 16px 0;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}

.paste-target {
  border: 2px dashed var(--border);
  text-align: center;
  cursor: pointer;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.paste-target.is-active {
  border-color: var(--accent);
  background: var(--surface-2);
}

.hint {
  font-size: 18px;
  margin: 0 0 4px;
  color: var(--text);
}

.hint-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

textarea {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  resize: vertical;
  margin-top: 12px;
}

select, input[type="password"], input[type="text"] {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 14px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.label {
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  align-items: center;
}

button, .btn {
  background: var(--accent-bg);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-size: 14px;
  font-family: inherit;
  transition: background-color 0.2s;
}

button:hover, .btn:hover {
  background: var(--accent-bg-hover);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0;
}

.meta.footer {
  margin-top: 32px;
  text-align: center;
}

.hidden {
  display: none;
}

pre {
  background: var(--surface);
  padding: 16px;
  border-radius: 8px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

iframe {
  width: 100%;
  height: 70vh;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

img.clip {
  display: block;
  max-width: 100%;
  height: auto;
  background: var(--surface);
  border-radius: 8px;
  padding: 8px;
  margin: 0 auto;
}

#result-link {
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

details.card > summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--muted);
  list-style: none;
  user-select: none;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before {
  content: "▶ ";
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s;
}
details.card[open] > summary::before { transform: rotate(90deg); }
details.card[open] > summary { color: var(--text); margin-bottom: 12px; }

#retrieve-pin {
  flex: 1;
  min-width: 120px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.theme-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 100;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

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