/**
 * Notepad page — dedicated workspace (no floating widget).
 * Complements site-enhancer shell tokens.
 */
.np-page {
  max-width: 720px;
  margin: 0 auto;
}

.np-card {
  margin-top: 8px;
  background: var(--cxz-surface, #fff);
  border: 1px solid var(--cxz-border, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 4px 24px -12px rgba(15, 23, 42, 0.12), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  overflow: hidden;
  position: relative;
}

.np-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--cxz-accent, #1d4ed8);
}

.np-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--cxz-border, #e2e8f0);
}

.np-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.np-card__meta {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cxz-muted, #64748b);
  letter-spacing: 0.01em;
}

.np-btn {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--cxz-border-strong, #cbd5e1);
  background: #fff;
  color: var(--cxz-text, #0f172a);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.np-btn:hover {
  background: #f8fafc;
  border-color: var(--cxz-muted, #64748b);
}

.np-btn:focus-visible {
  outline: 2px solid var(--cxz-accent, #1d4ed8);
  outline-offset: 2px;
}

.np-btn--danger {
  border-color: rgba(220, 38, 38, 0.35);
  color: #b91c1c;
}

.np-btn--danger:hover {
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.55);
}

.np-editor {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: min(52vh, 520px);
  padding: 18px 20px;
  margin: 0;
  border: none;
  resize: vertical;
  font-family: ui-monospace, "Cascadia Code", "Consolas", "Malgun Gothic", monospace;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--cxz-text, #0f172a);
  background: #fafbfc;
  outline: none;
}

.np-editor::placeholder {
  color: var(--cxz-faint, #94a3b8);
}

.np-editor:focus {
  background: #fff;
}

.np-card__foot {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--cxz-border, #e2e8f0);
  background: #f8fafc;
}

.np-card__foot p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--cxz-muted, #64748b);
}

@media (max-width: 600px) {
  .np-card__head {
    flex-direction: column;
    align-items: stretch;
  }

  .np-btn {
    width: 100%;
  }

  .np-editor {
    min-height: 40vh;
  }
}

/* Dark mode (toggle stores preference in localStorage) */
html[data-theme="dark"] body {
  background: #0f172a !important;
  color: #e2e8f0;
}

html[data-theme="dark"] .np-card {
  background: #1e293b;
  border-color: #334155;
}

html[data-theme="dark"] .np-editor {
  background: #0f172a;
  color: #f1f5f9;
}

html[data-theme="dark"] .np-editor:focus {
  background: #0f172a;
}

html[data-theme="dark"] .np-card__meta {
  color: #94a3b8;
}

html[data-theme="dark"] .np-card__foot {
  background: #1e293b;
  border-color: #334155;
}

html[data-theme="dark"] .np-card__foot p {
  color: #94a3b8;
}

html[data-theme="dark"] .np-btn {
  background: #334155;
  border-color: #475569;
  color: #f1f5f9;
}

html[data-theme="dark"] .np-btn:hover {
  background: #475569;
}
