@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&family=IBM+Plex+Mono:wght@500;600&display=swap');

/* ============ Design tokens ============ */
:root {
  /* Light mode: parchment / drafting-paper tan, dark warm text for legibility */
  --bg: #E5D8B8;
  --bg-elevated: #F6EFDD;
  --bg-sunken: #D8C89E;
  --text: #241C10;
  --text-muted: #4E4326;
  --border: #C4B27E;
  --accent: #A85B18;
  --accent-strong: #8B480E;
  --accent-2: #0F6E63;
  --danger: #A93226;
  --success: #0F6E63;
  --accept-green: #16A34A;
  --finalize-bg: #2B2116;
  --finalize-text: #F6EFDD;
  --shadow: 0 1px 2px rgba(36, 28, 16, 0.08), 0 10px 28px rgba(36, 28, 16, 0.09);
  --grid-line: rgba(36, 28, 16, 0.07);

  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  color-scheme: light;
}

html[data-theme='dark'] {
  /* Dark mode: lighter warm charcoal, not near-black */
  --bg: #33302A;
  --bg-elevated: #403C34;
  --bg-sunken: #2A271F;
  --text: #F5F1E6;
  --text-muted: #CBC2AC;
  --border: #55503F;
  --accent: #F0A94E;
  --accent-strong: #FFC575;
  --accent-2: #5FD9C9;
  --danger: #FF9285;
  --success: #5FD9C9;
  --accept-green: #4ADE80;
  --finalize-bg: #17140F;
  --finalize-text: #F5F1E6;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.3);
  --grid-line: rgba(255, 255, 255, 0.06);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    var(--bg);
  background-size: 34px 34px, 34px 34px, auto;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.65;
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, .brand, .btn-primary, .btn-secondary, button, input, select {
  font-family: var(--font-display);
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.3rem, 4.4vw, 3.5rem); font-weight: 700; }
h2 { font-size: 1.7rem; font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }

a { color: var(--accent-strong); }

p { color: var(--text-muted); margin: 0 0 1em; }

/* ============ Header / nav ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.navbar {
  max-width: 1140px;
  margin: 0 auto;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand::before {
  content: '◱';
  color: var(--accent);
  margin-right: 8px;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 7px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nav-links a:hover { color: var(--text); background: var(--bg-sunken); }
.nav-links a.active { color: var(--accent-strong); }

/* Login is visually separated from the other tabs: its own pill, own color */
.nav-login-btn {
  color: var(--bg-elevated) !important;
  background: var(--accent);
  border-radius: 999px !important;
  padding: 9px 18px !important;
  margin-left: 6px;
}
.nav-login-btn:hover { background: var(--accent-strong); color: var(--bg-elevated) !important; }
.nav-login-btn.active { color: var(--bg-elevated) !important; background: var(--accent-strong); }

.theme-toggle {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:active { transform: scale(0.96); }

.dash-user {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-family: var(--font-display);
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  padding: 9px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* ============ Layout ============ */
main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 56px 28px 110px;
}

.site-footer {
  text-align: center;
  padding: 36px 28px;
  color: var(--text-muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--border);
}

/* ============ Hero + before/after signature element ============ */
.hero {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 44px;
  align-items: center;
  padding: 24px 0 64px;
}
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
}

.hero-copy .eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
  margin-bottom: 20px;
}

.hero-copy p { max-width: 44ch; font-size: 1.12rem; }

.btn-primary, .btn-secondary {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 13px 24px;
  border-radius: 7px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-primary {
  background: var(--accent);
  color: #FBF6EA;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
  margin-left: 10px;
}
.btn-secondary:hover { border-color: var(--accent); }

/* Animated before/after reveal slider: one browser window with the old
   design layered on top of the new one, continuously wiped away and back,
   like a self-playing comparison slider. */
.makeover-diagram { padding: 12px; }

.reveal-diagram { position: relative; padding-top: 30px; }

.reveal-tag {
  position: absolute;
  top: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  z-index: 4;
}
.reveal-tag-old { left: 4px; background: var(--bg-sunken); color: var(--text-muted); border: 1px solid var(--border); }
.reveal-tag-new { right: 4px; background: var(--accent); color: #FBF6EA; }

.reveal-window {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: reveal-float 5s ease-in-out infinite;
}

.reveal-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
}
.reveal-chrome .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.reveal-address {
  flex: 1;
  height: 14px;
  margin-left: 8px;
  border-radius: 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  max-width: 220px;
}

.reveal-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.reveal-layer { position: absolute; inset: 0; padding: 24px; }

.layer-after { z-index: 1; background: var(--bg-elevated); }
.layer-before {
  z-index: 2;
  background: var(--bg-elevated);
  clip-path: inset(0 0% 0 0);
  animation: wipe-sweep 8s ease-in-out infinite;
}

.reveal-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  z-index: 3;
  left: 100%;
  transform: translateX(-50%);
  animation: handle-sweep 8s ease-in-out infinite;
}

.reveal-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--accent-strong);
  box-shadow: var(--shadow);
}
.reveal-grip svg { width: 12px; height: 12px; }

@keyframes reveal-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes wipe-sweep {
  0%, 10% { clip-path: inset(0 0% 0 0); }
  50%, 60% { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0% 0 0); }
}
@keyframes handle-sweep {
  0%, 10% { left: 100%; }
  50%, 60% { left: 0%; }
  100% { left: 100%; }
}

/* after (new) mock content: airy, modern */
.rl-nav { display: flex; gap: 16px; margin-bottom: 20px; }
.rl-nav span { display: block; width: 34px; height: 8px; border-radius: 4px; background: var(--accent); opacity: 0.7; }
.rl-hero { height: 34%; border-radius: 8px; background: var(--accent); opacity: 0.85; margin-bottom: 14px; }
.rl-lines span { display: block; height: 7px; border-radius: 4px; background: var(--accent); opacity: 0.5; margin-bottom: 8px; }
.rl-lines span:first-child { width: 70%; }
.rl-lines span:last-child { width: 45%; margin-bottom: 14px; }
.rl-cta {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #FBF6EA;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
}

/* before (old) mock content: cramped, dated */
.rl-nav.old { gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.rl-nav.old span { width: 24px; height: 6px; border-radius: 2px; background: var(--border); }
.rl-block { height: 30%; border-radius: 2px; background: var(--border); opacity: 0.7; margin-bottom: 14px; }
.rl-lines.old span { display: block; height: 6px; border-radius: 2px; background: var(--border); margin-bottom: 7px; }
.rl-lines.old span:nth-child(1) { width: 96%; }
.rl-lines.old span:nth-child(2) { width: 88%; }
.rl-lines.old span:nth-child(3) { width: 92%; }
.rl-lines.old span:nth-child(4) { width: 60%; }

/* Hovering lets a curious visitor freeze-frame either state */
.reveal-diagram:hover .layer-before,
.reveal-diagram:hover .reveal-handle {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-window, .layer-before, .reveal-handle {
    animation: none !important;
  }
  .layer-before { clip-path: inset(0 55% 0 0) !important; }
  .reveal-handle { left: 45% !important; }
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 26px;
  position: relative;
}

/* ============ Process diagram (replaces plain feature cards) ============ */
.process {
  display: flex;
  align-items: flex-start;
  margin-top: 24px;
  scroll-margin-top: 100px;
}
@media (max-width: 760px) {
  .process { flex-direction: column; }
}

.process-step {
  flex: 1;
  text-align: center;
  padding: 0 12px;
  position: relative;
}
@media (max-width: 760px) {
  .process-step { text-align: left; padding: 0 0 28px 64px; }
}

.process-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
@media (max-width: 760px) {
  .process-num { position: absolute; left: 0; top: 14px; }
}

.process-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  position: relative;
  z-index: 2;
}
.process-icon-circle svg { width: 26px; height: 26px; color: var(--accent-strong); }
@media (max-width: 760px) {
  .process-icon-circle { position: absolute; left: 0; top: 30px; margin: 0; }
  .process-step h3, .process-step p { margin-left: 0; }
}

.process-step h3 { margin-bottom: 6px; }
.process-step p { font-size: 0.92rem; max-width: 30ch; margin: 0 auto; }
@media (max-width: 760px) {
  .process-step p { max-width: none; }
}

.process-connector {
  flex: 0 0 56px;
  height: 2px;
  border-top: 2px dashed var(--border);
  margin-top: 46px;
}
@media (max-width: 760px) {
  .process-connector { display: none; }
}

.about-body { max-width: 68ch; }
.about-body h2 { margin-top: 1.4em; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 30px 0 10px;
}
.stat { border: 1px solid var(--border); border-radius: 11px; padding: 20px; background: var(--bg-elevated); }
.stat .num {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--accent-strong);
  display: block;
}
.stat .label { font-size: 0.86rem; color: var(--text-muted); }

/* ============ Forms ============ */
label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 7px;
}

input[type='text'], input[type='url'], input[type='password'], input[type='tel'], input[type='email'], input[type='search'], select, textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  color: var(--text);
  font-size: 1.02rem;
  margin-bottom: 16px;
  font-family: var(--font-body);
}
textarea { resize: vertical; min-height: 90px; }
input[type='file'] {
  width: 100%;
  padding: 10px;
  border-radius: 7px;
  border: 1px dashed var(--border);
  background: var(--bg-sunken);
  color: var(--text);
  font-size: 0.92rem;
  margin-bottom: 8px;
  font-family: var(--font-body);
}
.field-hint { margin: 0 0 16px; font-size: 0.82rem; color: var(--text-muted); }
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button {
  font-weight: 600;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 11px 18px;
  cursor: pointer;
  font-size: 0.94rem;
}

.btn-approve { background: var(--success); color: #08201D; }
.btn-decline { background: transparent; border-color: var(--danger); color: var(--danger); margin-left: 8px; }

.form-message { min-height: 1.3em; font-size: 0.92rem; font-family: var(--font-display); }
.form-message.success { color: var(--success); }
.form-message.error { color: var(--danger); }

.login-card { max-width: 400px; margin: 44px auto; }
.login-card p.hint { font-size: 0.84rem; color: var(--text-muted); }

/* ============ Dashboard tabs ============ */
.tab-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 12px 16px;
  cursor: pointer;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent-strong); border-bottom-color: var(--accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============ Tickets ============ */
.ticket-list { display: flex; flex-direction: column; gap: 16px; margin-top: 10px; }

.ticket-card {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 9px;
  padding: 18px 20px;
}

.ticket-card-header {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.98rem;
}
.ticket-card-header a { word-break: break-all; }

.ticket-meta { font-size: 0.9rem; margin: 7px 0 0; }

.ticket-actions { margin-top: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }

.inline-form { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.inline-form input { margin-bottom: 0; width: 230px; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px 16px;
  margin-bottom: 4px;
}
.field-grid input { margin-bottom: 0; }

.field-grid label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.field-input-wrap { position: relative; display: flex; align-items: center; }
.field-input-wrap:focus-within .field-icon { color: var(--accent-strong); }

.field-icon {
  position: absolute;
  left: 13px;
  width: 18px;
  height: 18px;
  color: var(--accent);
  pointer-events: none;
  flex-shrink: 0;
}

input.has-icon { padding-left: 42px; }

/* Icons used inline inside buttons and ticket-card headers (not field prefixes) */
.header-icon, .btn-icon, .summary-icon {
  position: static;
  width: 17px;
  height: 17px;
  color: currentColor;
  flex-shrink: 0;
}
.btn-icon { margin-right: 6px; vertical-align: -3px; }
.header-icon { color: var(--accent-strong); margin-right: 2px; }

/* Read-only ticket summary shown until "Edit ticket" is clicked */
.ticket-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 12px 0 4px;
}
.summary-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.96rem;
  color: var(--text);
}
.summary-item .summary-icon { width: 16px; height: 16px; color: var(--accent); }
.summary-item.muted { color: var(--text-muted); font-style: italic; }
.summary-item a { word-break: break-all; }

/* Demo link gets a highlighted treatment, congruent with the theme's accent
   color, everywhere it appears: the read-only summary, the edit field, and
   ticket history. It's the one link customers actually see, so it stands
   out from the plain site URL. */
.summary-item.demo-link a {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent-strong);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  text-decoration: none;
}
.summary-item.demo-link a:hover {
  background: color-mix(in srgb, var(--accent) 32%, transparent);
}
.summary-item.demo-link .summary-icon { color: var(--accent-strong); }

.demo-link-value {
  display: inline-block;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent-strong);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  text-decoration: none;
}
.demo-link-value:hover {
  background: color-mix(in srgb, var(--accent) 32%, transparent);
}

.ticket-view, .ticket-edit { }

/* Add ticket modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 10, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-overlay.hidden { display: none !important; }

.modal-dialog {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  max-width: 580px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.modal-header h2 { margin: 0; }

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  padding: 4px 8px;
}
.modal-close:hover { color: var(--danger); }

/* Brief "accepted" flash shown in the Add Ticket modal after a submitted
   URL passes the duplicate and static-site checks, before the details
   step form replaces it. */
.step-success-flash {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 34px 0;
}
.step-success-flash .success-ring {
  position: absolute;
  top: 34px;
  left: 50%;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid var(--accept-green);
  transform: translateX(-50%) scale(0.4);
  opacity: 0.7;
  animation: success-ring-pulse 0.8s ease-out;
}
.step-success-flash svg {
  width: 52px;
  height: 52px;
  color: var(--accept-green);
  position: relative;
  z-index: 1;
  animation: step-success-pop 0.5s cubic-bezier(0.34, 1.75, 0.64, 1);
}
.step-success-flash p {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--accept-green);
  opacity: 0;
  animation: success-text-in 0.4s ease 0.22s forwards;
}
@keyframes success-ring-pulse {
  0% { transform: translateX(-50%) scale(0.4); opacity: 0.7; }
  100% { transform: translateX(-50%) scale(2.2); opacity: 0; }
}
@keyframes step-success-pop {
  0% { opacity: 0; transform: scale(0.3) rotate(-15deg); }
  60% { opacity: 1; transform: scale(1.15) rotate(5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes success-text-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .step-success-flash svg,
  .step-success-flash .success-ring,
  .step-success-flash p {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .step-success-flash .success-ring { display: none; }
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.badge-sale { color: var(--success); border-color: var(--success); }
.badge-no_sale { color: var(--danger); border-color: var(--danger); }
.badge-non-static { color: var(--accent-strong); border-color: var(--accent); }

.empty {
  color: var(--text-muted);
  font-size: 0.94rem;
  font-style: italic;
  padding: 14px 0;
}

section.card + section.card { margin-top: 30px; }

.hidden { display: none !important; }

/* ============ History search ============ */
.panel-search { max-width: 420px; margin-top: 18px; margin-bottom: 18px; }
.panel-search input { margin-bottom: 0; }

/* ============ Accounts tab ============ */
.account-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.account-row:last-child { border-bottom: none; }
.account-name-edit { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 240px; }
.account-name-input { width: 160px; margin-bottom: 0; }
.account-role-tag { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-muted); white-space: nowrap; }
.account-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.account-actions form { display: flex; gap: 8px; align-items: center; margin: 0; }
.account-actions input { width: 170px; margin-bottom: 0; }
.btn-small { padding: 8px 12px; font-size: 0.82rem; }

/* Horizontal row of ticket-card actions: Edit ticket and Comments stay
   grouped together on the left; Finalize is pushed to the far right and
   visually set apart via its own darker button style. Every one of these
   opens a modal now; nothing here expands the card itself. */
.ticket-row-actions {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.ticket-row-actions-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}
.ticket-row-actions .btn-finalize { margin-left: auto; }
.ticket-row-actions > .btn-decline { margin-left: auto; }

.btn-finalize {
  background: var(--finalize-bg);
  color: var(--finalize-text);
  border: 1px solid transparent;
}
.btn-finalize:hover { filter: brightness(1.2); }

/* Comments popup: scrollable so a long thread doesn't grow the modal
   past a reasonable height. */
.comment-scroll {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 14px;
  padding-right: 4px;
}
.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.comment {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}
.comment-meta {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.comment-date { font-weight: 400; font-family: var(--font-mono); font-size: 0.76rem; }
.comment-body { margin: 0; font-size: 0.94rem; color: var(--text); }
.comment-actions { display: flex; gap: 8px; margin-top: 8px; }
.comment-form textarea { min-height: 70px; }

/* Recent-checks log (admin, Discovered Sites tab) */
.check-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
.check-log-entry {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-left: 4px solid transparent;
  border-radius: 8px;
  background: var(--bg-sunken);
}
.check-log-entry.check-log-accepted { border-left-color: var(--success); }
.check-log-entry.check-log-denied { border-left-color: var(--danger); }
.check-log-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.check-log-accepted .check-log-dot { background: var(--success); }
.check-log-denied .check-log-dot { background: var(--danger); }
.check-log-entry a { font-family: var(--font-mono); font-size: 0.86rem; }
.check-log-time {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
}
.check-log-reason {
  margin: 2px 0 0;
  width: 100%;
  font-size: 0.82rem;
  color: var(--danger);
}

/* ============ On-load reveal (no blocking overlay: content is present,
   it just animates into place while the rest of the page renders normally) ============ */
.fade-in { animation: fade-up 0.6s ease both; }
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }
.delay-5 { animation-delay: 0.40s; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .fade-in { animation: none !important; opacity: 1 !important; transform: none !important; }
}
