/* Shared people|area presentation (QHC + S02 formal Business Information).
   Pure UI only — no business state, storage, or data coupling. */

.smp-resource-grid {
  align-items: start;
  display: grid;
  column-gap: 14px;
  gap: 0 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.smp-resource-block {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.smp-resource-heading {
  color: var(--muted, #64716b);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
}

.smp-field {
  display: grid;
  gap: 3px;
  margin-bottom: 0;
  min-width: 0;
  width: 100%;
}

.smp-field > span {
  color: var(--ink, #17211d);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.smp-field > input,
.smp-input-affix {
  box-sizing: border-box;
  min-height: 40px;
  min-width: 0;
  width: 100%;
}

.smp-hint {
  color: var(--muted, #64716b);
  font-size: 0.8rem;
  line-height: 1.4;
  margin: 0;
}

.smp-hint--compact {
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  margin: 0;
  opacity: 0.9;
}

/* People + area helpers: stack on narrow; one line with middot on wide (≥700px). */
.smp-hint-pair {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.smp-hint-pair__sep {
  display: none;
}

@media (min-width: 700px) {
  .smp-hint-pair {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0;
    row-gap: 0;
  }

  .smp-hint-pair__sep {
    display: inline;
    flex: 0 0 auto;
    white-space: pre;
  }

  /* Grid + under-grid pair: hide per-column hints on desktop. */
  .smp-resource-extras--paired-hints .smp-hint--per-block {
    display: none;
  }
}

@media (max-width: 699px) {
  /* Grid + under-grid pair: keep per-column hints on mobile; hide combined pair. */
  .smp-resource-extras--paired-hints > .smp-hint-pair--under-grid {
    display: none;
  }
}

.smp-input-affix {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  position: relative;
}

.smp-input-affix input {
  box-sizing: border-box;
  min-height: 40px;
  min-width: 0;
  padding-right: 2rem;
  width: 100%;
}

.smp-affix {
  color: var(--muted, #64716b);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

/* QHC markup still carries --stack-narrow; default shared rule stacks <700.
   QHC mobile override in quickHealthCheck.css keeps 50%｜50% (UI-QHC-MOBILE-PEOPLE-AREA-50-001).
   S02 omits this modifier. */
@media (max-width: 699px) {
  .smp-resource-grid--stack-narrow {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr);
  }

  .smp-resource-grid--stack-narrow .smp-resource-block + .smp-resource-block {
    border-top: 1px solid var(--qhc-divider, #d7e3da);
    padding-top: 8px;
  }
}

/*
 * Standalone full-row date ONLY (date alone on its row).
 * Section 02 经营资料 places `fixedDate` inside `.s02v2-bizinfo-row` and overrides
 * these widths there so the date shares the people|area|date grid (desktop) or the
 * mobile date|people ~50/50 flex row.
 *
 * Do NOT apply to combined rows:
 * - 日期＋单据号 (.s02v2-purchase-row.s02v2-purchase-row--meta — ≤768: 50/50 date|doc; payment next row)
 * - 日期＋类别＋说明＋金额 / 日期＋投入类型 / 开始＋结束日期
 * - any date sharing a row with other fields (unless a local override fills the cell)
 *
 * Desktop (≥700): outer 320px, input width 100% / min-width 0 / max-width 320px, left-aligned.
 * Mobile (≤699): standalone fills available width; combined dates use their own layouts.
 * Compound selectors beat later `.qhc-module input { max-width:100% }` — no global date override.
 */
.qhc-field.smp-standalone-date,
.s02v2-field.smp-standalone-date,
.smp-standalone-date {
  box-sizing: border-box;
  display: grid;
  justify-self: start;
  max-width: 320px;
  min-width: 0;
  width: 100%;
}

.qhc-module .smp-standalone-date > input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),
.smp-standalone-date > input[type="date"] {
  box-sizing: border-box;
  max-width: 320px;
  min-width: 0;
  width: 100%;
}

@media (min-width: 700px) {
  .qhc-field.smp-standalone-date,
  .s02v2-field.smp-standalone-date,
  .smp-standalone-date {
    width: 320px;
    max-width: 320px;
  }

  .qhc-module .smp-standalone-date > input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),
  .smp-standalone-date > input[type="date"] {
    max-width: 320px;
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 699px) {
  .qhc-field.smp-standalone-date,
  .s02v2-field.smp-standalone-date,
  .smp-standalone-date {
    justify-self: stretch;
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .qhc-module .smp-standalone-date > input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),
  .smp-standalone-date > input[type="date"] {
    max-width: none;
    min-width: 0;
    width: 100%;
  }
}
