/* NSRH Core shared theme, typography, layout, forms, feedback, auth, tables, navbar, preferences, buttons and modal UI. */
:root,
:root[data-nsrh-theme="standard"],
.theme-choice-preview[data-theme-key="standard"]{
  --nsrh-bg:#f4f6f8;--nsrh-surface:#ffffff;--nsrh-input-bg:#ffffff;
  --nsrh-text:#17202a;--nsrh-text-secondary:#344054;--nsrh-text-muted:#667085;--nsrh-text-subtle:#475467;
  --nsrh-border:#e4e7eb;--nsrh-divider:#edf0f2;--nsrh-control-border:#cfd5dc;--nsrh-border-strong:#c8d0d9;
  --nsrh-hover:#f2f4f7;--nsrh-surface-secondary:#eef2f6;
  --nsrh-primary:#1f5f8b;--nsrh-primary-text:#1f5f8b;--nsrh-primary-hover:#194f75;--nsrh-primary-border:#8db4cf;
  --nsrh-focus-outline:#84adcb;--nsrh-primary-ring-faint:rgba(31,95,139,.16);--nsrh-on-accent:#ffffff;
  --nsrh-background-overlay:rgba(244,246,248,.26);--nsrh-shadow:0 12px 30px rgba(15,23,42,.10);--nsrh-modal-backdrop:rgba(15,23,42,.46);
  color-scheme:light;
}
:root[data-nsrh-theme="dark"],
.theme-choice-preview[data-theme-key="dark"]{
  --nsrh-bg:#121820;--nsrh-surface:#1b2430;--nsrh-input-bg:#202a36;
  --nsrh-text:#e8eef5;--nsrh-text-secondary:#c4d0dc;--nsrh-text-muted:#9ba9b7;--nsrh-text-subtle:#b2beca;
  --nsrh-border:#33414f;--nsrh-divider:#293746;--nsrh-control-border:#435365;--nsrh-border-strong:#536476;
  --nsrh-hover:#24313f;--nsrh-surface-secondary:#202c37;
  --nsrh-primary:#2f7198;--nsrh-primary-text:#79add0;--nsrh-primary-hover:#285f82;--nsrh-primary-border:#5f8dab;
  --nsrh-focus-outline:#73a8c9;--nsrh-primary-ring-faint:rgba(115,168,201,.20);--nsrh-on-accent:#ffffff;
  --nsrh-background-overlay:rgba(8,12,18,.36);--nsrh-shadow:0 12px 30px rgba(0,0,0,.35);--nsrh-modal-backdrop:rgba(0,0,0,.66);
  color-scheme:dark;
}
:root[data-nsrh-theme="green"],
.theme-choice-preview[data-theme-key="green"]{
  --nsrh-bg:#f1f6f2;--nsrh-surface:#ffffff;--nsrh-input-bg:#ffffff;
  --nsrh-text:#1d2a22;--nsrh-text-secondary:#34483a;--nsrh-text-muted:#6a7e70;--nsrh-text-subtle:#4f6656;
  --nsrh-border:#d9e4dc;--nsrh-divider:#e5ece7;--nsrh-control-border:#c4d3c8;--nsrh-border-strong:#b9cbbf;
  --nsrh-hover:#e8f1eb;--nsrh-surface-secondary:#edf3ef;
  --nsrh-primary:#2f6b4f;--nsrh-primary-text:#2f6b4f;--nsrh-primary-hover:#285b43;--nsrh-primary-border:#8db7a0;
  --nsrh-focus-outline:#84ad96;--nsrh-primary-ring-faint:rgba(47,107,79,.16);--nsrh-on-accent:#ffffff;
  --nsrh-background-overlay:rgba(241,246,242,.25);--nsrh-shadow:0 12px 30px rgba(29,42,34,.10);
  color-scheme:light;
}
:root[data-nsrh-theme="graphite"],
.theme-choice-preview[data-theme-key="graphite"]{
  --nsrh-bg:#f2f3f5;--nsrh-surface:#ffffff;--nsrh-input-bg:#ffffff;
  --nsrh-text:#20242a;--nsrh-text-secondary:#3d4652;--nsrh-text-muted:#6d7682;--nsrh-text-subtle:#545e6a;
  --nsrh-border:#dde1e6;--nsrh-divider:#e9ebee;--nsrh-control-border:#c8ced6;--nsrh-border-strong:#bac2cc;
  --nsrh-hover:#eceff2;--nsrh-surface-secondary:#eef0f3;
  --nsrh-primary:#495666;--nsrh-primary-text:#495666;--nsrh-primary-hover:#3f4a58;--nsrh-primary-border:#9ba5b0;
  --nsrh-focus-outline:#8793a1;--nsrh-primary-ring-faint:rgba(73,86,102,.16);--nsrh-on-accent:#ffffff;
  --nsrh-background-overlay:rgba(242,243,245,.25);--nsrh-shadow:0 12px 30px rgba(32,36,42,.10);
  color-scheme:light;
}
:root[data-nsrh-theme="warm"],
.theme-choice-preview[data-theme-key="warm"]{
  --nsrh-bg:#f7f2ea;--nsrh-surface:#fffdf9;--nsrh-input-bg:#fffdf9;
  --nsrh-text:#2d2824;--nsrh-text-secondary:#51463d;--nsrh-text-muted:#7d7167;--nsrh-text-subtle:#66594f;
  --nsrh-border:#e7ddd0;--nsrh-divider:#eee6dc;--nsrh-control-border:#d5c6b5;--nsrh-border-strong:#c8b6a2;
  --nsrh-hover:#f1e8dc;--nsrh-surface-secondary:#f4ece2;
  --nsrh-primary:#8a5e3b;--nsrh-primary-text:#8a5e3b;--nsrh-primary-hover:#754f32;--nsrh-primary-border:#c6a582;
  --nsrh-focus-outline:#b99068;--nsrh-primary-ring-faint:rgba(138,94,59,.16);--nsrh-on-accent:#ffffff;
  --nsrh-background-overlay:rgba(247,242,234,.25);--nsrh-shadow:0 12px 30px rgba(65,48,34,.10);
  color-scheme:light;
}
:root[data-nsrh-theme="vivid"],
.theme-choice-preview[data-theme-key="vivid"]{
  --nsrh-bg:#eefaff;--nsrh-surface:#ffffff;--nsrh-input-bg:#ffffff;
  --nsrh-text:#102a43;--nsrh-text-secondary:#2b4b63;--nsrh-text-muted:#647d90;--nsrh-text-subtle:#45677f;
  --nsrh-border:#d6eaf2;--nsrh-divider:#e4f1f6;--nsrh-control-border:#bddce7;--nsrh-border-strong:#a9cfdd;
  --nsrh-hover:#e3f6fb;--nsrh-surface-secondary:#e8f7fb;
  --nsrh-primary:#007ea7;--nsrh-primary-text:#007ea7;--nsrh-primary-hover:#006789;--nsrh-primary-border:#7fc2d7;
  --nsrh-focus-outline:#69b7cf;--nsrh-primary-ring-faint:rgba(0,126,167,.16);--nsrh-on-accent:#ffffff;
  --nsrh-background-overlay:rgba(238,250,255,.24);--nsrh-shadow:0 12px 30px rgba(16,42,67,.10);
  color-scheme:light;
}
:root[data-nsrh-theme="pop"],
.theme-choice-preview[data-theme-key="pop"]{
  --nsrh-bg:#fff3fb;--nsrh-surface:#ffffff;--nsrh-input-bg:#ffffff;
  --nsrh-text:#2a1938;--nsrh-text-secondary:#4f3960;--nsrh-text-muted:#806e8d;--nsrh-text-subtle:#654f75;
  --nsrh-border:#eadcef;--nsrh-divider:#f1e7f4;--nsrh-control-border:#d9c5e1;--nsrh-border-strong:#cdb5d7;
  --nsrh-hover:#f9eafa;--nsrh-surface-secondary:#f8edf9;
  --nsrh-primary:#7c3aed;--nsrh-primary-text:#7c3aed;--nsrh-primary-hover:#682dc7;--nsrh-primary-border:#b89be8;
  --nsrh-focus-outline:#a985df;--nsrh-primary-ring-faint:rgba(124,58,237,.16);--nsrh-on-accent:#ffffff;
  --nsrh-background-overlay:rgba(255,243,251,.24);--nsrh-shadow:0 12px 30px rgba(42,25,56,.10);
  color-scheme:light;
}

:root{
  --nsrh-success:#25734b;--nsrh-warning:#8a5b00;--nsrh-danger:#a12622;--nsrh-info:#1f5f8b;
  --nsrh-danger-action:#a12622;--nsrh-danger-action-hover:#861f1c;--nsrh-on-danger:#ffffff;
  --nsrh-positive:#25734b;--nsrh-positive-surface:#edf8f1;--nsrh-positive-border:#c5e3d0;--nsrh-positive-hover:#e2f2e8;--nsrh-positive-text:#17603a;
  --nsrh-button-radius:10px;--nsrh-button-h:40px;--nsrh-button-h-sm:34px;
  --nsrh-radius:14px;--nsrh-nav-h:64px;--nsrh-user-background:none;
  --nsrh-content-max:1180px;--nsrh-content-narrow:660px;--nsrh-page-pad-x:20px;--nsrh-page-pad-top:30px;--nsrh-page-pad-bottom:60px;
  --nsrh-layout-gap:16px;--nsrh-card-padding:20px;--nsrh-table-cell-x:12px;--nsrh-table-cell-y:11px;
  --nsrh-text-page-title:clamp(1.75rem,1.62rem + .45vw,2rem);
  --nsrh-text-section-title:clamp(1.15rem,1.08rem + .24vw,1.3rem);
  --nsrh-text-card-title:clamp(1.08rem,1.02rem + .2vw,1.2rem);
  --nsrh-text-body:clamp(.95rem,.93rem + .08vw,1rem);
  --nsrh-text-label:clamp(.82rem,.8rem + .07vw,.86rem);
  --nsrh-text-meta:clamp(.76rem,.74rem + .06vw,.82rem);
  --nsrh-text-table-head:clamp(.74rem,.72rem + .05vw,.78rem);
  --nsrh-field-sm:16rem;--nsrh-field-md:28rem;--nsrh-field-lg:44rem;
}
:root[data-nsrh-theme="dark"]{
  --nsrh-success:#62bd8b;--nsrh-warning:#e0b35b;--nsrh-danger:#e67d77;--nsrh-info:#79add0;
  --nsrh-danger-action:#b84b46;--nsrh-danger-action-hover:#a13f3b;--nsrh-on-danger:#ffffff;
  --nsrh-positive:#62bd8b;--nsrh-positive-surface:#193529;--nsrh-positive-border:#35634b;--nsrh-positive-hover:#214331;--nsrh-positive-text:#8ad7aa;
}

*{box-sizing:border-box}
.nsrh-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
html{min-height:100%;background:var(--nsrh-bg);scrollbar-gutter:stable}
body{margin:0;min-height:100vh;color:var(--nsrh-text);background-color:var(--nsrh-bg);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:var(--nsrh-text-body)}
a{color:var(--nsrh-primary-text);text-decoration:none}a:hover{text-decoration:underline}
button,input,select,textarea{font:inherit;color:inherit}button{cursor:pointer}
h1,h2,h3{letter-spacing:-.02em}h1{font-size:var(--nsrh-text-page-title);margin:0 0 8px}h2{font-size:var(--nsrh-text-section-title);margin:0 0 16px}h3{font-size:var(--nsrh-text-card-title)}
html[data-nsrh-background="custom"] body{background-image:linear-gradient(var(--nsrh-background-overlay),var(--nsrh-background-overlay)),var(--nsrh-user-background);background-size:cover;background-position:center;background-repeat:no-repeat;background-attachment:fixed}

/* Shared page/layout primitives. Core defines geometry; each app chooses business composition. */
.nsrh-page-shell{width:100%;max-width:var(--nsrh-content-max);margin:0 auto;padding:var(--nsrh-page-pad-top) var(--nsrh-page-pad-x) var(--nsrh-page-pad-bottom)}
.nsrh-page-shell.nsrh-narrow{max-width:var(--nsrh-content-narrow)}
.nsrh-page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:24px;min-width:0}.nsrh-page-head p{margin:6px 0 0;color:var(--nsrh-text-muted)}
.nsrh-content-full,.nsrh-content-3-4,.nsrh-content-1-2{width:100%;min-width:0}.nsrh-content-full{max-width:100%}.nsrh-content-3-4{max-width:75%}.nsrh-content-1-2{max-width:50%}.nsrh-content-center{margin-inline:auto}
.nsrh-grid,.nsrh-layout-grid{display:grid;gap:var(--nsrh-layout-gap);min-width:0}.nsrh-grid>* ,.nsrh-layout-grid>*{min-width:0}.nsrh-grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}.nsrh-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}.nsrh-grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.nsrh-layout-grid{grid-template-columns:repeat(12,minmax(0,1fr));container:nsrh-layout / inline-size}.nsrh-span-1-4{grid-column:span 3}.nsrh-span-1-3{grid-column:span 4}.nsrh-span-1-2{grid-column:span 6}.nsrh-span-2-3{grid-column:span 8}.nsrh-span-3-4{grid-column:span 9}.nsrh-span-full{grid-column:1/-1}
.nsrh-card{min-width:0;background:var(--nsrh-surface);border:1px solid var(--nsrh-border);border-radius:var(--nsrh-radius);padding:var(--nsrh-card-padding)}.nsrh-card h3{margin-top:0}.nsrh-card-title,.nsrh-card>h2:first-child,.nsrh-card>h3:first-child,.nsrh-card>.nsrh-section-title:first-child h2{margin:0 0 16px;font-size:var(--nsrh-text-card-title);font-weight:800;line-height:1.3;letter-spacing:-.02em}.nsrh-card>.nsrh-section-title:first-child h2{margin:0}
.nsrh-section{margin-top:28px;min-width:0}.nsrh-section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.nsrh-section-title h2{margin:0}
.nsrh-brand{font-size:clamp(1.25rem,1.16rem + .3vw,1.45rem);font-weight:850;letter-spacing:-.02em;margin-bottom:4px}.nsrh-subtle{color:var(--nsrh-text-muted)}.nsrh-muted-small{color:var(--nsrh-text-muted);font-size:var(--nsrh-text-meta)}

/* Shared authentication shell. Auth/service screens stay NSRH Standard unless their contract says otherwise. */
.nsrh-auth-shell{min-height:100vh;display:grid;place-items:center;padding:24px}.nsrh-auth-card{width:min(520px,100%);background:var(--nsrh-surface);border:1px solid var(--nsrh-border);border-radius:18px;box-shadow:var(--nsrh-shadow);padding:28px}
.nsrh-qr-wrap{display:flex;justify-content:center;padding:12px;min-width:0}

/* Shared forms. Apps supply business fields; Core owns geometry, bounded widths, focus and generic state treatment. */
.nsrh-form-grid{display:grid;gap:16px;min-width:0}.nsrh-form-grid>*{min-width:0}
.nsrh-field{min-width:0;width:100%;max-width:var(--nsrh-field-max,var(--nsrh-field-lg))}.nsrh-field-sm{--nsrh-field-max:var(--nsrh-field-sm)}.nsrh-field-md{--nsrh-field-max:var(--nsrh-field-md)}.nsrh-field-lg{--nsrh-field-max:var(--nsrh-field-lg)}.nsrh-field-full{--nsrh-field-max:none}
.nsrh-field label{display:block;font-size:var(--nsrh-text-label);font-weight:750;margin-bottom:6px}.nsrh-field input,.nsrh-field select,.nsrh-field textarea{width:100%;max-width:100%;min-width:0;padding:11px 12px;border:1px solid var(--nsrh-control-border);border-radius:10px;background:var(--nsrh-input-bg);outline:none}.nsrh-field textarea{min-height:110px;resize:vertical}.nsrh-field input:focus,.nsrh-field select:focus,.nsrh-field textarea:focus{border-color:var(--nsrh-primary);box-shadow:0 0 0 3px var(--nsrh-primary-ring-faint)}.nsrh-field input:disabled,.nsrh-field select:disabled,.nsrh-field textarea:disabled{opacity:.62;cursor:not-allowed;background:var(--nsrh-surface-secondary)}.nsrh-field input[readonly],.nsrh-field textarea[readonly]{background:var(--nsrh-surface-secondary)}
.nsrh-field-error input,.nsrh-field-error select,.nsrh-field-error textarea{border-color:var(--nsrh-danger)}.nsrh-field-error-message{margin-top:5px;color:var(--nsrh-danger);font-size:var(--nsrh-text-meta);font-weight:650}
.nsrh-help{font-size:var(--nsrh-text-meta);color:var(--nsrh-text-muted);margin-top:5px}.nsrh-checkbox{display:flex;gap:9px;align-items:flex-start}.nsrh-checkbox input{margin-top:3px}.nsrh-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}.nsrh-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 18px}.nsrh-tab{display:inline-flex;align-items:center;min-height:38px;padding:8px 12px;border:1px solid var(--nsrh-border);border-radius:var(--nsrh-button-radius);background:var(--nsrh-surface);color:var(--nsrh-text);font-weight:700;text-decoration:none}.nsrh-tab:hover,.nsrh-tab:focus-visible{background:var(--nsrh-surface-secondary)}.nsrh-tab.is-active{border-color:var(--nsrh-primary);color:var(--nsrh-primary);background:var(--nsrh-surface-secondary)}

/* Shared inline feedback/status. Business state -> semantic tone mapping stays in each app. */
.nsrh-flash{padding:12px 14px;border-radius:10px;margin-bottom:16px;border:1px solid var(--nsrh-border);background:var(--nsrh-surface)}
.nsrh-flash-success{border-color:var(--nsrh-success);background:color-mix(in srgb,var(--nsrh-success) 12%,var(--nsrh-surface))}.nsrh-flash-error{border-color:var(--nsrh-danger);background:color-mix(in srgb,var(--nsrh-danger) 12%,var(--nsrh-surface))}.nsrh-flash-warning{border-color:var(--nsrh-warning);background:color-mix(in srgb,var(--nsrh-warning) 12%,var(--nsrh-surface))}.nsrh-flash-info{border-color:var(--nsrh-info);background:color-mix(in srgb,var(--nsrh-info) 12%,var(--nsrh-surface))}
.nsrh-status{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:999px;font-size:var(--nsrh-text-table-head);font-weight:800;background:var(--nsrh-surface-secondary);border:1px solid var(--nsrh-border)}.nsrh-status-success{color:var(--nsrh-success)}.nsrh-status-warning{color:var(--nsrh-warning)}.nsrh-status-danger{color:var(--nsrh-danger)}.nsrh-status-info{color:var(--nsrh-info)}.nsrh-status-neutral{color:var(--nsrh-text-secondary)}
.nsrh-empty-state{padding:24px;text-align:center;color:var(--nsrh-text-muted);background:var(--nsrh-surface);border:1px dashed var(--nsrh-border);border-radius:12px}
.nsrh-danger-zone{border-color:var(--nsrh-danger)}

/* Shared filter, detail and technical-value utilities. */
.nsrh-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;padding:14px;background:var(--nsrh-surface);border:1px solid var(--nsrh-border);border-radius:12px;margin-bottom:14px}.nsrh-filters .nsrh-field label{font-size:var(--nsrh-text-table-head)}.nsrh-filters .nsrh-actions{margin:0;align-items:end}
.nsrh-kv{display:grid;grid-template-columns:180px 1fr;gap:8px 16px}.nsrh-kv dt{color:var(--nsrh-text-muted)}.nsrh-kv dd{margin:0;font-weight:650}
.nsrh-code-box{padding:12px;background:#0f1720;color:#d8e4ee;border-radius:10px;overflow:auto;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;word-break:break-all}
.nsrh-prefs-preview{display:flex;align-items:center;gap:16px;padding:16px;background:var(--nsrh-surface-secondary);border-radius:12px}

/* Shared responsive table standard. Column proportions belong to each concrete app table and should total 100%. */
.nsrh-table-wrap{min-width:0;overflow-x:auto;border:1px solid var(--nsrh-border);border-radius:12px;background:var(--nsrh-surface);container:nsrh-table / inline-size}
.nsrh-table-wrap table,.nsrh-responsive-table{width:100%;min-width:0;border-collapse:collapse;table-layout:fixed}
.nsrh-table-wrap col{min-width:0}
.nsrh-table-wrap th,.nsrh-table-wrap td{padding:var(--nsrh-table-cell-y) var(--nsrh-table-cell-x);text-align:left;border-bottom:1px solid var(--nsrh-border);vertical-align:top;overflow-wrap:anywhere;word-break:normal}
.nsrh-table-wrap th{font-size:var(--nsrh-text-table-head);text-transform:uppercase;letter-spacing:.04em;color:var(--nsrh-text-muted);background:var(--nsrh-surface-secondary)}.nsrh-table-wrap tr:last-child td{border-bottom:0}
.nsrh-table-actions{display:flex;gap:6px;flex-wrap:wrap}


/* Standard NSRH Core Button. Core owns visuals/states; apps choose semantic role and business action. */
.nsrh-btn,
.btn{
  appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:var(--nsrh-button-h);padding:9px 14px;border:1px solid transparent;border-radius:var(--nsrh-button-radius);
  background:var(--nsrh-primary);color:var(--nsrh-on-accent);font:inherit;font-weight:750;line-height:1.2;
  text-decoration:none;vertical-align:middle;cursor:pointer;user-select:none;
  transition:background-color .14s ease,border-color .14s ease,color .14s ease,box-shadow .14s ease,transform .08s ease,opacity .14s ease;
}
.nsrh-btn:hover:not(:disabled):not([aria-disabled="true"]):not([data-nsrh-busy="1"]),
.btn:hover:not(:disabled):not([aria-disabled="true"]):not([data-nsrh-busy="1"]){background:var(--nsrh-primary-hover);text-decoration:none}
.nsrh-btn:active:not(:disabled):not([aria-disabled="true"]):not([data-nsrh-busy="1"]),
.btn:active:not(:disabled):not([aria-disabled="true"]):not([data-nsrh-busy="1"]){transform:translateY(1px)}
.nsrh-btn:focus-visible,.btn:focus-visible{outline:2px solid var(--nsrh-focus-outline);outline-offset:2px}

.nsrh-btn-secondary,.btn-secondary{background:var(--nsrh-surface);color:var(--nsrh-text);border-color:var(--nsrh-border)}
.nsrh-btn-secondary:hover:not(:disabled):not([aria-disabled="true"]):not([data-nsrh-busy="1"]),
.btn-secondary:hover:not(:disabled):not([aria-disabled="true"]):not([data-nsrh-busy="1"]){background:var(--nsrh-hover);border-color:var(--nsrh-border-strong)}

.nsrh-btn-danger,.btn-danger{background:var(--nsrh-danger-action);color:var(--nsrh-on-danger);border-color:var(--nsrh-danger-action)}
.nsrh-btn-danger:hover:not(:disabled):not([aria-disabled="true"]):not([data-nsrh-busy="1"]),
.btn-danger:hover:not(:disabled):not([aria-disabled="true"]):not([data-nsrh-busy="1"]){background:var(--nsrh-danger-action-hover);border-color:var(--nsrh-danger-action-hover)}

.nsrh-btn-ghost,.btn-ghost{background:transparent;color:var(--nsrh-text-secondary);border-color:transparent}
.nsrh-btn-ghost:hover:not(:disabled):not([aria-disabled="true"]):not([data-nsrh-busy="1"]),
.btn-ghost:hover:not(:disabled):not([aria-disabled="true"]):not([data-nsrh-busy="1"]){background:var(--nsrh-hover);color:var(--nsrh-text)}

.nsrh-btn-positive,.btn-positive{background:var(--nsrh-positive-surface);color:var(--nsrh-positive-text);border-color:var(--nsrh-positive-border)}
.nsrh-btn-positive:hover:not(:disabled):not([aria-disabled="true"]):not([data-nsrh-busy="1"]),
.btn-positive:hover:not(:disabled):not([aria-disabled="true"]):not([data-nsrh-busy="1"]){background:var(--nsrh-positive-hover);border-color:var(--nsrh-positive)}

.nsrh-btn-sm,.btn-sm{min-height:var(--nsrh-button-h-sm);padding:7px 10px;font-size:.86rem}
.nsrh-btn-icon,.btn-icon{width:36px;min-width:36px;height:36px;min-height:36px;padding:0;border-radius:9px}
.nsrh-btn-icon.nsrh-btn-sm,.btn-icon.btn-sm{width:34px;min-width:34px;height:34px;min-height:34px}

.nsrh-btn:disabled,.nsrh-btn[aria-disabled="true"],.btn:disabled,.btn[aria-disabled="true"]{opacity:.5;cursor:not-allowed;pointer-events:none}
.nsrh-btn[data-nsrh-busy="1"],.btn[data-nsrh-busy="1"]{opacity:.72;cursor:wait;pointer-events:none}
.nsrh-btn[data-nsrh-busy="1"]::before,.btn[data-nsrh-busy="1"]::before{content:"";width:.9em;height:.9em;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:nsrh-btn-spin .7s linear infinite;flex:0 0 auto}
@keyframes nsrh-btn-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.nsrh-btn,.btn{transition:none}.nsrh-btn[data-nsrh-busy="1"]::before,.btn[data-nsrh-busy="1"]::before{animation:none}}

/* .btn aliases are compatibility-only for older NSRH app snapshots. New code uses nsrh-btn*. */

/* Standard NSRH Navbar. */
.navbar{position:sticky;top:0;z-index:50;min-height:var(--nsrh-nav-h);display:flex;align-items:center;gap:12px;padding:10px 20px;background:var(--nsrh-surface);border-bottom:1px solid var(--nsrh-border);box-shadow:0 3px 12px rgba(0,0,0,.04)}
.navbar-left,.navbar-end,.navbar-actions,.navbar-right{display:flex;align-items:center}.navbar-left{gap:12px;min-width:0}.navbar-end{margin-left:auto;gap:8px;justify-content:flex-end;flex:0 0 auto}.navbar-actions{gap:6px;justify-content:flex-end}.navbar-actions:empty{display:none}.navbar-right{gap:12px;justify-content:flex-end;flex:0 0 auto}
.current-app{display:inline-flex;align-items:center;min-height:38px;padding:6px 8px;border-radius:9px;color:var(--nsrh-text-secondary);font-weight:800}.current-app:hover{background:var(--nsrh-hover);color:var(--nsrh-text);text-decoration:none}
.navbar-slots{display:flex;align-items:center;gap:8px;justify-content:flex-start;min-width:0}.navbar-slots:empty{display:none}.app-slot{display:inline-flex;align-items:center;justify-content:center;min-width:38px;min-height:38px;padding:6px 10px;border:1px solid var(--nsrh-border);border-radius:10px;background:var(--nsrh-surface-secondary);color:var(--nsrh-text);font-weight:700;white-space:nowrap}.app-slot:hover{border-color:var(--nsrh-primary);text-decoration:none}.app-slot:focus-visible{outline:2px solid var(--nsrh-focus-outline);outline-offset:2px}
.navbar-action-icon,.navbar-primary-action{display:inline-flex;align-items:center;justify-content:center;min-height:38px;border-radius:10px;font:inherit;font-weight:750;cursor:pointer;transition:background .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease}.navbar-action-icon{width:38px;min-width:38px;padding:0;border:1px solid var(--nsrh-border);background:var(--nsrh-surface-secondary);color:var(--nsrh-text);font-weight:800}.navbar-action-icon:hover{border-color:var(--nsrh-primary);background:var(--nsrh-hover)}.navbar-primary-action{max-width:190px;padding:7px 14px;border:1px solid var(--nsrh-primary);background:var(--nsrh-primary);color:var(--nsrh-on-accent);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.navbar-primary-action:hover{border-color:var(--nsrh-primary-hover);background:var(--nsrh-primary-hover)}.navbar-action-icon:focus-visible,.navbar-primary-action:focus-visible{outline:2px solid var(--nsrh-focus-outline);outline-offset:2px}
details{position:relative}summary{list-style:none;cursor:pointer}summary::-webkit-details-marker{display:none}.nav-menu>summary,.user-menu>summary{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:10px;font-weight:700}.nav-menu>summary:hover,.user-menu>summary:hover{background:var(--nsrh-hover)}
.nav-popover{position:absolute;top:calc(100% + 8px);left:0;width:min(340px,calc(100vw - 24px));max-height:calc(100vh - 80px);max-height:var(--nsrh-menu-max-height,calc(100dvh - 80px));overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;padding:8px;background:var(--nsrh-surface);border:1px solid var(--nsrh-border);border-radius:12px;box-shadow:var(--nsrh-shadow)}.user-popover{left:auto;right:0;min-width:240px}
.nav-popover a,.menu-disabled,.link-button{display:flex;width:100%;align-items:center;justify-content:space-between;padding:10px 11px;border-radius:8px;color:var(--nsrh-text);text-align:left}.nav-popover a:hover,.link-button:hover{background:var(--nsrh-hover);text-decoration:none}.menu-disabled{opacity:.45}.menu-label{padding:12px 11px 5px;color:var(--nsrh-text-muted);font-size:.76rem;font-weight:800;text-transform:uppercase;letter-spacing:.07em}.menu-sep{height:1px;background:var(--nsrh-divider);margin:7px}.menu-form{margin:0}.link-button{border:0;background:transparent}.badge{display:inline-flex;min-width:22px;height:22px;align-items:center;justify-content:center;border-radius:999px;background:var(--nsrh-primary);color:var(--nsrh-on-accent);font-size:.76rem;padding:0 6px}.user-heading{padding:10px 11px;border-bottom:1px solid var(--nsrh-divider);margin-bottom:4px}.user-heading strong,.user-heading small{display:block}.user-heading small{color:var(--nsrh-text-muted);margin-top:2px}
.navbar-notifications{position:relative;display:flex;align-items:center}.navbar-notification-toggle{position:relative;gap:6px}.navbar-notification-toggle.has-groups{width:auto;min-width:38px;padding:0 9px;border-color:var(--nsrh-border);background:var(--nsrh-surface-secondary)}.navbar-notification-toggle.has-unread .navbar-notification-bell{color:var(--nsrh-warning)}.navbar-notification-bell{display:inline-block;font-size:1rem;line-height:1}.navbar-notification-badge{position:static;display:inline-block;min-width:0;height:auto;padding:0;border:0;border-radius:0;background:transparent;color:var(--nsrh-text);font-size:1rem;font-weight:850;line-height:1;font-variant-numeric:tabular-nums}.navbar-notification-badge[hidden]{display:none}.navbar-notification-popover{position:absolute;z-index:70;top:calc(100% + 8px);right:0;width:min(390px,calc(100vw - 24px));max-height:min(520px,70vh);overflow:auto;padding:8px;background:var(--nsrh-surface);border:1px solid var(--nsrh-border);border-radius:12px;box-shadow:var(--nsrh-shadow)}.navbar-notification-heading{padding:9px 10px 10px;border-bottom:1px solid var(--nsrh-divider)}.navbar-notification-list{display:grid;gap:4px;padding-top:4px}.navbar-notification-item{display:grid;width:100%;grid-template-columns:minmax(0,1fr) 30px;gap:6px;align-items:start;padding:7px;border-radius:9px;background:transparent;color:var(--nsrh-text)}.navbar-notification-item:hover{background:var(--nsrh-hover)}.navbar-notification-item.is-dismissed{opacity:.45;background:var(--nsrh-surface-secondary)}.navbar-notification-open,.navbar-notification-static{display:grid;width:100%;grid-template-columns:36px minmax(0,1fr);gap:10px;align-items:center;padding:3px;border:0;border-radius:8px;background:transparent;color:var(--nsrh-text);text-align:left;font:inherit}.navbar-notification-open{cursor:pointer}.navbar-notification-open:focus-visible,.navbar-notification-dismiss:focus-visible,.navbar-notification-clear-all:focus-visible{outline:2px solid var(--nsrh-focus-outline);outline-offset:1px}.navbar-notification-icon{display:grid;place-items:center;width:34px;height:34px;border:1px solid var(--nsrh-border);border-radius:9px;background:var(--nsrh-surface-secondary);font-size:1.05rem}.navbar-notification-copy{display:block;min-width:0}.navbar-notification-label{display:block;font-weight:800;overflow-wrap:anywhere}.navbar-notification-unseen-dot{display:inline-block;width:7px;height:7px;margin-left:2px;border-radius:50%;background:var(--nsrh-warning);vertical-align:middle}.navbar-notification-meta{display:flex;align-items:center;gap:6px;min-height:18px;margin-top:3px;color:var(--nsrh-text-muted);font-size:var(--nsrh-text-meta)}.navbar-notification-chevron{display:inline-block;color:var(--nsrh-primary);font-size:1.15rem;font-weight:900;line-height:1}.navbar-notification-time{display:inline-block;font-variant-numeric:tabular-nums}.navbar-notification-dismiss{display:grid;place-items:center;width:28px;height:28px;padding:0;border:0;border-radius:8px;background:transparent;color:var(--nsrh-text-muted);font:inherit;font-size:1.2rem;line-height:1;cursor:pointer}.navbar-notification-dismiss:hover{background:var(--nsrh-surface-secondary);color:var(--nsrh-text)}.navbar-notification-footer{display:flex;justify-content:flex-end;margin-top:4px;padding:8px 8px 2px;border-top:1px solid var(--nsrh-divider)}.navbar-notification-clear-all{padding:5px 7px;border:0;border-radius:7px;background:transparent;color:var(--nsrh-text-muted);font:inherit;font-size:var(--nsrh-text-meta);font-weight:700;cursor:pointer}.navbar-notification-clear-all:hover{background:var(--nsrh-hover);color:var(--nsrh-text)}.navbar-notification-clear-all[hidden]{display:none}.navbar-notification-source{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

.avatar{border-radius:50%;object-fit:cover;border:1px solid var(--nsrh-border)}.avatar-generated{--avatar-size:36px;display:inline-flex;width:var(--avatar-size);height:var(--avatar-size);border-radius:50%;align-items:center;justify-content:center;font-weight:800;color:#fff;font-size:calc(var(--avatar-size)*.38);letter-spacing:.02em}.tone-1{background:#355c7d}.tone-2{background:#6c5b7b}.tone-3{background:#2f6f5e}.tone-4{background:#8b5e3c}.tone-5{background:#765285}.tone-6{background:#3f6d87}.avatar-hover{position:relative;display:inline-flex;align-items:center}.avatar-tooltip{position:absolute;z-index:80;top:calc(100% + 9px);right:0;display:none;min-width:190px;max-width:280px;padding:9px 11px;border:1px solid var(--nsrh-border);border-radius:9px;background:var(--nsrh-surface);box-shadow:var(--nsrh-shadow);color:var(--nsrh-text);white-space:nowrap;pointer-events:none}.avatar-tooltip strong,.avatar-tooltip small{display:block}.avatar-tooltip small{margin-top:3px;color:var(--nsrh-text-muted)}.avatar-hover:hover .avatar-tooltip,.avatar-hover:focus-within .avatar-tooltip{display:block}
.avatar-34{--avatar-size:34px}.avatar-36{--avatar-size:36px}.avatar-42{--avatar-size:42px}.avatar-64{--avatar-size:64px}.avatar-88{--avatar-size:88px}

/* Shared preference cards. */
.nsrh-preferences-card .nsrh-section-title{margin-bottom:18px}.nsrh-preferences-card h3{margin:0 0 5px}.nsrh-pref-block+.nsrh-pref-block{margin-top:26px;padding-top:24px;border-top:1px solid var(--nsrh-divider)}.nsrh-pref-heading{display:flex;justify-content:space-between;gap:16px;margin-bottom:12px}.nsrh-pref-heading p{margin:0}
.theme-choice-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.theme-choice{display:flex;position:relative;flex-direction:column;gap:7px;padding:9px;border:1px solid var(--nsrh-border-strong);border-radius:11px;background:var(--nsrh-surface);cursor:pointer;transition:border-color .15s ease,transform .15s ease,box-shadow .15s ease}.theme-choice:hover{border-color:var(--nsrh-primary-border);transform:translateY(-1px)}.theme-choice:has(input:checked){border-color:var(--nsrh-primary);box-shadow:0 0 0 2px var(--nsrh-primary-ring-faint)}.theme-choice:has(input:focus-visible){outline:2px solid var(--nsrh-focus-outline);outline-offset:2px}.theme-choice input{position:absolute;opacity:0;pointer-events:none}.theme-choice-preview{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:3px;height:56px;padding:6px;border-radius:8px;background:var(--nsrh-border)}.theme-choice-preview i{display:block;border-radius:3px}.theme-preview-bg{background:var(--nsrh-bg)}.theme-preview-surface{background:var(--nsrh-surface)}.theme-preview-primary{background:var(--nsrh-primary)}.theme-preview-text{background:var(--nsrh-text)}.theme-choice>strong{color:var(--nsrh-text)}
.background-mode-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.background-mode-choice{position:relative;display:flex;align-items:flex-start;gap:10px;padding:12px;border:1px solid var(--nsrh-border-strong);border-radius:10px;background:var(--nsrh-surface);cursor:pointer}.background-mode-choice:has(input:checked){border-color:var(--nsrh-primary);box-shadow:0 0 0 2px var(--nsrh-primary-ring-faint)}.background-mode-choice:has(input:focus-visible){outline:2px solid var(--nsrh-focus-outline);outline-offset:2px}.background-mode-choice input{margin-top:3px}.background-mode-choice strong,.background-mode-choice small{display:block}.background-mode-choice small{margin-top:3px;color:var(--nsrh-text-muted)}
.background-current-preview{height:160px;margin:10px 0 16px;border:1px solid var(--nsrh-border);border-radius:12px;overflow:hidden;background:var(--nsrh-bg);display:grid;place-items:center}.background-current-preview img{width:100%;height:100%;object-fit:cover}.background-theme-preview{padding:12px;color:var(--nsrh-text-secondary);font-weight:700}.nsrh-inherit-form{margin-top:10px}.nsrh-pref-actions{margin-top:0}

/* Desktop page widths; smaller viewports retain the standard page shell. */
@media(min-width:1440px){:root{--nsrh-content-max:1320px}}
@media(min-width:1920px){:root{--nsrh-content-max:1760px}}

/* Responsive layout: component containers reflow before typography is reduced. */
@container nsrh-layout (max-width:56rem){
  .nsrh-span-1-4,.nsrh-span-1-3{grid-column:span 6}
  .nsrh-span-2-3,.nsrh-span-3-4{grid-column:1/-1}
}
@container nsrh-layout (max-width:38rem){
  .nsrh-span-1-4,.nsrh-span-1-3,.nsrh-span-1-2,.nsrh-span-2-3,.nsrh-span-3-4,.nsrh-span-full{grid-column:1/-1}
}

/* Table compression is based on the table container, not only the browser viewport. */
@container nsrh-table (max-width:52rem){
  .nsrh-table-wrap th,.nsrh-table-wrap td{padding:9px 8px}
}
@container nsrh-table (max-width:43.75rem){
  .nsrh-table-wrap table:not(.nsrh-table-no-cards){display:block;width:100%;table-layout:auto}
  .nsrh-table-wrap table:not(.nsrh-table-no-cards) colgroup{display:none}
  .nsrh-table-wrap table:not(.nsrh-table-no-cards) thead{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
  .nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody{display:grid;gap:10px}
  .nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody tr{display:block;padding:10px 12px;border:1px solid var(--nsrh-border);border-radius:12px;background:var(--nsrh-surface);box-shadow:0 2px 8px rgba(0,0,0,.025)}
  .nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody tr.nsrh-empty-row{padding:14px}
  .nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody td{display:grid;grid-template-columns:minmax(7.5rem,38%) minmax(0,1fr);gap:12px;width:100%;padding:8px 0;border-bottom:1px solid var(--nsrh-divider);background:transparent}
  .nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody td::before{content:attr(data-label);color:var(--nsrh-text-muted);font-size:var(--nsrh-text-table-head);font-weight:800;text-transform:uppercase;letter-spacing:.035em}
  .nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody td:last-child{border-bottom:0}
  .nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody td[data-label=""],.nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody td:not([data-label]){grid-template-columns:1fr}
  .nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody td[data-label=""]::before,.nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody td:not([data-label])::before{display:none}
  .nsrh-table-wrap table:not(.nsrh-table-no-cards) .nsrh-table-actions{justify-content:flex-start}
}
@container nsrh-table (max-width:30rem){
  .nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody td{grid-template-columns:1fr;gap:4px}
}

@media(max-width:960px){:root{--nsrh-page-pad-x:16px;--nsrh-layout-gap:12px;--nsrh-card-padding:16px;--nsrh-table-cell-x:10px;--nsrh-table-cell-y:9px}.nsrh-grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:980px){.navbar.navbar-has-actions{flex-wrap:wrap;padding:8px 12px}.navbar.navbar-has-actions .navbar-left{order:1}.navbar.navbar-has-actions .navbar-end{order:2;margin-left:auto}.navbar.navbar-has-actions .navbar-slots{order:3;flex:0 0 100%;width:100%;justify-content:flex-start}.navbar.navbar-has-actions .current-app{max-width:38vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
@media(max-width:780px){.navbar{flex-wrap:wrap;padding:8px 12px}.navbar-left{order:1}.navbar-end{order:2;margin-left:auto}.navbar-slots{order:3;flex:0 0 100%;width:100%;justify-content:flex-start}.current-app{max-width:42vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nsrh-grid-2,.nsrh-grid-3,.nsrh-grid-4{grid-template-columns:1fr}.nsrh-kv{grid-template-columns:1fr}.nsrh-auth-card{padding:22px}}
@media(max-width:700px){.user-first-name{display:none}.navbar-end{gap:6px}.navbar-actions{gap:5px}.user-menu>summary{padding-left:6px;padding-right:6px}.nsrh-content-3-4,.nsrh-content-1-2{max-width:100%}}
@media(max-width:560px){.navbar.navbar-has-actions{display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-auto-rows:auto;column-gap:8px;row-gap:6px}.navbar.navbar-has-actions .navbar-left{display:contents}.navbar.navbar-has-actions .nav-menu{grid-column:1;grid-row:1;justify-self:start}.navbar.navbar-has-actions .navbar-end{grid-column:3;grid-row:1;margin-left:0;justify-self:end;min-width:0}.navbar.navbar-has-actions .current-app{grid-column:1;grid-row:2;max-width:34vw;min-width:0}.navbar.navbar-has-actions .navbar-slots{grid-column:2/4;grid-row:2;width:auto;min-width:0;flex:0 1 auto;flex-wrap:wrap;gap:6px}.navbar-action-icon{width:36px;min-width:36px;min-height:36px}.navbar-primary-action{min-height:36px;max-width:128px;padding:6px 10px}.nav-menu>summary{padding-left:7px;padding-right:7px}.user-menu>summary{gap:5px;padding:4px 3px}}
@media(max-width:390px){.navbar.navbar-has-actions{grid-template-columns:minmax(0,1fr) auto;padding-left:8px;padding-right:8px;column-gap:6px}.navbar.navbar-has-actions .nav-menu{grid-column:1;grid-row:1}.navbar.navbar-has-actions .navbar-end{grid-column:2;grid-row:1}.navbar.navbar-has-actions .current-app{grid-column:1/3;grid-row:2;max-width:100%;justify-self:start}.navbar.navbar-has-actions .navbar-slots{grid-column:1/3;grid-row:3}.navbar-action-icon{width:34px;min-width:34px;min-height:36px}.navbar-primary-action{max-width:112px;padding-left:8px;padding-right:8px}.navbar-actions{gap:4px}.navbar-end{gap:4px}.nav-menu>summary{padding-left:5px;padding-right:5px}.user-menu>summary{padding-left:1px;padding-right:1px}}
@media(max-width:700px){
  :root{--nsrh-page-pad-x:14px;--nsrh-page-pad-top:22px;--nsrh-page-pad-bottom:50px;--nsrh-card-padding:14px;--nsrh-table-cell-x:0px;--nsrh-table-cell-y:8px}
  .theme-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.background-mode-grid{grid-template-columns:1fr}
  .nsrh-table-wrap{overflow:visible;border:0;background:transparent}
}
@media(max-width:480px){.navbar{gap:6px}.nsrh-page-head{align-items:flex-start;flex-direction:column}.nsrh-filters{grid-template-columns:1fr}}

/* Fallback for browsers without container-query support. */
@supports not (container-type:inline-size){
  @media(max-width:700px){
    .nsrh-table-wrap table:not(.nsrh-table-no-cards){display:block;width:100%;table-layout:auto}
  .nsrh-table-wrap table:not(.nsrh-table-no-cards) colgroup{display:none}
    .nsrh-table-wrap table:not(.nsrh-table-no-cards) thead{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
    .nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody{display:grid;gap:10px}
    .nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody tr{display:block;padding:10px 12px;border:1px solid var(--nsrh-border);border-radius:12px;background:var(--nsrh-surface);box-shadow:0 2px 8px rgba(0,0,0,.025)}
    .nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody td{display:grid;grid-template-columns:minmax(7.5rem,38%) minmax(0,1fr);gap:12px;width:100%;padding:8px 0;border-bottom:1px solid var(--nsrh-divider);background:transparent}
    .nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody td::before{content:attr(data-label);color:var(--nsrh-text-muted);font-size:var(--nsrh-text-table-head);font-weight:800;text-transform:uppercase;letter-spacing:.035em}
    .nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody td:last-child{border-bottom:0}
    .nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody td[data-label=""],.nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody td:not([data-label]){grid-template-columns:1fr}
    .nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody td[data-label=""]::before,.nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody td:not([data-label])::before{display:none}
    .nsrh-table-wrap table:not(.nsrh-table-no-cards) .nsrh-table-actions{justify-content:flex-start}
  }
  @media(max-width:480px){.nsrh-table-wrap table:not(.nsrh-table-no-cards) tbody td{grid-template-columns:1fr;gap:4px}}
}


/* Standard NSRH Core Modal. One active modal at a time; Core owns shell and behavior. */
body.nsrh-modal-open{overflow:hidden}
.nsrh-modal-root{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:20px}
.nsrh-modal-root[hidden]{display:none!important}
.nsrh-modal-backdrop{position:absolute;inset:0;background:var(--nsrh-modal-backdrop);backdrop-filter:blur(1.5px)}
.nsrh-modal{position:relative;z-index:1;width:min(100%,560px);max-height:min(90dvh,820px);display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--nsrh-border-strong);border-radius:14px;background:var(--nsrh-surface);color:var(--nsrh-text);box-shadow:0 24px 70px rgba(0,0,0,.24)}
.nsrh-modal-sm{max-width:430px}.nsrh-modal-md{max-width:560px}.nsrh-modal-lg{max-width:760px}
.nsrh-modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:18px 20px 14px;border-bottom:1px solid var(--nsrh-divider)}
.nsrh-modal-header h2{margin:0;font-size:1.08rem;line-height:1.35;color:var(--nsrh-text)}
.nsrh-modal-close{flex:0 0 auto;margin:-7px -7px -5px 0;color:var(--nsrh-text-muted);font-size:1.55rem;line-height:1}
.nsrh-modal-body{min-height:0;overflow:auto;padding:18px 20px}.nsrh-modal-body>:first-child{margin-top:0}.nsrh-modal-body>:last-child{margin-bottom:0}
.nsrh-modal-footer{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;padding:14px 20px 18px;border-top:1px solid var(--nsrh-divider);background:var(--nsrh-surface)}
.nsrh-modal-tone-info{border-top:3px solid var(--nsrh-info)}.nsrh-modal-tone-success{border-top:3px solid var(--nsrh-success)}.nsrh-modal-tone-warning{border-top:3px solid var(--nsrh-warning)}.nsrh-modal-tone-danger{border-top:3px solid var(--nsrh-danger)}
.nsrh-modal[data-nsrh-busy="1"] .nsrh-modal-footer button{pointer-events:none;opacity:.68}
@media(max-width:700px){.nsrh-modal-root{padding:12px}.nsrh-modal{width:100%;max-height:90dvh}.nsrh-modal-header{padding:16px 16px 12px}.nsrh-modal-body{padding:16px}.nsrh-modal-footer{padding:12px 16px 16px}.nsrh-modal-footer .nsrh-btn,.nsrh-modal-footer .btn{min-width:0}}
