/*
Theme Name: GemRap
Theme URI: https://gemrap.com
Author: GemRap, LLC
Description: Light custom theme for GemRap (Atelier design). No page builder, no jQuery.
Version: 0.1.0
Requires PHP: 8.0
Text Domain: gemrap
*/

:root {
  --red: #A3192B;
  --red-dark: #7E1220;
  --red-deep: #8A1424;
  --ink: #1C1A19;
  --ink-2: #3D3833;
  --muted: #5E5852;
  --muted-2: #6B6560;
  --line: #E7E2DC;
  --line-2: #D6CFC7;
  --paper: #F5F3F0;
  --paper-2: #FBFAF8;
  --panel: #FAF8F6;
  --stone: #EFEAE4;
  --dark: #1E1A19;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Keep room for the scrollbar so short pages (Contact) don't shift the header sideways. */
html:not(:has(body.gr-embed)) { scrollbar-gutter: stable; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; display: flex; flex-direction: column; min-height: 100vh; }
img { max-width: 100%; height: auto; }
a { color: var(--red); }
a:hover { color: var(--red-dark); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* Header */
.site-header { background: #fff; }
.brand-row { padding: 20px 24px 16px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-word { font-family: var(--serif); font-size: 40px; font-weight: 600; line-height: 1; }
.brand-word span, .brand-word sup { color: var(--red); }
.brand-word sup { font-size: 14px; }
.slogan { font-family: var(--serif); font-size: 14px; letter-spacing: 4px; text-transform: uppercase; color: var(--ink-2); }
.tagline { font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.site-header.compact .brand-row { padding: 14px 24px; }
.site-header.compact .brand-word { font-size: 30px; }
.site-header.compact .slogan, .site-header.compact .tagline { display: none; }

.main-nav { background: var(--red); }
.main-nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nav-links { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.nav-links a { color: #fff; text-decoration: none; font-size: 14px; font-weight: 500; padding: 0 18px; min-height: 48px; display: flex; align-items: center; }
.nav-links a:hover { background: var(--red-deep); color: #fff; }
.nav-links a[aria-current="page"] { font-weight: 600; box-shadow: inset 0 -3px 0 #fff; }
.nav-login { color: #fff; text-decoration: none; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; padding: 0 14px; min-height: 34px; }
.nav-login:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Hero + lookup */
.hero { position: relative; background: var(--dark); overflow: hidden; }
.hero svg.facets { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; max-width: 940px; margin: 0 auto; padding: 56px 24px 140px; text-align: center; color: #fff; }
.eyebrow { margin: 0 0 10px; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: #E7B8BE; font-weight: 600; }
.hero h1 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 44px; line-height: 1.1; }
.hero p.lede { margin: 12px auto 0; font-size: 16px; color: #CFC8C2; max-width: 560px; }

.lookup-wrap { position: relative; max-width: 940px; margin: -104px auto 0; padding: 0 24px; }
.lookup-card { background: #fff; border-radius: 12px; box-shadow: 0 24px 60px rgba(30,26,25,.18), 0 2px 6px rgba(30,26,25,.06); display: flex; flex-wrap: wrap; overflow: hidden; }
.lookup-form { flex: 1 1 380px; min-width: 0; padding: 40px; display: flex; flex-direction: column; gap: 18px; }
.lookup-form h2 { margin: 0; font-size: 20px; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea { font: inherit; font-size: 16px; padding: 13px 14px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); width: 100%; }
.field input::placeholder { color: #8A847E; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--muted); }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--red); flex: none; }
.btn { font: inherit; font-weight: 600; font-size: 15px; background: var(--red); color: #fff; border: 0; border-radius: 8px; min-height: 50px; padding: 0 22px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { background: var(--red-dark); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid #D9D2CA; color: var(--ink); font-weight: 500; }
.btn-ghost:hover { background: #fff; color: var(--ink); }
.notice { border-radius: 8px; padding: 12px 14px; font-size: 14px; }
.notice.error { background: #F6EDEE; color: var(--red-dark); }
.notice.info { background: var(--panel); color: var(--ink-2); border: 1px solid var(--line); }

.lookup-help { flex: 1 1 300px; min-width: 0; padding: 40px; background: var(--panel); border-left: 1px solid #EAE5DF; display: flex; flex-direction: column; gap: 22px; font-size: 14px; color: var(--ink-2); }
.lookup-help h3, .label-sm { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted-2); }
.lookup-help p { margin: 0; }
.sample-link { text-decoration: none; color: var(--ink); background: #fff; border: 1px solid #EAE5DF; border-radius: 10px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sample-link:hover { border-color: var(--line-2); color: var(--ink); }
.sample-link strong { display: block; font-weight: 600; }

.features { list-style: none; margin: 0; padding: 28px 0 56px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 36px; font-size: 14px; color: var(--muted); }
.features li { display: flex; align-items: center; gap: 8px; }

/* Generic page */
.page-head { background: var(--dark); color: #fff; }
.page-head .wrap { padding-top: 40px; padding-bottom: 40px; }
.page-head h1 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 1.1; }
.page-body { padding: 40px 0 64px; flex: 1; }
.prose { max-width: 760px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 40px; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
.prose h2 { font-size: 28px; } .prose h3 { font-size: 22px; }
.prose img { border-radius: 8px; }
.prose table { border-collapse: collapse; width: 100%; }
.prose td, .prose th { border: 1px solid var(--line); padding: 8px; }

/* Members directory */
.dir-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 20px; }
.dir-tools .field { flex: 1 1 260px; }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.member { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.member[hidden] { display: none; }
.member h2 { margin: 0 0 4px; font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.2; }
.member p { margin: 0; color: var(--muted); font-size: 15px; }
.member .actions { display: flex; gap: 16px; margin-top: 8px; font-size: 15px; font-weight: 500; flex-wrap: wrap; }
.member .actions a { min-height: 44px; display: inline-flex; align-items: center; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.card h2 { margin: 0 0 12px; font-family: var(--serif); font-size: 24px; font-weight: 600; }
.map-frame { width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: 12px; background: var(--stone); }

/* Report viewer */
.report { background: var(--paper-2); flex: 1; }
.report-main { padding-top: 32px; padding-bottom: 64px; }
.report-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.report-head h1 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 48px; line-height: 1; word-break: break-all; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: #F6EDEE; color: var(--red-dark); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; }
.report-grid { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.report-media { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.report-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.tabs { display: inline-flex; align-self: flex-start; background: #F1EDE8; border-radius: 999px; padding: 4px; gap: 4px; }
.tabs button { font: inherit; font-size: 14px; font-weight: 500; border: 0; border-radius: 999px; padding: 10px 18px; min-height: 44px; cursor: pointer; background: transparent; color: var(--muted); }
.tabs button[aria-selected="true"] { font-weight: 600; background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
[role=tabpanel][hidden] { display: none !important; }

.stage { position: relative; aspect-ratio: 4 / 3; background: var(--stone); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.slides { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slides figure { flex: 0 0 100%; margin: 0; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; background: #fff; }
.slides img { width: 100%; height: 100%; object-fit: contain; }
.stage .count { position: absolute; top: 12px; right: 12px; background: rgba(28,26,25,.72); color: #fff; font-size: 12px; border-radius: 999px; padding: 4px 10px; }
.round-btn { position: absolute; width: 44px; height: 44px; border-radius: 999px; border: 1px solid #D9D2CA; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.round-btn.fs { right: 16px; bottom: 16px; }
.round-btn.prev { left: 12px; top: 50%; transform: translateY(-50%); }
.round-btn.next { right: 12px; top: 50%; transform: translateY(-50%); }
.thumbs { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button { flex: 0 0 84px; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 0; overflow: hidden; cursor: pointer; }
.thumbs button[aria-current="true"] { border: 2px solid var(--red); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

.spin { position: relative; aspect-ratio: 4 / 3; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.spin.dragging { cursor: grabbing; }
.spin img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.spin .hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(28,26,25,.72); color: #fff; font-size: 12px; border-radius: 999px; padding: 6px 12px; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.spin .loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted-2); font-size: 14px; background: var(--stone); }
.spin-range { width: 100%; accent-color: var(--red); }

.details dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 14px 20px; font-size: 15px; }
.details dt { color: var(--muted-2); }
.details dd { margin: 0; font-weight: 500; text-align: right; word-break: break-word; }

dialog.lightbox { padding: 0; border: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: rgba(20,18,17,.96); }
dialog.lightbox img { width: 100%; height: 100%; object-fit: contain; }
dialog.lightbox .round-btn { top: 16px; right: 16px; }

/* Footer */
.site-footer { background: var(--dark); color: #CFC8C2; margin-top: auto; }
.site-footer .wrap { padding-top: 22px; padding-bottom: 22px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.site-footer a { color: #CFC8C2; }
.site-footer a:hover { color: #fff; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }

/* Phone */
@media (max-width: 640px) {
  .brand-word { font-size: 32px; }
  .site-header.compact .brand-row { padding: 10px 16px; }
  .site-header.compact .brand-word { font-size: 26px; }
  .nav-links a { padding: 0 12px; }
  .main-nav .wrap { padding: 0 4px; }
  .nav-login { margin: 0 12px 8px; }
  .hero-inner { padding: 40px 16px 120px; }
  .hero h1 { font-size: 34px; }
  .lookup-wrap { padding: 0 16px; }
  .lookup-form, .lookup-help { padding: 24px; }
  .lookup-help { border-left: 0; border-top: 1px solid #EAE5DF; }
  .wrap, .wrap-wide { padding: 0 16px; }
  .prose { padding: 24px; }
  .page-head h1 { font-size: 32px; }
  .report-main { padding-top: 16px; }
  .report-head { margin-bottom: 20px; }
  .report-head h1 { font-size: 36px; }
  .report-media { margin: 0 -16px; }
  .stage, .spin { border-radius: 0; border-left: 0; border-right: 0; aspect-ratio: 1; }
  .tabs { align-self: stretch; margin: 0 16px; display: grid; grid-template-columns: 1fr 1fr; }
  .thumbs { padding: 0 16px 4px; }
  .thumbs button { flex-basis: 64px; }
  .round-btn.prev, .round-btn.next { display: none; }
  .spin-wrap-range { padding: 0 16px; }
}

@media print {
  .site-header .main-nav, .tabs, .thumbs, .site-footer, .round-btn, .no-print { display: none !important; }
  body { background: #fff; }
}

/* v0.2 zoom + 360 controls */
[hidden] { display: none !important; }
.zoomable { overflow: hidden; touch-action: pan-y; }
.zoomable img { transform-origin: 0 0; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; will-change: transform; }
.photo-stage { background: #fff; cursor: zoom-in; outline-offset: 3px; }
.photo-stage img { width: 100%; height: 100%; object-fit: contain; display: block; }
.photo-stage.zoomed, .spin.zoom-mode.zoomed, .lb-vp.zoomed { cursor: grab; }
.zoom-ctl { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 8px; align-items: center; z-index: 2; }
.zoom-ctl .round-btn { position: static; transform: none; }
.round-btn { z-index: 2; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.round-btn:disabled { opacity: .45; cursor: default; }
.spin img { transform-origin: 0 0; }
.spin.zoom-mode { cursor: zoom-in; }
.spin-controls { display: flex; align-items: center; gap: 12px; }
.spin-controls .spin-range { flex: 1; min-width: 0; }
.ctl-btn, .pill-btn { font: inherit; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid #D9D2CA; background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
.ctl-btn:hover, .pill-btn:hover { border-color: #BFB6AC; }
.ctl-btn[data-spin-zoom][aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.ctl-btn[data-spin-play] .i-play { display: none; }
.ctl-btn[data-spin-play][aria-pressed="false"] .i-play { display: inline; }
.ctl-btn[data-spin-play][aria-pressed="false"] .i-pause { display: none; }
.lb-vp { position: absolute; inset: 0; }
.lb-vp img { width: 100%; height: 100%; object-fit: contain; display: block; }
dialog.lightbox .lb-close { position: absolute; top: 16px; right: 16px; left: auto; bottom: auto; transform: none; }
@media (max-width: 640px) {
  .spin-controls { padding: 0 16px; }
  .ctl-btn { padding: 0 12px; }
  .zoom-ctl { right: 12px; bottom: 12px; }
}

/* v0.2.2 frames follow image shape */
.stage, .spin { max-height: min(78vh, 760px); }
@media (max-width: 640px) { .stage, .spin { max-height: 70vh; } }

/* v0.2.3: fixed-size play/pause */
.ctl-btn[data-spin-play] { width: 104px; justify-content: center; padding: 0; }
@media (max-width: 640px) { .ctl-btn[data-spin-play] { width: 96px; } }

/* v0.3: member area */
.account { flex: 1; background: var(--paper-2); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.acct-login { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 56px 16px 72px; }
.login-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; padding: 36px; }
.login-card h1 { margin: -8px 0 0; font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 1.1; }
.login-card p { margin: 0; }
.login-card .label-sm { margin: 0; }
.acct-main { padding-top: 24px; padding-bottom: 72px; }
.acct-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; font-size: 14px; }
.acct-bar .back { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; min-height: 44px; }
.acct-bar .who { color: var(--muted); }
.acct-bar form { margin: 0; }
.link-btn { font: inherit; font-size: 14px; font-weight: 500; background: none; border: 0; color: var(--red); cursor: pointer; min-height: 44px; padding: 0; }
.link-btn:hover { color: var(--red-dark); text-decoration: underline; }
.acct-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.acct-head h1 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 44px; line-height: 1.05; word-break: break-all; }
.acct-head .label-sm { margin: 0 0 4px; }
.acct-search { display: flex; gap: 8px; margin-bottom: 16px; max-width: 520px; }
.acct-search input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 0 14px; min-height: 50px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; }
.card.empty { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.card.empty p { margin: 0 0 8px; }
.acct-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.acct-list li + li { border-top: 1px solid var(--line); }
.acct-row { display: flex; align-items: center; gap: 16px; padding: 12px 20px 12px 12px; text-decoration: none; color: var(--ink); }
.acct-row:hover { background: var(--panel); color: var(--ink); }
.acct-row .thumb { width: 56px; height: 56px; flex: none; border-radius: 10px; background: var(--stone); overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--muted-2); }
.acct-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.acct-row .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.acct-row .meta strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-row .meta span { font-size: 13px; color: var(--muted); }
.acct-row .go { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; color: var(--red); }

.editor-grid { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.ed-media { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.ed-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.ed-media h2, .ed-side h2 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 600; }
.ed-details, .danger { display: flex; flex-direction: column; gap: 14px; }
.danger p { margin: 0; }
.drop { border: 2px dashed var(--line-2); border-radius: 14px; background: var(--panel); padding: 32px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; cursor: pointer; color: var(--muted-2); transition: background .15s, border-color .15s; }
.drop strong { color: var(--ink); font-size: 16px; font-weight: 600; }
.drop span { font-size: 13px; color: var(--muted); max-width: 440px; }
.drop:hover, .drop.over { border-color: var(--red); background: #FBF4F5; }
.drop:focus-within { outline: 2px solid var(--red); outline-offset: 2px; }
.queue { display: flex; flex-direction: column; gap: 8px; }
.queue[hidden] { display: none; }
.q-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 140px; gap: 12px; align-items: center; font-size: 13px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.q-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-bar { height: 6px; border-radius: 99px; background: var(--stone); overflow: hidden; }
.q-bar span { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s; }
.q-status { color: var(--muted); text-align: right; }
.q-row.ok .q-status { color: #2F6B3A; }
.q-row.bad { border-color: #E8C5CA; background: #FBF4F5; }
.q-row.bad .q-status { color: var(--red-dark); }
.ed-sec { display: flex; flex-direction: column; gap: 12px; }
.ed-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.ed-sec-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.ed-sec p { margin: 0; }
.ed-sec p[hidden] { display: none; }
.ph-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--stone); cursor: grab; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.ph.dragging { opacity: .4; }
.ph.removing { opacity: .4; pointer-events: none; }
.ph .cover { position: absolute; left: 8px; bottom: 8px; background: rgba(28,26,25,.75); color: #fff; font-size: 11px; font-weight: 600; border-radius: 99px; padding: 3px 8px; }
.ph-del { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 99px; border: 0; background: rgba(255,255,255,.92); color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.ph-del:hover { background: #fff; color: var(--red); }
.spin-card { display: flex; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.spin-card[hidden] { display: none; }
.spin-card img { width: 120px; aspect-ratio: 4 / 3; object-fit: contain; background: var(--stone); border-radius: 8px; flex: none; }
.spin-card img:not([src]) { display: none; }
.spin-card > div { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.link-danger { font: inherit; font-size: 13px; font-weight: 500; background: none; border: 0; padding: 0; margin-top: 6px; color: var(--red); cursor: pointer; min-height: 32px; }
.link-danger:hover { text-decoration: underline; }
.saved { margin: 0; color: #2F6B3A; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.saved[hidden] { display: none; }
.btn[disabled] { opacity: .6; cursor: default; }
.btn-danger { background: var(--red); }
.confirm-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.confirm-row[hidden], .btn[hidden], .notice[hidden] { display: none; }
@media (max-width: 640px) {
  .acct-head h1 { font-size: 34px; }
  .acct-head .btn { width: 100%; }
  .q-row { grid-template-columns: minmax(0, 1fr) 90px; }
  .q-status { grid-column: 1 / -1; text-align: left; }
  .ph-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .login-card { padding: 24px; }
}

/* v0.5: real logo, centered nav, self-hosted fonts, page polish, viewer upgrades */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: block; src: url(assets/fonts/inter.woff2) format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 500 600; font-display: block; src: url(assets/fonts/cormorant.woff2) format('woff2'); }

.brand-row { padding: 18px 24px 16px; }
.brand { display: block; line-height: 0; }
.brand img { width: 300px; height: auto; display: block; }
.site-header.compact .brand-row { padding: 10px 24px; }
.site-header.compact .brand img { width: 190px; }

.main-nav { display: flex; justify-content: center; }
.nav-links { justify-content: center; gap: 0 28px; }
.nav-links a { padding: 0 20px; letter-spacing: .2px; }

.page-head .head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.head-btn { color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; padding: 0 18px; min-height: 44px; }
.head-btn:hover { background: rgba(255,255,255,.1); color: #fff; border-color: #fff; }

/* Text pages: one centered column, title lined up with the text */
.wrap-read { max-width: 960px; }
.prose { max-width: none; margin: 0 auto; padding: 48px 56px; font-size: 16px; line-height: 1.7; color: var(--ink-2); }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin: .3em 0; }
.prose strong { color: var(--ink); }
.prose img.alignright, .prose .alignright { float: right; margin: 4px 0 20px 32px; max-width: 42%; height: auto; }
.prose img.alignleft, .prose .alignleft { float: left; margin: 4px 32px 20px 0; max-width: 42%; height: auto; }
.prose img.aligncenter { display: block; margin: 24px auto; }
.prose::after { content: ""; display: table; clear: both; }
.prose a.btn { color: #fff; text-decoration: none; }

/* Hero subtitle stays on one line where there is room */
.hero p.lede { max-width: none; }
@media (min-width: 700px) { .hero p.lede { white-space: nowrap; } }

/* Home: lookup help panel centred vertically now that it is shorter */
.lookup-help { justify-content: center; }

/* Home: how it works, why, pro band */
.section-title { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 36px; line-height: 1.15; color: var(--ink); }
.how { padding: 24px 0 64px; }
.how .section-title { text-align: center; margin-bottom: 36px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.steps li { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.step-no { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 999px; border: 1px solid var(--red); color: var(--red); font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1; }
.steps h3 { margin: 16px 0 6px; font-size: 17px; font-weight: 600; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; }
.why { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 64px 0; }
.why-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.why-copy .label-sm { margin-bottom: 10px; }
.why-copy p:last-child { margin: 16px 0 0; color: var(--muted); }
.why-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.why-list li { display: flex; gap: 14px; align-items: flex-start; color: var(--muted); font-size: 15px; }
.why-list svg { flex: none; color: var(--red); margin-top: 3px; }
.why-list strong { display: block; color: var(--ink); font-weight: 600; font-size: 16px; }
.pro-band { background: var(--dark); color: #fff; padding: 44px 0; }
.pro-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.pro-band h2 { margin: 0 0 6px; font-family: var(--serif); font-weight: 500; font-size: 30px; }
.pro-band p { margin: 0; color: #CFC8C2; }
.pro-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-ghost-light { background: transparent; border: 1px solid rgba(255,255,255,.45); color: #fff; }
.btn-ghost-light:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Report viewer: fixed photo frame + slide */
.photo-stage { aspect-ratio: 4 / 3; }
.photo-stage img { position: relative; z-index: 1; background: #fff; }
.photo-stage .slide-ghost { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; pointer-events: none; }
.photo-stage .count, .photo-stage .round-btn, .photo-stage .zoom-ctl { z-index: 3; }

/* 360 controls: matching buttons + infinite wheel */
.ctl-btn[data-spin-play], .ctl-btn[data-spin-zoom] { width: 112px; padding: 0; justify-content: center; flex: none; }
.jog { position: relative; flex: 1; min-width: 0; height: 44px; border-radius: 999px; border: 1px solid #D9D2CA; background-color: #fff; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  background-image: repeating-linear-gradient(90deg, #B8AEA4 0 1.5px, transparent 1.5px 50px), repeating-linear-gradient(90deg, #DDD6CE 0 1px, transparent 1px 10px);
  background-size: 50px 18px, 10px 10px; background-repeat: repeat-x;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
.jog { background-position: 0 50%; }
.jog.dragging { cursor: grabbing; }
.jog-mark { position: absolute; left: 50%; top: 7px; bottom: 7px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--red); }
.jog:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.call-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; min-height: 44px; text-decoration: none; }
.call-link:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; gap: 12px; }
  .steps li { padding: 20px 22px; display: grid; grid-template-columns: 36px 1fr; column-gap: 16px; }
  .steps li .step-no { grid-row: span 2; }
  .steps h3 { margin: 4px 0 4px; }
  .why-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  .brand img { width: 230px; }
  .site-header.compact .brand img { width: 150px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 0 14px; }
  .main-nav .wrap { padding: 0; }
  .prose { padding: 24px 20px; }
  .prose img.alignright, .prose img.alignleft, .prose .alignright, .prose .alignleft { float: none; display: block; max-width: 100%; margin: 16px auto; }
  .section-title { font-size: 30px; }
  .how { padding: 8px 0 48px; }
  .why { padding: 48px 0; }
  .pro-actions, .pro-actions .btn { width: 100%; }
  .photo-stage { aspect-ratio: 1; }
  .ctl-btn[data-spin-play], .ctl-btn[data-spin-zoom] { width: 96px; }
  .head-btn { min-height: 40px; }
}

/* v0.5.2: equal-width nav cells so the middle item sits exactly on the page center */
.nav-links { display: grid; grid-template-columns: repeat(3, 176px); gap: 0 16px; justify-content: center; }
.nav-links a { justify-content: center; padding: 0 8px; white-space: nowrap; }
@media (max-width: 640px) { .nav-links { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; width: 100%; } .nav-links a { padding: 0 4px; font-size: 14px; } }

/* v0.5.3: centered single login card, small sample link under it */
.lookup-wrap { max-width: 520px; padding-bottom: 56px; display: flex; flex-direction: column; align-items: center; }
.lookup-card { width: 100%; display: block; }
.lookup-form { padding: 36px 40px 40px; }
.lookup-form h2 { text-align: center; }
.form-hint { margin: -8px 0 0; text-align: center; font-size: 13px; color: var(--muted-2); }
.sample-chip { margin-top: 18px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; }
.sample-chip strong { color: var(--ink); font-weight: 600; }
.sample-chip svg { color: var(--red); }
.sample-chip:hover { border-color: var(--line-2); color: var(--ink); }
@media (max-width: 640px) { .lookup-form { padding: 24px; } .lookup-wrap { padding-bottom: 40px; } }

/* v0.5.4: quiet page transitions and load-in */
@view-transition { navigation: auto; }
.site-header { view-transition-name: gr-header; }
.main-nav { view-transition-name: gr-nav; }
.site-footer { view-transition-name: gr-footer; }
::view-transition-old(root) { animation: gr-out .18s ease-in both; }
::view-transition-new(root) { animation: gr-in .32s cubic-bezier(.2,.7,.2,1) both; }
@keyframes gr-out { to { opacity: 0; } }
@keyframes gr-in { from { opacity: 0; } }
@keyframes gr-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.hero-inner > *, .page-head .wrap > *, .lookup-card, .sample-chip, .why-grid > *, .page-body, .report-head, .report-grid, .account > * {
	animation: gr-rise .7s cubic-bezier(.2,.7,.2,1) both;
}
.hero-inner > :nth-child(2), .page-head .wrap > :nth-child(2) { animation-delay: .06s; }
.hero-inner > :nth-child(3), .report-grid { animation-delay: .12s; }
.lookup-card, .page-body, .account > :nth-child(2) { animation-delay: .16s; }
.sample-chip { animation-delay: .28s; }
.why-grid > :first-child { animation-delay: .34s; }
.why-grid > :last-child { animation-delay: .42s; }
@media (prefers-reduced-motion: reduce) {
	*, ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}

/* v0.5.5: report layout: side cards line up with the image box, one strip height under photos and 360 */
:root { --strip: 84px; }
.head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.print-btn { min-height: 40px; padding: 0 16px; font-size: 14px; gap: 8px; }
.thumbs { gap: 12px; padding-bottom: 0; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumbs button { flex: 0 0 var(--strip); height: var(--strip); aspect-ratio: auto; border-radius: 10px; }
.spin-controls { height: var(--strip); }
.report-side.aligned { margin-top: var(--side-top, 0); min-height: var(--side-h, 0); height: var(--side-h, auto); }
.report-side.aligned > :last-child { flex: 1 0 auto; }
.report-side .card { padding: 22px 24px; }
.report-side .card h2 { font-size: 22px; }
.details dl { gap: 10px 20px; }
.appraiser { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.appraiser .call-link { margin-top: auto; }
.appraiser-logo { display: block; max-width: 180px; max-height: 64px; width: auto; height: auto; object-fit: contain; }
@media (max-width: 640px) {
  :root { --strip: 64px; }
  .thumbs button { flex-basis: var(--strip); }
  .head-actions { width: 100%; justify-content: space-between; }
}
.acct-head-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.acct-bar-right { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.acct-bar-right a.link-btn { text-decoration: none; }
.acct-bar-right .link-btn { display: inline-flex; align-items: center; line-height: 1; }
.acct-bar-right form { display: flex; }
.gr-preview { width: min(1040px, 94vw); height: min(900px, 92vh); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: var(--bg, #FAF8F6); box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.gr-preview[open] { display: flex; flex-direction: column; }
.gr-preview::backdrop { background: rgba(24,18,14,.6); }
.gr-preview-bar { display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); background: #fff; }
.gr-preview-bar .link-btn { margin-left: auto; }
.gr-preview iframe { flex: 1; width: 100%; border: 0; display: block; }
body.gr-embed > :not(main):not(script):not(style):not(link) { display: none !important; }
html:has(body.gr-embed) { margin-top: 0 !important; }
.gr-embed .report-main { padding-top: 20px; padding-bottom: 20px; }
.gr-embed .report-main > p.no-print, .gr-embed .report-head, .gr-embed .report-side { display: none !important; }
.gr-embed .report-grid { grid-template-columns: 1fr; }
html:has(body.gr-embed), body.gr-embed { overflow: hidden; height: 100%; }
.gr-embed .report-main { padding-top: 16px; padding-bottom: 0; }
.gr-embed .report-grid { margin-top: 0; }
.gr-embed .photo-stage, .gr-embed .spin { aspect-ratio: auto !important; width: 100%; height: max(220px, calc(100vh - 220px)); }
.acct-bar-right a.link-btn:hover, .acct-bar-right a[aria-current] { text-decoration: underline; }
.profile-card { margin-bottom: 28px; }
.profile-dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 12px 0 14px; }
.profile-dl dt { color: var(--muted, #6b625a); }
.profile-dl dd { margin: 0; }
.profile-sub { font-size: 22px; margin: 0 0 14px; }
.brand-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.brand-card h2 { margin-bottom: 4px; }
.brand-card > p { margin: 0; }
.brand-prev { height: 140px; border: 1px dashed var(--line-2); border-radius: 12px; display: flex; align-items: center; justify-content: center; padding: 12px; margin: 16px 0; text-align: center; }
.brand-prev.wm { background: repeating-conic-gradient(#EFEBE6 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.brand-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.brand-form p { margin: 0; }
.brand-card .link-btn { margin-top: 8px; }
.ph-grid.locked .ph { cursor: default; }
.acct-locked { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 20px; }
@media (max-width: 760px) { .brand-grid { grid-template-columns: 1fr; } }

/* Certificates (Superior Gemological Laboratory) */
.certs .cert-note { margin-bottom: 16px; }
.certs .cert-note ul { margin: 6px 0 0; padding-left: 18px; }
.cert-up { padding: 20px; margin-bottom: 24px; }
.cert-picked { margin: 12px 0 0; color: var(--ink-2); }
.cert-up-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-top: 16px; }
.cert-up-row .check { margin: 0; }
.cert-count { margin: -6px 0 12px; }
.cert-row { display: flex; align-items: center; gap: 16px; padding: 12px 20px 12px 12px; }
.cert-row .thumb { width: 48px; height: 48px; flex: none; border-radius: 10px; background: var(--stone); display: flex; align-items: center; justify-content: center; color: var(--muted-2); }
.cert-row .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cert-row .meta strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cert-row .meta span { font-size: 13px; color: var(--muted); }
.cert-pdf { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--red); }
.cert-acts { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; justify-content: flex-end; }
.cert-acts form { margin: 0; }
.cert-acts .link-btn, .cert-preview .gr-preview-bar .link-btn { display: inline-flex; align-items: center; line-height: 1; text-decoration: none; }
.cert-acts .link-btn:hover, .cert-preview .gr-preview-bar .link-btn:hover { text-decoration: underline; }
.cert-acts .link-danger { margin: 0; min-height: 44px; font-size: 14px; }
.btn.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.cert-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: var(--stone); overflow: auto; }
.cert-stage img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.cert-stage iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.cert-preview .gr-preview-bar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cert-preview .gr-preview-bar [data-cert-open] { margin-left: auto; }
.cert-preview .gr-preview-bar [data-cert-close] { margin-left: 0; }
@media (max-width: 640px) {
  .cert-row { flex-wrap: wrap; padding: 12px; }
  .cert-row .meta { flex-basis: calc(100% - 64px); }
  .cert-acts { width: 100%; justify-content: flex-start; padding-left: 64px; }
}
.cert-ro { font-size: 13px; color: var(--muted); min-height: 44px; display: inline-flex; align-items: center; }

/* 0.6.7 Share popup: link + QR, one permanent link per report. */
.gr-share { width: min(460px, calc(100vw - 32px)); max-width: none; padding: 24px; border: 0; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.gr-share[open] { display: flex; flex-direction: column; gap: 16px; }
.gr-share::backdrop { background: rgba(24,18,14,.6); }
.gr-share-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gr-share-head h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.1; }
.gr-share-head .round-btn { position: static; transform: none; flex: none; }
.gr-share-body { display: flex; flex-direction: column; gap: 18px; }
.gr-share-link { display: flex; gap: 8px; }
.gr-share-link input { flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 0 12px; min-height: 50px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--paper); color: var(--ink); }
.gr-share-link .btn { flex: none; min-width: 112px; }
.gr-share-qr { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 16px; border: 1px solid var(--line); border-radius: 12px; }
.gr-share-qr canvas { width: 132px; height: 132px; image-rendering: pixelated; flex: none; }
.gr-share-qr .btn { min-height: 44px; }
.gr-share-manage { border-top: 1px solid var(--line); padding-top: 12px; }
.gr-share-manage .confirm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.gr-share-manage .confirm-row .small { flex: 1 1 100%; color: var(--muted); }
.gr-share-manage .confirm-row .btn { min-height: 44px; font-size: 14px; }
@media (max-width: 480px) {
  .gr-share { padding: 20px 16px; }
  .gr-share-link { flex-direction: column; }
}

/* 0.6.9: on phones the .wrap-wide padding reset removed the space under the report's last card. */
@media (max-width: 640px) { .report-main { padding-bottom: 48px; } .gr-embed .report-main { padding-bottom: 0; } }
/* 0.6.11: Share and Print as icon-only round buttons on phones so they stay on one line with the status pill. */
@media (max-width: 640px) { .head-actions { flex-wrap: nowrap; gap: 8px; } .head-actions .pill { margin-right: auto; } .print-btn { width: 44px; min-height: 44px; padding: 0; border-radius: 999px; flex: none; } .print-btn .btn-txt { display: none; } }
