/* =========================================================
   Copista — Design System
   "Cool Stone" light / "Warm Carbon" dark
   ========================================================= */

@font-face {
  font-family: 'Coustard';
  src: url('/assets/fonts/Coustard-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens: Light mode (Cool Stone) ─────────────────────── */
:root {
  --bg:             #FFFFFF;
  --surface:        #F7F7F8;
  --border:         #E4E4E7;
  --text:           #09090B;
  --text-muted:     #52525B;
  --accent:         #FF79C6;
  --accent-hover:   #f060b8;
  --accent-fg:      #09090B;
  --accent-subtle:  rgba(255, 121, 198, 0.08);
  --link:           #9D174D;
  --link-hover:     #831843;
  --link-subtle:    rgba(157, 23, 77, 0.06);
  --danger:         #DC2626;
  --danger-hover:   #B91C1C;
  --danger-fg:      #FFFFFF;
  --success-bg:     #F0FDF4;
  --success-border: #BBF7D0;
  --success-text:   #15803D;
  --error-bg:       #FFF1F2;
  --error-border:   #FECDD3;
  --error-text:     #BE123C;
  --spark:          #FF79C6;
  --focus-ring:         0 0 0 3px rgba(255, 121, 198, 0.25);
  --focus-ring-danger:  0 0 0 3px rgba(220, 38, 38, 0.20);
  --shadow-dialog:  0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  --backdrop:       rgba(0, 0, 0, 0.40);
  --radius:         3px;
}

/* ── Tokens: Dark mode (Warm Carbon) ─────────────────────── */
html[data-theme="dark"] {
  --bg:             #131110;
  --surface:        #1C1917;
  --border:         #292524;
  --text:           #FAFAF9;
  --text-muted:     #A8A29E;
  --accent:         #FF79C6;
  --accent-hover:   #f060b8;
  --accent-fg:      #09090B;
  --accent-subtle:  rgba(255, 121, 198, 0.10);
  --link:           #FF79C6;
  --link-hover:     #f060b8;
  --link-subtle:    rgba(255, 121, 198, 0.08);
  --danger:         #F87171;
  --danger-hover:   #EF4444;
  --danger-fg:      #FFFFFF;
  --success-bg:     rgba(20, 83, 45, 0.20);
  --success-border: rgba(74, 222, 128, 0.25);
  --success-text:   #4ADE80;
  --error-bg:       rgba(190, 18, 60, 0.12);
  --error-border:   rgba(244, 63, 94, 0.25);
  --error-text:     #FB7185;
  --spark:          #FF79C6;
  --focus-ring:         0 0 0 3px rgba(255, 121, 198, 0.30);
  --focus-ring-danger:  0 0 0 3px rgba(248, 113, 113, 0.25);
  --shadow-dialog:  0 8px 32px rgba(0, 0, 0, 0.50), 0 2px 8px rgba(0, 0, 0, 0.30);
  --backdrop:       rgba(0, 0, 0, 0.60);
}


/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ── Typography ───────────────────────────────────────────── */
h1 { font-size: 1.375rem; font-weight: 600; line-height: 1.2; }
h2 { font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 0.95rem;  font-weight: 600; line-height: 1.4; }

a {
  color: var(--link);
  text-decoration: none;
  transition: color 150ms ease-out;
}
a:hover { color: var(--link-hover); }
a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: var(--radius);
}


/* ── Form elements ────────────────────────────────────────── */
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.375rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  border-color: var(--link);
  box-shadow: var(--focus-ring);
}

input[aria-invalid="true"] {
  border-color: var(--danger);
}
input[aria-invalid="true"]:focus {
  border-color: var(--danger);
  box-shadow: var(--focus-ring-danger);
}

.field {
  margin-bottom: 1rem;
}

.field--flush {
  margin-bottom: 0;
}

.field-error {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--error-text);
}


/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.875rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 150ms ease-out,
              color 150ms ease-out,
              border-color 150ms ease-out,
              box-shadow 150ms ease-out;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  min-height: 44px; /* touch target */
  min-width: 44px;
}

.btn:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary */
.btn-primary {
  background-color: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Outline accent */
.btn-outline-accent {
  background-color: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline-accent:hover:not(:disabled) {
  background-color: var(--accent-subtle);
  border-color: var(--accent-hover);
  color: var(--accent-hover);
}

/* Secondary */
.btn-secondary {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background-color: var(--border);
}

/* Outline danger */
.btn-outline-danger {
  background-color: var(--surface);
  color: var(--danger);
  border-color: var(--danger);
}
.btn-outline-danger:hover:not(:disabled) {
  background-color: var(--error-bg);
}

/* Danger */
.btn-danger {
  background-color: var(--danger);
  color: var(--danger-fg);
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background-color: var(--danger-hover);
  border-color: var(--danger-hover);
}

/* Ghost */
.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
  border-color: transparent;
  font-size: 0.75rem;
  font-weight: 400;
}
.btn-ghost:hover:not(:disabled) {
  background-color: var(--surface);
  color: var(--text);
}

/* Ghost danger */
.btn-ghost-danger {
  background-color: transparent;
  color: var(--text-muted);
  border-color: transparent;
  font-size: 0.75rem;
  font-weight: 400;
}
.btn-ghost-danger:hover:not(:disabled) {
  background-color: var(--error-bg);
  color: var(--danger);
}

/* Icon-only */
.btn-icon {
  background-color: transparent;
  color: var(--text-muted);
  border-color: transparent;
  padding: 0;
  width: 44px;
  height: 44px;
}
.btn-icon:hover:not(:disabled) {
  background-color: var(--surface);
  color: var(--text);
}

/* Icon-only danger variant */
.btn-icon-danger:hover:not(:disabled) {
  background-color: var(--error-bg);
  color: var(--danger);
}

/* Full-width modifier */
.btn-full {
  width: 100%;
  padding-top: 0.5625rem;
  padding-bottom: 0.5625rem;
}


/* ── Form-level error box ─────────────────────────────────── */
.form-error {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  background-color: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius);
  color: var(--error-text);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}


/* ── Flash messages ───────────────────────────────────────── */
.flash-container {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: calc(100% - 2rem);
  max-width: 480px;
  pointer-events: none;
}

.flash {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 0.875rem;
  line-height: 1.5;
  overflow: hidden;
  max-height: 200px;
  transition:
    opacity 350ms ease-out,
    max-height 300ms ease-out 100ms,
    padding 300ms ease-out 100ms,
    border-width 300ms ease-out 100ms;
  box-shadow: var(--shadow-dialog);
}

.flash-success {
  background-color: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.flash-error {
  background-color: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-text);
}

.flash-dismiss {
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
}

@media (prefers-reduced-motion: reduce) {
  .flash { transition-duration: 0.01ms !important; }
}


/* ── Auth layout (login page) ─────────────────────────────── */
.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 360px;
}

.auth-wordmark {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-wordmark h1 {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.auth-wordmark .wordmark-dot {
  color: var(--spark);
}

.auth-form {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 1.75rem;
}

.auth-form .btn-primary {
  margin-top: 0.5rem;
}


/* ── App layout ───────────────────────────────────────────── */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 3.25rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg);
  flex-shrink: 0;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.navbar-wordmark {
  font-family: 'Coustard', Georgia, serif;
  font-weight: 900;
  font-size: 1.0625rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.navbar-wordmark .wordmark-dot {
  color: var(--spark);
}

.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.main-inner {
  max-width: 800px;
  margin-inline: auto;
  padding: 2rem;
  width: 100%;
}


/* ── Select chevron ───────────────────────────────────────── */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2352525B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  background-size: 1rem;
  padding-right: 2.25rem;
  cursor: pointer;
}

html[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A8A29E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}


/* ── Dialog ───────────────────────────────────────────────── */
dialog {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--shadow-dialog);
  padding: 1.75rem;
  max-width: 560px;
  width: 90%;
  color: var(--text);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  max-height: 90dvh;
  overflow-y: auto;
}

dialog textarea {
  resize: vertical;
  max-height: 12rem;
}

dialog::backdrop {
  background-color: var(--backdrop);
  backdrop-filter: blur(2px);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.875rem;
}

.dialog-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
}

.dialog-url {
  font-size: 0.8125rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.delete-dialog-message {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}



/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
}

.welcome-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 4);
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  animation: welcome-enter 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

html[data-theme="dark"] .welcome-card {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.40), 0 2px 8px rgba(0, 0, 0, 0.20);
}

@keyframes welcome-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-card {
    animation-duration: 0.01ms !important;
  }
}

.welcome-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background-color: var(--accent-subtle);
  border-radius: calc(var(--radius) * 3);
  margin: 0 auto 1.5rem;
  color: var(--spark);
}

.welcome-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.welcome-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.welcome-form {
  text-align: left;
}

.welcome-input-row {
  display: flex;
  gap: 0.5rem;
}

.welcome-input-row input[type="url"] {
  flex: 1;
  min-width: 0;
  padding: 0.625rem 1rem;
}


/* ── Search stripe ────────────────────────────────────────── */
/* ── Search hero ──────────────────────────────────────────── */
.search-stripe {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 5rem 2rem 4.5rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.search-hero-heading {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.search-hero-heading .wordmark-dot {
  color: var(--spark);
}

.search-hero-sub {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.search-stripe-inner {
  width: 100%;
  max-width: 640px;
}

.search-stripe-row {
  display: flex;
  gap: 0.625rem;
  align-items: center;
}

.search-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--bg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
  cursor: text;
}

.search-field:focus-within {
  border-color: var(--link);
  box-shadow: var(--focus-ring), 0 1px 4px rgba(0, 0, 0, 0.06);
}

html[data-theme="dark"] .search-field {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.search-field svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-field input[type="search"] {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  padding: 0.875rem 0;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: transparent;
  line-height: 1.4;
  appearance: none;
  -webkit-appearance: none;
}

.search-field input[type="search"]::placeholder {
  color: var(--text-muted);
}

/* Remove native search clear button */
.search-field input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Search empty state */
.search-no-results {
  padding-top: 2rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
}


/* ── New bookmark dialog ──────────────────────────────────── */
#new-dialog {
  max-width: 520px;
  padding: 2rem;
}

.new-dialog-header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 1.75rem;
}

.new-dialog-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  background-color: var(--accent-subtle);
  border-radius: calc(var(--radius) * 2);
  color: var(--spark);
  margin-top: 0.125rem;
}

.new-dialog-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.new-dialog-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.new-dialog-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--bg);
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
  cursor: text;
}

.new-dialog-input-wrap:focus-within {
  border-color: var(--link);
  box-shadow: var(--focus-ring);
}

.new-dialog-input-wrap--error {
  border-color: var(--danger);
}

.new-dialog-input-wrap--error:focus-within {
  border-color: var(--danger);
  box-shadow: var(--focus-ring-danger);
}

.new-dialog-input-wrap svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.new-dialog-input-wrap input[type="url"] {
  display: block;
  flex: 1;
  min-width: 0;
  width: 100%;
  border: none;
  outline: none;
  padding: 0.9375rem 0;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: transparent;
  line-height: 1.4;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}

.new-dialog-input-wrap input[type="url"]::placeholder {
  color: var(--text-muted);
}

/* Cancel inherited focus styles — the wrap handles focus ring */
.new-dialog-input-wrap input[type="url"]:focus {
  border-color: transparent;
  box-shadow: none;
}

.new-dialog-error {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--error-text);
  line-height: 1.5;
}

.new-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
}


/* ── Bookmark list ────────────────────────────────────────── */
.bookmark-list {
  border-top: 1px solid color-mix(in srgb, var(--border) 50%, var(--bg));
}

.bookmark-item {
  position: relative;
  display: grid;
  grid-template-columns: 1.25rem 1fr auto;
  gap: 0 0.75rem;
  padding: 1.125rem 0.5rem;
  margin: 0 -0.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, var(--bg));
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 150ms ease-out;
}

.bookmark-item:hover {
  background-color: var(--accent-subtle);
}

.bookmark-item:target {
  animation: bookmark-highlight 2.5s ease-out forwards;
  border-radius: var(--radius);
}

@keyframes bookmark-highlight {
  from { background-color: var(--accent-subtle); }
  to   { background-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .bookmark-item:target { animation-duration: 0.01ms !important; }
}

.bookmark-gutter {
  display: flex;
  justify-content: center;
  padding-top: 0.375rem;
  flex-shrink: 0;
}

.bookmark-dot {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--spark);
  flex-shrink: 0;
}

.bookmark-body {
  min-width: 0;
}

.bookmark-title-link {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color 150ms ease-out;
}

.bookmark-title-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.bookmark-item:hover .bookmark-title-link {
  color: var(--link);
}

.bookmark-url-display {
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .bookmark-url-display {
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    overflow-wrap: break-word;
  }
}

.bookmark-author {
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.bookmark-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  padding-top: 0.125rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease-out;
}

.bookmark-item:hover .bookmark-actions,
.bookmark-item:focus-within .bookmark-actions {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .bookmark-actions {
    opacity: 1;
    pointer-events: auto;
  }
}


/* ── Status pipeline ──────────────────────────────────────── */
.status-pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem 0.625rem;
  margin-top: 0.375rem;
}

.status-step {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  opacity: 0.45;
}

.status-step--done {
  color: var(--success-text);
  opacity: 1;
}

.status-step--error {
  color: var(--error-text);
  opacity: 1;
}

.status-step-icon {
  flex-shrink: 0;
}


/* ── Edit bookmark page ───────────────────────────────────── */
.edit-inner {
  max-width: 560px;
  margin-inline: auto;
  padding: 2rem;
  width: 100%;
}

.edit-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  text-decoration: none;
  transition: color 150ms ease-out;
}

.edit-back-link:hover {
  color: var(--text);
}

.edit-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 1.75rem;
}

.edit-card-url {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.edit-url-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.edit-url-value {
  font-size: 0.875rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Bookmark detail page ────────────────────────────────── */
.detail-inner {
  max-width: 720px;
  margin-inline: auto;
  padding: 2rem;
  width: 100%;
}

.detail-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 2rem;
}

.detail-header {
  margin-bottom: 1.5rem;
}

.detail-title {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.detail-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  transition: color 150ms ease-out;
}

.detail-link:hover {
  color: var(--link);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.detail-meta-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.8125rem;
}

.detail-meta-item dt {
  color: var(--text-muted);
  font-weight: 500;
}

.detail-meta-item dd {
  color: var(--text);
}

.detail-summary {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.detail-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.75rem 0;
}

/* ── Prose (markdown content) ────────────────────────────── */
.prose {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--text);
  overflow-wrap: break-word;
  overflow: hidden;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  margin-top: 1.75em;
  margin-bottom: 0.75em;
  line-height: 1.3;
}

.prose h1 { font-size: 1.375rem; }
.prose h2 { font-size: 1.125rem; }
.prose h3 { font-size: 1rem; }

.prose p {
  margin-bottom: 1em;
}

.prose ul,
.prose ol {
  margin-bottom: 1em;
  padding-left: 1.5em;
}

.prose li {
  margin-bottom: 0.375em;
}

.prose li > ul,
.prose li > ol {
  margin-bottom: 0;
  margin-top: 0.375em;
}

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.25em 0;
  color: var(--text-muted);
  font-style: italic;
}

.prose code {
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 0.8125rem;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.125em 0.375em;
}

.prose pre {
  margin: 1.25em 0;
  padding: 1rem;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.prose a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose a:hover {
  color: var(--link-hover);
}

.prose img,
.prose video,
.prose iframe,
.prose embed,
.prose object {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.25em 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25em 0;
  font-size: 0.875rem;
}

.prose th,
.prose td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}

.prose th {
  background-color: var(--bg);
  font-weight: 600;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.75em 0;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose > *:last-child {
  margin-bottom: 0;
}


/* ── Utilities ────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: 0.875rem; }
.text-xs    { font-size: 0.75rem; }
