/* Public-readable access states for hard-refresh and session checks. */
:root {
  --access-ink: #1b1917;
  --access-muted: #726d67;
  --access-paper: #f8f5f1;
  --access-card: rgba(255, 255, 255, 0.94);
  --access-line: rgba(28, 24, 21, 0.12);
  --access-accent: #e8611a;
  --access-success: #16865e;
  --access-danger: #b23a35;
}

/* Owner panel: deliberately opaque surfaces over the workspace. */
.owner-panel{--owner-bg:#f4f1ec;--owner-card:#fff;--owner-ink:#24201c;--owner-dim:#766f68;--owner-line:#ded8d1;min-height:100%;padding:clamp(18px,3vw,36px);color:var(--owner-ink);background:var(--owner-bg);box-sizing:border-box}.owner-head{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:24px}.owner-head h1{margin:3px 0 8px;font-size:clamp(28px,4vw,42px);letter-spacing:-.04em}.owner-head p{margin:0;color:var(--owner-dim);line-height:1.5}.owner-kicker{color:#d95f1d!important;font:800 10px/1.2 "JetBrains Mono",monospace;letter-spacing:.14em;text-transform:uppercase}.owner-badge{padding:9px 13px;border-radius:999px;color:#9d4418;background:#fff0e6;font-size:11px;font-weight:800;white-space:nowrap}.owner-tabs{display:flex;gap:5px;padding:5px;overflow-x:auto;border:1px solid var(--owner-line);border-radius:16px;background:#ebe6df}.owner-tab{min-height:42px;padding:0 15px;border:0;border-radius:11px;color:#69625b;background:transparent;font-weight:750;white-space:nowrap;cursor:pointer}.owner-tab.active{color:var(--owner-ink);background:#fff;box-shadow:0 5px 16px rgba(40,32,25,.08)}.owner-content{margin-top:18px}.owner-metrics{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-bottom:16px}.owner-metric,.owner-section{border:1px solid var(--owner-line);background:var(--owner-card);box-shadow:0 8px 28px rgba(42,32,24,.05)}.owner-metric{display:flex;min-height:112px;flex-direction:column;justify-content:center;padding:18px;border-radius:17px}.owner-metric strong{font-size:30px;line-height:1}.owner-metric span{margin-top:10px;color:var(--owner-dim);font-size:12px}.owner-section{padding:20px;border-radius:20px;margin-bottom:16px}.owner-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:17px}.owner-section h2,.owner-modal h2{margin:0;font-size:20px}.owner-section h3,.owner-modal h3{margin:22px 0 6px}.owner-section-head p,.owner-modal header p,.owner-help{margin:6px 0 0;color:var(--owner-dim);font-size:12px;line-height:1.5}.owner-toolbar{display:flex;gap:9px;flex-wrap:wrap;margin-bottom:15px}.owner-input,.owner-select,.owner-form-grid input,.owner-form-grid select,.owner-one-time textarea{min-height:44px;padding:0 12px;border:1px solid var(--owner-line);border-radius:11px;color:var(--owner-ink);outline:0;background:#fff;font:inherit;box-sizing:border-box}.owner-input:focus,.owner-select:focus,.owner-form-grid input:focus,.owner-form-grid select:focus{border-color:#df6c2c;box-shadow:0 0 0 3px rgba(223,108,44,.12)}.owner-toolbar .grow{flex:1 1 290px}.owner-select{max-width:220px}.owner-table{overflow:hidden;border:1px solid var(--owner-line);border-radius:14px;background:#fff}.owner-tr{display:grid;grid-template-columns:1.55fr 1.2fr 1fr 1fr 1fr auto;gap:12px;align-items:center;padding:13px 14px;border-bottom:1px solid #ebe7e2;font-size:12px}.owner-tr:last-child{border:0}.owner-tr.head{color:var(--owner-dim);background:#f7f4f0;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.06em}.owner-tr span{min-width:0}.owner-tr b,.owner-tr small{display:block}.owner-tr small{margin-top:4px;color:var(--owner-dim);font-size:10px}.owner-tr.invites{grid-template-columns:1.5fr 1fr 1fr .8fr 1fr}.owner-tr.journal{grid-template-columns:1fr 2fr .8fr}.owner-tr.sessions{grid-template-columns:1.5fr .6fr 1fr auto}.owner-status{display:inline-flex;padding:5px 8px;border-radius:999px;color:#725f45;background:#f4eee3;font-style:normal;font-weight:800;font-size:10px}.owner-status.s-active,.owner-status.s-pending{color:#0f7655;background:#e4f5ed}.owner-status.s-blocked,.owner-status.s-revoked{color:#9c342f;background:#f9e8e6}.owner-status.s-closed,.owner-status.s-expired{color:#665f58;background:#ede9e5}.owner-button{min-height:38px;padding:0 13px;border:0;border-radius:10px;color:#fff;background:#e36724;font-weight:800;font-size:11px;cursor:pointer}.owner-button.quiet{color:var(--owner-ink);border:1px solid var(--owner-line);background:#fff}.owner-button.danger{background:#a83c35}.owner-link{padding:3px;border:0;color:#b34e1e;background:transparent;font-size:11px;font-weight:800;cursor:pointer}.owner-link.danger{color:#a83c35}.owner-row-actions{display:flex;gap:8px;flex-wrap:wrap}.owner-columns{display:grid;grid-template-columns:1fr 1fr;gap:16px}.owner-structure-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid #ebe7e2;font-size:12px}.owner-structure-row:last-child{border:0}.owner-structure-row small{display:block;margin-top:4px;color:var(--owner-dim)}.owner-role-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.owner-role-grid article{display:flex;flex-direction:column;gap:7px;padding:14px;border:1px solid var(--owner-line);border-radius:13px}.owner-role-grid span{color:var(--owner-dim);font-size:11px}.owner-modal-layer{position:fixed;inset:0;z-index:2400;display:grid;place-items:center;padding:20px;background:rgba(25,21,18,.72)}.owner-modal{width:min(900px,calc(100vw - 30px));max-height:92vh;overflow:auto;padding:26px;border:1px solid #ded8d1;border-radius:22px;color:#24201c;background:#fff!important;box-shadow:0 30px 100px rgba(0,0,0,.38);box-sizing:border-box}.owner-modal header{display:flex;justify-content:space-between;gap:20px;margin-bottom:20px}.owner-icon-button{width:40px;height:40px;border:1px solid var(--owner-line);border-radius:11px;color:#655d56;background:#fff;font-size:23px;cursor:pointer}.owner-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.owner-form-grid label,.owner-one-time{display:grid;gap:7px;color:#6f6861;font-size:11px;font-weight:800}.owner-form-grid input,.owner-form-grid select{width:100%;background:#fff!important}.owner-permissions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.owner-permission-group{margin:0;padding:12px;border:1px solid var(--owner-line);border-radius:13px;background:#faf8f5}.owner-permission-group legend{padding:0 6px;font-weight:850;font-size:11px}.owner-permission-group label{display:grid;grid-template-columns:auto 1fr;gap:2px 8px;align-items:start;padding:7px 0;font-size:11px}.owner-permission-group input{grid-row:1/3}.owner-permission-group small{color:var(--owner-dim);font-size:9px}.owner-callout,.owner-error{padding:12px;border-radius:12px;margin:15px 0;font-size:11px}.owner-callout{color:#7d471f;background:#fff0e4}.owner-error{color:#8f2f2a;background:#f9e8e6}.owner-modal-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:22px}.owner-tech{margin-top:16px;color:var(--owner-dim);font-size:11px}.owner-tech dl{display:grid;grid-template-columns:auto 1fr;gap:5px 12px}.owner-one-time textarea{width:100%;min-height:120px;padding:12px;resize:none;background:#fff!important;word-break:break-all}.owner-empty,.owner-loading{padding:42px;text-align:center;color:var(--owner-dim);border-radius:18px;background:#fff}.owner-loading{min-height:220px;display:grid;place-items:center}
@media(max-width:1100px){.owner-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.owner-role-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.owner-tr{grid-template-columns:1.4fr 1fr 1fr .9fr auto}.owner-tr>*:nth-child(5){display:none}}
@media(max-width:760px){.owner-panel{padding:14px}.owner-head{display:block}.owner-badge{display:inline-flex;margin-top:14px}.owner-tabs{margin:0 -2px}.owner-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.owner-columns,.owner-form-grid,.owner-permissions{grid-template-columns:1fr}.owner-section{padding:14px}.owner-section-head{align-items:stretch;flex-direction:column}.owner-select{max-width:none;flex:1 1 140px}.owner-table{border:0;background:transparent;overflow:visible}.owner-tr,.owner-tr.invites,.owner-tr.sessions,.owner-tr.journal{grid-template-columns:1fr auto;padding:14px;margin-bottom:9px;border:1px solid var(--owner-line);border-radius:13px;background:#fff}.owner-tr.head{display:none}.owner-tr>*{display:block!important}.owner-tr>button,.owner-tr>.owner-row-actions{grid-column:2;grid-row:1/-1;align-self:center}.owner-role-grid{grid-template-columns:1fr}.owner-modal-layer{padding:8px}.owner-modal{width:calc(100vw - 16px);padding:18px;border-radius:17px}.owner-modal-actions .owner-button{flex:1 1 140px}}

/* Keep every intentionally hidden control hidden even when a component
   applies its own display rule (for example .access-field uses display:grid). */
[hidden] {
  display: none !important;
}

.access-state-screen,
.access-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 12%, rgba(232, 97, 26, 0.13), transparent 34%),
    rgba(26, 24, 22, 0.92);
  /* A live full-viewport blur stalls Firefox for several seconds on 4K
     displays during hard reload. The opaque scrim keeps protected content
     unreadable without forcing an expensive GPU repaint. */
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.access-state-screen[hidden],
.access-modal-layer[hidden] {
  display: none !important;
}

.access-state-card,
.access-modal {
  width: min(100%, 540px);
  color: var(--access-ink);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 30px;
  background: var(--access-card);
  box-shadow: 0 32px 90px rgba(18, 14, 11, 0.28);
}

.access-state-card {
  padding: clamp(28px, 5vw, 52px);
  text-align: center;
}

.access-state-mark {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 24px;
  place-items: center;
  border-radius: 20px;
  background: rgba(232, 97, 26, 0.12);
}

.access-state-mark span {
  width: 14px;
  height: 14px;
  border: 3px solid var(--access-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(232, 97, 26, 0.13);
}

.access-state-screen[data-tone="danger"] .access-state-mark {
  background: rgba(178, 58, 53, 0.12);
}

.access-state-screen[data-tone="danger"] .access-state-mark span {
  border-color: var(--access-danger);
  box-shadow: 0 0 0 7px rgba(178, 58, 53, 0.12);
}

.access-state-screen[data-tone="warning"] .access-state-mark span {
  animation: accessPulse 1.4s ease-in-out infinite;
}

.access-eyebrow {
  margin: 0 0 10px;
  color: var(--access-accent);
  font: 700 11px/1.2 "JetBrains Mono", monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.access-state-card h1,
.access-modal h2,
.access-dashboard h1,
.access-governance-card h2 {
  margin: 0;
  color: var(--access-ink);
  letter-spacing: -0.035em;
}

.access-state-card h1 {
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.05;
}

.access-state-text {
  max-width: 420px;
  margin: 18px auto 0;
  color: var(--access-muted);
  font-size: 15px;
  line-height: 1.6;
}

.access-state-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.access-btn {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font: 700 14px/1 "DM Sans", sans-serif;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.access-btn:disabled {
  cursor: wait;
  opacity: 0.58;
}

.access-btn-primary {
  color: #fff;
  background: var(--access-accent);
  box-shadow: 0 10px 24px rgba(232, 97, 26, 0.24);
}

.access-btn-primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(232, 97, 26, 0.3);
}

.access-btn-quiet {
  color: var(--access-ink);
  border: 1px solid var(--access-line);
  background: transparent;
}

.access-btn-wide {
  width: 100%;
  margin-top: 6px;
}

.access-modal {
  position: relative;
  padding: clamp(26px, 5vw, 42px);
}

.access-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  color: var(--access-muted);
  border: 1px solid var(--access-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 23px;
  cursor: pointer;
}

.access-modal-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--access-muted);
  font: 700 10px/1 "JetBrains Mono", monospace;
  letter-spacing: 0.14em;
}

.access-brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--access-accent);
}

.access-modal h2 {
  padding-right: 42px;
  font-size: 32px;
}

.access-modal-sub {
  margin: 9px 0 24px;
  color: var(--access-muted);
  font-size: 14px;
}

.access-field {
  display: grid;
  gap: 8px;
  margin-bottom: 15px;
  color: var(--access-muted);
  font-size: 12px;
  font-weight: 700;
}

.access-field input {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  color: var(--access-ink);
  border: 1px solid var(--access-line);
  border-radius: 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.82);
  font: 500 15px/1 "DM Sans", sans-serif;
}

.access-field input:focus {
  border-color: var(--access-accent);
  box-shadow: 0 0 0 4px rgba(232, 97, 26, 0.12);
}

.access-form-error {
  margin: 6px 0 12px;
  padding: 11px 13px;
  color: #8f2f2a;
  border-radius: 12px;
  background: rgba(178, 58, 53, 0.09);
  font-size: 12px;
  line-height: 1.45;
}

.access-account-button,
.access-account {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: #fff;
  border: 0;
  background: transparent;
  text-align: left;
}

.access-account-button {
  cursor: pointer;
}

.access-account-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: #fff;
  border-radius: 11px;
  background: var(--access-accent);
  font-size: 11px;
  font-weight: 800;
}

.access-account-button span:last-child,
.access-account-copy {
  min-width: 0;
}

.access-account-button strong,
.access-account-button small,
.access-account-copy strong,
.access-account-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-account-button strong,
.access-account-copy strong {
  font-size: 12px;
}

.access-account-button small,
.access-account-copy small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 9px;
}

.access-account-more {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.65);
  border: 0;
  background: transparent;
  cursor: pointer;
}

.access-account-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 50;
  width: 178px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  background: #28231f;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

.access-account-menu button {
  width: 100%;
  padding: 10px;
  color: #fff;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.access-account-menu button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.access-dashboard {
  position: absolute;
  inset: 0;
  z-index: 25;
  overflow: auto;
  color: var(--access-ink);
  background:
    radial-gradient(circle at 82% 8%, rgba(232, 97, 26, 0.11), transparent 30%),
    linear-gradient(150deg, #f5f0eb 0%, #ebe5df 100%);
}

.access-dashboard[hidden] {
  display: none !important;
}

.access-dashboard-inner {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) 0;
}

.access-dashboard-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.access-dashboard-head h1 {
  font-size: clamp(36px, 6vw, 64px);
}

.access-dashboard-head p:last-child,
.access-governance-card p {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--access-muted);
  line-height: 1.55;
}

.access-live-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  color: var(--access-success);
  border: 1px solid rgba(22, 134, 94, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 800;
}

.access-live-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--access-success);
  box-shadow: 0 0 0 5px rgba(22, 134, 94, 0.1);
}

.access-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.access-metric,
.access-governance-card {
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 14px 34px rgba(63, 50, 39, 0.07);
}

.access-metric {
  min-height: 180px;
  padding: 24px;
  border-radius: 22px;
}

.access-metric span,
.access-metric small {
  display: block;
  color: var(--access-muted);
}

.access-metric span {
  font: 700 10px/1.2 "JetBrains Mono", monospace;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.access-metric strong {
  display: block;
  margin: 24px 0 9px;
  font-size: clamp(25px, 4vw, 38px);
  line-height: 1;
}

.access-metric small {
  font-size: 11px;
  line-height: 1.4;
}

.access-governance-card {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 30px;
  margin-top: 14px;
  padding: clamp(24px, 4vw, 38px);
  border-radius: 26px;
}

.access-governance-card h2 {
  font-size: 26px;
}

.access-cap-list {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
}

.access-cap-list span {
  padding: 8px 10px;
  color: #655f59;
  border: 1px solid var(--access-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
  font: 600 9px/1.25 "JetBrains Mono", monospace;
}

.access-cap-list .is-muted {
  color: var(--access-muted);
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
}

.access-readonly-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 80;
  width: max-content;
  max-width: calc(100% - 24px);
  transform: translateX(-50%);
  padding: 8px 12px;
  color: #665b4d;
  border: 1px solid rgba(133, 99, 51, 0.16);
  border-radius: 999px;
  background: rgba(255, 248, 233, 0.94);
  box-shadow: 0 8px 24px rgba(65, 48, 31, 0.1);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.access-rights-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1300;
  max-width: min(380px, calc(100vw - 40px));
  padding: 13px 16px;
  color: #fff;
  border-radius: 14px;
  background: #28231f;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 12px;
  font-weight: 700;
}

.access-rights-toast.is-visible {
  opacity: 1;
  transform: none;
}

.access-btn:focus-visible,
.access-modal-close:focus-visible,
.access-account-button:focus-visible,
.access-account-more:focus-visible,
.access-account-menu button:focus-visible {
  outline: 3px solid rgba(232, 97, 26, 0.34);
  outline-offset: 3px;
}

@keyframes accessPulse {
  50% { transform: scale(0.82); opacity: 0.62; }
}

@media (max-width: 820px) {
  .access-dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .access-metric:first-child {
    grid-column: 1 / -1;
  }

  .access-governance-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .access-state-screen,
  .access-modal-layer {
    align-items: end;
    padding: 10px;
  }

  .access-state-card,
  .access-modal {
    border-radius: 24px;
  }

  .access-state-actions {
    flex-direction: column;
  }

  .access-state-actions .access-btn {
    width: 100%;
  }

  .access-dashboard-inner {
    width: min(100% - 28px, 720px);
    padding: 28px 0 50px;
  }

  .access-dashboard-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .access-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .access-metric:first-child {
    grid-column: auto;
  }

  .access-metric {
    min-height: 140px;
  }

  .access-readonly-banner {
    top: 64px;
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .access-btn,
  .access-rights-toast,
  .access-state-mark span {
    animation: none !important;
    transition: none !important;
  }
}

[data-theme="dark"] .access-dashboard {
  color: #f2efeb;
  background: radial-gradient(circle at 82% 8%, rgba(232, 97, 26, 0.12), transparent 30%), #1b1815;
}

[data-theme="dark"] .access-dashboard h1,
[data-theme="dark"] .access-dashboard h2,
[data-theme="dark"] .access-metric strong {
  color: #f7f4f0;
}

[data-theme="dark"] .access-metric,
[data-theme="dark"] .access-governance-card {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.055);
}

/* Owner access editor — clear, layered controls for people, departments and roles. */
.owner-subtabs {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--owner-line);
  border-radius: 14px;
  background: #f4f1ed;
}

.owner-subtabs .owner-button {
  min-width: max-content;
  color: var(--owner-dim);
  background: transparent;
}

.owner-subtabs .owner-button.active {
  color: var(--owner-ink);
  border: 1px solid var(--owner-line);
  background: #fff;
  box-shadow: 0 5px 14px rgba(40, 32, 25, 0.07);
}

.owner-modal {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.owner-modal-wide {
  width: min(980px, calc(100vw - 30px));
}

.owner-modal-header {
  flex: 0 0 auto;
  align-items: flex-start;
  margin: 0 !important;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--owner-line);
  background: #fff;
}

.owner-modal-body {
  min-height: 0;
  padding: 22px 26px 28px;
  overflow: auto;
  overscroll-behavior: contain;
  background: #fff;
}

.owner-modal-actions.sticky {
  position: sticky;
  bottom: -28px;
  z-index: 2;
  margin: 24px -26px -28px;
  padding: 16px 26px;
  border-top: 1px solid var(--owner-line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -12px 28px rgba(43, 34, 27, 0.06);
}

.owner-form-section {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--owner-line);
  border-radius: 16px;
  background: #faf8f5;
}

.owner-section-number {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #e36724;
  font-size: 13px;
  font-weight: 900;
}

.owner-form-section h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.owner-form-section > div > p {
  margin: 0 0 14px;
  color: var(--owner-dim);
  font-size: 11px;
  line-height: 1.5;
}

.owner-form-grid label > span {
  color: var(--owner-ink);
  font-size: 11px;
}

.owner-form-grid label > small {
  color: var(--owner-dim);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.4;
}

.owner-access-summary {
  display: grid;
  gap: 14px;
  margin: 12px 0;
  padding: 13px 14px;
  border: 1px solid #efd5c5;
  border-radius: 13px;
  background: #fff8f3;
}

.owner-access-summary > div {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.owner-access-summary b,
.owner-access-summary small {
  display: block;
}

.owner-access-summary small {
  margin-top: 3px;
  color: var(--owner-dim);
}

.owner-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #9d4418;
  background: #ffe8d9;
  font-size: 10px;
  font-weight: 900;
}

.owner-permission-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 15px 0 9px;
}

.owner-permission-heading h4 {
  margin: 0;
  font-size: 13px;
}

.owner-permission-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

details.owner-permission-group {
  padding: 0;
  overflow: hidden;
  background: #fff;
}

details.owner-permission-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  font-weight: 850;
}

details.owner-permission-group > summary::-webkit-details-marker {
  display: none;
}

details.owner-permission-group > summary::after {
  content: "+";
  color: #b34e1e;
  font-size: 18px;
}

details.owner-permission-group[open] > summary::after {
  content: "−";
}

.owner-permission-list {
  padding: 0 14px 10px;
  border-top: 1px solid #eee9e4;
}

.owner-permission-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 9px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid #f0ece8;
  color: var(--owner-ink);
  font-size: 11px;
  font-weight: 700;
}

.owner-permission-item:last-child {
  border-bottom: 0;
}

.owner-permission-item input {
  grid-row: 1 / 3;
  margin-top: 2px;
}

.owner-permission-item small {
  color: var(--owner-dim);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.35;
}

.owner-permission-item.locked {
  opacity: 0.65;
}

.owner-policy-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 13px 0 16px;
}

.owner-policy-overview span {
  padding: 10px;
  border: 1px solid var(--owner-line);
  border-radius: 11px;
  background: #fff;
  font-size: 10px;
  line-height: 1.4;
}

.owner-callout {
  display: grid;
  gap: 4px;
}

.owner-callout b,
.owner-callout span {
  display: block;
}

.owner-structure-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.owner-structure-grid,
.owner-role-list {
  display: grid;
  gap: 10px;
}

.owner-structure-card,
.owner-role-card {
  padding: 15px;
  border: 1px solid var(--owner-line);
  border-radius: 14px;
  background: #fff;
}

.owner-structure-title,
.owner-role-main,
.owner-structure-actions,
.owner-role-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.owner-structure-title h3,
.owner-role-card h3 {
  margin: 0;
  font-size: 14px;
}

.owner-structure-title small,
.owner-role-meta {
  color: var(--owner-dim);
  font-size: 10px;
}

.owner-structure-card > p {
  margin: 10px 0;
  color: var(--owner-dim);
  font-size: 10px;
  line-height: 1.45;
}

.owner-structure-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0 13px;
}

.owner-structure-chips span,
.owner-profile-state {
  padding: 5px 8px;
  border-radius: 999px;
  color: #665f58;
  background: #f1ece6;
  font-size: 9px;
  font-weight: 800;
}

.owner-profile-state.custom {
  color: #9d4418;
  background: #fff0e6;
}

.owner-role-card {
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.owner-role-card:hover,
.owner-role-card:focus-visible {
  border-color: #df6c2c;
  outline: 0;
  transform: translateY(-1px);
}

.owner-role-card[disabled] {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

@media (max-width: 980px) {
  .owner-structure-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .owner-modal-wide {
    width: calc(100vw - 16px);
  }

  .owner-modal-header {
    padding: 18px 16px 14px;
  }

  .owner-modal-body {
    padding: 16px;
  }

  .owner-modal-actions.sticky {
    bottom: -16px;
    margin: 20px -16px -16px;
    padding: 13px 16px;
  }

  .owner-form-section {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .owner-section-number {
    width: 30px;
    height: 30px;
  }

  .owner-access-summary,
  .owner-permission-heading,
  .owner-structure-title,
  .owner-structure-actions,
  .owner-role-main,
  .owner-role-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .owner-policy-overview {
    grid-template-columns: 1fr;
  }

  .owner-permissions {
    grid-template-columns: 1fr;
  }
}
