*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

:root,
:root[data-theme="dark"] {
  --bg: #0d0d0d;
  --sidebar-bg: #111;
  --surface: #1a1a1a;
  --surface-hover: #222;
  --border: #2a2a2a;
  --text: #e5e5e5;
  --text-muted: #777;
  --text-subtle: #444;
  --accent: #818cf8;
  --accent-dim: #3730a3;
  --info: #818cf8;
  --warning: #fbbf24;
  --error: #f87171;
  --sidebar-width: 280px;
  --overlay-bg: rgba(0, 0, 0, 0.5);
  --scrollbar-thumb-hover: #3a3a3a;
}

:root[data-theme="light"] {
  --bg: #f5f5f5;
  --sidebar-bg: #fff;
  --surface: #fff;
  --surface-hover: #f0f0f0;
  --border: #e0e0e0;
  --text: #1a1a1a;
  --text-muted: #666;
  --text-subtle: #999;
  --accent: #6366f1;
  --accent-dim: #c7d2fe;
  --overlay-bg: rgba(0, 0, 0, 0.3);
  --scrollbar-thumb-hover: #bbb;
}

@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --bg: #f5f5f5;
    --sidebar-bg: #fff;
    --surface: #fff;
    --surface-hover: #f0f0f0;
    --border: #e0e0e0;
    --text: #1a1a1a;
    --text-muted: #666;
    --text-subtle: #999;
    --accent: #6366f1;
    --accent-dim: #c7d2fe;
    --overlay-bg: rgba(0, 0, 0, 0.3);
    --scrollbar-thumb-hover: #bbb;
  }
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #0d0d0d;
    --sidebar-bg: #111;
    --surface: #1a1a1a;
    --surface-hover: #222;
    --border: #2a2a2a;
    --text: #e5e5e5;
    --text-muted: #777;
    --text-subtle: #444;
    --accent: #818cf8;
    --accent-dim: #3730a3;
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --scrollbar-thumb-hover: #3a3a3a;
  }
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────── */

#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text);
  text-decoration: none;
}

.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 8px 4px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-nav-item {
  display: block;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}

.sidebar-nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.sidebar-nav-item.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.settings-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
  position: relative;
  z-index: 1;
}

.settings-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.settings-btn.notif-active {
  color: var(--accent);
}

#channel-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 8px;
}

.channel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 4px;
  flex-shrink: 0;
}

.channel-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-section-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.reorder-hint {
  margin: 0;
  padding: 0 12px 6px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

#sidebar.reorder-mode .reorder-hint {
  display: block;
}

#sidebar.reorder-mode .reorder-hint[hidden] {
  display: none;
}

#sidebar.reorder-mode .channel-section-actions .add-channel-btn:not(#reorder-mode-btn) {
  display: none;
}

#sidebar.reorder-mode .channel-group-actions,
#sidebar.reorder-mode .channel-settings-btn,
#sidebar.reorder-mode .group-settings-btn {
  display: none;
}

#sidebar.reorder-mode #reorder-mode-btn {
  color: var(--accent);
  background: var(--surface-hover);
  pointer-events: auto;
}

.reorder-handle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 20px;
  color: var(--text-subtle);
  cursor: grab;
  touch-action: none;
}

.reorder-handle:active {
  cursor: grabbing;
}

.channel-group--reorderable {
  cursor: grab;
}

.channel-group--reorderable.reorder-dragging,
.channel-row--reorderable.reorder-dragging {
  opacity: 0.55;
}

.channel-group-channels.reorder-drop-over {
  background: var(--surface-hover);
  border-radius: 6px;
  outline: 1px dashed var(--accent-dim);
  outline-offset: -1px;
  min-height: 28px;
}

.channel-row--reorderable {
  cursor: grab;
}

.channel-row--reorderable .channel-item {
  pointer-events: none;
}

.add-channel-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  transition: color 0.15s, background 0.15s;
}

.add-channel-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.channel-group {
  margin-bottom: 2px;
}

.channel-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0 4px;
  width: 100%;
}

.channel-group-header:hover .group-settings-btn,
.channel-group-header:focus-within .group-settings-btn {
  opacity: 1;
}

.channel-group-label-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.channel-group-label {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-group-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.channel-group--ungrouped .channel-group-label {
  color: var(--text-muted);
}

.channel-group-channels {
  padding-bottom: 2px;
}

.group-settings-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--text-subtle);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.1s, color 0.1s, background 0.1s;
}

.group-settings-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.channel-row {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.channel-row:hover .channel-settings-btn,
.channel-row:focus-within .channel-settings-btn {
  opacity: 1;
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 14px;
  cursor: pointer;
  border-radius: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.2;
  transition: background 0.1s, color 0.1s;
  border: none;
  background: none;
  flex: 1;
  min-width: 0;
  min-height: 100%;
  text-align: left;
}

.channel-item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  line-height: 1.2;
}

.channel-settings-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 28px;
  height: 28px;
  margin-right: 6px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--text-subtle);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.1s, color 0.1s, background 0.1s;
}

.channel-settings-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.channel-item::before {
  content: "#";
  opacity: 0.4;
  font-size: 1em;
  line-height: 1;
  flex-shrink: 0;
}

.channel-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.channel-item.active {
  color: var(--text);
  background: var(--surface);
}

.channel-item.active::before {
  opacity: 1;
  color: var(--accent);
}

.channel-item--unread .channel-item-label {
  color: var(--text);
  font-weight: 600;
}

.badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.loading-text {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  color: var(--text-subtle);
  font-size: 12px;
}

.loading-text--error {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  color: var(--error);
}

.loading-text-message {
  margin: 0;
  font-weight: 600;
}

.loading-text-detail {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.loading-retry-btn {
  margin-top: 4px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.loading-retry-btn:hover {
  background: var(--bg);
  border-color: var(--text-muted);
}

.channel-refresh-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 10px 8px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--error);
  background: color-mix(in srgb, var(--error) 8%, transparent);
  border-radius: 6px;
}

.channel-refresh-hint-btn {
  flex-shrink: 0;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}

.loading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--text-muted);
  border-radius: 50%;
  animation: loading-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

/* ── Main ──────────────────────────────────── */

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  position: relative;
}

#feed-header {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.sidebar-toggle:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}

.sidebar-backdrop.visible {
  display: block;
}

.channel-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status {
  font-size: 10px;
  flex-shrink: 0;
}

.status--connected { color: #4ade80; }
.status--connecting { color: var(--warning); }
.status--disconnected { color: var(--text-subtle); }

#feed-viewport {
  flex: 1;
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.feed-sticky-date {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 2px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 88%, var(--surface));
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
  white-space: nowrap;
}

#feed {
  flex: 1;
  overflow-y: auto;
  padding: 32px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed-date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 4px 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
}

.feed-date-divider::before,
.feed-date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.new-notif-banner {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 10;
  padding: 8px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: 20px;
  background: var(--surface);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: background 0.15s, transform 0.15s;
}

.new-notif-banner:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

@media (max-width: 767px) {
  .channel-row {
    min-height: 44px;
  }

  .channel-settings-btn {
    opacity: 1;
    width: 36px;
    height: 36px;
    margin-right: 4px;
  }

  .group-settings-btn {
    opacity: 1;
    width: 36px;
    height: 36px;
  }

  .add-channel-btn {
    width: 36px;
    height: 36px;
    padding: 6px;
  }

  .channel-section-header {
    padding: 12px 12px 6px;
    min-height: 44px;
  }

  .channel-group-header {
    padding: 6px 0;
    min-height: 44px;
  }

  .channel-group-label {
    font-size: 12px;
    line-height: 1.2;
  }

  .channel-item {
    padding: 0 8px 0 12px;
    font-size: 14px;
  }

  .reorder-handle {
    width: 28px;
  }

  .channel-group {
    margin-bottom: 4px;
  }

  .channel-group-channels {
    padding-bottom: 4px;
  }

  .reorder-hint {
    padding-bottom: 10px;
  }
}

/* ── Notification card ─────────────────────── */

.notif-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  border-left: 3px solid var(--info);
  animation: slide-in 0.2s ease;
}

.notif-card[data-level="warning"] { border-left-color: var(--warning); }
.notif-card[data-level="error"]   { border-left-color: var(--error); }

.notif-card--new {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

.notif-new-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: 0.02em;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.notif-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.notif-message {
  font-size: 13px;
  color: var(--text-muted);
  word-break: break-word;
  white-space: pre-wrap;
}

/* ── Embed fields (Discord-style) ──────────── */

.embed-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 16px;
  margin-top: 8px;
}

.embed-field {
  grid-column: span 3;
}

.embed-field--inline {
  grid-column: span 1;
}

.embed-field-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.embed-field-value {
  font-size: 13px;
  color: var(--text-muted);
  word-break: break-word;
}

.embed-field-value a {
  color: var(--accent);
  text-decoration: none;
}

.embed-field-value a:hover {
  text-decoration: underline;
}

.embed-field-value code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 12px;
}

/* ── Empty / loading states ────────────────── */

.empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  font-size: 13px;
  padding: 40px;
}

.feed-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  z-index: 1;
}

.feed-state-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  max-width: 280px;
}

.feed-state-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.feed-state--error .feed-state-text {
  color: var(--error);
}

.feed-state-retry {
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.feed-state-retry:hover {
  background: var(--bg);
  border-color: var(--text-muted);
}

/* ── Scrollbar ─────────────────────────────── */

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* ── Sidebar footer / Version button ──────── */

.sidebar-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  margin-top: auto;
}

.version-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
  font-family: monospace;
}

.version-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

/* ── Changelog dialog ──────────────────────── */

.changelog-dialog {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  align-items: flex-end;
  justify-content: center;
  z-index: 150;
}

.changelog-dialog.open {
  display: flex;
}

.changelog-dialog.dialog-centered {
  align-items: center;
}

@media (max-width: 767px) {
  .changelog-dialog.dialog-centered {
    padding: 16px;
  }

  .changelog-dialog.dialog-centered .changelog-panel {
    border-radius: 12px;
    max-height: min(85dvh, calc(100dvh - 32px));
  }

  .changelog-dialog.dialog-centered .create-channel-body {
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }

  /* iOS Safari: 16px 未満の input フォーカス時に画面が自動拡大されるのを防ぐ */
  .create-channel-input,
  .create-channel-input.create-channel-webhook-input {
    font-size: 16px;
  }
}

@media (min-width: 768px) {
  .changelog-dialog {
    align-items: center;
  }
}

.changelog-panel {
  background: var(--surface);
  border-radius: 12px 12px 0 0;
  width: 100%;
  max-width: 440px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.changelog-dialog.dialog-centered .changelog-panel {
  border-radius: 12px;
}

@media (min-width: 768px) {
  .changelog-panel {
    border-radius: 12px;
    max-height: 80vh;
  }
}

.changelog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.changelog-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.changelog-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.changelog-close:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.changelog-list {
  overflow-y: auto;
  padding: 12px 20px 20px;
}

/* ── Create channel dialog ─────────────────── */

.create-channel-panel {
  max-width: 400px;
}

.create-channel-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.create-channel-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.create-channel-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.create-channel-input:focus {
  border-color: var(--accent);
}

.create-channel-error {
  font-size: 12px;
  color: var(--error);
}

.create-channel-submit {
  margin-top: 4px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.create-channel-submit:hover:not(:disabled) {
  opacity: 0.9;
}

.create-channel-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.create-channel-success-text {
  font-size: 13px;
  color: var(--text-muted);
}

.create-channel-success-text strong {
  color: var(--text);
}

.create-channel-webhook-row {
  display: flex;
  gap: 8px;
}

.create-channel-webhook-input {
  flex: 1;
  font-size: 12px;
  font-family: ui-monospace, monospace;
}

.create-channel-copy {
  flex-shrink: 0;
  padding: 8px 12px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.create-channel-copy:hover {
  background: var(--border);
}

.webhook-reveal-btn {
  align-self: flex-start;
}

.channel-settings-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.channel-delete-btn {
  color: var(--error);
  border-color: color-mix(in srgb, var(--error) 35%, var(--border));
}

.channel-delete-btn:hover:not(:disabled) {
  color: #fff;
  background: var(--error);
  border-color: var(--error);
}

.confirm-dialog {
  z-index: 200;
}

.confirm-dialog-panel {
  text-align: center;
  padding-top: 24px;
}

.confirm-dialog-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--error);
}

.confirm-dialog-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
  padding: 0 20px;
}

.confirm-dialog-body {
  padding-top: 8px;
}

.confirm-dialog-message {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.confirm-dialog-message strong {
  color: var(--text);
}

.confirm-dialog-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.confirm-delete-btn {
  background: var(--error);
}

.confirm-delete-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.create-channel-hint {
  font-size: 11px;
  color: var(--text-subtle);
}

.notif-setting-select {
  cursor: pointer;
}

/* ── Notification mode (有効 / 無効 / グループ) ── */

.notif-mode-segment {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}

.notif-mode-segment-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 8px 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.notif-mode-segment-btn:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-hover);
}

.notif-mode-segment-btn:disabled,
.notif-mode-segment-btn[hidden] {
  display: none;
}

.notif-mode-segment-btn.active[data-value="true"] {
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.35);
}

.notif-mode-segment-btn.active[data-value="false"] {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.35);
}

.notif-mode-segment-btn.active[data-value="inherit"] {
  color: #818cf8;
  background: rgba(129, 140, 248, 0.12);
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.35);
}

.notif-mode-segment-icon,
.notif-btn-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  background-color: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.notif-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.notif-mode-segment-icon--on,
.notif-btn-icon--on {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E");
}

.notif-mode-segment-icon--off,
.notif-btn-icon--off {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3Cpath d='M18.63 13A17.89 17.89 0 0 1 18 8'/%3E%3Cpath d='M6.26 6.26A5.86 5.86 0 0 0 6 8c0 7-3 9-3 9h11'/%3E%3Cpath d='M2 2l20 20'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3Cpath d='M18.63 13A17.89 17.89 0 0 1 18 8'/%3E%3Cpath d='M6.26 6.26A5.86 5.86 0 0 0 6 8c0 7-3 9-3 9h11'/%3E%3Cpath d='M2 2l20 20'/%3E%3C/svg%3E");
}

.notif-mode-segment-icon--inherit,
.notif-btn-icon--inherit {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='8' width='12' height='12' rx='2'/%3E%3Cpath d='M4 16V6a2 2 0 0 1 2-2h10'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='8' width='12' height='12' rx='2'/%3E%3Cpath d='M4 16V6a2 2 0 0 1 2-2h10'/%3E%3C/svg%3E");
}

.notif-btn-icon--refresh {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8'/%3E%3Cpath d='M21 3v5h-5'/%3E%3Cpath d='M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16'/%3E%3Cpath d='M8 16H3v5'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8'/%3E%3Cpath d='M21 3v5h-5'/%3E%3Cpath d='M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16'/%3E%3Cpath d='M8 16H3v5'/%3E%3C/svg%3E");
}

.notif-btn-icon--test {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 2-7 20-4-9-9-4z'/%3E%3Cpath d='M22 2 11 13'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 2-7 20-4-9-9-4z'/%3E%3Cpath d='M22 2 11 13'/%3E%3C/svg%3E");
}

.notif-mode-preview {
  margin-top: 10px;
}

.notif-mode-preview-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.notif-mode-preview-card--enabled {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.06);
}

.notif-mode-preview-card--disabled {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.06);
}

.notif-mode-preview-card--inherit {
  border-color: rgba(129, 140, 248, 0.35);
  background: rgba(129, 140, 248, 0.06);
}

.notif-mode-preview-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background-color: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.notif-mode-preview-card--enabled .notif-mode-preview-icon {
  color: #34d399;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E");
}

.notif-mode-preview-card--disabled .notif-mode-preview-icon {
  color: #f87171;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3Cpath d='M18.63 13A17.89 17.89 0 0 1 18 8'/%3E%3Cpath d='M6.26 6.26A5.86 5.86 0 0 0 6 8c0 7-3 9-3 9h11'/%3E%3Cpath d='M2 2l20 20'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3Cpath d='M18.63 13A17.89 17.89 0 0 1 18 8'/%3E%3Cpath d='M6.26 6.26A5.86 5.86 0 0 0 6 8c0 7-3 9-3 9h11'/%3E%3Cpath d='M2 2l20 20'/%3E%3C/svg%3E");
}

.notif-mode-preview-card--inherit .notif-mode-preview-icon {
  color: #818cf8;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='8' width='12' height='12' rx='2'/%3E%3Cpath d='M4 16V6a2 2 0 0 1 2-2h10'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='8' width='12' height='12' rx='2'/%3E%3Cpath d='M4 16V6a2 2 0 0 1 2-2h10'/%3E%3C/svg%3E");
}

.notif-mode-preview-text {
  min-width: 0;
}

.notif-mode-preview-text strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.notif-mode-preview-text span {
  display: block;
  font-size: 11px;
  color: var(--text-subtle);
  line-height: 1.4;
}

.notif-indicator {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  background-color: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.notif-indicator--muted {
  color: var(--text-subtle);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3Cpath d='M18.63 13A17.89 17.89 0 0 1 18 8'/%3E%3Cpath d='M6.26 6.26A5.86 5.86 0 0 0 6 8c0 7-3 9-3 9h11'/%3E%3Cpath d='M2 2l20 20'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3Cpath d='M18.63 13A17.89 17.89 0 0 1 18 8'/%3E%3Cpath d='M6.26 6.26A5.86 5.86 0 0 0 6 8c0 7-3 9-3 9h11'/%3E%3Cpath d='M2 2l20 20'/%3E%3C/svg%3E");
}

.channel-group-header .notif-indicator {
  width: 12px;
  height: 12px;
}

.channel-item .notif-indicator {
  margin-left: auto;
}

/* ── Notification settings dialog ──────────── */

.notif-status-list {
  margin: 0 0 16px;
  padding: 0;
}

.notif-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.notif-status-row:first-child {
  padding-top: 0;
}

.notif-status-row dt {
  font-size: 13px;
  color: var(--text-muted);
}

.notif-status-row dd {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

.notif-status-row dd.notif-status--ok {
  color: var(--accent);
}

.notif-status-row dd.notif-status--warn {
  color: #fbbf24;
}

.notif-status-row dd.notif-status--bad {
  color: #f87171;
}

.notif-settings-message {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 16px;
}

.notif-test-result {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.notif-test-result--ok {
  color: var(--accent);
}

.notif-test-result--warn {
  color: var(--warning);
}

.notif-test-result--error {
  color: var(--error);
}

.notif-secondary-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.notif-secondary-btn:hover:not(:disabled) {
  background: var(--surface-hover);
}

.notif-os-hint {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.notif-os-hint-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 6px;
}

/* ── Settings dialog ───────────────────────── */

.settings-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.settings-panel {
  max-width: 440px;
  max-height: min(80vh, calc(100dvh - 40px));
}

.settings-panel .changelog-header {
  flex-shrink: 0;
}

.settings-section {
  flex-shrink: 0;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  margin-bottom: 10px;
}

.theme-segment {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}

.theme-segment-btn {
  flex: 1;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 7px 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.theme-segment-btn:hover {
  color: var(--text);
}

.theme-segment-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.settings-btn-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.notif-actions {
  width: 100%;
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

.notif-actions-group {
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 6px;
  width: auto;
  max-width: 100%;
}

.notif-actions-group .create-channel-submit,
.notif-actions-group .settings-danger-btn {
  flex: 0 0 auto;
  min-width: 0;
  width: auto;
  max-width: none;
  padding: 8px 12px;
  font-size: 12px;
  margin-top: 0;
}

.settings-btn-group .create-channel-submit,
.settings-btn-group .settings-danger-btn {
  margin-top: 0;
  width: auto;
  min-width: 14em;
}

.settings-btn-group.notif-actions-group .create-channel-submit,
.settings-btn-group.notif-actions-group .settings-danger-btn {
  min-width: 0;
}

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

.settings-version-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  flex-shrink: 0;
}

.settings-version-text {
  font-family: monospace;
  font-size: 13px;
  color: var(--text-muted);
}

.settings-changelog-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.settings-changelog-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.settings-doc-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.settings-doc-link {
  color: var(--accent);
  text-decoration: none;
}

.settings-doc-link:hover {
  text-decoration: underline;
}

.settings-changelog-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay-bg);
  z-index: 10;
  padding: 20px 16px;
}

#settings-dialog {
  position: fixed;
}

.settings-changelog-panel {
  width: 100%;
  max-width: 400px;
  max-height: min(70vh, calc(100dvh - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-logout-btn {
  width: auto;
  min-width: 14em;
  background: none;
  border: 1px solid var(--border);
  color: var(--error);
  font-size: 13px;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 6px;
  transition: background 0.15s, border-color 0.15s;
}

.settings-logout-btn:hover {
  background: var(--surface-hover);
  border-color: var(--error);
}

.settings-danger-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--error);
}

.settings-danger-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--error);
}

.settings-section--footer {
  padding-top: 4px;
  display: flex;
  justify-content: center;
}

/* ── Docs page ─────────────────────────────── */

.docs-body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
}

.docs-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.docs-back {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}

.docs-back:hover {
  text-decoration: underline;
}

.docs-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  font-size: 14px;
  line-height: 1.7;
}

.docs-content h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

.docs-content h2 {
  font-size: 1.15rem;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.docs-content h3 {
  font-size: 1rem;
  margin: 1.5rem 0 0.5rem;
}

.docs-content p {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
}

.docs-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.docs-content ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.docs-content li + li {
  margin-top: 0.35rem;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem;
  font-size: 13px;
}

.docs-content th,
.docs-content td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.docs-content th {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.docs-content td {
  color: var(--text-muted);
}

.docs-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

.docs-content pre {
  margin: 0 0 1rem;
  padding: 12px 14px;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.docs-content pre code {
  display: block;
  padding: 0;
  border: none;
  background: none;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
}

.docs-content a {
  color: var(--accent);
}

.docs-error {
  color: var(--danger, #ed4245);
}

/* ── Webhooks page ─────────────────────────── */

.webhooks-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
}

.webhooks-intro {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 640px;
}

.webhook-detail {
  max-width: 720px;
}

.header-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.header-action-btn:hover {
  color: var(--accent);
  background: var(--surface-hover);
}

.webhooks-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
}

.webhook-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.webhook-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.webhooks-example {
  margin-top: 32px;
  max-width: 720px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.webhooks-example-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.webhooks-example-code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
}

.webhooks-example-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-subtle);
  line-height: 1.6;
}

.webhooks-example-hint code {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.api-key-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.api-key-form .create-channel-input {
  flex: 1;
}

.api-key-created {
  margin-bottom: 16px;
}

.api-key-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.api-key-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.api-key-item-name {
  flex: 1;
  font-size: 13px;
}

.api-key-item-prefix {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-muted);
}

.api-key-delete {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.api-key-delete:hover {
  color: #f87171;
  border-color: #f87171;
}

.api-key-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
}

.cl-entry {
  padding-bottom: 20px;
}

.cl-entry + .cl-entry {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.cl-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.cl-version {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  font-family: monospace;
}

.cl-date {
  font-size: 11px;
  color: var(--text-muted);
}

.cl-changes {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cl-changes li {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Login overlay ─────────────────────────── */

#login-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#login-overlay.visible {
  display: flex;
}

.login-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 40px;
  text-align: center;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-top: 4px;
}

.login-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 8px;
  background: #fff;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.login-btn:hover {
  background: #f5f5f5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* ── Mobile sidebar ─────────────────────────── */

@media (max-width: 767px) {
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    width: min(92vw, 320px);
    min-width: min(92vw, 320px);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: none;
  }

  #sidebar.sidebar--open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  }

  .sidebar-toggle {
    display: flex;
  }
}

@media (min-width: 768px) {
  #sidebar {
    position: relative;
    transform: none;
  }
}
