/* OpenFlow v2: the settings pages' own rules. Report 204.
   Uses the shared templates in of-base.css (`templates/_of.html`); only
   this page group's rules go here. See
   planning/design/openflow-v2-handoff/BUILD-NOTES.md.

   Settings, My profile, What reaches you, the Guide and CE requirements.
   Every rule is under `.ofs-page` (or a panel class), so nothing here
   reaches another page. */

/* `.ui-page p` caps a paragraph at 72ch (components.css), and a capped
   line fits beside the section title instead of under it. */
.ofs-page .of-section__line { max-width: none; }

/* ── A line in a card: key, words, an act on the right ───────────────── */
.ofs-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  padding: 12px 20px; border-top: 1px solid var(--line-2);
}
.ofs-line__key { flex: 0 0 40px; font-weight: 600; color: var(--ink-1); }
.ofs-line__text { flex: 1 1 200px; min-width: 0; font-size: 15px; color: var(--of-head-ink); }
.ofs-line__act { flex: none; }
.ofs-line .of-danger { display: inline-flex; align-items: center; height: 36px; margin-left: 0; font-size: 14px; }

/* The foot of a card of rows: an add form, or the card's Save. */
.ofs-foot {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 20px; border-top: 1px solid var(--line-2);
  background: var(--of-head-bg);
}
.ofs-foot .ui-btn { align-self: flex-start; }
.ofs-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }

/* ── Fields ──────────────────────────────────────────────────────────── */
.ofs-label { font-size: 14px; font-weight: 600; color: var(--ink-1); }
.ofs-hint { margin: 0; font-size: 14px; color: var(--of-muted); }
.ofs-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ofs-inline .ui-btn { height: 42px; min-height: 42px; padding-block: 0; white-space: nowrap; }
.ofs-input {
  height: 42px; box-sizing: border-box; max-width: 100%;
  border: 1px solid var(--of-field); border-radius: 10px;
  padding: 0 12px; background: var(--card-bg);
  font: inherit; font-size: 15px; color: var(--ink-1);
}
select.ofs-input { padding: 0 10px; }
.ofs-input::placeholder { color: var(--of-muted); }
.ofs-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ofs-page .ofs-foot input.ofs-input--code { width: 80px; text-transform: uppercase; }
.ofs-page .ofs-input--zone { flex: 1 1 260px; width: auto; max-width: 420px; min-width: 0; }
.ofs-input--days, .ofs-page .ofs-input--days { width: 140px; }
.ofs-input--n, .ofs-page .ofs-input--n { width: 64px; }
.ofs-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ofs-field .ofs-input { width: 100%; }
.ofs-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 16px; }
.ofs-check { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 15px; color: var(--ink-1); }
.ofs-check input { width: 18px; height: 18px; accent-color: var(--ink-1); }
.ofs-empty { margin: 0; padding: 14px 20px; border-top: 1px solid var(--line-2); font-size: 15px; color: var(--of-muted); }
.ofs-subhead { margin: 18px 0 8px; font-size: 15px; font-weight: 600; color: var(--ink-1); display: flex; align-items: center; gap: 8px; }
.ofs-subhead:first-child { margin-top: 0; }

/* ── Role names: the platform's word, then the firm's ────────────────── */
.ofs-role__name { flex: 0 0 180px; font-weight: 500; color: var(--ink-1); }
.ofs-role__input { flex: 1 1 220px; max-width: 360px; min-width: 0; }

/* ── Reminders ───────────────────────────────────────────────────────── */
.ofs-sentence { margin: 0 0 8px; line-height: 2.6; font-size: 15px; color: var(--ink-1); }
.ofs-sentence .ofs-input { height: 38px; vertical-align: middle; }
.settings-reminder.is-open .settings-cadence { display: flex; flex-direction: column; gap: 8px; }
.settings-reminder .settings-cadence__default { margin: 4px 0 0; }
.settings-wording { border-top: 1px solid var(--line-2); padding-top: 12px; }
.settings-wording__open {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  min-height: 36px; font-weight: 600; color: var(--ink-1);
}
.settings-wording form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.ofs-fields-list { margin: 0; padding-left: 18px; font-size: 14px; color: var(--of-head-ink); }
.ofs-fields-list li { margin: 2px 0; overflow-wrap: anywhere; }
.ofs-fields-list code { font-size: 13px; color: var(--ink-1); }
.ui-panel .settings-wording, .ui-panel .settings-reminder { border-top: 0; padding-top: 0; }
.ui-panel .settings-wording .ofs-field, .ui-panel .settings-wording .ofs-hint,
.ui-panel .settings-wording .ofs-fields-list { margin-bottom: 12px; }
.ofs-panel-pill { margin: 0 0 12px; }
.ui-panel .ofs-fields { grid-template-columns: minmax(0, 1fr); }

/* ── Remove a state ──────────────────────────────────────────────────── */
.ofs-consequences { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }

@media (max-width: 759.98px) {
  .ofs-line { padding: 12px 16px; }
  .ofs-foot { padding: 14px 16px; }
  .ofs-role__name { flex-basis: 100%; }
  .ofs-role__input { max-width: none; }
  .ofs-page .ofs-input--zone { max-width: none; }
}

.ofs-page .settings-reminder.is-open { background: var(--card-bg); }

/* In the panel the reminder's sentence keeps its short boxes in line.
   design-system.css gives every panel input `width: 100%` through four
   `:not()`s, so these name the type and the attribute to outrank it. */
.ui-panel .ofs-sentence input.ofs-input[type="text"][name] { display: inline-block; height: 38px; margin: 0 2px; padding: 0 10px; }
.ui-panel .ofs-sentence input.ofs-input--days[type="text"][name] { width: 140px; }
.ui-panel .ofs-sentence input.ofs-input--n[type="text"][name] { width: 64px; }
.ui-panel .ui-panel__body label.ofs-check { display: flex; justify-content: flex-start; width: auto; margin: 4px 0; }
.ui-panel .ui-panel__body label.ofs-check input { flex: none; width: 18px; }

/* ── What reaches you: a row per topic, a fixed column per channel ───── */
.ofs-standing { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--of-head-ink); }
.ofs-standing strong { color: var(--ink-1); font-weight: 600; }
.ofs-pref {
  display: grid; grid-template-columns: minmax(0, 1fr) repeat(var(--ofs-n, 2), 136px);
  align-items: center; gap: 4px 12px;
  padding: 12px 20px; border-top: 1px solid var(--line-2);
}
.ofs-pref--head {
  padding: 10px 20px; background: var(--of-head-bg);
  font-size: 13px; font-weight: 600; color: var(--of-head-ink);
}
.ofs-pref__what { display: flex; flex-direction: column; min-width: 0; }
.ofs-pref__title { font-weight: 500; color: var(--ink-1); }
.ofs-pref__when { font-size: 14px; color: var(--of-muted); }
.ofs-pref__col { text-align: center; }
.ofs-pref__col input[type="checkbox"] { width: 20px; height: 20px; margin: 0; accent-color: var(--ink-1); vertical-align: middle; }
@media (max-width: 759.98px) {
  .ofs-pref { grid-template-columns: minmax(0, 1fr) repeat(var(--ofs-n, 2), 64px); gap: 4px 8px; padding: 12px 16px; }
  .ofs-pref--head { padding: 10px 16px; }
  .ofs-pref--head .ofs-pref__col { font-size: 13px; line-height: 1.2; }
}

/* ── The Guide: a topic list, then one topic ─────────────────────────── */
.ofs-guide .of-settings__nav { max-height: calc(100vh - 120px); overflow-y: auto; }
.ofs-guide .of-settings__link { min-height: 40px; padding-block: 8px; line-height: 1.3; }
.ofs-topic .guide-body { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 759.98px) {
  .ofs-guide .of-settings__nav { max-height: none; }
}

/* ── CE requirements: the list and a state's numbers ─────────────────── */
.ofs-reqs .of-row__sub { white-space: normal; }
.ofs-req .of-section .req-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.ofs-req .ofs-source { margin: 0; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 14px; color: var(--of-muted); max-width: none; }
.ofs-req .of-section .req-parts { margin: 0; padding: 0; list-style: none; }
.ofs-req .req-part {
  display: grid; grid-template-columns: minmax(0, 1fr) 120px 64px;
  align-items: end; gap: 6px 16px; padding: 12px 0; border-top: 1px solid var(--line-2);
}
.ofs-req .req-part:first-child { border-top: 0; }
.ofs-req .req-part > .req-edit { grid-column: 1 / -1; margin: 0; }
.ofs-req .req-part__label { align-self: center; min-width: 0; }
.ofs-req .req-part__hours { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.ofs-req .req-part__hours .ui-input { width: 100%; }
.ofs-req .req-part__hours input[type="checkbox"] { width: 18px; height: 18px; margin: 9px 0; }
@media (max-width: 759.98px) {
  .ofs-req .req-part { grid-template-columns: minmax(0, 1fr) 76px 56px; gap: 6px 10px; }
}

/* Report 215. Home photos: a thumbnail, its place, its description, and
   Move up / Move down / Remove. On a phone the description and the buttons
   wrap under the thumbnail. */
.ofs-photo { align-items: center; flex-wrap: wrap; }
.ofs-photo__thumb { flex: none; width: 128px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--line-2); }
.ofs-photo__place { flex: none; width: 24px; text-align: center; font-weight: 600; color: var(--ink-1); }
.ofs-photo__alt { flex: 1 1 260px; min-width: 0; }
.ofs-photo__alt .ofs-inline .ofs-input { flex: 1 1 160px; min-width: 0; }
.ofs-photo__acts { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ofs-photo__acts form { margin: 0; }
.ofs-photo__file { padding-top: 8px; }
.ofs-photo__big { display: block; width: 100%; max-width: 480px; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 14px; margin-bottom: 8px; }

/* Report 226. The two brand colour pickers, side by side. */
.ofs-colors { display: flex; flex-wrap: wrap; gap: 16px 32px; }
.ofs-color { width: 88px; height: 44px; padding: 2px; border: 1px solid var(--line-input, #918D86); border-radius: var(--radius-sm); background: var(--surface-3); cursor: pointer; }

/* Report 251. MY PROFILE, the 22 Oct redesign.
   The summary sits on top: photo, name and status, then what the firm
   holds. On a desktop every card shows and the side list jumps to its
   anchor (`scroll-margin-top` clears the sticky top bar). On a phone the
   side list is the page; a picked section (#anchor, or `?section=`, which
   marks the card `.is-chosen`) shows alone under "← My profile". */
.ofs-profile .ofs-summary { padding: 20px 24px; margin: 0 0 24px; display: grid; grid-template-columns: minmax(260px, auto) minmax(0, 1fr); gap: 16px 32px; align-items: start; }
.ofs-summary__who { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.ofs-profile .ofs-summary__avatar { width: 64px; height: 64px; font-size: 20px; }
.ofs-summary__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ofs-summary__id { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ofs-summary__name { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 20px; font-weight: 600; color: var(--ink-1); }
.ofs-profile .ofs-summary__facts { margin: 0; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 24px; }
.ofs-profile .ofs-summary > .prof-note { grid-column: 1 / -1; margin: 0; }
.ofs-profile .ofs-card { scroll-margin-top: 84px; }
.ofs-profile .person-photo { gap: 8px; }
.ofs-profile .person-photo form { margin: 0; }
.ofs-profile .upload__help { margin: 0; }
/* Birthday: two selects side by side, under one label. */
.ofs-birthday { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ofs-birthday legend { padding: 0; margin: 0 0 6px; font-size: 14px; font-weight: 500; color: var(--ink-1); }
.ofs-birthday__pair { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
.ofs-birthday .ui-field__hint { margin: 0; }
/* A license: its number, then the state and type under it. */
.ofs-profile #licenses .lic-name { display: flex; flex-direction: column; gap: 2px; }
.ofs-profile .lic-sub { font-weight: 400; font-size: 14px; color: var(--ink-3); }
/* Property management, read-only for the broker. */
.pm-readonly { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.pm-readonly p { margin: 0; }
.pm-readonly__value { font-size: 15px; font-weight: 600; color: var(--ink-1); }
@media (max-width: 759.98px) {
  .ofs-profile .ofs-summary { grid-template-columns: minmax(0, 1fr); padding: 16px; margin-bottom: 16px; }
  .ofs-profile .ofs-summary__facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  /* A section picked by its anchor shows alone, like `?section=`. */
  .ofs-profile .of-settings:has(.ofs-card:target) .of-settings__nav { display: none; }
  .ofs-profile .of-settings:has(.ofs-card:target) .of-settings__body { display: flex; }
  .ofs-profile .of-settings:has(.ofs-card:target) .of-settings__back { display: inline-flex; }
  .ofs-profile .of-settings:has(.ofs-card:target) .ofs-card:not(:target),
  .ofs-profile .of-settings[data-chosen]:has(.is-chosen):not(:has(.ofs-card:target)) .ofs-card:not(.is-chosen) { display: none; }
  /* With a section open, the summary steps aside for it. */
  .ofs-profile:has(.ofs-card:target) .ofs-summary,
  .ofs-profile:has(.is-chosen) .ofs-summary { display: none; }
}

/* Settings → Company and Fee plans: the help lines' type. Their layout stays
   in the templates' own <style>; sizes live here, where the type lints can
   see a stylesheet (test_the_type_has_a_floor). */
.cd-help { font-size: .85rem; }
.fp-help { font-size: .9rem; }
