:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1b2926;
  background: #f4f6f2;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
.shell { max-width: 980px; margin: 0 auto; padding: 32px 20px 56px; }
.topbar { display: flex; align-items: center; gap: 14px; }
.topbar img { flex: 0 0 auto; }
.topbar .tenant-branding { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; }
.tenant-logo-preview { max-width: 240px; max-height: 160px; object-fit: contain; }
.eyebrow { margin: 0 0 3px; color: #41655d; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.35rem, 3vw, 2rem); }
.intro { margin: 34px 0 20px; }
.intro h2 { font-size: 1.15rem; }
.intro p { max-width: 70ch; line-height: 1.55; color: #53625e; }
.notice { border-left: 4px solid #bd6b39; padding: 12px 14px; background: #fff3e8; line-height: 1.5; }
.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.status-card { min-height: 102px; padding: 16px; border: 1px solid #d5ddd7; border-radius: 12px; background: #fff; }
.status-card h2 { margin-bottom: 10px; color: #4a5d56; font-size: .88rem; }
.status-card p { margin: 0; overflow-wrap: anywhere; font-weight: 650; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
button { min-height: 44px; padding: 10px 16px; border: 0; border-radius: 8px; background: #183b37; color: #fff; font: inherit; font-weight: 650; cursor: pointer; }
button:focus-visible { outline: 3px solid #e4a857; outline-offset: 3px; }
button[hidden] { display: none; }
.update-status { min-height: 1.5em; margin: 12px 0 0; color: #41655d; }
.footnote { margin: 26px 0 0; color: #64736d; font-size: .88rem; }
.mode-link { margin-left: auto; color: #41655d; font-size: .9rem; font-weight: 650; }
.panel { margin: 22px 0; padding: 22px; border: 1px solid #d5ddd7; border-radius: 14px; background: #fff; }
.panel h2, .panel h3 { margin-bottom: 8px; }
.message { margin: 18px 0; padding: 12px 14px; border-radius: 8px; line-height: 1.45; overflow-wrap: anywhere; }
.message.info { background: #e9f1ed; color: #183b37; }
.message.success { background: #e6f4e9; color: #1d5b31; }
.message.error { background: #fff0ec; color: #8a2f1d; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 24px 0 14px; }
.section-heading h2, .section-heading h3, .section-heading p { margin-bottom: 0; }
.muted { color: #64736d; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 760px; margin-top: 20px; }
.form-grid label { display: grid; gap: 6px; color: #3d514b; font-size: .9rem; font-weight: 650; }
input, select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #b9c7bf; border-radius: 7px; background: #fff; color: #1b2926; font: inherit; }
textarea { width: 100%; padding: 9px 11px; border: 1px solid #b9c7bf; border-radius: 7px; background: #fff; color: #1b2926; font: 0.9rem ui-monospace, monospace; }
input:focus, select:focus { outline: 3px solid #d5e5db; border-color: #41655d; }
button:disabled { opacity: .6; cursor: wait; }
button.secondary { border: 1px solid #b9c7bf; background: #fff; color: #183b37; }
.form-grid button { align-self: end; }
.form-grid.compact { max-width: none; margin: 18px 0 24px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 11px 9px; border-bottom: 1px solid #e1e7e2; vertical-align: middle; }
th { color: #4a5d56; font-size: .82rem; }
td { overflow-wrap: anywhere; }
.text-button { min-height: auto; padding: 4px 2px; background: transparent; color: #285d50; text-decoration: underline; font-size: .9rem; }
.diagnostics { margin-top: 36px; border-top: 1px solid #d5ddd7; padding-top: 18px; }
.diagnostics summary { cursor: pointer; color: #41655d; font-weight: 650; }
.diagnostics .notice { margin-top: 18px; }
.edit-dialog { width: min(680px, calc(100% - 28px)); max-height: 90vh; overflow-y: auto; border: 0; border-radius: 14px; padding: 22px; box-shadow: 0 16px 48px #10231e55; }
.edit-dialog::backdrop { background: #10231e88; }
.edit-dialog h2 { grid-column: 1 / -1; }
.dialog-actions { display: flex; align-items: end; gap: 10px; }
.address-field { grid-column: 1 / -1; }
.permission-list { margin: 0; padding: 12px; border: 1px solid #d5ddd7; border-radius: 8px; grid-column: 1 / -1; }
.permission-list legend { padding: 0 6px; color: #4a5d56; font-weight: 650; }
.permission-row { display: flex !important; align-items: center; justify-content: space-between; gap: 12px !important; padding: 8px 0; border-bottom: 1px solid #e1e7e2; font-weight: 450 !important; }
.permission-row:last-child { border-bottom: 0; }
.permission-row select { flex: 0 0 170px; }
.session-list { padding-left: 22px; overflow-wrap: anywhere; }
.session-list li { margin: 8px 0; }
[hidden] { display: none !important; }
@media (max-width: 640px) {
  .shell { padding: 22px 16px 40px; }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .status-card { min-height: 96px; padding: 13px; }
  .topbar { flex-wrap: wrap; }
  .mode-link { margin-left: 54px; }
  .form-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; }
  .panel { padding: 17px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
