/* ==========================================================================
   Client Onboarding Kit — directly-editable document sheet (block: ob-doc).
   Restyled to the owner's shipped document design language (source of
   truth: "Invoice app redesign/Invoice Template.dc.html"): #FDFCFA sheet on
   an #EDEAE4 page, Newsreader display titles, circular accent monogram,
   10px small-caps eyebrows (13px mobile floor), #EEEAE2 dividers, #F4F0E9
   highlight boxes, #9A4A28 default accent (user-overridable via the
   --ob-doc-accent custom property set from JS).

   The --ob-* names below are thin aliases of the SHARED main.css redesign
   tokens (landed by the invoice worker; incl. the WCAG-corrected muted
   #756E62 / faint #7A7368 and the self-hosted Newsreader @font-face) so
   this block consumes the shared palette from one indirection point.

   File 1 of 2: sheet, inputs, tabs, masthead, identity row.
   Sections/rows/lists/footer live in onboarding-doc-sections.css.
   ========================================================================== */

.ob-doc-wrap {
  margin-bottom: var(--space-5);
}

/* ---- The sheet ----
   Width parity (owner decision, shared with the invoice tool): the sheet
   fills the SAME content column as the surrounding page copy. */
.ob-doc {
  /* Aliases of the shared main.css tokens (see note above). */
  --ob-sheet: var(--color-sheet);
  --ob-ink: var(--color-ink);
  --ob-ink-soft: var(--color-ink-soft);
  --ob-ink-muted: var(--color-ink-muted);
  --ob-divider: var(--color-divider);
  --ob-divider-strong: var(--color-border);
  --ob-box: var(--color-paper-alt);
  --ob-faint: var(--color-ink-faint);
  --ob-doc-accent: #9A4A28;
  --ob-serif: var(--font-doc-serif);

  width: 100%;
  background: var(--ob-sheet);
  color: var(--ob-ink);
  box-shadow: 0 1px 2px rgba(28, 26, 23, 0.06), 0 24px 64px rgba(28, 26, 23, 0.12);
  padding: var(--space-5);
}
@media (min-width: 1024px) {
  .ob-doc {
    padding: 48px 64px 0;
  }
}

/* ---- Editable-field baseline: reads as document text until interacted
   with — transparent by default, faint outline on hover, clear ring on
   :focus-visible (never removed). ---- */
.ob-doc__input {
  display: block;
  width: 100%;
  min-height: var(--touch-min);
  padding: var(--space-1) var(--space-2);
  margin: 0;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ob-ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: border-color var(--motion-fast) var(--ease-out),
              background-color var(--motion-fast) var(--ease-out);
}
@media (min-width: 1024px) {
  /* Exact 14px document body scale (mockup): px, not rem — html is scaled
     to 106.25% (1rem = 17px), so a rem value here would leak larger
     input/hint text into the 14px document context. */
  .ob-doc__input { font-size: 14px; }
}
.ob-doc__input::placeholder {
  color: var(--color-placeholder);
  opacity: 1;
}
.ob-doc__input:hover {
  border-color: var(--ob-divider-strong);
  background: var(--ob-box);
}
.ob-doc__input:focus-visible {
  outline: none;
  border-color: var(--ob-doc-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(154, 74, 40, 0.18);
}
.ob-doc__input--textarea {
  resize: vertical;
  min-height: 3.5em;
  line-height: 1.7;
  color: var(--ob-ink-soft);
}
/* Native number spinners stay enabled (no appearance override) — input
   events patch only the derived checklist list, never replacing the input
   element mid-press, so spinners keep working across "re-renders".
   Numeric/date columns: compact, right-aligned, tabular-nums. */
.ob-doc__input--num {
  width: 5.5em;
  flex: 0 0 auto;
  display: inline-block;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ob-doc__input--date {
  width: auto;
  flex: 0 0 auto;
  display: inline-block;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ob-doc__mini-select {
  display: inline-block;
  width: auto;
  min-height: var(--touch-min);
  cursor: pointer;
}

/* ---- Small-caps eyebrow labels (mockup: 10px / 0.14em / muted).
   Mobile-first floor of 13px below 1024px for legibility. ---- */
.ob-doc__eyebrow {
  display: block;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ob-ink-muted);
  font-weight: 400;
}
@media (min-width: 1024px) {
  .ob-doc__eyebrow { font-size: 10px; }
}

/* ---- Tabs (document switcher — UI chrome above the document header) ---- */
.ob-doc__tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--ob-divider);
}
.ob-doc__tab {
  min-height: var(--touch-min);
  padding: var(--space-2) var(--space-4);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ob-ink-muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
}
.ob-doc__tab:hover { color: var(--ob-ink); }
.ob-doc__tab[aria-selected="true"] {
  color: var(--ob-doc-accent);
  border-bottom-color: var(--ob-doc-accent);
}
.ob-doc__tab:focus-visible {
  outline: 3px solid var(--ob-doc-accent);
  outline-offset: 2px;
}

/* ---- Masthead (mockup header): circular monogram/logo, centered
   Newsreader title, muted meta line, 1px ink rule beneath. ---- */
.ob-doc__masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ob-ink);
  margin-bottom: 28px;
}
.ob-doc__logo-cell {
  position: relative;
}
/* Circular accent monogram — the logo slot. An uploaded logo replaces the
   monogram inside the same circle. */
.ob-doc__logo-slot,
.ob-doc__logo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  border-radius: 50%;
  border: none;
  background: var(--ob-doc-accent);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
}
.ob-doc__logo-btn {
  background: var(--ob-sheet);
  border: 1px solid var(--ob-divider-strong);
}
.ob-doc__logo-slot:hover { opacity: 0.85; }
.ob-doc__logo-btn:hover { border-color: var(--ob-doc-accent); }
.ob-doc__logo-slot:focus-visible,
.ob-doc__logo-btn:focus-visible,
.ob-doc__logo-remove:focus-visible {
  outline: 3px solid var(--ob-doc-accent);
  outline-offset: 2px;
}
.ob-doc__monogram {
  font-family: var(--ob-serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ob-sheet);
}
.ob-doc__logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ob-doc__logo-remove {
  position: absolute;
  top: -8px;
  right: -14px;
  min-height: 28px;
  min-width: 28px;
  font-size: 1rem;
  line-height: 1;
  color: var(--ob-ink-muted);
  background: var(--ob-sheet);
  border: 1px solid var(--ob-divider-strong);
  border-radius: 999px;
  cursor: pointer;
}
.ob-doc__logo-remove:hover { color: var(--color-error); border-color: var(--color-error); }

.ob-doc__doc-title {
  font-family: var(--ob-serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0;
}
@media (min-width: 1024px) {
  .ob-doc__doc-title { font-size: 44px; }
}
.ob-doc__doc-meta {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ob-ink-soft);
  margin: 0;
}
/* Empty-state muting: while the fields feeding the brief's title/meta are
   untouched, their fallback phrasing renders muted — never as real data. */
.ob-doc__doc-title--ph,
.ob-doc__doc-meta--ph {
  color: var(--ob-ink-muted);
}

/* ---- Identity row (mockup "From + data block"): From block left (≤50%),
   label-left/value-right meta block right. Stacked at 375px. ---- */
.ob-doc__identity {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-bottom: 32px;
}
@media (min-width: 640px) {
  .ob-doc__identity {
    flex-direction: row;
    justify-content: space-between;
    gap: 56px;
  }
}
.ob-doc__from {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}
@media (min-width: 640px) {
  .ob-doc__from { max-width: 50%; flex: 1; }
}
.ob-doc__business-name {
  font-weight: 500;
  font-size: 1rem;
}
.ob-doc__meta-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
@media (min-width: 640px) {
  .ob-doc__meta-block { width: 280px; flex-shrink: 0; }
}
/* Label-left / value-right meta rows (mockup data block). */
.ob-doc__meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}
.ob-doc__meta-row .ob-doc__eyebrow {
  flex-shrink: 0;
  align-self: center;
}
.ob-doc__meta-value {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  text-align: right;
}
.ob-doc__meta-value--group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
}
.ob-doc__meta-row--accent {
  justify-content: flex-start;
  margin-top: var(--space-2);
}
.ob-doc__client-name {
  font-weight: 500;
}
.ob-doc__color-input {
  width: 40px;
  height: 28px;
  padding: 2px;
  border: 1px solid var(--ob-divider-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
}
.ob-doc__color-input:hover { border-color: var(--ob-doc-accent); }
.ob-doc__color-input:focus-visible {
  outline: 3px solid var(--ob-doc-accent);
  outline-offset: 2px;
}
.ob-doc__inline-text {
  font-size: 0.85rem;
  color: var(--ob-ink-muted);
  white-space: nowrap;
}
