/* Mayo Clinic–inspired clinical UI — colors come from themes.css (data-theme) */

* {
  box-sizing: border-box;
}

:root {
  --sidebar-w: 240px;
  --radius: 6px;
  --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mayo-blue: #00539c;
  --mayo-blue-dark: #003b73;
  --mayo-blue-soft: #e8f2fa;
  --mayo-red: #b5121b;
  --mayo-text: #1d1d1f;
  --mayo-muted: #5c5c5c;
  --mayo-border: #d8dde3;
  --mayo-bg: #f4f6f8;
  --mayo-surface: #ffffff;
  --mayo-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--mayo-bg);
  color: var(--mayo-text);
  font-size: 0.9375rem;
  line-height: 1.45;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body.login-page {
  --login-bg-image: url("images/admin123.jpeg");
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  padding-top: max(2rem, env(safe-area-inset-top));
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  background-color: #0f1720;
  background-image: var(--login-bg-image);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

body.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(7, 13, 24, 0.58);
  pointer-events: none;
  z-index: 0;
}

body.login-page #root,
body.launcher-page #root,
body.launcher-page .legacy-page-root {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: transparent;
}

body.memo-page #root,
body.memo-page .legacy-page-root {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: transparent;
}

h1, h2, h3, h4, p {
  margin: 0 0 0.5rem;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.25rem;
  background: color-mix(in srgb, var(--mayo-surface) 92%, transparent);
  border-bottom: 1px solid var(--mayo-border);
  box-shadow: var(--mayo-shadow);
  backdrop-filter: blur(10px);
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.app-header-brand-text {
  min-width: 0;
}

.app-eyebrow {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mayo-muted);
}

.brand-mark {
  width: 4px;
  height: 40px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--mayo-blue) 0%, var(--mayo-blue-dark) 100%);
}

.brand-logo {
  display: block;
  width: 148px;
  height: 148px;
  object-fit: contain;
  margin: 0 auto 1rem;
  background: #fff;
  border-radius: 16px;
  padding: 0.5rem;
  box-shadow: none;
}

.brand-logo--header {
  width: 48px;
  height: 48px;
  margin: 0;
  flex-shrink: 0;
  border-radius: 10px;
  background: #fff;
  padding: 2px;
  object-fit: contain;
}

.launcher-header-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 1rem;
  min-width: 0;
}

.launcher-header-brand .brand-logo--header {
  width: 72px;
  height: 72px;
}

.launcher-header-copy {
  min-width: 0;
}

.launcher-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mayo-muted);
}

.app-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--mayo-blue);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
}

.app-tagline {
  font-size: 0.8rem;
  color: var(--mayo-muted);
  margin: 0.15rem 0 0;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.user-pill {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mayo-text);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--mayo-border);
  background: var(--mayo-surface);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border-radius: 0.55rem;
  border: 1px solid var(--mayo-border);
  background: var(--mayo-surface);
  color: var(--mayo-blue);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--mayo-blue-soft);
  border-color: var(--mayo-blue);
}

.mobile-menu-btn {
  display: none;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 32, 0.45);
  z-index: 80;
  pointer-events: none;
}

body.mobile-nav-open .mobile-nav-backdrop:not(.hidden) {
  pointer-events: auto;
}

body:not(.mobile-nav-open) .mobile-nav-backdrop {
  display: none !important;
  pointer-events: none !important;
}

.app-shell {
  display: flex;
  min-height: calc(100vh - 64px);
  min-height: calc(100dvh - 64px);
  width: 100%;
  background:
    radial-gradient(900px 320px at 0% 0%, color-mix(in srgb, var(--mayo-blue) 8%, transparent), transparent 55%),
    var(--mayo-bg);
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--mayo-surface);
  border-right: 1px solid var(--mayo-border);
  padding: 0.85rem 0 1rem;
  display: flex;
  flex-direction: column;
}

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mayo-muted);
  padding: 0.35rem 1rem 0.45rem;
}

.sidebar-meta {
  padding: 0.75rem 0.85rem 0;
  margin-top: auto;
  border-top: 1px solid var(--mayo-border);
}

.sidebar-meta-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mayo-muted);
  margin-bottom: 0.35rem;
}

.sidebar-meta-perms {
  font-size: 0.9rem;
  line-height: 1.35;
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 0.35rem;
  border: 1px solid var(--mayo-border);
  background: var(--mayo-surface);
  color: var(--mayo-text);
}

.pill-warn {
  border-color: rgba(181, 18, 27, 0.35);
  background: rgba(181, 18, 27, 0.08);
  color: var(--mayo-red);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0.55rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 550;
  color: var(--mayo-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-item i {
  font-size: 1.05rem;
  color: var(--mayo-muted);
  width: 1.1rem;
  text-align: center;
}

.nav-item:hover {
  background: var(--mayo-blue-soft);
  color: var(--mayo-blue-dark);
}

.nav-item:hover i {
  color: var(--mayo-blue);
}

.nav-item.active {
  background: color-mix(in srgb, var(--mayo-blue) 12%, var(--mayo-surface));
  color: var(--mayo-blue-dark);
  font-weight: 700;
  border-color: color-mix(in srgb, var(--mayo-blue) 22%, transparent);
  border-left-color: var(--mayo-blue);
}

.nav-item.active i {
  color: var(--mayo-blue);
}

.nav-item-label {
  flex: 1 1 auto;
}

.nav-badge {
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
  border-radius: 999px;
  background: var(--mayo-red);
  color: #fff;
}

.nav-badge.hidden {
  display: none;
}

.nav-divider {
  height: 1px;
  margin: 0.5rem 0.85rem;
  background: var(--mayo-border);
}

.main-panel {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 1.35rem 1.5rem 2rem;
  position: relative;
}

.admin-msg-global {
  margin: 0 0 1rem;
}

.admin-msg-global:not(.hidden) {
  display: block;
}

.view-panel {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0.85; }
  to { opacity: 1; }
}

.mayo-card {
  background: var(--mayo-surface);
  border: 1px solid var(--mayo-border);
  border-radius: 12px;
  padding: 1.35rem 1.5rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
}

.panel-title {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--mayo-blue-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid var(--mayo-blue-soft);
}

.panel-lead {
  margin-bottom: 1rem;
  color: var(--mayo-muted);
  font-size: 0.95rem;
}

.panel-lead.muted {
  margin-top: -0.5rem;
}

.form {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.form-row > * {
  flex: 1 1 140px;
}

.compose-pair-row {
  align-items: flex-start;
  gap: 0.75rem 1rem;
  margin: 0;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.form-field > label {
  margin: 0;
}

.form-field > select,
.form-field .recipient-picker {
  width: 100%;
}

.form-field .recipient-picker select {
  flex: 1 1 auto;
  min-width: 0;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}

.form-inline input {
  flex: 1 1 200px;
}

.form-create-user .file-label {
  margin-top: 0.25rem;
}

input, select, textarea {
  font: inherit;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--mayo-border);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(0, 83, 156, 0.35);
  outline-offset: 1px;
}

.memo-content-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.memo-content-label-row label {
  margin-bottom: 0;
}

.memo-editor-expand-btn {
  flex-shrink: 0;
  padding: 0.25rem 0.65rem;
  font-size: 0.85rem;
  line-height: 1.3;
}

.memo-editor-wrap {
  margin-bottom: 0.75rem;
}

.memo-editor-wrap .ql-toolbar.ql-snow {
  border-radius: var(--radius) var(--radius) 0 0;
  border-color: var(--mayo-border);
  background: color-mix(in srgb, var(--mayo-bg) 70%, var(--mayo-surface));
  font-family: inherit;
  color: var(--mayo-text);
}

.memo-editor-wrap .ql-container.ql-snow {
  min-height: 200px;
  height: 220px;
  max-height: min(70vh, 720px);
  resize: vertical;
  overflow-y: auto;
  border-radius: 0 0 var(--radius) var(--radius);
  border-color: var(--mayo-border);
  font-family: inherit;
  font-size: 1rem;
  background: var(--mayo-surface);
  color: var(--mayo-text);
}

.memo-editor-wrap.is-expanded .ql-container.ql-snow {
  height: min(70vh, 640px);
  max-height: min(85vh, 900px);
}

.memo-editor-wrap .ql-editor {
  min-height: 100%;
}

.memo-editor-wrap .ql-editor.ql-blank::before {
  color: var(--mayo-muted);
  font-style: normal;
}

.memo-editor-wordcount {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  text-align: right;
}

.memo-body-rich {
  line-height: 1.55;
  word-break: break-word;
}

.memo-body-rich p {
  margin: 0 0 0.65rem;
}

.memo-body-rich p:last-child {
  margin-bottom: 0;
}

.memo-body-rich ul,
.memo-body-rich ol {
  margin: 0 0 0.65rem;
  padding-left: 1.5rem;
}

.memo-body-rich a {
  color: var(--mayo-blue, #00539c);
}

.memo-body-rich table,
.memo-editor-wrap .ql-editor table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 0.75rem;
}

.memo-body-rich td,
.memo-body-rich th,
.memo-editor-wrap .ql-editor td,
.memo-editor-wrap .ql-editor th {
  border: 1px solid var(--mayo-border, #d1d5db);
  padding: 0.4rem 0.55rem;
  vertical-align: top;
}

.memo-flex-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0.5rem;
}

.memo-flex-actions button {
  margin: 0;
}

button {
  font: inherit;
  cursor: pointer;
  background: var(--mayo-blue);
  color: #fff;
  border: 1px solid var(--mayo-blue);
  font-weight: 600;
  border-radius: var(--radius);
  padding: 0.4rem 0.55rem;
  width: fit-content;
  max-width: 100%;
  justify-self: start;
  flex: 0 0 auto;
}

button:hover {
  background: var(--mayo-blue-dark);
  border-color: var(--mayo-blue-dark);
}

button.secondary {
  background: var(--mayo-surface);
  color: var(--mayo-blue);
  border-color: var(--mayo-blue);
}

button.secondary:hover {
  background: var(--mayo-blue-soft);
}

a.btn,
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: var(--mayo-blue);
  color: #fff;
  border: 1px solid var(--mayo-blue);
  border-radius: var(--radius);
  padding: 0.45rem 0.75rem;
  min-height: 40px;
  box-sizing: border-box;
}

a.btn.secondary,
.btn.secondary {
  background: var(--mayo-surface);
  color: var(--mayo-blue);
  border-color: var(--mayo-border);
}

a.btn.secondary:hover,
.btn.secondary:hover {
  background: var(--mayo-blue-soft);
}

.login-theme-block {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--mayo-border);
}

.login-theme-toggle {
  width: 100%;
  justify-content: center;
  margin-bottom: 0.75rem;
}

button.danger {
  background: var(--mayo-red);
  border-color: var(--mayo-red);
}

button.danger:hover {
  background: #8f0e15;
  border-color: #8f0e15;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--mayo-border);
  border-radius: var(--radius);
}

.table-wrap-audit {
  max-height: min(70vh, 640px);
  overflow: auto;
}

.priority-pill {
  display: inline-block;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.priority-normal {
  background: #edf7ee;
  color: #206036;
  border-color: #b7dfbf;
}

.priority-urgent {
  background: #fff4db;
  color: #8a4b00;
  border-color: #f2cf8f;
}

.priority-critical {
  background: #fee7e7;
  color: #9f1239;
  border-color: #f7b8c2;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--mayo-surface);
}

th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mayo-muted);
}

th, td {
  border-bottom: 1px solid var(--mayo-border);
  text-align: left;
  padding: 0.55rem 0.65rem;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

.recipient-picker {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.compose-recipients {
  margin: 0;
  padding-left: 1.25rem;
}

.compose-route-preview {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--mayo-border);
  border-radius: var(--radius);
  background: var(--mayo-blue-soft);
}

.compose-route-preview-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--mayo-blue-dark);
  margin-bottom: 0.35rem;
}

.compose-route-print {
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
  line-height: 1.55;
}

.compose-route-print div {
  margin: 0.15rem 0;
}

.compose-route-steps {
  margin: 0 0 0.5rem;
  padding-left: 1.25rem;
  font-size: 0.9rem;
}

.compose-route-steps li {
  margin-bottom: 0.25rem;
}

.hint-text {
  font-size: 0.85rem;
  color: var(--mayo-muted);
  margin: 0;
}

.memo-category-select {
  max-width: 100%;
}

.memo-category-hint {
  margin: 0.35rem 0 0.75rem;
  line-height: 1.4;
}

.error {
  color: var(--mayo-red);
  margin-top: 0.5rem;
}

.success {
  color: #0d5c2e;
  margin-top: 0.5rem;
}

.admin-msg {
  font-size: 0.95rem;
}

.centered-card {
  max-width: 480px;
  margin: 5rem auto;
  background: var(--mayo-surface);
  padding: 1.5rem;
  border-radius: 10px;
  border: 1px solid var(--mayo-border);
  box-shadow: var(--mayo-shadow);
}

body.login-page .centered-card {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  margin: 0;
  background: color-mix(in srgb, var(--mayo-surface) 88%, transparent);
  border-color: color-mix(in srgb, var(--mayo-border) 75%, transparent);
  backdrop-filter: blur(6px);
}

html[data-theme='midnight'] body.login-page .centered-card {
  background: color-mix(in srgb, var(--mayo-surface) 92%, transparent);
}

.centered-card > h1,
.centered-card > .subtitle {
  text-align: center;
}

.login-footnote {
  margin-top: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.subtitle {
  color: var(--mayo-muted);
}

dialog {
  width: min(780px, 90vw);
  border: 1px solid var(--mayo-border);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

dialog::backdrop {
  background: rgba(29, 29, 31, 0.35);
}

.memo-dialog > article {
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 900px);
  overflow: hidden;
  margin: 0;
}

.memo-dialog-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.memo-dialog.memo-dialog--wide {
  width: min(1320px, 98vw);
  max-height: 96vh;
  padding: 1.35rem 1.5rem;
}

.memo-dialog.memo-dialog--wide > article {
  max-height: min(92vh, 1100px);
}

.memo-dialog .dialog-actions {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: 0;
  padding-top: 0.85rem;
  background: var(--mayo-surface);
  border-top: 1px solid var(--mayo-border);
  box-shadow: 0 -6px 16px color-mix(in srgb, var(--mayo-surface) 88%, transparent);
}

.memo-preview-wrap {
  margin-bottom: 1rem;
}

.memo-preview-hint {
  margin: 0 0 0.5rem 0;
}

.memo-report-frame {
  width: 100%;
  height: clamp(280px, 50vh, 520px);
  border: 1px solid var(--mayo-border);
  border-radius: var(--radius);
  background: var(--mayo-surface);
  display: block;
}

.memo-dialog-scroll--official .memo-preview-hint {
  display: none;
}

.memo-dialog-scroll--official > h4 {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.95rem;
}

.memo-dialog-scroll--official .memo-respond-panel {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--mayo-border);
}

.memo-dialog-scroll--official .memo-flex-actions {
  margin-top: 0.5rem;
}

.memo-dialog-scroll--official .memo-report-frame {
  height: clamp(320px, 55vh, 580px);
}

dialog.preview-dialog {
  width: min(960px, 96vw);
  max-height: 92vh;
  overflow: auto;
}

.preview-frame {
  width: 100%;
  min-height: min(70vh, 640px);
  border: 1px solid var(--mayo-border);
  border-radius: var(--radius);
  background: #f8fafc;
}

.preview-img {
  max-width: 100%;
  max-height: min(70vh, 640px);
  display: block;
  margin: 0 auto;
  border-radius: var(--radius);
}

.preview-fallback {
  padding: 0.75rem;
  background: #fff8e6;
  border: 1px solid #f5d76e;
  border-radius: var(--radius);
  color: #5c4a00;
}

.preview-docx {
  max-height: min(70vh, 640px);
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--mayo-border);
  border-radius: var(--radius);
  background: var(--mayo-surface);
  font-size: 0.95rem;
}

.preview-docx :is(p, li) {
  margin: 0.35rem 0;
}

tr.inbox-unread td {
  font-weight: 600;
  background: #fffdf5;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin: 0.25rem 0;
}

.edit-user-dialog {
  width: min(480px, 94vw);
}

.hidden {
  display: none !important;
}

.memo-ha-attach {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--mayo-border);
}

.staff-compose-notice {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--mayo-border);
  border-radius: 8px;
  background: #f8fafc;
}

.memo-respond-panel {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--mayo-border);
}

.memo-respond-row {
  align-items: flex-start;
  margin: 0;
}

.memo-respond-remark {
  flex: 1.35 1 200px;
}

.memo-respond-remark textarea {
  width: 100%;
  min-height: 2.6rem;
  resize: vertical;
}

.memo-respond-hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.memo-respond-hint:empty {
  display: none;
}

.memo-forward-panel {
  flex: 1 1 180px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.memo-forward-panel select {
  width: 100%;
  max-width: none;
  margin: 0;
}

.request-input-wrap {
  margin: 0.75rem 0 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--mayo-border);
  border-radius: 8px;
  background: #f8fafc;
}

.request-input-wrap select {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 0.35rem 0;
}

.memo-requested-input-banner {
  margin: 0.75rem 0;
  padding: 0.6rem 0.85rem;
  border-left: 3px solid var(--mayo-blue, #2563eb);
  background: #eff6ff;
  font-size: 0.92rem;
}

.memo-sender-success-banner {
  margin: 0.75rem 0;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid #15803d;
  background: #f0fdf4;
  color: #166534;
  font-size: 0.95rem;
  font-weight: 600;
}

.memo-routing-trail-wrap {
  margin: 0.75rem 0 1rem;
}

.memo-routing-trail {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
}

.memo-routing-trail li {
  margin-bottom: 0.65rem;
}

.memo-routing-trail .trail-group-head {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.memo-routing-trail .trail-remarks-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--mayo-border, #e5e7eb);
}

.memo-routing-trail .trail-remark-entry {
  margin: 0;
}

.memo-routing-trail .trail-remark {
  margin-top: 0;
  color: var(--mayo-text-muted, #4b5563);
  white-space: pre-wrap;
}

.memo-routing-trail .trail-remark-continuation {
  padding-top: 0.35rem;
  border-top: 1px dashed var(--mayo-border, #e5e7eb);
}

.memo-recipient-list .recipient-group {
  margin-bottom: 0.5rem;
}

.memo-recipient-list .recipient-group-head {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.memo-recipient-list .recipient-remarks-col {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--mayo-border, #e5e7eb);
  color: var(--mayo-text-muted, #4b5563);
}

.memo-recipient-list .recipient-remark-continuation {
  padding-top: 0.25rem;
  border-top: 1px dashed var(--mayo-border, #e5e7eb);
}

.memo-recipient-list .recipient-remark-when {
  font-size: 0.82rem;
}

.memo-routing-trail .trail-when {
  font-size: 0.82rem;
  color: var(--mayo-text-muted, #6b7280);
}

.outbox-tracking {
  max-width: 280px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.memo-ha-attach h4 {
  margin-bottom: 0.35rem;
}

.memo-ha-attach-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.5rem 0 0.35rem;
}

.memo-ha-attach-row input[type="file"] {
  display: inline-block;
  margin: 0;
  flex: 1 1 200px;
  min-width: 0;
  max-width: 100%;
}

.memo-ha-attach-row #memoHaAttachBtn {
  margin: 0;
  flex: 0 0 auto;
}

.memo-ha-attach-row #memoHaAttachMsg {
  flex: 1 1 100%;
  margin: 0;
}

.compose-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: stretch;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--mayo-border);
}

.compose-actions:has(#discardDraftBtn:not(.hidden)) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compose-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.65rem 0.9rem;
  border-radius: 0.65rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  cursor: pointer;
  box-sizing: border-box;
  justify-self: stretch;
  flex: 1 1 auto;
  max-width: none;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.compose-btn i {
  font-size: 1rem;
  line-height: 1;
}

.compose-btn--primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--mayo-blue) 92%, #fff) 0%, var(--mayo-blue) 100%);
  color: #fff;
  border: 1px solid var(--mayo-blue);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 28%, transparent),
    0 1px 2px rgba(15, 23, 42, 0.12);
}

.compose-btn--primary:hover {
  background: var(--mayo-blue-dark);
  border-color: var(--mayo-blue-dark);
  color: #fff;
}

.compose-btn--secondary {
  background: var(--mayo-surface);
  color: var(--mayo-blue-dark);
  border: 1px solid color-mix(in srgb, var(--mayo-blue) 45%, var(--mayo-border));
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 50%, transparent);
}

.compose-btn--secondary:hover {
  background: var(--mayo-blue-soft);
  border-color: var(--mayo-blue);
  color: var(--mayo-blue-dark);
}

.compose-btn--ghost {
  background: color-mix(in srgb, var(--mayo-bg) 65%, var(--mayo-surface));
  color: var(--mayo-text);
  border: 1px solid var(--mayo-border);
}

.compose-btn--ghost:hover {
  background: var(--mayo-blue-soft);
  border-color: color-mix(in srgb, var(--mayo-blue) 35%, var(--mayo-border));
  color: var(--mayo-blue-dark);
}

.compose-btn--danger {
  background: linear-gradient(180deg, color-mix(in srgb, var(--mayo-red) 88%, #fff) 0%, var(--mayo-red) 100%);
  color: #fff;
  border: 1px solid var(--mayo-red);
}

.compose-btn--danger:hover {
  filter: brightness(0.92);
  color: #fff;
  background: var(--mayo-red);
  border-color: var(--mayo-red);
}

.compose-btn:active {
  transform: translateY(1px);
}

.compose-actions button {
  margin: 0;
}

.dialog-actions--memo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
  align-items: stretch;
}

.dialog-actions--memo .compose-btn {
  width: 100%;
}

.memo-draft-banner {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--mayo-border);
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--mayo-text, #1f2937);
}

.outbox-toolbar {
  margin: 0 0 0.75rem;
  max-width: 280px;
}

.outbox-draft-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: #eef2ff;
  color: #3730a3;
}

.outbox-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.compose-attachments {
  list-style: none;
  margin: 0.35rem 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.compose-attachments .attachment-row {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--mayo-border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--mayo-bg) 70%, var(--mayo-surface));
  margin-bottom: 0;
}

.attachment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.attachment-name {
  flex: 1 1 160px;
  min-width: 0;
  word-break: break-word;
}

.attachment-row button {
  flex: 0 0 auto;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.memo-recipient-list {
  margin: 0;
  padding-left: 1.25rem;
}

.memo-recipient-list li {
  margin-bottom: 0.5rem;
}

.memo-signature-thumb {
  display: block;
  max-height: 56px;
  max-width: 140px;
  margin-top: 0.35rem;
  object-fit: contain;
  background: var(--mayo-surface) !important;
  padding: 2px 4px;
  border-radius: 2px;
}

.memo-sender-signature-wrap {
  margin: 0.75rem 0 1rem;
}

.memo-sender-signature-wrap .muted {
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.admin-sig-thumb {
  max-height: 40px;
  max-width: 120px;
  object-fit: contain;
  vertical-align: middle;
  border: 1px solid var(--mayo-border);
  border-radius: 2px;
  background: var(--mayo-surface);
}

.sig-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.sig-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.sig-actions input[type="file"] {
  font-size: 0.75rem;
  max-width: 180px;
}

.users-table td {
  vertical-align: top;
}

.decisions-toolbar-wrap {
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.decisions-toolbar-wrap .decisions-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.decisions-toolbar-wrap .decisions-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--mayo-muted, #6b7280);
}

.decisions-toolbar-wrap select,
.decisions-toolbar-wrap input[type="date"],
.decisions-toolbar-wrap input[type="search"] {
  min-height: 2.25rem;
  font-size: 0.875rem;
}

.decisions-field.decisions-grow {
  flex: 1 1 180px;
}

.decisions-toolbar-wrap .decisions-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.decisions-table tbody tr.decisions-row:hover {
  background: rgba(0, 94, 184, 0.06);
}

.mono-ref {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.dept-actions-cell {
  white-space: nowrap;
}

.dept-actions-cell .edit-dept-btn {
  margin-right: 0.35rem;
}

.memo-ref-line {
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

/* Phones + tablets: hamburger drawer (do not use a horizontal top nav — it broke mobile layout) */
@media (max-width: 900px) {
  body.memo-page,
  body:not(.login-page):not(.launcher-page):not(.asms-app) {
    overflow-x: hidden;
  }

  .app-header {
    padding: 0.55rem 0.7rem;
    gap: 0.5rem;
  }

  .app-header-brand {
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 auto;
  }

  .app-header-brand > div {
    min-width: 0;
  }

  .brand-logo--header {
    width: 44px;
    height: 44px;
  }

  .app-title {
    font-size: 0.95rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-menu-btn {
    display: inline-flex !important;
    flex-shrink: 0;
  }

  .app-tagline,
  .user-pill {
    display: none;
  }

  .app-shell {
    display: block;
    min-height: calc(100vh - 56px);
    min-height: calc(100dvh - 56px);
  }

  .main-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0.65rem;
  }

  .form-row,
  .compose-pair-row,
  .form-inline,
  .outbox-row-actions,
  .dialog-actions:not(.dialog-actions--memo),
  .memo-ha-attach-row {
    flex-direction: column;
    align-items: stretch;
  }

  .compose-actions,
  .compose-actions:has(#discardDraftBtn:not(.hidden)) {
    grid-template-columns: 1fr;
  }

  .dialog-actions--memo {
    grid-template-columns: 1fr 1fr;
  }

  .dialog-actions--memo .compose-btn--ghost {
    grid-column: 1 / -1;
  }

  .form-row > *,
  .dialog-actions:not(.dialog-actions--memo) button,
  .outbox-row-actions button {
    width: 100%;
    flex: 1 1 auto;
  }

  .compose-actions .compose-btn {
    width: 100%;
    min-height: 48px;
  }

  .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mayo-card,
  .card,
  .view-panel {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    max-width: 100%;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    width: min(86vw, 320px);
    z-index: 90;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    border-right: 1px solid var(--mayo-border);
    border-bottom: none;
    overflow-y: auto;
    padding-top: max(0.85rem, env(safe-area-inset-top));
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 4px 0 24px rgba(15, 23, 32, 0.12);
  }

  .sidebar-nav {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .nav-item {
    flex: 0 0 auto;
    border-bottom: none;
    border-left: 3px solid transparent;
  }

  .nav-item.active {
    border-bottom-color: transparent;
    border-left-color: var(--mayo-blue);
  }

  .nav-divider {
    display: none !important;
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  .mayo-card {
    border-radius: 10px;
    padding: 0.75rem;
  }

  .panel-title {
    margin-bottom: 0.7rem;
    padding-bottom: 0.35rem;
    font-size: 1.05rem;
  }

  .memo-editor-wrap {
    max-width: 100%;
    overflow-x: auto;
  }

  .memo-editor-wrap .ql-toolbar.ql-snow {
    white-space: normal;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .memo-editor-wrap .ql-container.ql-snow {
    height: 180px;
    max-height: 55vh;
  }

  /* Mobile email-style message list cards */
  #view-inbox .table-wrap,
  #view-outbox .table-wrap,
  #view-decisions .table-wrap {
    border: none;
    overflow: visible;
  }

  #view-inbox table,
  #view-outbox table,
  #view-decisions table {
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    background: transparent;
    width: 100%;
  }

  #view-inbox thead,
  #view-outbox thead,
  #view-decisions thead {
    display: none;
  }

  #view-inbox tbody tr,
  #view-outbox tbody tr,
  #view-decisions tbody tr {
    display: block;
    border: 1px solid var(--mayo-border);
    border-radius: 10px;
    background: var(--mayo-surface);
    padding: 0.55rem 0.65rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  }

  #view-inbox tbody td,
  #view-outbox tbody td,
  #view-decisions tbody td {
    display: block;
    border-bottom: none;
    padding: 0.08rem 0;
    font-size: 0.9rem;
  }

  #view-inbox tbody td:nth-child(1),
  #view-outbox tbody td:nth-child(1),
  #view-decisions tbody td:nth-child(1) {
    font-size: 0.72rem;
    color: var(--mayo-muted);
  }

  #view-inbox tbody td:nth-child(2),
  #view-outbox tbody td:nth-child(2),
  #view-decisions tbody td:nth-child(2) {
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--mayo-text);
    margin-bottom: 0.2rem;
  }

  #view-inbox tbody td:last-child,
  #view-outbox tbody td:last-child,
  #view-decisions tbody td:last-child {
    margin-top: 0.4rem;
  }

  #view-inbox tbody td:last-child button,
  #view-outbox tbody td:last-child button {
    width: 100%;
    justify-content: center;
  }

  tr.inbox-unread {
    border-left: 4px solid var(--mayo-blue);
  }

  tr.inbox-unread td {
    background: transparent;
  }

  /* Full-screen mobile reading experience */
  dialog.memo-dialog,
  dialog.preview-dialog {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    margin: 0;
    border: none;
    padding: 0.8rem;
    padding-bottom: max(0.8rem, env(safe-area-inset-bottom));
  }

  .memo-dialog article {
    max-height: calc(100dvh - 7.5rem);
    overflow: auto;
  }

  .dialog-actions {
    position: sticky;
    bottom: 0;
    background: var(--mayo-surface);
    padding-top: 0.5rem;
    border-top: 1px solid var(--mayo-border);
  }
}

/* App launcher */
body.launcher-page {
  --launcher-bg-image: url("images/launcher.jpeg?v=1");
  --launcher-glass: color-mix(in srgb, var(--mayo-surface) 62%, transparent);
  --launcher-glass-border: color-mix(in srgb, var(--mayo-border) 55%, transparent);
  --launcher-card-memo-bg: color-mix(in srgb, var(--mayo-blue) 12%, var(--mayo-surface));
  --launcher-card-memo-bg-hover: color-mix(in srgb, var(--mayo-blue) 22%, var(--mayo-surface));
  --launcher-card-stores-bg: color-mix(in srgb, #2e7d32 12%, var(--mayo-surface));
  --launcher-card-stores-bg-hover: color-mix(in srgb, #2e7d32 22%, var(--mayo-surface));
  --launcher-card-memo-title: var(--mayo-blue-dark);
  --launcher-card-memo-desc: var(--mayo-muted);
  --launcher-card-memo-action: var(--mayo-blue);
  --launcher-card-stores-title: color-mix(in srgb, #166534 55%, var(--mayo-text));
  --launcher-card-stores-desc: var(--mayo-muted);
  --launcher-card-stores-action: color-mix(in srgb, #166534 70%, var(--mayo-text));
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem 1rem;
  padding-top: max(1.5rem, env(safe-area-inset-top));
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  background-color: #0f1720;
  background-image: var(--launcher-bg-image);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

body.launcher-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(7, 13, 24, 0.28);
  pointer-events: none;
  z-index: 0;
}

.launcher-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 880px);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.75rem 1.5rem;
  border: 1px solid var(--launcher-glass-border);
  border-radius: 20px;
  background: var(--launcher-glass);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 35%, transparent) inset,
    0 22px 56px rgba(0, 20, 40, 0.22);
  color: var(--mayo-text);
}

.launcher-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--mayo-border) 70%, transparent);
}

.launcher-header-brand h1 {
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--mayo-blue-dark);
  line-height: 1.2;
  text-shadow: 0 1px 0 color-mix(in srgb, var(--mayo-surface) 55%, transparent);
}

.launcher-header-brand .subtitle {
  margin: 0.25rem 0 0;
  color: var(--mayo-muted);
  font-size: 0.92rem;
}

.launcher-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-shrink: 0;
}

.launcher-section-label {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mayo-muted);
}

.launcher-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  align-items: stretch;
}

.launcher-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 268px;
  width: 100%;
  padding: 1.5rem 1.25rem 1.25rem;
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  font: inherit;
  color: var(--mayo-text);
  appearance: none;
  -webkit-appearance: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.launcher-card--memo {
  border: 1px solid color-mix(in srgb, var(--mayo-blue) 40%, var(--mayo-border));
  background: var(--launcher-card-memo-bg);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--mayo-blue) 10%, transparent);
}

.launcher-card--memo .launcher-card-title {
  color: var(--launcher-card-memo-title);
}

.launcher-card--memo .launcher-card-desc {
  color: var(--launcher-card-memo-desc);
}

.launcher-card--memo:not(.launcher-card--disabled) .launcher-card-action {
  color: var(--launcher-card-memo-action);
}

.launcher-card--memo:not(.launcher-card--disabled):hover,
.launcher-card--memo:not(.launcher-card--disabled):focus-visible {
  border-color: var(--mayo-blue);
  background: var(--launcher-card-memo-bg-hover);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--mayo-blue) 22%, transparent);
  transform: translateY(-3px);
}

.launcher-card--memo:not(.launcher-card--disabled):hover .launcher-card-title,
.launcher-card--memo:not(.launcher-card--disabled):focus-visible .launcher-card-title {
  color: var(--launcher-card-memo-title);
}

.launcher-card--memo:not(.launcher-card--disabled):hover .launcher-card-desc,
.launcher-card--memo:not(.launcher-card--disabled):focus-visible .launcher-card-desc {
  color: var(--launcher-card-memo-desc);
}

.launcher-card--memo:not(.launcher-card--disabled):hover .launcher-card-action,
.launcher-card--memo:not(.launcher-card--disabled):focus-visible .launcher-card-action {
  color: var(--launcher-card-memo-action);
}

.launcher-card--stores {
  border: 1px solid color-mix(in srgb, #2e7d32 40%, var(--mayo-border));
  background: var(--launcher-card-stores-bg);
  box-shadow: 0 6px 18px color-mix(in srgb, #2e7d32 10%, transparent);
}

.launcher-card--stores .launcher-card-title {
  color: var(--launcher-card-stores-title);
}

.launcher-card--stores .launcher-card-desc {
  color: var(--launcher-card-stores-desc);
}

.launcher-card--stores:not(.launcher-card--disabled) .launcher-card-action {
  color: var(--launcher-card-stores-action);
}

.launcher-card--stores:not(.launcher-card--disabled):hover,
.launcher-card--stores:not(.launcher-card--disabled):focus-visible {
  border-color: #2e7d32;
  background: var(--launcher-card-stores-bg-hover);
  box-shadow: 0 14px 34px color-mix(in srgb, #2e7d32 22%, transparent);
  transform: translateY(-3px);
}

.launcher-card--stores:not(.launcher-card--disabled):hover .launcher-card-title,
.launcher-card--stores:not(.launcher-card--disabled):focus-visible .launcher-card-title {
  color: var(--launcher-card-stores-title);
}

.launcher-card--stores:not(.launcher-card--disabled):hover .launcher-card-desc,
.launcher-card--stores:not(.launcher-card--disabled):focus-visible .launcher-card-desc {
  color: var(--launcher-card-stores-desc);
}

.launcher-card--stores:not(.launcher-card--disabled):hover .launcher-card-action,
.launcher-card--stores:not(.launcher-card--disabled):focus-visible .launcher-card-action {
  color: var(--launcher-card-stores-action);
}

.launcher-card--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.launcher-card-icon {
  flex: 0 0 auto;
  width: 4rem;
  height: 4rem;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 1.75rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.launcher-card:not(.launcher-card--disabled):hover .launcher-card-icon,
.launcher-card:not(.launcher-card--disabled):focus-visible .launcher-card-icon {
  transform: scale(1.04);
}

.launcher-card--memo .launcher-card-icon {
  background: var(--mayo-blue);
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--mayo-blue) 30%, transparent);
}

.launcher-card--stores .launcher-card-icon {
  background: #2e7d32;
  color: #fff;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.launcher-card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.launcher-card-title {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.launcher-card-desc {
  display: block;
  font-size: 0.9rem;
  line-height: 1.45;
}

.launcher-card-note {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--mayo-red);
}

.launcher-card-action {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.launcher-admin-tools {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.launcher-admin-tools.hidden {
  display: none;
}

.launcher-footer-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--mayo-border);
}

.launcher-setup-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.35rem;
  border-radius: 10px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.launcher-setup-btn--logout {
  border: 2px solid #be123c;
  background: linear-gradient(165deg, #ffe4e6 0%, #fecdd3 100%);
  color: #9f1239;
}

.launcher-setup-btn--logout:hover {
  border-color: #9f1239;
  background: linear-gradient(165deg, #fecdd3 0%, #fda4af 100%);
  box-shadow: 0 8px 24px rgba(190, 18, 60, 0.18);
  transform: translateY(-1px);
}

.launcher-setup-btn--account {
  border: 2px solid #5b21b6;
  background: linear-gradient(165deg, #f3e8ff 0%, #e9d5ff 100%);
  color: #4c1d95;
}

.launcher-setup-btn--account:hover,
.launcher-setup-btn--account.is-active {
  border-color: #4c1d95;
  background: linear-gradient(165deg, #ede4ff 0%, #ddd6fe 100%);
  box-shadow: 0 8px 24px rgba(91, 33, 182, 0.2);
  transform: translateY(-1px);
}

.launcher-setup-btn--backup {
  border: 2px solid #0369a1;
  background: linear-gradient(165deg, #e0f2fe 0%, #bae6fd 100%);
  color: #075985;
}

.launcher-setup-btn--backup:hover,
.launcher-setup-btn--backup.is-active {
  border-color: #075985;
  background: linear-gradient(165deg, #d4ecfc 0%, #a8dcfa 100%);
  box-shadow: 0 8px 24px rgba(3, 105, 161, 0.2);
  transform: translateY(-1px);
}

.launcher-setup-btn--manage {
  border: 2px solid #047857;
  background: linear-gradient(165deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
}

.launcher-setup-btn--manage:hover,
.launcher-setup-btn--manage.is-active {
  border-color: #065f46;
  background: linear-gradient(165deg, #bbf7d0 0%, #86efac 100%);
  box-shadow: 0 8px 24px rgba(4, 120, 87, 0.2);
  transform: translateY(-1px);
}

.launcher-setup-btn--security {
  border: 2px solid #b45309;
  background: linear-gradient(165deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}

.launcher-setup-btn--security:hover,
.launcher-setup-btn--security.is-active {
  border-color: #92400e;
  background: linear-gradient(165deg, #fde68a 0%, #fcd34d 100%);
  box-shadow: 0 8px 24px rgba(180, 83, 9, 0.2);
  transform: translateY(-1px);
}

body.launcher-modal-open {
  overflow: hidden;
}

.launcher-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.launcher-modal.hidden {
  display: none;
}

.launcher-modal-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(15, 23, 42, 0.55);
  cursor: pointer;
}

.launcher-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(90vh, 920px);
  display: flex;
  flex-direction: column;
  background: var(--mayo-surface);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.launcher-modal-dialog--wide {
  width: min(960px, 100%);
}

.launcher-modal-dialog--manage {
  width: min(1140px, 100%);
  max-height: min(94vh, 980px);
  border: 1px solid color-mix(in srgb, var(--mayo-border) 80%, transparent);
  border-radius: 18px;
  background: var(--mayo-surface);
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 40%, transparent) inset,
    0 28px 80px rgba(15, 23, 42, 0.28);
}

.launcher-modal-header--manage {
  align-items: center;
  padding: 1.1rem 1.25rem;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--mayo-blue) 6%, var(--mayo-surface)) 0%, var(--mayo-surface) 100%);
  border-bottom: 1px solid var(--mayo-border);
}

.launcher-manage-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
}

.launcher-manage-brand-icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 0.85rem;
  background: color-mix(in srgb, var(--mayo-blue) 14%, var(--mayo-surface));
  color: var(--mayo-blue);
  font-size: 1.2rem;
  border: 1px solid color-mix(in srgb, var(--mayo-blue) 22%, transparent);
}

.launcher-manage-brand-copy {
  min-width: 0;
}

.launcher-manage-eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mayo-muted);
}

.launcher-modal-header--manage h2 {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--mayo-blue-dark);
}

.launcher-modal-header--manage .launcher-admin-lead {
  margin: 0.25rem 0 0;
  max-width: 52ch;
}

.launcher-modal-body--manage {
  display: flex;
  gap: 0;
  padding: 0;
  overflow: hidden;
  min-height: min(70vh, 740px);
  background:
    radial-gradient(700px 240px at 100% 0%, color-mix(in srgb, var(--mayo-blue) 8%, transparent), transparent 60%),
    var(--mayo-bg);
}

.launcher-manage-side {
  flex: 0 0 248px;
  background: color-mix(in srgb, var(--mayo-surface) 92%, var(--mayo-bg));
  border-right: 1px solid var(--mayo-border);
  padding: 1.05rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.launcher-manage-side-label {
  margin: 0 0.35rem 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mayo-muted);
}

.launcher-manage-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.launcher-manage-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 0.8rem;
  background: transparent;
  color: var(--mayo-text);
  font: inherit;
  text-align: left;
  padding: 0.7rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.launcher-manage-nav-icon {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 0.65rem;
  background: var(--mayo-bg);
  border: 1px solid var(--mayo-border);
  color: var(--mayo-muted);
  font-size: 1.05rem;
}

.launcher-manage-nav-copy {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.launcher-manage-nav-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--mayo-text);
}

.launcher-manage-nav-desc {
  font-size: 0.75rem;
  color: var(--mayo-muted);
  line-height: 1.25;
}

.launcher-manage-nav-btn:hover {
  background: var(--mayo-blue-soft);
  border-color: color-mix(in srgb, var(--mayo-blue) 18%, transparent);
}

.launcher-manage-nav-btn:hover .launcher-manage-nav-icon {
  color: var(--mayo-blue);
  border-color: color-mix(in srgb, var(--mayo-blue) 30%, transparent);
}

.launcher-manage-nav-btn.is-active {
  background: color-mix(in srgb, var(--mayo-blue) 12%, var(--mayo-surface));
  border-color: color-mix(in srgb, var(--mayo-blue) 28%, transparent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.launcher-manage-nav-btn.is-active .launcher-manage-nav-icon {
  background: var(--mayo-blue);
  border-color: var(--mayo-blue);
  color: #fff;
}

.launcher-manage-nav-btn.is-active .launcher-manage-nav-title {
  color: var(--mayo-blue-dark);
}

.launcher-manage-panels {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1.1rem 1.25rem 1.35rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.launcher-manage-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -0.15rem 0 1rem;
  padding: 0.15rem 0 0.35rem;
  background: linear-gradient(180deg, var(--mayo-bg) 70%, transparent);
}

.launcher-manage-search-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--mayo-border);
  border-radius: 0.85rem;
  background: var(--mayo-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.launcher-manage-search-label {
  display: grid;
  place-items: center;
  color: var(--mayo-muted);
  margin: 0;
}

.launcher-manage-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  color: var(--mayo-text);
  padding: 0.2rem 0;
}

.launcher-manage-search-input:focus {
  outline: none;
}

.launcher-manage-search-clear {
  border: none;
  background: transparent;
  color: var(--mayo-blue);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  min-height: 44px;
}

.launcher-manage-search-clear.hidden {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.launcher-manage-panel[hidden] {
  display: none !important;
}

.launcher-manage-panel.is-active {
  display: block;
  animation: managePanelIn 0.2s ease;
}

@keyframes managePanelIn {
  from { opacity: 0.75; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.launcher-manage-panel > .launcher-admin-card {
  margin-bottom: 1.15rem;
  border: 1px solid var(--mayo-border);
  border-radius: 14px;
  background: var(--mayo-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.04);
  padding: 1.05rem 1.15rem 1.15rem;
}

.launcher-admin-card-head {
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--mayo-border);
}

.launcher-admin-card-head h3 {
  margin: 0 0 0.25rem;
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  color: var(--mayo-text);
}

.launcher-admin-card-lead {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--mayo-muted);
}

.launcher-manage-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.launcher-manage-count {
  flex-shrink: 0;
  margin-top: 0.15rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--mayo-border);
  background: var(--mayo-surface);
  color: var(--mayo-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.launcher-table-shell {
  border: 1px solid var(--mayo-border);
  border-radius: 14px;
  background: var(--mayo-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.launcher-table-wrap--paged {
  border: none;
  border-radius: 0;
  background: transparent;
  max-height: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.launcher-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.75rem 0.9rem;
  border-top: 1px solid var(--mayo-border);
  background: color-mix(in srgb, var(--mayo-bg) 55%, var(--mayo-surface));
}

.launcher-pager[hidden] {
  display: none !important;
}

.launcher-pager-meta {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mayo-muted);
}

.launcher-pager-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.launcher-pager-btn,
.launcher-pager-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 2.25rem;
  min-width: 2.25rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--mayo-border);
  border-radius: 0.55rem;
  background: var(--mayo-surface);
  color: var(--mayo-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.launcher-pager-btn:hover:not(:disabled),
.launcher-pager-page:hover {
  background: var(--mayo-blue-soft);
  border-color: color-mix(in srgb, var(--mayo-blue) 35%, var(--mayo-border));
  color: var(--mayo-blue-dark);
}

.launcher-pager-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.launcher-pager-pages {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.launcher-pager-page.is-active {
  background: color-mix(in srgb, var(--mayo-blue) 14%, var(--mayo-surface));
  border-color: var(--mayo-blue);
  color: var(--mayo-blue-dark);
}

.launcher-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--mayo-border);
  background: color-mix(in srgb, var(--mayo-surface) 92%, var(--mayo-bg));
}

.launcher-modal-header h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--mayo-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.launcher-modal-header .launcher-admin-lead {
  margin: 0;
}

.launcher-modal-close {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--mayo-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.launcher-modal-close:hover {
  background: rgba(15, 23, 42, 0.08);
  color: var(--mayo-text);
}

.launcher-modal-body {
  padding: 1.15rem 1.25rem 1.25rem;
  overflow: auto;
}

.launcher-modal-body .launcher-backup-card {
  max-width: none;
  border: none;
  padding: 0;
  background: transparent;
}

.launcher-error {
  margin-top: 1rem;
  text-align: center;
}

.launcher-admin {
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(15, 23, 42, 0.12);
}

.launcher-admin-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--mayo-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.launcher-admin-lead {
  margin: 0 0 1.25rem;
  color: var(--mayo-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.launcher-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.launcher-admin-grid--triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.launcher-admin-card {
  background: var(--mayo-surface);
  border: 1px solid var(--mayo-border);
  border-radius: 14px;
  padding: 1.1rem 1.15rem 1.2rem;
}

.launcher-admin-card > h3 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--mayo-text);
}

.launcher-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.launcher-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.launcher-form input,
.launcher-form select {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--mayo-border);
  border-radius: 0.65rem;
  font: inherit;
  color: var(--mayo-text);
  background: var(--mayo-surface);
}

.launcher-form input:focus,
.launcher-form select:focus {
  outline: 2px solid color-mix(in srgb, var(--mayo-blue) 35%, transparent);
  outline-offset: 1px;
  border-color: var(--mayo-blue);
}

.launcher-form .btn-primary {
  align-self: flex-start;
  margin-top: 0.25rem;
  min-height: 44px;
  padding: 0.6rem 1.15rem;
  border-radius: 0.65rem;
  font-weight: 700;
}

.launcher-checkbox-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin: 0.15rem 0;
}

.launcher-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--mayo-text);
  cursor: pointer;
  user-select: none;
}

.launcher-checkbox input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #047857;
  cursor: pointer;
  vertical-align: middle;
}

.launcher-checkbox span {
  line-height: 1.2;
}

.launcher-admin-message {
  margin: 1rem 0 0;
  min-height: 1.25rem;
  font-size: 0.92rem;
  color: var(--mayo-muted);
}

.launcher-admin-message.is-success {
  color: #166534;
}

.launcher-admin-message.is-error {
  color: #b91c1c;
}

.launcher-manage-section + .launcher-manage-section {
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--mayo-border);
}

.launcher-manage-section h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--mayo-text);
}

.launcher-manage-hint {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
}

.launcher-manage-hint.muted,
.text-muted {
  color: var(--mayo-muted);
}

.launcher-table-wrap {
  overflow: auto;
  border: 1px solid var(--mayo-border);
  border-radius: 10px;
  background: var(--mayo-surface);
}

.launcher-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.launcher-data-table th,
.launcher-data-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--mayo-border);
  vertical-align: middle;
  color: var(--mayo-text);
}

.launcher-data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--mayo-bg) 70%, var(--mayo-surface));
  font-weight: 700;
  color: var(--mayo-muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.launcher-data-table tbody tr:hover td {
  background: color-mix(in srgb, var(--mayo-blue) 6%, var(--mayo-surface));
}

.launcher-data-table tr:last-child td {
  border-bottom: none;
}

.launcher-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  white-space: nowrap;
}

.launcher-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: var(--mayo-surface);
  color: var(--mayo-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.launcher-btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.launcher-edit-user-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(560px, calc(100vw - 2rem));
  max-height: min(90vh, 820px);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
}

.launcher-edit-user-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.launcher-edit-user-dialog article {
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 820px);
}

.launcher-edit-user-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
}

.launcher-edit-user-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.launcher-edit-user-form {
  padding: 1rem;
  overflow: auto;
}

.launcher-edit-user-form label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mayo-muted);
}

.launcher-edit-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.launcher-backup-card {
  max-width: 720px;
}

.launcher-backup-status {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.launcher-backup-status div {
  display: grid;
  grid-template-columns: minmax(140px, 180px) 1fr;
  gap: 0.75rem;
  align-items: baseline;
}

.launcher-backup-status dt {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--mayo-muted);
}

.launcher-backup-status dd {
  margin: 0;
  color: var(--mayo-text);
  word-break: break-word;
}

.launcher-backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.launcher-backup-recent h3 {
  margin: 1rem 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mayo-text);
}

.launcher-backup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.launcher-backup-list li {
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: var(--mayo-surface);
}

.launcher-backup-meta {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--mayo-muted);
}

.launcher-security-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.launcher-security-stat {
  background: var(--mayo-surface);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
}

.launcher-security-stat .label {
  display: block;
  font-size: 0.78rem;
  color: var(--mayo-muted);
  margin-bottom: 0.25rem;
}

.launcher-security-stat strong {
  font-size: 1.35rem;
  color: var(--mayo-text);
}

.launcher-security-recommend {
  margin-bottom: 1rem;
}

.launcher-security-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--mayo-muted);
  font-size: 0.92rem;
}

.launcher-security-list li + li {
  margin-top: 0.35rem;
}

.launcher-security-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.launcher-security-toolbar .launcher-manage-search-input {
  flex: 1 1 220px;
}

.launcher-security-select {
  min-width: 180px;
  padding: 0.45rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: var(--mayo-surface);
}

.launcher-security-events-wrap {
  max-height: 280px;
  margin-bottom: 1rem;
}

.launcher-security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.launcher-data-table--compact td,
.launcher-data-table--compact th {
  font-size: 0.86rem;
}

.launcher-security-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.launcher-security-badge--ok {
  background: #dcfce7;
  color: #166534;
}

.launcher-security-badge--warn {
  background: #fef3c7;
  color: #92400e;
}

.launcher-security-badge--bad {
  background: #fee2e2;
  color: #991b1b;
}

.launcher-alert {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.launcher-alert.hidden {
  display: none;
}

.launcher-alert-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
}

.launcher-alert-dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 1.35rem 1.35rem 1.15rem;
  background: var(--mayo-surface);
  border-radius: 14px;
  box-shadow: 0 20px 56px rgba(15, 23, 42, 0.28);
  text-align: center;
}

.launcher-alert-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  border-radius: 999px;
  font-size: 1.5rem;
}

.launcher-alert-icon--success {
  background: #dcfce7;
  color: #166534;
}

.launcher-alert-icon--error {
  background: #fee2e2;
  color: #b91c1c;
}

.launcher-alert-icon--info {
  background: #e0f2fe;
  color: #0369a1;
}

.launcher-alert-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--mayo-text);
}

.launcher-alert-message {
  margin: 0 0 1.1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--mayo-muted);
}

.launcher-alert-ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6rem;
  padding: 0.55rem 1.25rem;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: #00539c;
  color: #fff;
}

.launcher-alert-ok:hover {
  background: #003d73;
}

body.launcher-alert-open {
  overflow: hidden;
}

.launcher-role-access-fieldset {
  margin: 0 0 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  background: #f8fafc;
}

.launcher-role-access-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--mayo-text);
}

.launcher-role-access-fieldset .launcher-checkbox + .launcher-checkbox {
  margin-top: 0.45rem;
}

.launcher-user-perm-overrides {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
}

.launcher-user-perm-overrides.hidden {
  display: none;
}

.launcher-user-access-fieldset .launcher-manage-hint {
  margin: 0.45rem 0 0;
}

.launcher-access-pill {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.launcher-access-pill--yes {
  background: #dcfce7;
  color: #166534;
}

.launcher-access-pill--no {
  background: #f1f5f9;
  color: var(--mayo-muted);
}

@media (max-width: 960px) {
  .launcher-modal:has(.launcher-modal-dialog--manage) {
    padding: 0;
    align-items: stretch;
  }

  .launcher-modal-dialog--manage {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }

  .launcher-modal-body--manage {
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
  }

  .launcher-manage-side {
    flex: 0 0 auto;
    border-right: none;
    border-bottom: 1px solid var(--mayo-border);
    padding: 0.75rem 0.75rem 0.65rem;
    background: var(--mayo-surface);
  }

  .launcher-manage-side-label {
    display: none;
  }

  .launcher-manage-nav {
    flex-direction: row;
    gap: 0.45rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.15rem;
    scrollbar-width: none;
  }

  .launcher-manage-nav::-webkit-scrollbar {
    display: none;
  }

  .launcher-manage-nav-btn {
    flex: 1 1 0;
    min-width: max(30%, 8.5rem);
    justify-content: flex-start;
    padding: 0.6rem 0.65rem;
  }

  .launcher-manage-nav-desc {
    display: none;
  }

  .launcher-manage-panels {
    padding: 0.9rem 0.85rem 1.25rem;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  }

  .launcher-manage-brand-copy .launcher-admin-lead {
    display: none;
  }

  /* Card-style rows on tablets/phones */
  .launcher-table-wrap--paged .launcher-data-table thead {
    display: none;
  }

  .launcher-table-wrap--paged .launcher-data-table,
  .launcher-table-wrap--paged .launcher-data-table tbody {
    display: block;
    width: 100%;
  }

  .launcher-table-wrap--paged .launcher-data-table tr {
    display: block;
    margin: 0.7rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--mayo-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--mayo-bg) 35%, var(--mayo-surface));
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  .launcher-table-wrap--paged .launcher-data-table tr:first-child {
    margin-top: 0.75rem;
  }

  .launcher-table-wrap--paged .launcher-data-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.4rem 0;
    border-bottom: 1px dashed color-mix(in srgb, var(--mayo-border) 80%, transparent);
    white-space: normal;
  }

  .launcher-table-wrap--paged .launcher-data-table td:last-child {
    border-bottom: none;
    padding-top: 0.65rem;
  }

  .launcher-table-wrap--paged .launcher-data-table td::before {
    content: attr(data-label);
    flex: 0 0 38%;
    max-width: 9rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mayo-muted);
    line-height: 1.35;
  }

  .launcher-table-wrap--paged .launcher-data-table td.launcher-table-empty,
  .launcher-table-wrap--paged .launcher-data-table td.launcher-table-empty::before {
    display: block;
    content: none;
    text-align: center;
    width: 100%;
    max-width: none;
    padding: 1rem 0.5rem;
    border: none;
  }

  .launcher-table-wrap--paged .launcher-table-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    width: 100%;
  }

  .launcher-table-wrap--paged .launcher-table-actions .launcher-btn-secondary {
    flex: 1 1 calc(50% - 0.25rem);
    min-height: 44px;
    justify-content: center;
  }

  .launcher-pager {
    flex-direction: column;
    align-items: stretch;
  }

  .launcher-pager-controls {
    justify-content: space-between;
  }

  .launcher-pager-pages {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  body.launcher-page,
  body.login-page {
    padding: 0.75rem 0.75rem 1rem;
    padding-top: max(0.75rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .launcher-panel {
    width: min(100%, 720px);
    min-height: auto;
    padding: 1.25rem 0.9rem 1rem;
    border-radius: 14px;
  }

  .launcher-header {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
  }

  .launcher-header-actions {
    justify-content: flex-start;
  }

  .launcher-header-brand .brand-logo--header {
    width: 56px;
    height: 56px;
  }

  .launcher-header-brand h1 {
    font-size: 1.2rem;
  }

  .launcher-grid {
    grid-template-columns: 1fr;
  }

  .launcher-card {
    min-height: 0;
    padding: 1.1rem 1rem;
  }

  .launcher-footer-actions,
  .launcher-admin-tools {
    gap: 0.5rem;
  }

  .launcher-setup-btn {
    flex: 1 1 calc(50% - 0.5rem);
    justify-content: center;
    min-height: 44px;
  }

  .launcher-setup-btn--logout {
    flex: 1 1 100%;
  }

  .centered-card {
    width: min(100%, 480px);
    padding: 1.15rem 1rem 1.25rem;
  }

  .brand-logo {
    width: 112px;
    height: 112px;
  }

  .launcher-admin-grid,
  .launcher-admin-grid--triple,
  .launcher-form-row,
  .launcher-backup-status div {
    grid-template-columns: 1fr;
  }

  .launcher-modal {
    padding: 0.5rem;
  }

  .launcher-modal:has(.launcher-modal-dialog--manage) {
    padding: 0;
  }

  .launcher-modal-dialog,
  .launcher-modal-dialog--wide {
    width: 100%;
    max-height: 95vh;
  }

  .launcher-modal-dialog--manage {
    max-height: 100dvh;
    height: 100%;
  }

  .launcher-modal-header--manage {
    padding: 0.85rem 0.9rem;
    padding-top: max(0.85rem, env(safe-area-inset-top));
  }

  .launcher-manage-brand-icon {
    width: 2.4rem;
    height: 2.4rem;
    font-size: 1.05rem;
  }

  .launcher-modal-header--manage h2 {
    font-size: 1.12rem;
  }

  .launcher-manage-nav-btn {
    min-width: 0;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
    padding: 0.55rem 0.35rem;
  }

  .launcher-manage-nav-copy {
    align-items: center;
  }

  .launcher-manage-nav-title {
    font-size: 0.78rem;
  }

  .launcher-pager-btn-label {
    display: none;
  }

  .launcher-form .btn-primary,
  .launcher-checkbox-row .launcher-checkbox {
    min-height: 44px;
  }

  .launcher-checkbox-row {
    flex-direction: column;
    align-items: stretch;
  }
}
