/* ============================================================
   RESET & TOKENS
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:    #e8a800;
  --panel:   #1a1a1a;
  --border:  #2a2a2a;
  --text:    #f0f0f0;
  --cw:      650px;

  --font-body:    'Gotham', 'Gotham HTF', 'Nunito Sans', 'Century Gothic',
                  'Trebuchet MS', Arial, sans-serif;
  --font-heading: 'Gotham', 'Gotham HTF', 'Nunito Sans', 'Bebas Neue',
                  'Century Gothic', 'Trebuchet MS', Arial, sans-serif;
}

body {
  font-family: var(--font-body);
  background: #0d0d0d;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  background: #111;
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  gap: 8px;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dot {
  width: 8px; height: 8px; flex-shrink: 0;
  background: var(--gold);
  border-radius: 50%;
  animation: blink 2s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }
.topbar-name  { font-size: 14px; font-weight: 700; color: #fff; letter-spacing: .03em; white-space: nowrap; }
.topbar-sub   { font-size: 8px; letter-spacing: .14em; text-transform: uppercase; color: #555; }
#layout-pill  { font-size: 9px; color: #555; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; white-space: nowrap; flex-shrink: 0; }

/* ============================================================
   WORKSPACE — single column mobile, two-column desktop
   ============================================================ */
.workspace { display: flex; flex: 1; min-height: 0; flex-direction: column; }

/* ============================================================
   LEFT PANEL
   ============================================================ */
.panel {
  width: 100%;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 16px 14px 24px;
}

.eyebrow {
  font-size: 9px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold); font-weight: 700; margin-bottom: 10px;
}

.field { margin-bottom: 11px; }
.field label {
  display: block; font-size: 10px; color: #888;
  margin-bottom: 4px; font-weight: 400;
  letter-spacing: .08em; text-transform: uppercase;
}
.field input {
  width: 100%; background: #222; border: 1px solid #333;
  border-radius: 6px; color: #f0f0f0;
  padding: 10px 11px; font-size: 16px; /* 16px prevents iOS zoom */
  outline: none; transition: border-color .2s;
  font-weight: 400; -webkit-appearance: none; appearance: none;
}
.field textarea {
  width: 100%; background: #222; border: 1px solid #333;
  border-radius: 6px; color: #f0f0f0;
  padding: 10px 11px; font-size: 16px;
  font-family: inherit; outline: none; transition: border-color .2s;
  -webkit-appearance: none; appearance: none;
}
.field input:focus,
.field textarea:focus  { border-color: var(--gold); }
.field input::placeholder,
.field textarea::placeholder { color: #444; }
.field textarea { resize: vertical; min-height: 60px; line-height: 1.5; }

.row2  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sep   { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

/* ============================================================
   LOGO UPLOADER
   ============================================================ */
.logo-col label {
  display: block; font-size: 10px; color: #888;
  margin-bottom: 5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.logo-upload-box {
  border: 2px dashed #333; border-radius: 8px; padding: 8px;
  text-align: center; cursor: pointer; background: #1e1e1e;
  transition: border-color .2s; position: relative;
  min-height: 66px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  -webkit-tap-highlight-color: transparent;
}
.logo-upload-box:hover,
.logo-upload-box:active { border-color: var(--gold); }
.logo-upload-box img      { max-width: 100%; max-height: 46px; object-fit: contain; }
.logo-upload-box .placeholder-txt { font-size: 11px; color: #555; }

.logo-del {
  position: absolute; top: 3px; right: 3px;
  width: 24px; height: 24px; background: rgba(0,0,0,.8);
  border: none; border-radius: 50%; color: #ccc; font-size: 11px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.logo-del:hover,
.logo-del:active { background: #c0392b; color: #fff; }

.suggested-label {
  font-size: 9px; color: #555; letter-spacing: .1em;
  text-transform: uppercase; font-weight: 700; margin: 7px 0 5px;
}
.suggested-logos  { display: flex; flex-wrap: wrap; gap: 5px; }
.sug-empty-notice { font-size: 10px; color: #555; font-style: italic; padding: 4px 0; line-height: 1.4; display: none; }
.sug-logo {
  width: 44px; height: 44px; border-radius: 6px; overflow: hidden;
  border: 2px solid #333; cursor: pointer; background: #222;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, transform .15s; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.sug-logo:hover,
.sug-logo:active   { border-color: var(--gold); transform: scale(1.08); }
.sug-logo.selected { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(232,168,0,.3); }
.sug-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }

/* ============================================================
   PHOTO DROP ZONE
   ============================================================ */
.drop-zone {
  border: 2px dashed #333; border-radius: 10px; padding: 20px 14px;
  text-align: center; cursor: pointer; background: #1a1a1a;
  transition: all .2s; margin-bottom: 10px;
  -webkit-tap-highlight-color: transparent;
}
.drop-zone:hover,
.drop-zone:active,
.drop-zone.drag-over  { border-color: var(--gold); background: #1e1b12; }
.drop-zone.disabled   { opacity: .4; pointer-events: none; }
.drop-icon  { font-size: 22px; margin-bottom: 6px; opacity: .4; }
.drop-text  { font-size: 13px; color: #666; }
.drop-text strong   { color: var(--gold); }
.drop-slots { font-size: 10px; color: #444; margin-top: 4px; }

.thumbs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px;
}
.thumb {
  position: relative; aspect-ratio: 1; border-radius: 6px;
  overflow: hidden; border: 1px solid #333; background: #1c1c1c;
}
.thumb img     { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-num {
  position: absolute; top: 4px; left: 4px;
  background: rgba(232,168,0,.9); color: #111;
  font-size: 8px; font-weight: 800; padding: 2px 5px; border-radius: 3px;
}
.thumb-del {
  position: absolute; top: 3px; right: 3px;
  width: 26px; height: 26px; background: rgba(0,0,0,.75);
  border: none; border-radius: 50%; color: #ddd; font-size: 11px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.thumb-del:hover,
.thumb-del:active { background: #c0392b; color: #fff; }

.count-pill {
  display: none; align-items: center; gap: 6px;
  background: rgba(232,168,0,.08); border: 1px solid rgba(232,168,0,.2);
  color: var(--gold); font-size: 10px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px; margin-bottom: 10px; letter-spacing: .06em;
}

.gen-btn {
  width: 100%; background: var(--gold); color: #111; border: none;
  border-radius: 8px; padding: 15px; font-size: 14px; font-weight: 800;
  font-family: inherit; cursor: pointer; letter-spacing: .1em;
  text-transform: uppercase; transition: all .2s; margin-top: 10px;
  -webkit-tap-highlight-color: transparent;
}
.gen-btn:hover  { background: #f0b800; }
.gen-btn:active { background: #d49600; transform: scale(.99); }

/* ============================================================
   PREVIEW AREA
   ============================================================ */
.preview {
  flex: 1; background: #161616; padding: 16px 12px 32px;
  overflow-y: auto; display: flex; flex-direction: column; align-items: center;
}
.preview-bar {
  width: 100%; max-width: var(--cw);
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: center; margin-bottom: 14px; gap: 8px;
}
.preview-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #444; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.action-btn {
  background: transparent; border: 1px solid #333; color: #888;
  padding: 9px 14px; border-radius: 6px; font-size: 12px;
  font-family: inherit; font-weight: 400; cursor: pointer;
  letter-spacing: .04em; transition: all .2s; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.action-btn:hover,
.action-btn:active         { border-color: var(--gold); color: var(--gold); }
.action-btn.primary        { background: var(--gold); border-color: var(--gold); color: #111; }
.action-btn.primary:hover,
.action-btn.primary:active { background: #f0b800; }

.empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 260px; text-align: center;
  gap: 12px; color: #333; padding: 20px;
}
.empty-glyph { font-size: 40px; opacity: .2; }
.empty-title { font-size: 18px; font-weight: 700; color: #444; }
.empty-sub   { font-size: 12px; color: #3a3a3a; max-width: 220px; line-height: 1.6; }

.saving-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.85); z-index: 999;
  align-items: center; justify-content: center; flex-direction: column; gap: 16px;
}
.saving-overlay.show { display: flex; }
.saving-spinner {
  width: 44px; height: 44px; border: 3px solid #333;
  border-top-color: var(--gold); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.saving-text { font-size: 13px; font-weight: 700; color: #fff; letter-spacing: .1em; text-transform: uppercase; }

/* ============================================================
   REPORT CARD — fluid width on mobile, fixed 650px on desktop
   ============================================================ */
#report-card {
  width: 100%;
  max-width: var(--cw);
  background: #fff;
  color: #111;
  font-family: 'Gotham', 'Gotham HTF', 'Nunito Sans', 'Century Gothic',
               'Trebuchet MS', Arial, sans-serif;
  display: flex;
  flex-direction: column;
  border: 1px solid #ccc;
  box-shadow: 0 12px 48px rgba(0,0,0,.45);
  flex-shrink: 0;
}

.rc-logo-bar {
  background: #fff;
  padding: 10px 14px 8px;
  display: flex; align-items: center; justify-content: center;
  gap: 10px; border-bottom: 3px solid #fbcd0d; flex-shrink: 0;
}
.rc-logo-slot {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rc-logo-slot img { max-width: 52px; max-height: 52px; object-fit: contain; } 
/* object-fit:contain
background:#000 */

.rc-header-center { text-align: center; }
.rc-org-name {
  font-family: 'Gotham', 'Gotham HTF', 'Nunito Sans', 'Century Gothic', Arial, sans-serif;
  font-size: clamp(18px, 5.5vw, 34px);
  font-weight: 700; color: #098ce5; line-height: 1;
  text-transform: uppercase; letter-spacing: 0.005em;
}
.rc-org-sub {
  font-size: clamp(7px, 1.8vw, 11px);
  font-weight: 600; color: #098ce5; letter-spacing: .1em;
  text-transform: uppercase; margin-top: 4px;
  border-top: 2px solid #fbcd0d; padding-top: 3px; display: inline-block;
}

.rc-title-section {
  background: #fff; text-align: center;
  padding: 8px 14px; border-bottom: 1px solid #e0e0e0; flex-shrink: 0;
}
.rc-report-title {
  font-family: 'Gotham', 'Gotham HTF', 'Nunito Sans', 'Century Gothic', Arial, sans-serif;
  font-size: clamp(12px, 3.5vw, 22px);
  font-weight: 600; color: #111;
  text-transform: uppercase; letter-spacing: .04em; line-height: 1.25;
}

.rc-meta {
  background: #fff; padding: 6px 14px 8px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px 10px; border-bottom: 1px solid #e0e0e0; flex-shrink: 0;
}
.rc-meta-item { font-size: clamp(8px, 2vw, 12px); color: #1a1a1a; line-height: 1.6; font-weight: 300; }
.rc-label { font-weight: 700; }

.rc-photos { padding: 8px 14px 0; flex-shrink: 0; }

.rc-footer {
  background: #fff; border-top: 3px solid #fbcd0d;
  padding: 8px 14px; font-size: clamp(8px, 2vw, 13px);
  color: #1a1a1a; flex-shrink: 0; margin-top: 8px; font-weight: 300;
}

.photo-img { width: 100%; display: block; border: 2px solid #111; border-radius: 2px; object-fit: cover; }

/* ============================================================
   TABLET  ≥ 560px
   ============================================================ */
@media (min-width: 560px) {
  .topbar        { padding: 13px 22px; }
  .topbar-name   { font-size: 15px; }
  #layout-pill   { font-size: 10px; }
  .panel         { padding: 18px 18px 28px; }
  .preview       { padding: 20px 20px 36px; }
  .rc-logo-slot  { width: 62px; height: 62px; }
  .rc-logo-slot img { max-width: 62px; max-height: 62px; }
}

/* ============================================================
   DESKTOP  ≥ 900px — restore sidebar layout
   ============================================================ */
@media (min-width: 900px) {
  .topbar        { padding: 14px 28px; }
  .topbar-name   { font-size: 16px; }

  .workspace     { flex-direction: row; flex: 1; min-height: 0; }

  .panel {
    width: 340px; min-width: 340px;
    border-right: 1px solid var(--border); border-bottom: none;
    padding: 20px 18px 48px; overflow-y: auto;
    max-height: calc(100vh - 53px); position: sticky; top: 53px;
  }

  .preview       { padding: 28px 36px; overflow-y: auto; }
  .preview-bar   { width: var(--cw); }

  #report-card   { width: var(--cw); max-width: none; box-shadow: 0 24px 80px rgba(0,0,0,.5); }

  .rc-logo-bar   { padding: 14px 22px 10px; gap: 16px; }
  .rc-logo-slot  { width: 72px; height: 72px; }
  .rc-logo-slot img { max-width: 72px; max-height: 72px; }

  .rc-title-section { padding: 12px 22px 10px; }
  .rc-meta          { padding: 8px 22px 10px; }
  .rc-photos        { padding: 10px 22px 0; }
  .rc-footer        { padding: 10px 22px; margin-top: 10px; }

  .gen-btn { padding: 12px; font-size: 13px; }
  .field input,
  .field textarea { font-size: 13px; padding: 8px 11px; }
}