/* MostlyID — the Organization home (F307): header + switcher, tabs, members table, sign-in &
   security, the Require dialog and the toast. Uses the settings page's tokens (--accent, --ink,
   --muted, --line, --bg-soft); every control is a real button/link/input with a 44 px target. */

.content-col.wide { max-width: 1040px; }

.oh-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 18px; }
.oh-title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.oh-sub { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.oh-head-acts { display: flex; gap: 8px; align-items: center; position: relative; }

.oh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.oh-btn:hover { background: var(--bg-soft); }
.oh-btn.dark { background: var(--midnight); border-color: var(--midnight); color: #fff; }
.oh-btn.dark:hover { background: #26264a; }
.oh-btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.oh-btn.accent:hover { background: var(--accent-hover); }
.oh-btn.danger { color: #b4232a; }
.oh-btn:disabled { opacity: .55; cursor: not-allowed; }
.oh-link { background: none; border: 0; padding: 10px 4px; min-height: 44px; font: inherit; font-size: 14px; font-weight: 600; color: var(--accent); cursor: pointer; text-decoration: none; }
.oh-link:hover { color: var(--accent-hover); }
.oh-link.muted { color: var(--muted); font-weight: 500; }

/* org switcher: a button with a menu */
.oh-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px 0 6px; border-radius: 22px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.oh-switch .ava { width: 32px; height: 32px; }
.oh-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 260px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(20,20,43,.12); padding: 6px; display: grid; gap: 2px; }
.oh-menu[hidden] { display: none; }
.oh-menu button { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: 14px; color: var(--ink); text-align: left; cursor: pointer; }
.oh-menu button:hover, .oh-menu button[aria-current="true"] { background: var(--bg-soft); }
.oh-menu .role { font-size: 12px; color: var(--muted); }
.oh-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* tabs */
.oh-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin: 0 0 22px; overflow-x: auto; }
.oh-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 0 12px; min-height: 44px; font: inherit; font-size: 15px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.oh-tabs button[aria-selected="true"] { color: var(--ink); font-weight: 650; border-bottom-color: var(--ink); }

/* avatars + badges */
.ava { flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: color-mix(in srgb, var(--accent) 14%, #fff); color: var(--accent); }
.ava.t1 { background: #e3efe8; color: #1f5f3f; } .ava.t2 { background: #f5e8da; color: #8a4b12; } .ava.t3 { background: #e5eef8; color: #1d4f86; } .ava.t4 { background: #f1f0ec; color: #3f3f46; }
.tile { flex: none; width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; background: #eef0f5; color: #1d2b53; }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 14px; background: var(--bg-soft); font-size: 13px; color: var(--ink); white-space: nowrap; }
.badge.sso { background: color-mix(in srgb, var(--accent) 13%, #fff); color: #3a3aa8; font-weight: 600; }
.badge.sso::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.badge.warn { background: #fff4e5; color: #8a4b12; }
.badge.ok { background: #e8f6ef; color: #1a6b4c; }
.chip-guest { font-size: 11.5px; font-weight: 600; color: var(--muted); background: #f1f0ec; padding: 2px 8px; border-radius: 10px; margin-left: 6px; }
.note-warn { display: block; font-size: 12px; color: #8a4b12; margin-top: 4px; }

/* cards */
.oh-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.oh-card + .oh-card { margin-top: 16px; }
.oh-card-pad { padding: 20px 22px; }
.oh-card h3 { margin: 0; font-size: 16px; font-weight: 650; }

/* members table */
.oh-table { width: 100%; }
.oh-tr { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, .9fr) auto; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid #efeff5; }
.oh-tr:first-child { border-top: 0; }
.oh-tr.th { font-size: 12.5px; color: var(--muted); padding-top: 14px; padding-bottom: 10px; }
.oh-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.oh-person .nm { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.oh-person .em { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.oh-role { appearance: none; min-height: 40px; padding: 0 32px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236a6a85' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.oh-role:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.oh-muted { font-size: 13.5px; color: var(--muted); }
.oh-empty { padding: 18px 20px; color: var(--muted); font-size: 14px; }

/* sign-in & security */
.oh-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.oh-status { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.oh-status p { margin: 6px 0 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #c9c9d6; flex: none; }
.dot.on { background: #1a7f5a; } .dot.required { background: var(--accent); } .dot.off { background: #c9c9d6; }
.oh-hint { margin: 14px 0 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: #f1f1f6; border-radius: 12px; }
.seg button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button[aria-checked="true"] { background: #fff; color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px rgba(20,20,43,.1); }
.seg button:disabled { cursor: not-allowed; opacity: .5; }
.oh-rows { border-top: 1px solid #efeff5; }
.oh-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 22px; border-top: 1px solid #efeff5; }
.oh-row:first-child { border-top: 0; }
.oh-row .k { font-size: 13.5px; color: var(--muted); }
.oh-row .v { font-size: 14.5px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.oh-row .v .ok { color: #1a7f5a; font-size: 13px; }
.oh-row .v .oh-role { width: auto; }
.oh-tr > div > span { font-size: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border-radius: 15px; background: #e8f6ef; color: #1a6b4c; font-size: 13.5px; }
.chip.pending { background: #fff4e5; color: #8a4b12; }
.mix { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin: 12px 0; }
.mix span { display: block; } .mix .sso { background: var(--accent); } .mix .other { background: #b9b9ee; } .mix .guests { background: #dcdce6; }
.mix-rows { display: grid; gap: 8px; font-size: 14px; }
.mix-rows div { display: flex; justify-content: space-between; align-items: center; }
.mix-rows i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 8px; }
.feed { list-style: none; margin: 12px 0 4px; padding: 0; display: grid; gap: 12px; font-size: 14px; line-height: 1.4; }
.feed small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* dialog + toast */
.oh-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(20,20,43,.32); display: flex; align-items: center; justify-content: center; padding: 16px; }
.oh-dialog { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 20px; box-shadow: 0 24px 60px rgba(20,20,43,.2); padding: 26px; display: grid; gap: 18px; }
.oh-dialog h2 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.oh-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.oh-stats div { background: var(--bg-soft); border-radius: 12px; padding: 12px; }
.oh-stats b { display: block; font-size: 24px; letter-spacing: -0.02em; }
.oh-stats span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.oh-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14.5px; line-height: 1.45; color: #3f3f55; }
.oh-acts { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.oh-dialog textarea { width: 100%; min-height: 110px; font: inherit; font-size: 15px; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: .6rem; resize: vertical; }
.oh-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 8px 0 18px; border-radius: 14px; background: var(--midnight); color: #fff; font-size: 14.5px; box-shadow: 0 12px 30px rgba(20,20,43,.3); max-width: calc(100vw - 32px); }
.oh-toast button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: rgba(255,255,255,.16); color: #fff; font: inherit; font-weight: 650; cursor: pointer; }

@media (max-width: 860px) {
  .oh-grid { grid-template-columns: minmax(0, 1fr); }
  .oh-tr { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; }
  .oh-tr .oh-person { grid-column: 1 / -1; }
  .oh-tr .c-method { grid-column: 1; grid-row: 2; }
  .oh-tr .c-last { grid-column: 2; grid-row: 2; text-align: right; }
  .oh-tr .c-role { grid-column: 1; grid-row: 3; }
  .oh-tr .c-act { grid-column: 2; grid-row: 3; }
  .oh-tr .c-role .oh-role { width: 100%; max-width: 220px; }
  .oh-tr.th { display: none; }
  .oh-row { grid-template-columns: minmax(0, 1fr) auto; }
  .oh-row .k { grid-column: 1 / -1; }
  .oh-stats { grid-template-columns: minmax(0, 1fr); }
}
