:root {
  --bg: #17110c;
  --bg-alt: #1f1710;
  --card: #241b13;
  --card-border: #3a2c1c;
  --leather: #8a5a34;
  --leather-light: #c98a4b;
  --accent: #d8a54c;
  --accent-soft: rgba(216, 165, 76, 0.14);
  --cream: #f3e9d8;
  --muted: #b8a892;
  --muted-dim: #8a7c68;
  --danger: #c96a4c;
  --ok: #7a9a6a;
  --radius: 14px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --gold-gradient: linear-gradient(180deg, #f6dfa8 0%, #d8a54c 48%, #a06a2c 100%);
  --stitch-color: rgba(216, 165, 76, 0.55);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  color: var(--cream);
  margin: 0 0 0.5em;
  letter-spacing: 0.01em;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--leather-light);
}

p {
  color: var(--muted);
  margin: 0 0 1em;
}

img, svg {
  max-width: 100%;
}

/* ---------- shared: hand-stitched leather trim ---------- */

.stitched {
  position: relative;
}
.stitched::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: calc(var(--radius) - 5px);
  border: 1.4px dashed var(--stitch-color);
  pointer-events: none;
}

/* French seam: two parallel rows of stitching just inside the edge */
.french-seam {
  position: relative;
}
.french-seam::before,
.french-seam::after {
  content: '';
  position: absolute;
  border-radius: calc(var(--radius) - 4px);
  border: 1.2px dashed var(--stitch-color);
  pointer-events: none;
}
.french-seam::before { inset: 5px; }
.french-seam::after { inset: 9px; border-color: rgba(216, 165, 76, 0.3); }

.gold-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.35));
}

/* a short stitched seam used as a decorative divider */
.seam {
  width: 64px;
  height: 10px;
  margin: 0 auto 22px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--accent) 0 8px,
    transparent 8px 14px
  );
  background-position: center;
  background-size: 100% 1.6px;
  background-repeat: no-repeat;
  position: relative;
}
.seam::before,
.seam::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
}
.seam::before { left: 0; }
.seam::after { right: 0; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- leather grain backdrop ---------- */

/* real pull-up leather photo as backdrop, tiled at a fixed physical size so grain
   never gets upscaled/blown-up on large or high-DPI screens, with warm glows and a vignette on top */
.grain-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 55% 38% at 20% 15%, rgba(224, 176, 96, 0.16), transparent 62%),
    radial-gradient(ellipse 40% 32% at 76% 10%, rgba(201, 138, 75, 0.12), transparent 58%),
    radial-gradient(ellipse 50% 42% at 88% 68%, rgba(158, 104, 58, 0.14), transparent 60%),
    radial-gradient(ellipse 38% 30% at 8% 78%, rgba(216, 165, 76, 0.10), transparent 55%),
    radial-gradient(ellipse 130% 95% at 50% 45%, transparent 35%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(rgba(12, 9, 6, 0.5), rgba(12, 9, 6, 0.6)),
    url('/img/bg/skin-tile.jpg');
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  background-size: auto, auto, auto, auto, auto, auto, 420px 420px;
  background-position: center;
  background-color: var(--bg);
}
.grain-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.2;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/></svg>");
}

/* ---------- top nav ---------- */

.site-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding: 22px 0;
}
.site-nav .brand {
  flex: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
}
.brand .word {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand .mark {
  width: 30px;
  height: 30px;
  flex: none;
}

/* bigger masthead treatment on the public landing page only */
.brand-hero {
  gap: 18px;
}
.brand-hero .mark {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  box-shadow: 0 10px 26px -10px rgba(0, 0, 0, 0.65);
}
.brand-hero .word {
  font-size: 2.5rem;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-size: 0.92rem;
}
.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}
.lang-switch a {
  color: var(--muted);
  padding: 2px 3px;
}
.lang-switch a:hover {
  color: var(--accent);
}
.lang-switch a.is-active {
  color: var(--leather-light);
  font-weight: 600;
}
.lang-switch .sep {
  color: var(--muted);
  opacity: 0.5;
}
.nav-underline {
  position: relative;
  color: var(--accent);
  padding-bottom: 2px;
}
.nav-underline::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 1.4px;
  background-image: repeating-linear-gradient(90deg, var(--accent) 0 5px, transparent 5px 9px);
  transition: right 0.25s ease;
}
.nav-underline:hover {
  color: var(--leather-light);
}
.nav-underline:hover::after {
  right: 0;
}
.nav-underline.is-active {
  color: var(--leather-light);
}
.nav-underline.is-active::after {
  right: 0;
  background-image: none;
  background-color: var(--accent);
}

/* header bar for the authenticated app shell (tester/admin area) — a subtle
   separation from content below, the public landing nav stays borderless */
.app-nav-bar {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.14);
}
.app-nav-bar .site-nav {
  padding: 16px 0;
}

.nav-links a.ghost {
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.55)), url('/img/buttons/btn-black.jpg');
  background-size: cover;
  background-position: center;
  color: var(--muted);
  border: 1px solid rgba(216, 165, 76, 0.28);
  padding: 8px 16px;
  border-radius: 999px;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.nav-links a.ghost::before {
  content: '';
  position: absolute;
  inset: 2.5px;
  border-radius: 999px;
  border: 1px dashed rgba(216, 165, 76, 0.3);
  pointer-events: none;
}
.nav-links a.ghost:hover {
  color: var(--cream);
  border-color: var(--leather-light);
  transform: translateY(-1px);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  z-index: 1;
  padding: 64px 0 40px;
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow:
    -1px -1px 0 rgba(0, 0, 0, 0.5),
    1px 1px 0 rgba(255, 222, 168, 0.14);
  margin-bottom: 22px;
}
.eyebrow::before,
.eyebrow::after {
  content: '';
  width: 24px;
  height: 1.4px;
  flex: none;
  background-image: repeating-linear-gradient(90deg, var(--stitch-color) 0 4px, transparent 4px 7px);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .hero .eyebrow,
  .hero h1,
  .hero .lede,
  .hero .cta-row {
    animation: rise-in 0.5s ease both;
  }
  .hero h1 {
    animation-delay: 0.06s;
  }
  .hero .lede {
    animation-delay: 0.12s;
  }
  .hero .cta-row {
    animation-delay: 0.18s;
  }
  .hero .blueprint-frame {
    animation: rise-in 0.6s ease 0.15s both;
  }

  .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.45s ease, transform 0.45s ease;
  }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  margin-bottom: 0.35em;
  /* debossed / blind-stamped into leather: dark groove toward the light, warm rim-light opposite it */
  color: #cdb890;
  text-shadow:
    -1px -1.5px 0 rgba(0, 0, 0, 0.55),
    -2px -3px 4px rgba(0, 0, 0, 0.35),
    1px 1.5px 0 rgba(255, 231, 186, 0.16),
    2px 2px 3px rgba(255, 200, 130, 0.08);
}
.hero h1 .stitch {
  color: var(--accent);
}

.hero .lede {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 1.8em;
}

.cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.96rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.btn-primary {
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(180deg, rgba(50, 28, 10, 0.15), rgba(20, 11, 4, 0.45)), url('/img/buttons/btn-brown.jpg');
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(216, 165, 76, 0.4);
  color: var(--cream);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s ease;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 7px;
  border: 1.4px dashed rgba(255, 231, 186, 0.35);
  pointer-events: none;
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 35%;
  height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
  pointer-events: none;
}
.btn-primary:hover::after {
  left: 130%;
}
.btn-primary:hover {
  transform: translateY(-1px);
  color: var(--cream);
  filter: brightness(1.12) saturate(1.08);
}

.btn-outline {
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.4)), url('/img/buttons/btn-black.jpg');
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(216, 165, 76, 0.3);
  color: var(--cream);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.btn-outline::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 7px;
  border: 1.4px dashed rgba(216, 165, 76, 0.3);
  pointer-events: none;
}
.btn-outline::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/img/buttons/btn-tan.jpg');
  background-size: cover;
  background-position: center;
  mix-blend-mode: overlay;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.btn-outline:hover {
  transform: translateY(-1px);
  border-color: var(--leather-light);
  color: var(--cream);
}
.btn-outline:hover::after {
  opacity: 0.4;
}

/* ---------- blueprint illustration ---------- */

.blueprint-frame {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.blueprint-frame::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -14%;
  background: radial-gradient(ellipse 60% 55% at 50% 45%, rgba(216, 165, 76, 0.32), transparent 70%);
  filter: blur(6px);
  pointer-events: none;
}
.blueprint-frame .cap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--muted-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 4px 10px;
  border-bottom: 1px dashed var(--card-border);
  margin-bottom: 14px;
}
.blueprint-frame .cap span:nth-child(2) {
  flex: 1;
}
.dots {
  display: inline-flex;
  gap: 5px;
  flex: none;
}
.dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--leather-light), var(--leather));
  display: block;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.dots i:nth-child(2) { opacity: 0.7; }
.dots i:nth-child(3) { opacity: 0.45; }

.screenshot {
  display: block;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

/* corner rivets on the framed screenshot cards */
.blueprint-frame,
.screen-card {
  background-color: var(--card);
  background-image:
    radial-gradient(circle at center, #f0c878 0%, #8a5a34 55%, transparent 60%),
    radial-gradient(circle at center, #f0c878 0%, #8a5a34 55%, transparent 60%),
    radial-gradient(circle at center, #f0c878 0%, #8a5a34 55%, transparent 60%),
    radial-gradient(circle at center, #f0c878 0%, #8a5a34 55%, transparent 60%);
  background-repeat: no-repeat;
  background-size: 9px 9px;
  background-position:
    9px 9px,
    calc(100% - 9px) 9px,
    9px calc(100% - 9px),
    calc(100% - 9px) calc(100% - 9px);
}

/* ---------- features ---------- */

.section {
  position: relative;
  z-index: 1;
  padding: 56px 0;
}
.section-head {
  max-width: 60ch;
  margin: 0 auto 36px;
  text-align: center;
}
.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.feature-card:hover {
  border-color: var(--leather-light);
  transform: translateY(-2px);
}
.feature-card .icon {
  width: 40px;
  height: 40px;
  color: var(--accent);
  filter: drop-shadow(0 0 6px rgba(216, 165, 76, 0.35));
  margin-bottom: 14px;
  transition: transform 0.2s ease;
}
.feature-card:hover .icon {
  transform: scale(1.08);
}
.feature-card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.feature-card p {
  font-size: 0.92rem;
  margin: 0;
}

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--card-border);
  padding: 28px 0;
  margin-top: 30px;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--muted-dim);
}
.site-footer a {
  color: var(--muted-dim);
}
.site-footer a:hover {
  color: var(--accent);
}

/* ---------- auth / app shell ---------- */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-main {
  flex: 1;
  position: relative;
  z-index: 1;
  padding: 40px 0 60px;
}

.auth-card {
  max-width: 380px;
  margin: 8vh auto 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 34px 30px;
  box-shadow: var(--shadow);
}
.auth-card__logo {
  display: block;
  width: 88px;
  height: 88px;
  margin: 0 auto 18px;
  border-radius: 20px;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.6);
}
.auth-card h1 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}
.auth-card .sub {
  color: var(--muted-dim);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input, .field textarea {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--cream);
  font-family: inherit;
  font-size: 0.95rem;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--leather-light);
}

.alert {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 18px;
}
.alert-error {
  background: rgba(201, 106, 76, 0.12);
  border: 1px solid rgba(201, 106, 76, 0.4);
  color: #e5a58e;
}
.alert-ok {
  background: rgba(122, 154, 106, 0.12);
  border: 1px solid rgba(122, 154, 106, 0.4);
  color: #b6d1a6;
}

/* ---------- testers dashboard ---------- */

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-head h1 {
  font-size: 1.6rem;
  margin: 0;
}
.who {
  font-size: 0.88rem;
  color: var(--muted-dim);
}
.who strong {
  color: var(--cream);
}

.thread-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.thread-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px 18px;
  transition: border-color 0.15s ease;
}
.thread-row:hover {
  border-color: var(--leather-light);
}
.thread-row .name {
  font-weight: 600;
  color: var(--cream);
}
.thread-row .preview {
  font-size: 0.85rem;
  color: var(--muted-dim);
  max-width: 46ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge-unread {
  background: var(--accent);
  color: #201409;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}
.empty-state {
  color: var(--muted-dim);
  text-align: center;
  padding: 40px 0;
}

.thread-view {
  max-width: 720px;
}
.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.msg {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.94rem;
}
.msg-body {
  white-space: pre-wrap;
  word-wrap: break-word;
  display: block;
}
.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.attachment-thumb {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: block;
  cursor: zoom-in;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.attachment-thumb:hover {
  transform: translateY(-1px);
  border-color: var(--leather-light);
}
.attachment-file {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 90px;
  min-width: 120px;
  max-width: 220px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: inherit;
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.attachment-file:hover {
  transform: translateY(-1px);
  border-color: var(--leather-light);
}
.attachment-file svg {
  flex: none;
  opacity: 0.8;
}
.attachment-file-name {
  font-size: 0.85em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 6, 4, 0.88);
  align-items: center;
  justify-content: center;
  padding: 30px;
  cursor: zoom-out;
}
.lightbox.open {
  display: flex;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  cursor: default;
}
.status-badge svg {
  display: block;
}
.status-reviewed {
  background: rgba(184, 168, 146, 0.18);
  color: var(--muted);
  border: 1px solid rgba(184, 168, 146, 0.35);
}
.status-in_progress {
  background: rgba(216, 165, 76, 0.16);
  color: var(--accent);
  border: 1px solid rgba(216, 165, 76, 0.4);
}
.status-rejected {
  background: rgba(201, 106, 76, 0.14);
  color: #e5a58e;
  border: 1px solid rgba(201, 106, 76, 0.4);
}
.status-closed {
  background: rgba(122, 154, 106, 0.14);
  color: var(--ok);
  border: 1px solid rgba(122, 154, 106, 0.4);
}

.status-badge:empty {
  display: none;
}

.status-form {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-form select {
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 4px 8px;
}
.status-save-hint {
  font-size: 0.76rem;
  color: var(--ok);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.status-save-hint.show {
  opacity: 1;
}
.field input[type="file"] {
  background: var(--bg-alt);
  border: 1px dashed var(--card-border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.86rem;
}
.field input[type="file"]::file-selector-button {
  background: linear-gradient(180deg, var(--leather-light), var(--leather));
  color: #201409;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 8px 14px;
  margin-right: 12px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.field input[type="file"]::file-selector-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.5);
}

.msg .meta {
  display: block;
  font-size: 0.72rem;
  color: var(--muted-dim);
  margin-top: 6px;
}
.day-divider {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 10px;
  margin: 6px 0;
  color: var(--muted-dim);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.day-divider::before,
.day-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-image: repeating-linear-gradient(90deg, var(--stitch-color) 0 5px, transparent 5px 9px);
}
.msg-tester {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-bottom-left-radius: 3px;
}
.msg-admin {
  align-self: flex-end;
  background: linear-gradient(180deg, rgba(216,165,76,0.22), rgba(138,90,52,0.18));
  border: 1px solid rgba(216, 165, 76, 0.35);
  border-bottom-right-radius: 3px;
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.composer textarea {
  min-height: 90px;
  resize: vertical;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.table th, .table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--card-border);
}
.table th {
  color: var(--muted-dim);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.inline-form {
  display: inline;
}
.btn-small {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: 7px;
}
.btn-danger {
  background: transparent;
  border: 1px solid rgba(201, 106, 76, 0.4);
  color: #e5a58e;
}
.btn-danger:hover {
  border-color: var(--danger);
}

.credential-box {
  background: var(--bg-alt);
  border: 1px dashed var(--leather-light);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.credential-box code {
  background: rgba(216, 165, 76, 0.15);
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--accent);
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.card h2 {
  font-size: 1.1rem;
}

.help-steps {
  margin: 0;
  padding-left: 1.3em;
  color: var(--muted);
}
.help-steps li {
  margin-bottom: 10px;
  line-height: 1.5;
}
.help-steps li:last-child {
  margin-bottom: 0;
}
.help-steps strong {
  color: var(--cream);
}
.help-steps code {
  background: rgba(216, 165, 76, 0.15);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--accent);
  font-size: 0.9em;
}

.help-platform {
  font-size: 0.98rem;
  color: var(--cream);
  margin: 22px 0 6px;
}
.help-platform:first-of-type {
  margin-top: 4px;
}

.changelog-entry__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.changelog-entry__head h2 {
  margin-bottom: 0;
}
.changelog-entry__meta {
  font-size: 0.82rem;
  color: var(--muted-dim);
  margin-top: 2px;
}
.changelog-entry__body {
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-top: 12px;
  margin-bottom: 0;
}

.agreement-text h3 {
  font-size: 0.98rem;
  color: var(--cream);
  margin: 22px 0 6px;
}
.agreement-text h3:first-of-type {
  margin-top: 4px;
}
.agreement-text p {
  font-size: 0.9rem;
}
.agreement-intro {
  font-size: 0.95rem;
  color: var(--muted);
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--card-border);
  margin-bottom: 4px;
}
.agreement-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--cream);
  cursor: pointer;
}
.agreement-checkbox input {
  margin-top: 3px;
  flex: none;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.faq-item {
  border-top: 1px dashed var(--card-border);
  padding: 14px 0;
}
.faq-item:first-of-type {
  border-top: none;
  padding-top: 4px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--cream);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::before {
  content: '+';
  color: var(--accent);
  font-size: 1.1em;
  width: 1em;
  flex: none;
  transition: transform 0.15s ease;
}
.faq-item[open] summary::before {
  content: '–';
}
.faq-item p {
  margin: 10px 0 0 1.9em;
  font-size: 0.92rem;
}
.faq-item code {
  background: rgba(216, 165, 76, 0.15);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--accent);
  font-size: 0.9em;
}

.screens-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: start;
}
.screen-card {
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin: 0;
}
.screen-card .cap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--muted-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 4px 10px;
  border-bottom: 1px dashed var(--card-border);
  margin-bottom: 12px;
}
.screenshot.props {
  max-height: 520px;
  object-fit: cover;
  object-position: top;
}

/* ---------- workflow: "путь выкройки" ---------- */

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.workflow-card {
  background-color: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin: 0;
  display: flex;
  flex-direction: column;
}
.workflow-card .cap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--cream);
  font-weight: 600;
  padding: 0 2px 10px;
  border-bottom: 1px dashed var(--card-border);
  margin-bottom: 12px;
}
.step-num {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: #201409;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.workflow-shot {
  height: 190px;
  object-fit: cover;
  object-position: top;
}

.lightbox-trigger {
  cursor: zoom-in;
  transition: filter 0.15s ease;
}
.lightbox-trigger:hover {
  filter: brightness(1.08);
}
.workflow-card figcaption {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted-dim);
  line-height: 1.5;
}

/* ---------- join / recruit testers ---------- */

.join-card {
  padding: 40px;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}
.join-card h2 {
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
}
.join-card .eyebrow {
  margin-bottom: 18px;
}
.join-card p {
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}
.join-card .muted-small {
  font-size: 0.85rem;
  color: var(--muted-dim);
  margin-bottom: 26px;
}

/* ---------- why LeatherDraft ---------- */

.why-card {
  background-image: linear-gradient(180deg, rgba(10, 7, 5, 0.55), rgba(10, 7, 5, 0.72)), url('/img/buttons/btn-black.jpg');
  background-size: cover;
  background-position: center;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 44px 40px;
  box-shadow: var(--shadow);
}
.why-card .section-head {
  margin-bottom: 30px;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px 32px;
}
.why-item {
  padding-left: 16px;
  border-left: 2px solid rgba(216, 165, 76, 0.4);
}
.why-item h3 {
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--cream);
}
.why-item p {
  font-size: 0.88rem;
  margin: 0;
}
.why-item code {
  background: rgba(216, 165, 76, 0.15);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--accent);
  font-size: 0.9em;
}

@media (max-width: 860px) {
  .screens-grid {
    grid-template-columns: 1fr;
  }
  .workflow-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .why-card {
    padding: 32px 26px;
  }
}
@media (max-width: 560px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .workflow-grid {
    grid-template-columns: 1fr;
  }
  .why-grid {
    grid-template-columns: 1fr;
  }
  .join-card {
    padding: 28px 20px;
  }
  .nav-links span.hide-mobile {
    display: none;
  }
  .brand-hero {
    gap: 12px;
  }
  .brand-hero .mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .brand-hero .word {
    font-size: 1.5rem;
  }
}

/* ---------- public tool guide (/guide) ---------- */

.guide-nav {
  padding: 22px 0;
}

.guide-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
  padding: 30px 0 80px;
}

.guide-toc {
  position: sticky;
  top: 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 14px;
  font-size: 0.88rem;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.guide-toc__home {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  color: var(--cream);
  text-decoration: none;
  padding: 7px 9px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 0.95rem;
}
.guide-toc__home:hover {
  background: rgba(255, 255, 255, 0.04);
}
.guide-toc__home.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}
.guide-toc__group {
  margin-bottom: 16px;
}
.guide-toc__group:last-child {
  margin-bottom: 0;
}
.guide-toc__group-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-dim);
  padding: 0 9px;
  margin-bottom: 6px;
}
.guide-toc__link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  line-height: 1.3;
}
/* `display: flex` выше перебивает базовый `[hidden]{display:none}` браузера
   (собственные правила автора всегда сильнее пользовательских стилей) —
   без этого поиск по справке (`guide-search.js`) визуально не прятал пункты,
   которые сам же честно помечал `hidden` в DOM. */
.guide-toc__link[hidden],
.guide-toc__group[hidden] {
  display: none;
}
a.guide-toc__link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
}
.guide-toc__link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}
.guide-toc__link.is-soon {
  color: var(--muted-dim);
  cursor: default;
  opacity: 0.55;
}
.guide-toc__icon {
  flex: none;
  display: flex;
}
.guide-toc__icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  display: block;
}
.guide-toc__label {
  flex: 1;
}
.guide-toc__badge {
  flex: none;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-dim);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 1px 6px;
}

/* ---------- guide search: riveted leather tab over the TOC ---------- */

.guide-search {
  position: relative;
  margin-bottom: 12px;
  padding: 5px;
  border-radius: 10px;
  /* same brass-rivet trick as .screen-card/.blueprint-frame, four corners */
  background-color: var(--bg-alt);
  background-image:
    radial-gradient(circle at center, #f0c878 0%, #8a5a34 55%, transparent 60%),
    radial-gradient(circle at center, #f0c878 0%, #8a5a34 55%, transparent 60%),
    radial-gradient(circle at center, #f0c878 0%, #8a5a34 55%, transparent 60%),
    radial-gradient(circle at center, #f0c878 0%, #8a5a34 55%, transparent 60%);
  background-repeat: no-repeat;
  background-size: 7px 7px;
  background-position:
    7px 7px,
    calc(100% - 7px) 7px,
    7px calc(100% - 7px),
    calc(100% - 7px) calc(100% - 7px);
}
.guide-search::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 7px;
  border: 1.4px dashed var(--stitch-color);
  pointer-events: none;
}
.guide-search__icon {
  position: absolute;
  left: 17px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  color: var(--muted-dim);
  pointer-events: none;
}
.guide-search__input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--cream);
  font-family: inherit;
  font-size: 0.86rem;
  padding: 8px 10px 8px 34px;
}
.guide-search__input::placeholder {
  color: var(--muted-dim);
}
/* clear (x) button on WebKit/Blink — match the leather palette, not default blue */
.guide-search__input::-webkit-search-cancel-button {
  filter: sepia(1) saturate(3) hue-rotate(-10deg);
  cursor: pointer;
}
.guide-search__empty {
  font-size: 0.82rem;
  color: var(--muted-dim);
  padding: 4px 9px 12px;
  margin: 0;
}

.guide-content {
  min-width: 0;
  max-width: 780px;
}
.guide-eyebrow {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.guide-hotkey {
  display: inline-block;
  background: rgba(216, 165, 76, 0.15);
  color: var(--accent);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 0.72rem;
  letter-spacing: 0;
  margin-left: 4px;
}
.guide-content h1 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin-bottom: 14px;
}
.guide-content h2 {
  font-size: 1.2rem;
  margin: 34px 0 12px;
}
.guide-lead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 68ch;
}
.guide-note {
  font-size: 0.88rem;
  color: var(--muted-dim);
  background: rgba(255, 255, 255, 0.02);
  border-left: 2px solid var(--accent);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin: 18px 0;
}
.guide-note code {
  background: rgba(216, 165, 76, 0.15);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--accent);
  font-size: 0.9em;
}
.guide-note a {
  color: var(--leather-light);
}

.guide-shot {
  margin: 24px 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.guide-shot__cap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--muted-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 4px 10px;
  border-bottom: 1px dashed var(--card-border);
  margin-bottom: 12px;
}
.guide-shot img {
  display: block;
  width: 100%;
  border-radius: 8px;
}

.guide-props {
  margin: 14px 0 26px;
}
.guide-props dt {
  color: var(--cream);
  font-weight: 600;
  margin-top: 14px;
  font-size: 0.95rem;
}
.guide-props dt:first-of-type {
  margin-top: 0;
}
.guide-props dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
.guide-props dd code,
.guide-content code {
  background: rgba(216, 165, 76, 0.15);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--accent);
  font-size: 0.9em;
}
.guide-props dd a,
.guide-content p a {
  color: var(--leather-light);
}

.guide-index-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 30px;
}
.guide-index-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.guide-index-card:hover {
  border-color: var(--leather-light);
  transform: translateY(-2px);
}
.guide-index-card__icon {
  color: var(--accent);
  filter: drop-shadow(0 0 6px rgba(216, 165, 76, 0.3));
}
.guide-index-card__icon svg {
  width: 26px;
  height: 26px;
  display: block;
  stroke: currentColor;
}
.guide-index-card__title {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--cream);
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
}
.guide-index-card__key {
  margin-left: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.68rem;
  color: var(--muted-dim);
  border: 1px solid var(--card-border);
  border-radius: 5px;
  padding: 1px 6px;
}
.guide-index-card__summary {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.guide-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
}
.guide-pager__link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  padding: 12px 16px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  max-width: 48%;
  transition: border-color 0.15s ease;
}
.guide-pager__link:hover {
  border-color: var(--leather-light);
}
.guide-pager__next {
  text-align: right;
  margin-left: auto;
}
.guide-pager__dir {
  font-size: 0.7rem;
  color: var(--muted-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.guide-pager__title {
  color: var(--cream);
  font-weight: 600;
}

@media (max-width: 860px) {
  .guide-shell {
    grid-template-columns: 1fr;
  }
  .guide-toc {
    position: static;
    max-height: none;
  }
  .guide-content {
    max-width: none;
  }
}
@media (max-width: 560px) {
  .guide-index-grid {
    grid-template-columns: 1fr;
  }
  .guide-pager {
    flex-direction: column;
  }
  .guide-pager__link {
    max-width: none;
  }
}
