:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1a202c;
  --muted: #4a5568;
  --brand: #0b6bcb;
  --danger: #b00020;
  --line: #d9e2ec;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, #eaf4ff, var(--bg));
}

.container {
  max-width: 720px;
  margin: 2rem auto;
  padding: 1rem;
}

.container.wide { max-width: 980px; }

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.inline-form {
  margin: 0;
}

.password-menu {
  position: relative;
}

.password-menu summary {
  list-style: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #cdd6e0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  margin-top: 0;
  border-radius: 50%;
  border: 1px solid #cdd6e0;
  background: #fff;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-menu summary::-webkit-details-marker {
  display: none;
}

.icon-svg {
  width: 18px;
  height: 18px;
  display: block;
}

.password-popover {
  position: absolute;
  right: 0;
  top: 48px;
  width: 320px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 30;
}

.password-popover h3 {
  margin: 0 0 0.5rem;
}

.subtitle { color: var(--muted); margin-top: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
}

label {
  display: block;
  margin: 0.6rem 0 0.25rem;
  font-weight: 600;
}

input, textarea, button {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #cdd6e0;
  font-size: 0.95rem;
}

button {
  margin-top: 0.9rem;
  border: none;
  color: white;
  background: var(--brand);
  cursor: pointer;
}

button.danger {
  background: var(--danger);
}

.error {
  background: #ffe7ea;
  color: var(--danger);
  border: 1px solid #ffccd4;
  border-radius: 8px;
  padding: 0.75rem;
}

.muted { color: var(--muted); }

ul {
  margin: 0;
  padding-left: 1.2rem;
}

.share-item {
  margin-bottom: 1rem;
}

.share-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.2rem 0 0.4rem;
}

.copy-btn {
  width: auto;
  margin-top: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #cdd6e0;
  background: #fff;
  color: var(--text);
}

@media (max-width: 640px) {
  .password-popover {
    width: 280px;
  }
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
}

.markdown-body { line-height: 1.65; }
.markdown-body p { margin: 0.6rem 0; }
.markdown-body pre, .markdown-body code { background: #f8fafc; }
.markdown-body pre { padding: 0.75rem; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.markdown-body code { padding: 0.1rem 0.25rem; border-radius: 4px; }
.markdown-body a { color: var(--brand); }
