/* Unstamped — product design system (restrained, calm, trustworthy). */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e6e8ec;
  --ink: #14161a;
  --muted: #6b7280;
  --faint: #9aa1ac;
  --accent: #e8590c;          /* warm orange, used sparingly for the primary CTA + focus */
  --accent-ink: #ffffff;
  --accent-weak: #fff2ea;
  --success: #0a7a44;
  --success-weak: #e7f6ee;
  --error: #b3261e;
  --error-weak: #fdecea;
  --focus: #1a73e8;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 22, 32, .05), 0 8px 28px rgba(16, 22, 32, .07);
  --space: 16px;
  --maxw: 700px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
}

/* ---- header ---- */
.appbar {
  width: 100%;
  max-width: var(--maxw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: .95rem; }
.brand svg { display: block; }
.brand-name { color: var(--ink); letter-spacing: -.01em; }

/* ---- card ---- */
.card {
  width: 100%;
  max-width: var(--maxw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 18px 16px 28px;
  padding: 28px 28px 24px;
}
.card.narrow { max-width: 420px; }
.descriptor {
  margin: 0 0 8px; color: var(--accent); font-size: .74rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
h1 { font-size: 1.4rem; line-height: 1.25; margin: 0 0 6px; letter-spacing: -.02em; }
.intro { color: var(--muted); margin: 0 0 20px; font-size: .95rem; line-height: 1.5; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.fineprint { color: var(--muted); font-size: .82rem; line-height: 1.5; }

/* ---- drop zone (READY) ---- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  border: 1.5px dashed #cdd2da;
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 40px 20px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-weak); }
.dropzone:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(26,115,232,.28); }
.dz-icon { color: var(--faint); margin-bottom: 2px; }
.dz-title { font-size: 1.05rem; font-weight: 600; }
.dz-sub { color: var(--muted); font-size: .9rem; }
.dz-formats { color: var(--faint); font-size: .82rem; margin-top: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- selected / success media ---- */
.media {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);        /* neutral by default (opaque images) */
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-height: 300px;
}
.media.alpha {                          /* checkerboard ONLY when transparency requires it */
  background:
    linear-gradient(45deg, #eef0f3 25%, transparent 25%, transparent 75%, #eef0f3 75%) 0 0/18px 18px,
    linear-gradient(45deg, #eef0f3 25%, #f7f8fa 25%, #f7f8fa 75%, #eef0f3 75%) 9px 9px/18px 18px,
    #f7f8fa;
}
.media img { display: block; max-width: 100%; max-height: 300px; width: auto; height: auto; object-fit: contain; }
.media.busy img { filter: saturate(.5) opacity(.7); }

.filemeta { margin: 12px 0 4px; }
.filemeta .name { font-weight: 600; word-break: break-all; }
.filemeta .dims { color: var(--muted); font-size: .88rem; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 12px 18px;
  font-size: 1rem; font-weight: 600; font-family: inherit;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(.96); }
.btn-primary:disabled { background: #f0c3aa; cursor: not-allowed; }
.btn-secondary {
  background: transparent; color: var(--ink); border-color: transparent;
  width: auto; min-height: 40px; margin: 6px auto 0; display: block; font-weight: 500;
}
.btn-secondary:hover { color: var(--accent); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(26,115,232,.35); }
.stack { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }
.link:hover { color: var(--accent); }

/* ---- account chip (hosted accounts) ---- */
.account { display: inline-flex; align-items: center; gap: 10px; font-size: .85rem; }
.account-email { color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-badge {
  color: var(--accent); background: var(--accent-weak); border-radius: 999px;
  padding: 1px 8px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}
.signin-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }

/* ---- public marketing landing ---- */
.landing { width: 100%; max-width: var(--maxw); padding: 0 20px 40px; }
.hero { padding: 24px 0 8px; }
.hero h1 { font-size: 2rem; line-height: 1.15; margin: 4px 0 10px; }
.hero .intro { font-size: 1.05rem; max-width: 620px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 18px; }
.hero-cta .btn { width: auto; padding: 12px 22px; }
.trust { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; color: var(--muted); font-size: .9rem; }
.trust li { position: relative; padding-left: 20px; }
.trust li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 700; }
.howto { margin-top: 34px; }
.howto h2, .faq h2 { font-size: 1.25rem; margin: 0 0 14px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
.step-n { grid-row: 1 / 3; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-weak); color: var(--accent); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.step-t { font-weight: 600; }
.step-d { color: var(--muted); font-size: .9rem; }
.faq { margin-top: 34px; padding: 0; }
.site-footer { width: 100%; max-width: var(--maxw); padding: 20px; display: flex; justify-content: space-between; align-items: center; color: var(--faint); font-size: .85rem; border-top: 1px solid var(--border); }
.site-footer nav { display: flex; gap: 16px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
@media (max-width: 480px) { .hero h1 { font-size: 1.6rem; } }

/* ---- owner admin ---- */
.card.admin { max-width: 860px; }
.admin section { margin-top: 26px; }
.admin h2 { font-size: 1.1rem; margin: 0 0 12px; }
.admin-form .admin-fields { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.admin-fields label { display: flex; flex-direction: column; font-size: .82rem; font-weight: 600; gap: 4px; }
.admin-fields input, .admin-fields select { min-height: 40px; padding: 8px 10px; border: 1px solid #cdd2da; border-radius: var(--radius-sm); font: inherit; font-weight: 400; }
.admin-form .btn-primary { width: auto; padding: 10px 20px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.row-actions { white-space: nowrap; }
.row-actions .inline { display: inline; }
.row-actions .link { margin-right: 12px; font-size: .84rem; }
.tag { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: .74rem; font-weight: 700; }
.tag-active { background: var(--success-weak); color: var(--success); }
.tag-suspended, .tag-revoked, .tag-expired { background: var(--error-weak); color: var(--error); }
.tag-pending, .tag-consumed { background: var(--accent-weak); color: var(--accent); }
.invite-created { background: var(--accent-weak); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 8px; }
.invite-created-t { margin: 0 0 8px; font-weight: 600; color: var(--ink); }
.copy-row { display: flex; gap: 8px; }
.copy-input { flex: 1; min-height: 40px; padding: 8px 10px; border: 1px solid #cdd2da; border-radius: var(--radius-sm); font: inherit; background: #fff; }
.copy-row .btn-secondary { width: auto; margin: 0; padding: 8px 16px; }

/* ---- SEO editorial pages ---- */
.article { width: 100%; max-width: 720px; padding: 8px 20px 40px; }
.article h1 { font-size: 1.8rem; line-height: 1.2; margin: 12px 0 10px; }
.article h2 { font-size: 1.15rem; margin: 26px 0 8px; }
.article p { color: var(--ink); line-height: 1.6; margin: 0 0 12px; }
.article .intro { color: var(--muted); font-size: 1.05rem; }
.article .hero-cta { margin: 24px 0 8px; }

/* ---- privacy + limitation ---- */
.notice { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.notice .privacy { color: var(--ink); font-size: .86rem; }
.limitation { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.success-note { margin: 12px 0 0; }

/* ---- FAQ (outside the card, quiet, native disclosure) ---- */
.faq {
  width: 100%; max-width: var(--maxw);
  margin: 0 16px 32px; padding: 0 12px;
}
.faq details {
  border-top: 1px solid var(--border);
  padding: 12px 4px;
}
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary {
  cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--ink);
  list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--faint); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 10px 0 2px; color: var(--muted); font-size: .88rem; line-height: 1.55; }

/* ---- status pills ---- */
.pill { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; }
.pill.success { color: var(--success); }
.pill.error { color: var(--error); }
.badge { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.badge.success { background: var(--success-weak); color: var(--success); }
.badge.error { background: var(--error-weak); color: var(--error); }

.errorbox {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--error-weak); color: var(--error); font-size: .9rem;
  display: flex; gap: 10px; align-items: flex-start;
}

/* ---- processing ---- */
.processing { display: flex; align-items: center; gap: 12px; margin-top: 16px; color: var(--ink); font-weight: 600; }
.processing .hint { display: block; color: var(--muted); font-weight: 400; font-size: .85rem; margin-top: 2px; }
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid #e6e8ec; border-top-color: var(--accent);
  animation: spin .8s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* ---- login ---- */
.field { display: block; margin: 4px 0 16px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field input {
  width: 100%; min-height: 46px; padding: 11px 13px; font-size: 1rem; font-family: inherit;
  border: 1px solid #cdd2da; border-radius: var(--radius-sm); background: #fff;
}
.field input:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(26,115,232,.25); }

/* ---- offline banner ---- */
.offline-banner {
  position: fixed; left: 0; right: 0; bottom: 0; margin: 0; padding: 10px;
  text-align: center; background: #2b2622; color: #fff; font-size: .88rem;
}

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

/* ---- responsive ---- */
@media (max-width: 480px) {
  .card { margin: 12px 10px 22px; padding: 20px 18px; border-radius: 12px; }
  h1 { font-size: 1.25rem; }
  .appbar { padding: 14px 14px 0; }
  .dropzone { padding: 32px 14px; }
  .media, .media img { max-height: 240px; }
}

/* ---- guest-first clean (rendered only in the flag-gated guest funnel) ---- */
.guest-note {
  margin: 4px 0 0; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--accent-weak); color: var(--ink); font-size: .86rem; font-weight: 600;
}
.guest-report {
  margin-top: 16px; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2);
}
.guest-report .rep-title { margin: 0 0 8px; font-weight: 600; font-size: .9rem; }
.rep-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rep-list.rep-limits { margin-top: 10px; }
.rep-row { display: flex; align-items: flex-start; gap: 8px; font-size: .86rem; color: var(--ink); }
.rep-row.ok { color: var(--success); }
.rep-row.ok span { color: var(--ink); }
.rep-row.lim { color: var(--muted); font-size: .8rem; }
.guest-cta {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); text-align: center;
}
.guest-cta p { margin: 0 0 8px; font-size: .9rem; color: var(--muted); }
