/* ================= Organization settings pane — new bits only =================
   Reusable pieces (.stg-sec, .stg-row, .a-card, .a-chip, .btn, .empty-state, .add-row, .cfg-status) come from
   alt-settings-stride.css (sys_stride-settings-design.md §3/§4). This file adds the two-column layout, count tiles
   and Billing empty state, scoped to `#orgPaneBody`/`#orgBillingView`. */

/* ================= Layout, measured off the supplied mockup =================
   Measured at 1378px and divided by 1.4113 (so 45px button = `.btn`'s 32px). Ratios transfer,
   absolute pixels do not, so fields use `var(--a-ctl)` rather than restating a density value. */

#orgPaneBody .org-pane-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}
#orgPaneBody .org-pane-t{
  /* DS-76: the pane title is the overlay title (`.settings-modal-title`, components.css: display face 16px/600). The one pane with a
     heading at all: every other pane opens with a `.pane-intro` sentence instead. */
  margin:0;
  color:var(--stg-text);
}
#orgPaneBody .org-pane-d{
  margin-top:3px;
  font-size:var(--a-fs-ctl);
  color:var(--stg-dim);
  line-height:var(--a-lh-ui);
}

/* ---- Row 2: the two cards, at the supplied proportions ---- */
/* One rhythm, the dialog's own — these cards are grandchildren of `.admin-pane.active` (through
   #orgPaneBody), so its 10px row-gap never reaches them; `.stg-sec`'s margin-bottom used to
   carry it instead. Flex column with the same 10px states it once. */
#orgPaneBody #orgSettingsView{ display:flex; flex-direction:column; gap:10px; }
#orgPaneBody #orgSettingsView > .stg-sec,
#orgPaneBody .org-row-2 > .stg-sec{ margin:0; }

/* Both two-column rows split 50/50. The mockup's 475fr/507fr ratio made misaligned columns
   read as a rendering fault once a second row existed; change both rows or neither. */
#orgPaneBody .org-row-2{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:17px;
  align-items:stretch;
}

/* ---- The details card's own two-column field grid ---- */
#orgPaneBody .org-field-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  /* 41px measured; column gap carries it, row gap is the 95px pitch minus the 48px control. */
  column-gap:29px;
  row-gap:14px;
}
#orgPaneBody .org-field{ display:flex; flex-direction:column; gap:6px; min-width:0; }
#orgPaneBody .org-field-wide{ margin-top:16px; }
#orgPaneBody .org-field-l{
  font-size:var(--a-fs-ctl-sm);
  font-weight:600;
  color:var(--stg-text);
  line-height:var(--a-lh-ui);
}
/* These fields are `.a-input`/`.a-textarea`, like every other control in this dialog (a
   hand-built copy diverged on contrast). Height comes from `.a-input`'s `var(--a-ctl)`; only
   the differences are below. */
#orgPaneBody .org-field .a-input,
#orgPaneBody .org-field .a-textarea{
  /* LAYOUT, NOT APPEARANCE. The primitive sizes to its container; these fill a grid cell. */
  width:100%;
  box-sizing:border-box;
}
#orgPaneBody .org-field .a-textarea{
  /* 102px in the mockup / 1.4113 = 72px — three lines. `.a-textarea` sets height:auto so the
     caller says how tall, and keeps resize:vertical/line-height:1.5 for free. */
  min-height:72px;
}
/* ADDS rather than overrides: `.a-input` declares no placeholder colour. */
#orgPaneBody .org-field .a-input::placeholder,
#orgPaneBody .org-field .a-textarea::placeholder{ color:var(--stg-faint); }
/* No local focus rule: `.stg-sec`'s overflow:hidden does not clip the outset ring (3px ring
   inside 14px padding). The input takes `.a-input:focus-visible`, the textarea takes
   alt-focus.css's floor. */

/* The character count sits inside the textarea's own box, bottom-right, reading as part of the
   control rather than a separate line under it. */
#orgPaneBody .org-ta-wrap{ position:relative; display:flex; }
#orgPaneBody .org-ta-count{
  position:absolute;
  /* Clear of the textarea's own resize grabber, which the mockup also draws. */
  right:14px;
  bottom:6px;
  font-size:var(--a-fs-11);
  color:var(--stg-faint);
  pointer-events:none;
  font-variant-numeric:tabular-nums;
}

/* ---- Cancel / Save changes ---- */
#orgPaneBody .org-details-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid var(--stg-line);
}
#orgPaneBody .org-details-actions .cfg-status{ margin-right:auto; }

/* ---- The mark card ---- */
#orgPaneBody .org-mark-row{ display:flex; gap:13px; align-items:flex-start; }
#orgPaneBody .org-mark-preview{
  /* A large preview, not the 30x28 shell slot — this is where an admin judges the image before
     committing it. object-fit:contain keeps the "resized to fit, never stretched" promise. */
  flex:0 0 auto;
  /* 140px in the mockup / 1.4113 = 99px. */
  width:100px;
  height:100px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border:1px solid var(--stg-line);
  border-radius:var(--stg-r);
  background:var(--stg-surface);
}
/* `display:block`, and it must NOT be `none` — orgRenderMark() shows the mark by REMOVING the
   inline `display:none` rather than setting a visible one, so this stylesheet's value becomes
   the answer. `none` here hid the mark permanently while the caption still said it was showing —
   "visibility is not function" running in the other direction. */
#orgPaneBody .org-mark-preview img{
  max-width:88%;
  max-height:88%;
  object-fit:contain;
  display:block;
}
#orgPaneBody .org-mark-side{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:0;
  font-size:var(--a-fs-ctl);
  color:var(--stg-text);
  line-height:var(--a-lh-ui);
}
#orgPaneBody .org-mark-btns{ display:flex; gap:10px; flex-wrap:wrap; }
#orgPaneBody .org-mark-note{ margin-top:12px; }
/* No logo yet: the name's initials fill the frame, as the header's own placeholder does. */
#orgPaneBody .org-mark-initials{
  font-size:var(--a-fs-28); font-weight:700; color:var(--stg-dim); letter-spacing:.02em; line-height:var(--a-lh-ctl);
}
/* Owner-only controls and the read-only line, driven by `data-can-edit` on the card (orgRenderLogoGate()):
   "1" shows the controls, "0" shows the sentence, absent (not yet known) shows neither, so a Member
   never sees a button flash. Postgres refuses the write regardless. */
#orgPaneBody #orgMarkCard:not([data-can-edit="1"]) [data-owner-only]{ display:none !important; }
#orgPaneBody #orgMarkCard:not([data-can-edit="0"]) #orgLogoReadonly{ display:none; }

/* ---- Other uploaded images: folded under the logo ---- */
#orgPaneBody .org-logo-more{
  margin-top:14px;
  padding-top:10px;
  border-top:1px solid var(--stg-line);
}
#orgPaneBody .org-logo-more > summary{
  cursor:pointer;
  font-size:var(--a-fs-ctl); font-weight:600; color:var(--stg-text);
  border-radius:var(--stg-r);
  padding:4px 2px;
}
#orgPaneBody .org-logo-more > summary:focus-visible{
  outline:2px solid var(--accent-text); outline-offset:2px;
}
#orgPaneBody .org-logo-more[open] > summary{ margin-bottom:6px; }

/* ---- Owners ---- */
#orgPaneBody .org-owner-row{
  display:flex;
  align-items:center;
  gap:11px;
  padding:9px 0;
  border-bottom:1px solid var(--stg-line);
}
#orgPaneBody .org-owner-row:last-of-type{ border-bottom:0; }
/* The avatar is `.a-av.lg`. White over `var(--accent)` fails AA in dark (3.7:1); `.a-av` uses
   `--a-blue-fill` (`--accent-fill`, 4.5:1). The two match in light, so check both themes.
   The semantic class survives only as a JS/test hook. */
#orgPaneBody .org-owner-id{ display:flex; flex-direction:column; gap:1px; min-width:0; flex:1 1 auto; }
#orgPaneBody .org-owner-n{
  font-size:var(--a-fs-ctl); font-weight:600; color:var(--stg-text);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
#orgPaneBody .org-owner-e{
  font-size:var(--a-fs-ctl-sm); color:var(--stg-dim);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
/* A dashed add control, full width under the list — this product's existing convention for
   "add another one of these" rows. */
#orgPaneBody .org-owner-add{
  width:100%;
  margin-top:9px;
  padding:9px 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font:inherit;
  font-size:var(--a-fs-ctl);
  font-weight:600;
  /* Accent, not grey — the mockup draws this control's "+" in brand blue, separating "add
     another owner" from a disabled-looking placeholder. `--accent-text`, not `--accent`: this is
     TEXT (the fill colour isn't legible as type — see alt-conversation.css's own note); the
     dashed BORDER correctly stays `--accent`. */
  color:var(--accent-text);
  background:transparent;
  border:1px dashed var(--stg-line-strong);
  border-radius:var(--stg-r);
  cursor:pointer;
}
#orgPaneBody .org-owner-add svg{ width:13px; height:13px; flex:0 0 auto; }
#orgPaneBody .org-owner-add:hover{ background:var(--stg-surface-2); border-color:var(--accent); }
#orgPaneBody .org-owner-add:focus-visible{ outline:2px solid var(--stg-ring); outline-offset:-2px; }

/* ---- Count tiles: ONE row of four ---- */
#orgPaneBody .stg-org-tiles{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:16px;
}
#orgPaneBody .stg-org-tile{
  display:flex;
  flex-direction:column;
  gap:2px;
  padding:11px 13px;
  border:1px solid var(--stg-line);
  border-radius:var(--stg-r);
  background:var(--stg-surface);
}
#orgPaneBody .stg-org-tile-n{
  /* 30px in the mockup / 1.4113 = 21px. */
  font-size:var(--a-fs-21);
  font-weight:700;
  color:var(--stg-text);
  font-variant-numeric:tabular-nums;
  line-height:var(--a-lh-tight);
}
#orgPaneBody .stg-org-tile-l{ font-size:var(--a-fs-ctl-sm); color:var(--stg-faint); line-height:var(--a-lh-ui); }
#orgPaneBody .stg-org-tiles-caption{
  margin-top:11px;
  font-size:var(--a-fs-ctl-sm);
  color:var(--stg-faint);
  line-height:var(--a-lh-ui);
}

/* ---- The Billing button, in the details card's header band ---- */
.alt-app #adminModal #orgPaneBody .stg-org-billing-slot > button.a-btn{
  align-self:center;
  min-width:113px;
  justify-content:center;
}
#orgPaneBody #orgDetailsCard{ position:relative; }
#orgPaneBody .stg-org-billing-slot{
  position:absolute;
  top:1px;
  right:16px;
  height:71px;
  display:flex;
  align-items:center;
  z-index:1;
}
#orgPaneBody #orgDetailsCard > .stg-sec-h{ padding-right:130px; }

/* Third button: `.stg-pane-actions` (alt-team.css) assumes two buttons and no wrap, so wrap is
   scoped to this pane. `flex-wrap` alone does nothing because `flex:0 0 auto` never shrinks;
   `max-width:100%` clamps the row first, giving it something to wrap inside. */
#orgPaneBody .stg-pane-actions{ flex-wrap:wrap; justify-content:flex-end; max-width:100%; }

/* ---- Narrow ---- */
@media (max-width:900px){
  #orgPaneBody .org-row-2{ grid-template-columns:minmax(0,1fr); }
  #orgPaneBody .org-field-grid{ grid-template-columns:minmax(0,1fr); }
  #orgPaneBody .stg-org-tiles{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}
@media (max-width:560px){
  #orgPaneBody .stg-org-tiles{ grid-template-columns:minmax(0,1fr); }
  #orgPaneBody .org-mark-row{ flex-direction:column; }
  #orgPaneBody .stg-org-billing-slot{
    position:static; height:auto; justify-content:flex-end; padding:0 16px 10px;
  }
  #orgPaneBody #orgDetailsCard > .stg-sec-h{ padding-right:16px; }
}

/* ================= Organization billing — the disabled empty state =================
   Scoped to #orgBillingView, this pane's own view swap target (JS/features/org-billing.js). */

#orgBillingView .stg-org-billing-crumb{
  margin-bottom:12px;
}
#orgBillingView .stg-org-billing-crumb .a-btn span{
  font-size:var(--a-fs-16);
  line-height:var(--a-lh-ctl);
}

#orgBillingView .stg-org-billing-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  margin-bottom:14px;
}
#orgBillingView .stg-org-billing-head-copy{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
}
/* "Coming soon" reuses `.a-chip` verbatim (no modifier class) — a neutral chip, never a warning
   or danger colour, because a scaffold that has not shipped yet is not an error state. */

#orgBillingView .stg-org-billing-empty{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:10px;
  padding:48px 24px;
  border:1px solid var(--stg-line);
  border-radius:var(--stg-r-lg);
  background:var(--stg-surface);
}
#orgBillingView .stg-org-billing-ico{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:56px;
  height:56px;
  border-radius:50%;
  background:var(--stg-surface-2);
  color:var(--stg-dim);
  margin-bottom:4px;
}
#orgBillingView .stg-org-billing-ico svg{ width:28px; height:28px; }
#orgBillingView .stg-org-billing-empty h3{
  margin:0;
  font-size:var(--a-fs-16);
  font-weight:700;
  color:var(--stg-text);
}
#orgBillingView .stg-org-billing-empty p{
  margin:0;
  max-width:440px;
  /* 13px, not 12.5px — a half-pixel size rounds differently per platform/zoom, which is why
     responsive-layout.test.js refuses fractional font sizes across every stylesheet. */
  font-size:var(--a-fs-ctl);
  line-height:var(--a-lh-ui);
  color:var(--stg-dim);
}
/* The disabled button — `.btn:disabled` already gives opacity/cursor (components.css); a
   second settings-local treatment would be CLAUDE.md principle 4's duplication. This only adds
   the spacing this layout needs. */
#orgBillingView #orgConfigureBillingBtn{
  margin-top:6px;
}
/* "This feature is currently disabled" — the third place (after the chip and heading) the
   disabled state is stated in words, per sys_design-system.md's colour-is-never-the-only-
   carrier rule. */
#orgBillingView .stg-org-billing-note{
  font-size:var(--a-fs-11);
  color:var(--stg-faint);
}

@media (max-width:640px){
  #orgBillingView .stg-org-billing-head{
    flex-direction:column;
  }
}


/* ============================================================================
   The logo's alternates list. Repeats `.org-owner-row`'s geometry on purpose (alike lists, different components).
   Uses the pane's tokens (--stg-line, --stg-text, --stg-dim, --accent-text).
   ============================================================================ */

/* `.org-assets-list` has no rule, and that's a judgement (CLAUDE.md 4d), not an omission — it's
   a bare innerHTML/delegation target; the rows carry the layout, so a default block div needs
   nothing. `.org-owner-list` has no equivalent only because the owners list has no wrapper. */
#orgPaneBody .org-asset-row{
  display:flex;
  align-items:center;
  gap:11px;
  padding:9px 0;
  border-bottom:1px solid var(--stg-line);
}
#orgPaneBody .org-asset-row:last-of-type{ border-bottom:0; }

/* Preview slot: `.org-mark-preview` at row scale (same border, radius, surface). 30x28 is the
   mark's slot (TEAM_BRAND_W/H); the frame keeps a transparent PNG legible in light mode.
   `flex:0 0 auto` so `.org-asset-id` beside it truncates instead. */
#orgPaneBody .org-asset-thumb{
  flex:0 0 auto;
  width:38px;
  height:36px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border:1px solid var(--stg-line);
  border-radius:var(--stg-r);
  background:var(--stg-surface);
  color:var(--stg-dim);
}
/* `display:block`, must not be `none` — same trap as the mark preview above. orgAssetThumbsFill()
   reveals the image by REMOVING the inline display:none; `none` here would hide every thumbnail
   while the fill still reported success. */
#orgPaneBody .org-asset-thumb img{
  max-width:88%;
  max-height:88%;
  object-fit:contain;
  display:block;
}
/* The not-an-image glyph — a PDF has no preview, and an empty frame reads as a failed thumbnail
   rather than a file that has none. */
#orgPaneBody .org-asset-thumb svg{ display:block; }

/* The identity column takes the slack; `min-width:0` is what makes the ellipsis work — a flex
   item's default min-width:auto is its content's intrinsic width, the same defect that once
   clipped meta text on task rows and reached the owner's screen. */
#orgPaneBody .org-asset-id{
  display:flex; flex-direction:column; gap:1px;
  min-width:0; flex:1 1 auto;
}
#orgPaneBody .org-asset-n{
  font-size:var(--a-fs-ctl); font-weight:600; color:var(--stg-text);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
#orgPaneBody .org-asset-m{
  font-size:var(--a-fs-ctl-sm); color:var(--stg-dim);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}

#orgPaneBody .org-live-note{ margin-top:12px; }

/* At phone width the row stacks rather than squeezing two buttons and a filename into ~300px —
   640px matches the billing breakpoint at the foot of this file; a second value would be a
   second answer to the same question. */
@media (max-width:640px){
  #orgPaneBody .org-asset-row{
    align-items:flex-start;
    flex-wrap:wrap;
  }
  /* The thumbnail stays beside the name when the row wraps — calc() removes the frame and gap
     from the line the identity column shares, so `flex:1 1 100%` alone wouldn't. */
  #orgPaneBody .org-asset-id{ flex:1 1 calc(100% - 49px); }
}
