.account-open, .account-content button:not(.icon-button) {
  min-height: 38px; padding: 8px 13px; border: 1px solid var(--line);
  border-radius: 6px; color: var(--text); background: #fff; font-weight: 600;
}
.account-open { flex-shrink: 0; }
.account-dialog { width: min(1120px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0;
  border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: #fff; }
.account-dialog::backdrop { background: rgba(22,32,42,.45); }
.account-header { display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 24px; border-bottom: 1px solid var(--line); }
.account-header h2 { margin: 0; font-size: 21px; }
.account-header p { margin: 6px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.account-header .icon-button { flex-shrink: 0; }
.account-content { padding: 20px 24px; }
.account-nav { display: flex; gap: 4px; padding: 8px 24px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.account-nav button { padding: 12px 10px; border: 0; border-bottom: 3px solid transparent; background: white; color: var(--muted); white-space: nowrap; }
.account-nav button[aria-current=page] { color: var(--blue); border-bottom-color: var(--blue); font-weight: 700; }
.directory-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.directory-section .account-toolbar { margin-bottom: 8px; }
.audit-filters { display: grid; grid-template-columns: minmax(150px,1.5fr) minmax(170px,1.5fr) minmax(110px,1fr) minmax(130px,1fr) minmax(130px,1fr) auto; gap: 12px; align-items: end; margin-bottom: 18px; }
.audit-table-wrap { max-height: 52dvh; }
.audit-table td { vertical-align: top; min-width: 120px; overflow-wrap: anywhere; }
.audit-table td:first-child { min-width: 165px; }
.audit-table td:last-child { min-width: 210px; max-width: 280px; }
.account-content h3 { margin: 0; font-size: 17px; }
.account-content .primary { background: var(--blue) !important; color: white !important; border-color: var(--blue) !important; }
.account-content .danger { color: var(--red) !important; }
.account-content button:disabled { opacity: .5; cursor: wait; }
.account-toolbar, .account-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.account-toolbar h3 { flex: 1; }
.account-toolbar input { flex: 1; min-width: 180px; }
.account-content .account-toolbar select { width: auto; flex: 0 1 260px; }
.account-content .account-toolbar input:not([type=checkbox]) { width: auto; }
.account-toolbar .check-label { justify-content: flex-start; }
.account-content input:not([type=checkbox]), .account-content select {
  width: 100%; min-height: 42px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--text);
}
.account-content label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; min-width: 0; }
.account-content input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); flex: 0 0 18px; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.account-content .check-label { display: flex; align-items: center; gap: 9px; color: var(--text); }
.account-table-wrap { overflow: auto; max-height: 56dvh; }
.account-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.account-table th { color: var(--muted); background: var(--bg); font-size: 12px; position: sticky; top: 0; }
.account-table td, .account-table th { padding: 12px 10px; border-bottom: 1px solid var(--line); }
.account-table td:first-child { min-width: 210px; }
.account-table small { display: block; color: var(--muted); margin-top: 5px; overflow-wrap: anywhere; }
.account-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.account-status::before { content: ''; width: 7px; height: 7px; background: var(--green); border-radius: 50%; }
.account-status.inactive::before { background: var(--grey); }
.account-message { margin: 0; padding: 0 24px 16px; color: var(--green); min-height: 24px; font-size: 14px; }
.account-message.error { color: var(--red); }
.account-empty { padding: 30px 0; color: var(--muted); text-align: center; }
.object-access { border: 0; border-top: 1px solid var(--line); padding: 18px 0 0; margin: 0 0 20px; min-width: 0; }
.object-access legend { font-size: 16px; font-weight: 700; padding: 0 8px 0 0; }
.access-list { max-height: 28dvh; overflow: auto; border-top: 1px solid var(--line); }
.access-list .check-label { padding: 10px 4px; border-bottom: 1px solid var(--line); font-weight: 400; }
.access-list .check-label span { min-width: 0; overflow-wrap: anywhere; }
.access-list small { display: block; color: var(--muted); margin-top: 4px; }
.access-count { font-size: 13px; color: var(--muted); }
.contact-row { padding: 18px 0; border-top: 1px solid var(--line); }
.contact-row-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.contact-row .account-grid { margin-bottom: 0; }
.account-actions { margin-bottom: 0; padding-top: 12px; }
.account-actions .primary { margin-left: auto; }
.account-profile { display: grid; grid-template-columns: 160px 1fr; gap: 12px; overflow-wrap: anywhere; }
.account-profile dt { color: var(--muted); }
.account-profile dd { margin: 0; }
[hidden] { display: none !important; }
@media(max-width: 640px) {
  .account-dialog { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .account-header { padding: 16px; }
  .account-header h2 { font-size: 18px; }
  .account-content { padding: 16px; }
  .account-nav { padding: 4px 8px 0; gap: 0; flex-wrap: wrap; }
  .account-nav button { padding: 12px 6px; font-size: 13px; }
  .audit-filters { grid-template-columns: 1fr 1fr; }
  .audit-filters label:first-child { grid-column: 1 / -1; }
  .directory-table, .directory-table tbody, .audit-table, .audit-table tbody { display: block; width: 100%; }
  .directory-table thead, .audit-table thead { display: none; }
  .directory-table tr, .audit-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .account-table.directory-table td, .account-table.audit-table td { display: grid; grid-template-columns: 106px minmax(0,1fr); gap: 10px; min-width: 0; max-width: none; width: 100%; padding: 7px 0; border: 0; overflow-wrap: anywhere; }
  .directory-table td::before, .audit-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
  .account-message { padding: 0 16px 16px; }
  .account-grid { grid-template-columns: 1fr; }
  .account-content .account-toolbar select { width: 100%; flex-basis: 100%; }
  .account-table td, .account-table th { padding: 10px 8px; }
  .account-table .role-column { display: none; }
  .account-open { width: 36px; height: 36px; min-height: 36px; padding: 0; font-size: 0; }
  .account-open::before { content: '☰'; font-size: 18px; }
  .account-profile { grid-template-columns: 1fr; gap: 7px; }
  .account-profile dd { margin-bottom: 12px; }
  .access-list { max-height: 240px; }
}
