/* DIGI HAM LINK master preference v1. Scoped to the picker, Profile card and master summary. */
:is(.bmMasterProfile,.bmMasterConnection,dialog.bmMasterPicker) {
  --master-ink:#edf5ff;--master-muted:#aec1d4;--master-cyan:#4fe7f5;
  --master-line:#324e65;--master-bg:#0d2033;box-sizing:border-box;color:var(--master-ink);
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
:is(.bmMasterProfile,.bmMasterConnection,dialog.bmMasterPicker) *,
:is(.bmMasterProfile,.bmMasterConnection,dialog.bmMasterPicker) *::before,
:is(.bmMasterProfile,.bmMasterConnection,dialog.bmMasterPicker) *::after {box-sizing:border-box;}
:is(.bmMasterProfile,.bmMasterConnection,dialog.bmMasterPicker) [hidden] {display:none!important;}
:is(.bmMasterProfile,.bmMasterConnection,dialog.bmMasterPicker) svg {width:22px;height:22px;display:block;flex:none;}
:is(.bmMasterProfile,.bmMasterConnection,dialog.bmMasterPicker) .bmMasterEyebrow {display:block;font-size:.65rem;font-weight:750;letter-spacing:.12em;line-height:1.5;color:#a8bfd4;}
:is(.bmMasterProfile,.bmMasterConnection,dialog.bmMasterPicker) .bmMasterFlag {display:grid;place-items:center;flex:none;width:48px;height:42px;border:1px solid #52758d45;border-radius:12px;background:#25415760;overflow:hidden;color:#7deaf4;}
:is(.bmMasterProfile,.bmMasterConnection,dialog.bmMasterPicker) .bmMasterFlag img {display:block;width:34px;height:26px;object-fit:contain;border-radius:3px;}
:is(.bmMasterProfile,.bmMasterConnection,dialog.bmMasterPicker) .bmMasterIdentity {display:flex;gap:13px;align-items:center;min-width:0;}
:is(.bmMasterProfile,.bmMasterConnection,dialog.bmMasterPicker) .bmMasterIdentityText {min-width:0;}
:is(.bmMasterProfile,.bmMasterConnection,dialog.bmMasterPicker) .bmMasterName {display:block;color:#f1f7ff;font-size:1.25rem;font-weight:750;line-height:1.3;overflow-wrap:anywhere;}
:is(.bmMasterProfile,.bmMasterConnection,dialog.bmMasterPicker) .bmMasterNumber {display:block;color:#bed0df;font-size:.78rem;line-height:1.45;font-variant-numeric:tabular-nums;}
:is(.bmMasterProfile,.bmMasterConnection,dialog.bmMasterPicker) .bmMasterDefaultTag {display:inline-block;width:max-content;max-width:100%;padding:4px 8px;border:1px solid #3a7179;border-radius:999px;background:#12434b;color:#9bf3ea;font-size:.66rem;font-weight:650;line-height:1.25;white-space:normal;}
:is(.bmMasterProfile,.bmMasterConnection,dialog.bmMasterPicker) button:focus-visible,
dialog.bmMasterPicker input:focus-visible,dialog.bmMasterPicker .bmMasterList:focus-visible {outline:3px solid #b1faff;outline-offset:3px;}

/* Profile: a compact independent preference above the existing private credentials. */
#view-profile .bmMasterProfile {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px 18px;margin:2px 0 24px;padding:20px;border:1px solid #427486;border-radius:18px;background:radial-gradient(ellipse at 95% 0,#12617244,transparent 65%),linear-gradient(120deg,#132e43,#0a1d30);box-shadow:inset 0 1px #d6ffff12;}
#view-profile .bmMasterProfileTop {display:flex;flex-wrap:wrap;gap:10px 14px;align-items:center;min-width:0;}
#view-profile .bmMasterProfile .bmMasterChange {display:flex;align-items:center;justify-content:center;gap:10px;width:auto;max-width:100%;min-height:48px;margin:0;padding:10px 16px;border:1px solid #43b9ce;border-radius:12px;background:#0d4054;color:#bdF7ff;font-size:.85rem;font-weight:700;line-height:1.3;white-space:normal;cursor:pointer;}
#view-profile .bmMasterProfile .bmMasterChange svg {width:17px;height:17px;}
#view-profile .bmMasterProfile p {grid-column:1/-1;margin:0;font-size:.78rem;line-height:1.5;overflow-wrap:anywhere;}
#view-profile .bmMasterProfile .bmMasterProfileNote {color:#c2d6e5;}
#view-profile .bmMasterProfile .bmMasterProfileNote.is-pending {padding:10px 12px;border-radius:10px;background:#153d50;border-left:3px solid #57dfea;color:#d2f6ff;}
#view-profile .bmMasterProfile .bmMasterTiming {color:#9ab3c9;font-size:.72rem;}
#view-profile .bmMasterProfile .bmMasterTextAction {grid-column:1/-1;justify-self:start;width:auto;min-height:44px;margin:0;padding:7px 10px;border:1px solid #557b93;border-radius:9px;background:#19384e;color:#daefff;cursor:pointer;}
#view-profile .bmMasterProfile button:disabled {opacity:.5;cursor:not-allowed;}

/* Current master stays visible when reopening an existing BrandMeister session. */
dialog#brandmeisterDialog.bmSimple .bmMasterConnection {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;flex:0 0 auto;padding:12px;border:1px solid #345c70;border-radius:13px;background:linear-gradient(115deg,#173c50,#12293e);}
dialog#brandmeisterDialog.bmSimple .bmMasterConnection .bmMasterIdentity {gap:10px;}
dialog#brandmeisterDialog.bmSimple .bmMasterConnection .bmMasterFlag {width:38px;height:34px;border-radius:9px;}
dialog#brandmeisterDialog.bmSimple .bmMasterConnection .bmMasterFlag img {width:28px;height:21px;}
dialog#brandmeisterDialog.bmSimple .bmMasterConnection .bmMasterName {font-size:.98rem;}
dialog#brandmeisterDialog.bmSimple .bmMasterConnection .bmMasterNumber {font-size:.7rem;}
dialog#brandmeisterDialog.bmSimple .bmMasterConnection .bmMasterEyebrow {font-size:.57rem;letter-spacing:.1em;}
dialog#brandmeisterDialog.bmSimple #personalDmrForm .bmMasterConnection .bmMasterChange {align-self:center;width:auto;min-width:64px;min-height:44px;padding:9px 11px;border:1px solid #4c8299;border-radius:10px;background:#163d51;color:#b8f7ff;font-size:.76rem;line-height:1.3;}
dialog#brandmeisterDialog.bmSimple .bmMasterConnectionNote {grid-column:1/-1;margin:0;padding-top:8px;border-top:1px solid #38576a;color:#a7eff2;font-size:.73rem;line-height:1.4;}

/* Native modal with one scrolling list and permanently visible actions. */
dialog#bmMasterDialog.bmMasterPicker {position:fixed;inset:auto;top:calc(var(--bm-master-viewport-top,0px) + var(--bm-master-viewport-height,100dvh)/2);left:50%;transform:translate(-50%,-50%);width:min(560px,calc(100vw - 32px));max-width:calc(100vw - 32px);height:min(700px,calc(var(--bm-master-viewport-height,100dvh) - 32px));max-height:calc(var(--bm-master-viewport-height,100dvh) - 32px);margin:0;padding:0;overflow:hidden;border:1px solid #416478;border-radius:24px;background:#0d2033;box-shadow:0 30px 100px #000a,0 0 0 1px #e1ffff09;color-scheme:dark;}
dialog#bmMasterDialog.bmMasterPicker::backdrop {background:#020a15ce;backdrop-filter:blur(5px);}
dialog#bmMasterDialog .bmMasterShell {display:flex;flex-direction:column;height:100%;min-width:0;min-height:0;}
dialog#bmMasterDialog .bmMasterHeader {display:flex;flex:0 0 auto;align-items:center;justify-content:space-between;gap:12px;padding:24px 24px 0;min-width:0;}
dialog#bmMasterDialog .bmMasterTitleWrap {min-width:0;}
dialog#bmMasterDialog .bmMasterHeader h2 {margin:4px 0 0;font-size:1.65rem;letter-spacing:-.035em;line-height:1.2;font-weight:750;color:#f3f8ff;}
dialog#bmMasterDialog .bmMasterSubtitle {flex:0 0 auto;margin:10px 24px 16px;color:#acc3d6;font-size:.8rem;line-height:1.5;}
dialog#bmMasterDialog button {font-family:inherit;cursor:pointer;white-space:normal;overflow-wrap:anywhere;}
dialog#bmMasterDialog button:disabled {opacity:.5;cursor:not-allowed;}
dialog#bmMasterDialog .bmMasterClose {display:grid;place-items:center;flex:0 0 44px;align-self:flex-start;min-height:44px;height:44px;width:44px;margin:0;padding:0;border:1px solid #425a7044;border-radius:12px;background:#1c364b;color:#c5d8e7;font-size:1.7rem;line-height:1;box-shadow:none;}
dialog#bmMasterDialog .bmMasterSearchArea {flex:0 0 auto;margin:0;padding:0 24px;}
dialog#bmMasterDialog .bmMasterSearchLabel {display:block;margin:0 0 7px;color:#d8e7f2;font-size:.75rem;font-weight:650;line-height:1.3;}
dialog#bmMasterDialog .bmMasterSearchWrap {position:relative;}
dialog#bmMasterDialog .bmMasterSearchWrap > svg {position:absolute;left:14px;top:14px;z-index:1;width:20px;height:20px;color:#7fb3ca;pointer-events:none;}
dialog#bmMasterDialog #bmMasterSearch {display:block;box-sizing:border-box;width:100%;min-width:0;height:48px;min-height:48px;margin:0;padding:11px 48px 11px 43px;border:1px solid #416277;border-radius:12px;background:#071829;color:#f4f8ff;font:400 16px/1.35 system-ui,sans-serif;appearance:none;}
dialog#bmMasterDialog #bmMasterSearch::placeholder {color:#8eaabd;opacity:1;font-size:.86rem;}
dialog#bmMasterDialog #bmMasterSearch::-webkit-search-cancel-button {display:none;}
dialog#bmMasterDialog .bmMasterClearSearch {position:absolute;right:2px;top:2px;display:grid;place-items:center;width:44px;min-height:44px;height:44px;margin:0;padding:0;border:0;border-radius:10px;background:transparent;color:#c3d8e9;font-size:1.5rem;line-height:1;box-shadow:none;}
dialog#bmMasterDialog .bmMasterListStatus {min-height:18px;margin:10px 0 6px;color:#9ab5ca;font-size:.69rem;font-weight:500;line-height:1.5;}
dialog#bmMasterDialog .bmMasterResults {display:flex;flex:1 1 auto;min-height:0;min-width:0;margin:0 17px;padding:3px 0 9px;overflow:hidden;}
dialog#bmMasterDialog .bmMasterList {flex:1 1 auto;min-height:0;min-width:0;padding:5px 7px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-color:#53788e #0d2033;scroll-padding:7px;}
dialog#bmMasterDialog .bmMasterOption {display:grid;grid-template-columns:48px minmax(0,1fr) 24px;align-items:center;gap:13px;width:100%;min-width:0;min-height:76px;height:auto;margin:0 0 7px;padding:12px 14px;border:1px solid #354e626e;border-radius:14px;background:#122a3e;color:#eef6ff;text-align:left;box-shadow:none;transition:border-color .15s ease,background-color .15s ease;}
dialog#bmMasterDialog .bmMasterOption[aria-checked=true] {border-color:#43deeb;background:linear-gradient(105deg,#0d495c,#12364b);box-shadow:inset 0 0 0 1px #7eefff18;}
dialog#bmMasterDialog .bmMasterOptionText {display:flex;flex-wrap:wrap;align-items:center;gap:4px 9px;min-width:0;}
dialog#bmMasterDialog .bmMasterOptionText > strong {flex-basis:100%;font-size:.95rem;line-height:1.35;font-weight:680;color:#f2f7ff;}
dialog#bmMasterDialog .bmMasterOptionNumber {color:#a9c5d8;font-size:.75rem;line-height:1.4;font-variant-numeric:tabular-nums;}
dialog#bmMasterDialog .bmMasterOption .bmMasterDefaultTag {padding:3px 7px;font-size:.59rem;line-height:1.15;}
dialog#bmMasterDialog .bmMasterOptionCheck {display:grid;place-items:center;width:23px;height:23px;border:1px solid #5b7a8e;border-radius:50%;background:#10283b;color:transparent;}
dialog#bmMasterDialog .bmMasterOptionCheck svg {width:16px;height:16px;}
dialog#bmMasterDialog .bmMasterOption[aria-checked=true] .bmMasterOptionCheck {border-color:#61f2f6;background:#59e7ee;color:#053443;}
dialog#bmMasterDialog .bmMasterEmpty {display:flex;flex:1 1 auto;flex-direction:column;align-items:center;justify-content:center;min-width:0;min-height:0;padding:18px;text-align:center;overflow:auto;}
dialog#bmMasterDialog .bmMasterEmpty > svg {width:36px;height:36px;margin-bottom:14px;color:#68bbc9;}
dialog#bmMasterDialog .bmMasterEmpty > strong {font-size:1rem;line-height:1.4;color:#e3eff7;}
dialog#bmMasterDialog .bmMasterEmpty > p {max-width:32ch;margin:8px 0 0;color:#a4bfd0;font-size:.8rem;line-height:1.5;overflow-wrap:anywhere;}
dialog#bmMasterDialog .bmMasterEmpty > button {margin-top:15px;}
dialog#bmMasterDialog .bmMasterFooter {flex:0 0 auto;margin:0;padding:16px 24px max(22px,env(safe-area-inset-bottom));border-top:1px solid #345267;background:#0a1c2e;color:#ebf6ff;text-align:left;}
dialog#bmMasterDialog .bmMasterPicked {display:flex;flex-wrap:wrap;align-items:center;gap:5px 10px;margin-bottom:13px;min-width:0;}
dialog#bmMasterDialog .bmMasterPicked > strong {color:#c9e8f7;font-size:.82rem;font-weight:600;line-height:1.35;overflow-wrap:anywhere;}
dialog#bmMasterDialog .bmMasterActions {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.7fr);gap:10px;}
dialog#bmMasterDialog :is(.bmMasterPrimary,.bmMasterSecondary) {width:100%;min-width:0;min-height:48px;height:auto;margin:0;padding:12px 14px;border:1px solid #426177;border-radius:12px;background:#172f44;color:#dceefa;font-size:.9rem;font-weight:650;line-height:1.35;box-shadow:none;}
dialog#bmMasterDialog .bmMasterPrimary {border-color:#60e5ef;background:linear-gradient(105deg,#59e7f3,#2accdf);color:#052b39;font-weight:750;box-shadow:inset 0 1px #eeffff66;}
dialog#bmMasterDialog .bmMasterSaveStatus {max-height:66px;margin:0 0 10px;overflow:auto;color:#ffc9d2;font-size:.78rem;line-height:1.45;overflow-wrap:anywhere;}
@media(hover:hover) {
  dialog#bmMasterDialog .bmMasterOption:not(:disabled):hover {border-color:#67b5c8;background:#174155;}
  dialog#bmMasterDialog .bmMasterOption[aria-checked=true]:not(:disabled):hover {border-color:#a0f7fb;background:#125265;}
  dialog#bmMasterDialog .bmMasterPrimary:not(:disabled):hover {background:linear-gradient(105deg,#83f4f9,#50dfe9);}
  #view-profile .bmMasterProfile .bmMasterChange:not(:disabled):hover {background:#15536a;border-color:#85e8f1;}
}
@media(max-width:600px) {
  #view-profile .bmMasterProfile {grid-template-columns:minmax(0,1fr);padding:17px;gap:12px;}
  #view-profile .bmMasterProfileTop {justify-content:space-between;}
  #view-profile .bmMasterProfile .bmMasterChange {width:100%;justify-content:space-between;}
  dialog#bmMasterDialog.bmMasterPicker {top:calc(var(--bm-master-viewport-top,0px) + var(--bm-master-viewport-height,100dvh));left:0;transform:translateY(-100%);width:100%;max-width:100%;height:min(740px,calc(var(--bm-master-viewport-height,100dvh) - 12px));max-height:calc(var(--bm-master-viewport-height,100dvh) - 12px);border-radius:24px 24px 0 0;border-bottom:0;}
  dialog#bmMasterDialog .bmMasterHeader {padding:20px 20px 0;}
  dialog#bmMasterDialog .bmMasterHeader h2 {font-size:1.5rem;}
  dialog#bmMasterDialog .bmMasterSubtitle {margin:9px 20px 15px;}
  dialog#bmMasterDialog .bmMasterSearchArea {padding:0 20px;}
  dialog#bmMasterDialog .bmMasterResults {margin:0 13px;}
  dialog#bmMasterDialog .bmMasterFooter {padding:14px 20px max(20px,env(safe-area-inset-bottom));}
}
@media(max-width:360px) {
  #view-profile .bmMasterProfile {padding:13px;}
  #view-profile .bmMasterProfile .bmMasterName {font-size:1.1rem;}
  dialog#bmMasterDialog .bmMasterHeader {padding:16px 15px 0;}
  dialog#bmMasterDialog .bmMasterHeader .bmMasterEyebrow {font-size:.57rem;letter-spacing:.08em;}
  dialog#bmMasterDialog .bmMasterHeader h2 {font-size:1.4rem;}
  dialog#bmMasterDialog .bmMasterSubtitle {margin:8px 15px 12px;font-size:.75rem;}
  dialog#bmMasterDialog .bmMasterSearchArea {padding:0 15px;}
  dialog#bmMasterDialog .bmMasterResults {margin:0 8px;}
  dialog#bmMasterDialog .bmMasterOption {grid-template-columns:40px minmax(0,1fr) 23px;gap:10px;padding:10px;}
  dialog#bmMasterDialog .bmMasterOption .bmMasterFlag {width:40px;height:38px;}
  dialog#bmMasterDialog .bmMasterOptionText > strong {font-size:.88rem;}
  dialog#bmMasterDialog .bmMasterFooter {padding:12px 15px max(16px,env(safe-area-inset-bottom));}
}
@media(max-height:540px) {
  dialog#bmMasterDialog .bmMasterHeader {padding-top:10px;}
  dialog#bmMasterDialog .bmMasterHeader .bmMasterEyebrow {display:none;}
  dialog#bmMasterDialog .bmMasterHeader h2 {font-size:1.2rem;}
  dialog#bmMasterDialog .bmMasterSubtitle {margin-top:2px;margin-bottom:8px;font-size:.72rem;}
  dialog#bmMasterDialog .bmMasterSearchLabel {display:none;}
  dialog#bmMasterDialog .bmMasterListStatus {margin-top:5px;margin-bottom:2px;}
  dialog#bmMasterDialog .bmMasterFooter {padding-top:10px;padding-bottom:max(12px,env(safe-area-inset-bottom));}
  dialog#bmMasterDialog .bmMasterPicked {margin-bottom:8px;}
  dialog#bmMasterDialog .bmMasterOption {min-height:62px;padding-block:8px;}
}
@media(prefers-reduced-motion:reduce) {dialog#bmMasterDialog .bmMasterOption {transition:none;}}
