#tab-profiles .table-wrapper { overflow-x:auto; }
#tab-profiles [data-col="card"] { width:32px !important; min-width:32px !important; max-width:32px !important; padding:3px !important; text-align:center; box-sizing:border-box; }
#tab-profiles .table-wrapper > table { overflow:visible; }
#tab-profiles .table-wrapper .profile-details-cell {
    position:sticky; right:0; width:34px; min-width:34px; max-width:34px;
    padding:3px !important; box-sizing:border-box; text-align:center;
    background:var(--surface); box-shadow:none; z-index:3;
}
#tab-profiles .table-wrapper thead .profile-details-cell { top:0; z-index:12; background:var(--thead); }
.profile-details-button { width:26px; height:26px; padding:0; border:0; border-radius:0;
    background:transparent; color:var(--text-muted); font-size:18px; cursor:pointer; }
.profile-details-button:hover { color:#2563eb; background:transparent; }
.profile-details-dialog { margin:auto; padding:0; width:min(760px,calc(100vw - 32px)); max-height:86vh;
    border:1px solid #e5e7eb; border-radius:14px; background:#fff; color:#1f2937;
    box-shadow:0 18px 60px #0004; overflow:hidden; }
.profile-details-dialog[open] { display:flex; flex-direction:column; }
.profile-details-dialog::backdrop { background:#0007; }
.profile-details-dialog header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 20px; border-bottom:1px solid var(--border); }
.profile-details-dialog h2 { margin:0; font-size:17px; overflow-wrap:anywhere; }
.profile-details-close { border:0; background:transparent; color:var(--text-muted); font-size:25px; cursor:pointer; }
.profile-details-body { overflow:auto; min-height:0; padding:0 20px 18px; }
.profile-details-body h3 { font-size:12px; color:var(--text-muted); margin:20px 0 8px; }
.profile-details-body table { width:100%; table-layout:fixed; border-collapse:collapse; box-shadow:none; }
.profile-details-body th, .profile-details-body td { padding:8px 10px; border-bottom:1px solid var(--border);
    font-size:12px; line-height:1.5; text-align:left; vertical-align:top; white-space:pre-wrap; overflow-wrap:anywhere; }
.profile-details-body th { width:32%; font-weight:500; color:var(--text-muted); background:var(--btn-bg); }
.profile-details-body summary { cursor:pointer; color:#3b82f6; }
.profile-details-body pre { max-height:220px; overflow:auto; white-space:pre-wrap; font:11px/1.5 monospace; }
.profile-details-dialog footer { padding:12px 20px; font-size:11px; color:var(--text-muted); border-top:1px solid var(--border); }
.profile-details-message { padding:18px 0; font-size:13px; }
.profile-details-dialog { --border:#edf0f3; --text-muted:#64748b; --btn-bg:#fff; --thead:#fff; --surface:#fff; }
.profile-details-dialog .profile-details-body th { background:#fff; }
.profile-details-dialog .profile-details-body tr:hover td { background:#fff; }
.profile-details-tabs { display:flex; flex-wrap:nowrap; flex-shrink:0; gap:5px; padding:10px 20px;
    overflow-x:auto; overscroll-behavior-x:contain; border-bottom:1px solid #edf0f3; scrollbar-width:thin; }
.profile-details-tab { flex:0 0 auto; white-space:nowrap; border:0; border-radius:6px; padding:7px 11px;
    background:transparent; color:#64748b; cursor:pointer; font-size:12px; }
.profile-details-tab[aria-selected="true"] { background:#eff6ff; color:#2563eb; font-weight:600; }
.profile-details-tab:focus-visible { outline:2px solid #93c5fd; outline-offset:-2px; }
.profile-details-panel { padding-top:16px; }
.profile-details-panel[hidden] { display:none; }
.profile-card-form { display:flex; flex-direction:column; gap:9px; max-width:680px; margin:0 auto; }
.profile-card-field { display:flex; flex-direction:column; gap:4px; font-size:11px; color:#475569; min-width:0; }
.profile-card-form input { box-sizing:border-box; width:100%; min-width:0; border:1px solid #dbe1e8; border-radius:7px;
    padding:6px 8px; background:#fff; color:#111827; font-size:12px; line-height:1.25; font-family:inherit; }
.profile-card-form input:focus { outline:2px solid #bfdbfe; border-color:#93c5fd; }
.profile-card-input-row { display:flex; align-items:stretch; gap:0; min-width:0; }
.profile-card-input-row > input, .profile-card-input-row > details { flex:1 1 auto; min-width:0; }
.profile-card-input-row > input { border-radius:0 7px 7px 0; }
.profile-card-input-row > .profile-card-country-picker > summary { border-radius:0 7px 7px 0; }
.profile-card-form .profile-card-copy { flex:0 0 29px; width:29px; min-height:29px; padding:0; border:1px solid #e5eaf0;
    border-right:0; border-radius:7px 0 0 7px; background:#f8fafc; color:#a3afbf; font-size:12px; font-weight:400; }
.profile-card-form .profile-card-copy:hover { background:#f1f5f9; border-color:#dbe2ea; color:#64748b; }
.profile-card-form .profile-card-copy.is-copied { background:#f0fdf4; color:#22a35a; }
.profile-card-open-link { flex:none; padding:2px 4px; color:#2563eb; font-size:18px; line-height:1; text-decoration:none; }
.profile-card-open-link[hidden] { display:none; }
.profile-card-core-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(100px,.72fr) minmax(86px,.55fr); gap:8px; }
.profile-card-core-grid > :first-child input { font-family:monospace; letter-spacing:.6px; }
.profile-card-link-balance { display:grid; grid-template-columns:minmax(0,3fr) minmax(120px,1fr); gap:8px; }
.profile-card-pair { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.profile-card-address-line { display:grid; grid-template-columns:5fr 3fr 2fr; gap:8px; }
.profile-card-form button { border:1px solid #dbe1e8; border-radius:7px; padding:6px 9px; background:white; color:#475569; cursor:pointer; font-size:11px; }
.profile-card-section-header { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:3px; padding-top:10px; border-top:1px solid #edf0f3; }
.profile-card-section-title { flex:1; margin:0 !important; color:#334155 !important; font-size:13px !important; }
.profile-card-section-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:5px; }
.profile-card-generate-address { padding:5px 8px !important; background:#eff6ff !important; border-color:#bfdbfe !important; color:#1d4ed8 !important; white-space:nowrap; }
.profile-card-country-picker { position:relative; }
.profile-card-country-picker > summary { list-style:none; box-sizing:border-box; width:100%; border:1px solid #dbe1e8; border-radius:7px;
    padding:6px 30px 6px 8px; background:#fff; color:#111827; font-size:12px; line-height:1.25; cursor:pointer; position:relative; }
.profile-card-country-picker > summary::-webkit-details-marker { display:none; }
.profile-card-country-picker > summary::after { content:'⌄'; position:absolute; right:12px; color:#64748b; }
.profile-card-country-picker[open] > summary { outline:2px solid #bfdbfe; border-color:#93c5fd; }
.profile-card-country-menu { position:absolute; z-index:30; left:0; right:0; top:calc(100% + 5px); padding:8px; border:1px solid #dbe1e8;
    border-radius:9px; background:#fff; box-shadow:0 10px 30px #0f172a24; }
.profile-card-country-menu > input { margin-bottom:7px; }
.profile-card-country-options { max-height:210px; overflow:auto; display:flex; flex-direction:column; gap:2px; }
.profile-card-country-options .profile-card-country-option { width:100%; border:0; padding:7px 8px; text-align:left; background:#fff; color:#334155; }
.profile-card-country-options .profile-card-country-option:hover,
.profile-card-country-options .profile-card-country-option[aria-selected="true"] { background:#eff6ff; color:#1d4ed8; }
.profile-card-actions { display:flex; gap:8px; margin-top:4px; }
.profile-card-actions .profile-card-save { background:#effaf3; border-color:#bbebcc; color:#15803d; }
.profile-card-status { min-height:18px; margin:0; color:#475569; font-size:12px; }
.profile-card-hint { max-width:680px; margin:12px auto 0; color:#94a3b8; font-size:11px; line-height:1.5; }
.profile-card-form :disabled { opacity:.55; cursor:wait; }
@media (max-width:640px) {
    .profile-card-core-grid, .profile-card-link-balance, .profile-card-pair { grid-template-columns:1fr; }
    .profile-card-address-line { grid-template-columns:1fr 1fr; }
    .profile-card-address-line > :first-child { grid-column:1 / -1; }
    .profile-card-section-header { align-items:flex-start; flex-direction:column; }
}
