:root {
  --ink: #172432;
  --muted: #5d6b78;
  --primary: #173b57;
  --primary-dark: #102c42;
  --accent: #e06d2f;
  --accent-dark: #b84f18;
  --surface: #ffffff;
  --surface-alt: #f3f6f8;
  --border: #d8e0e6;
  --success: #176b4b;
  --success-bg: #e8f6ef;
  --warning: #8a5600;
  --warning-bg: #fff4d8;
  --danger: #a8292f;
  --danger-bg: #fcebed;
  --info: #1d5f88;
  --info-bg: #e8f3fa;
  --focus: #0067b8;
  --shadow: 0 8px 26px rgba(22, 47, 66, .08);
  --radius: 14px;
  --header-height: 68px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--surface-alt);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100%; margin: 0; background: var(--surface-alt); color: var(--ink); font-size: 16px; line-height: 1.65; }
a { color: var(--info); text-underline-offset: .2em; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .45rem; font-size: clamp(1.65rem, 4.8vw, 2.25rem); line-height: 1.3; letter-spacing: -.02em; }
h2 { font-size: 1.22rem; line-height: 1.4; }
small { color: var(--muted); }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.container { width: min(100% - 32px, 1180px); margin-inline: auto; }
.visually-hidden { 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; }
.skip-link { position: fixed; z-index: 999; left: 12px; top: -80px; padding: .7rem 1rem; background: var(--ink); color: #fff; border-radius: 6px; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.app-header { position: sticky; z-index: 50; top: 0; min-height: var(--header-height); background: var(--surface); border-bottom: 1px solid var(--border); }
.header-row { min-height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--primary); text-decoration: none; font-weight: 800; letter-spacing: .02em; }
.brand img { flex: none; border-radius: 9px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.organization-chip { display: none; align-items: center; gap: 7px; padding: .45rem .7rem; color: var(--ink); background: var(--surface-alt); border: 1px solid var(--border); border-radius: 10px; text-decoration: none; }
.organization-chip-label { color: var(--muted); font-size: .72rem; }
.account-menu { position: relative; }
.account-menu summary { min-height: 44px; display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-name { display: none; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 38px; height: 38px; display: inline-grid; flex: none; place-items: center; overflow: hidden; border-radius: 50%; background: #dce8ef; color: var(--primary); font-weight: 800; }
.account-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(280px, calc(100vw - 32px)); padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.account-menu-panel a, .menu-button { width: 100%; min-height: 44px; display: flex; align-items: center; padding: .55rem .75rem; border: 0; background: transparent; color: var(--ink); text-decoration: none; text-align: left; border-radius: 8px; }
.account-menu-panel a:hover, .menu-button:hover { background: var(--surface-alt); }
.desktop-nav { display: none; background: var(--surface); border-bottom: 1px solid var(--border); }
.nav-links { min-height: 48px; display: flex; align-items: stretch; gap: 4px; }
.nav-links a { display: flex; align-items: center; padding: .55rem .9rem; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; }
.nav-links a[aria-current="page"] { color: var(--primary); border-color: var(--accent); font-weight: 700; }
.page-shell { padding-block: 28px 104px; }
.mobile-nav { position: fixed; z-index: 45; inset: auto 0 0; height: calc(70px + env(safe-area-inset-bottom)); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 5px 8px env(safe-area-inset-bottom); background: rgba(255,255,255,.98); border-top: 1px solid var(--border); box-shadow: 0 -5px 20px rgba(22,47,66,.08); }
.mobile-nav a { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: .75rem; text-decoration: none; border-radius: 8px; }
.mobile-nav svg { width: 23px; height: 23px; fill: currentColor; }
.mobile-nav a[aria-current="page"] { color: var(--primary); background: #edf4f7; font-weight: 700; }

.page-header { margin-bottom: 24px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-header p { margin-bottom: 0; color: var(--muted); }
.eyebrow { margin-bottom: .35rem !important; color: var(--accent-dark) !important; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.section-heading, .card-header, .list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading { margin: 30px 0 12px; }
.section-heading h2, .card-header h2, .list-toolbar h2 { margin: 0; }
.card-header { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.card-header p { margin: .25rem 0 0; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 2px 8px rgba(22,47,66,.04); }
.muted { color: var(--muted); font-weight: 400; }

.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: .62rem 1.05rem; border: 1px solid transparent; border-radius: 9px; font-weight: 700; line-height: 1.25; text-decoration: none; transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }
.btn.disabled { opacity: .5; cursor: default; pointer-events: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 3px 8px rgba(184,79,24,.2); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--surface); border-color: #a9b7c1; color: var(--primary); }
.btn-secondary:hover { background: var(--surface-alt); }
.btn-link { background: transparent; color: var(--info); }
.btn-block { width: 100%; }
.btn-large { min-height: 52px; padding-inline: 1.4rem; }
.btn-small { min-height: 36px; padding: .35rem .7rem; font-size: .88rem; }

.message-stack { margin-bottom: 20px; display: grid; gap: 8px; }
.alert { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: .85rem 1rem; border: 1px solid; border-radius: 10px; }
.alert p:last-child { margin-bottom: 0; }
.alert-success { background: var(--success-bg); border-color: #9ed5bd; color: #0f563c; }
.alert-warning { background: var(--warning-bg); border-color: #e8cb7e; color: #6d4607; }
.alert-error, .alert-danger { background: var(--danger-bg); border-color: #e5aeb2; color: #8b2027; }
.alert-info { background: var(--info-bg); border-color: #a9cfe6; color: #174f72; }
.alert-close { min-width: 32px; min-height: 32px; padding: 0; border: 0; background: transparent; color: inherit; font-size: 1.25rem; line-height: 1; }

.public-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-page { background: linear-gradient(145deg, #eaf1f5 0%, #f7f9fa 46%, #f7eee9 100%); }
.auth-card { width: min(100%, 460px); padding: clamp(24px, 6vw, 40px); background: rgba(255,255,255,.98); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.auth-brand h1 { margin: 0; font-size: 1.55rem; }
.auth-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 13px; background: var(--primary); color: #fff; font-weight: 900; font-size: 1.45rem; }
.auth-intro { margin-bottom: 24px; color: var(--muted); }
.security-note { margin: 18px 0 0; padding-left: 24px; position: relative; color: var(--muted); font-size: .87rem; }
.security-note::before { content: "🔒"; position: absolute; left: 0; }
.secondary-action { margin-top: 10px; text-align: center; }
.auth-result { text-align: center; }
.result-icon { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; background: var(--info-bg); color: var(--info); font-size: 1.8rem; font-weight: 900; }
.result-icon.success { background: var(--success-bg); color: var(--success); }
.result-icon.warning { background: var(--warning-bg); color: var(--warning); }
.step-indicator { display: flex; align-items: center; width: 116px; margin-bottom: 18px; }
.step-indicator span { width: 30px; height: 30px; display: grid; place-items: center; border: 2px solid var(--border); border-radius: 50%; color: var(--muted); font-weight: 800; }
.step-indicator .done, .step-indicator .current { border-color: var(--primary); background: var(--primary); color: #fff; }
.step-indicator i { height: 2px; flex: 1; background: var(--primary); }
.recovery-help { margin-top: 22px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.recovery-help summary, .manual-key summary { min-height: 44px; display: flex; align-items: center; color: var(--info); font-weight: 700; cursor: pointer; }

.form-group { margin-bottom: 18px; }
.form-group > label { display: block; margin-bottom: 6px; font-weight: 700; }
.required { display: inline-block; margin-left: 5px; padding: .08rem .38rem; border-radius: 4px; background: var(--danger-bg); color: var(--danger); font-size: .68rem; vertical-align: .12em; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { width: 100%; min-height: 46px; padding: .65rem .75rem; color: var(--ink); background: #fff; border: 1px solid #98a8b3; border-radius: 8px; }
textarea { min-height: 110px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; flex: none; accent-color: var(--primary); }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(0,103,184,.15); outline: none; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.form-help { margin-top: 5px; color: var(--muted); font-size: .85rem; }
.form-help ul { margin: .35rem 0 0; padding-left: 1.3rem; }
.field-errors { margin: 6px 0 0; padding: 0; color: var(--danger); font-size: .88rem; list-style: none; }
.check-row { display: flex; align-items: flex-start; gap: 9px; margin: 4px 0 20px; }
.check-row label { cursor: pointer; }
.password-field { position: relative; }
.password-field input { padding-right: 64px !important; }
.password-toggle { position: absolute; right: 5px; top: 5px; min-width: 50px; min-height: 36px; border: 0; border-radius: 6px; background: var(--surface-alt); color: var(--info); font-weight: 700; }
.otp-input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.15rem; letter-spacing: .08em; }
.form-actions { margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.form-actions.centered { justify-content: center; }

.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.metric-card { min-width: 0; min-height: 125px; display: flex; flex-direction: column; justify-content: space-between; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--border); border-radius: 12px; color: var(--ink); text-decoration: none; box-shadow: 0 2px 8px rgba(22,47,66,.04); }
.metric-card > span { color: var(--muted); font-size: .85rem; }
.metric-card strong { font-size: clamp(1.7rem, 7vw, 2.4rem); line-height: 1; }
.metric-card strong small { margin-left: 3px; color: var(--muted); font-size: .75rem; }
.metric-card.tone-primary { border-top-color: var(--info); }
.metric-card.tone-warning { border-top-color: #d89b1d; }
.metric-card.tone-danger { border-top-color: var(--danger); }
.metric-card.tone-success { border-top-color: var(--success); }
.count-badge { min-width: 28px; padding: .12rem .45rem; text-align: center; border-radius: 99px; background: var(--danger); color: #fff; font-weight: 800; font-size: .8rem; }
.action-list { display: grid; gap: 9px; }
.action-card { min-height: 70px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--danger); border-radius: 10px; color: var(--ink); text-decoration: none; }
.action-card.tone-warning { border-left-color: #d89b1d; }
.action-card.tone-primary { border-left-color: var(--info); }
.action-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--danger-bg); color: var(--danger); font-weight: 900; }
.action-copy { min-width: 0; display: grid; flex: 1; }
.action-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-arrow { color: var(--muted); font-size: 1.8rem; }
.dashboard-columns { margin-top: 24px; display: grid; gap: 18px; }
.record-list, .notice-list, .session-list, .health-list { margin: 0; padding: 0; list-style: none; }
.record-list li + li, .notice-list li + li, .session-list li + li, .health-list li + li { border-top: 1px solid var(--border); }
.record-list a { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; color: var(--ink); text-decoration: none; }
.record-list a > span:first-child { min-width: 0; display: grid; }
.record-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-meta { display: grid; justify-items: end; gap: 5px; flex: none; }
.record-meta time { color: var(--muted); font-size: .78rem; }
.notice-list li { display: grid; grid-template-columns: 68px 1fr; gap: 8px; padding: 13px 18px; }
.notice-list time { color: var(--muted); font-size: .86rem; }

.status { display: inline-flex; align-items: center; width: fit-content; padding: .18rem .55rem; border-radius: 99px; background: #edf1f3; color: #465660; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.status-success { background: var(--success-bg); color: var(--success); }
.status-warning { background: var(--warning-bg); color: var(--warning); }
.status-danger, .status-error { background: var(--danger-bg); color: var(--danger); }
.status-primary, .status-info { background: var(--info-bg); color: var(--info); }
.empty-state { padding: 42px 20px; text-align: center; color: var(--muted); }
.empty-state h2 { color: var(--ink); }
.empty-state.compact { padding: 30px 20px 20px; }
.empty-icon { margin-bottom: 8px; color: var(--info); font-size: 2rem; }

.selection-panel { max-width: 780px; }
.organization-list { display: grid; gap: 10px; }
.organization-list form { margin: 0; }
.organization-option { width: 100%; min-height: 84px; display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--ink); text-align: left; box-shadow: 0 2px 7px rgba(22,47,66,.04); }
.organization-option.selected { border: 2px solid var(--primary); background: #f3f8fb; }
.organization-avatar { width: 46px; height: 46px; display: grid; place-items: center; flex: none; border-radius: 10px; background: #dce8ef; color: var(--primary); font-size: 1.2rem; font-weight: 900; }
.organization-details { min-width: 0; display: grid; flex: 1; }
.organization-details strong, .organization-details small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.current-label { color: var(--success); font-size: .82rem; font-weight: 800; }
.select-arrow { color: var(--muted); font-size: 1.8rem; }
.info-panel { margin-top: 18px; padding: 16px 18px; background: var(--info-bg); border: 1px solid #b5d4e7; border-radius: 11px; color: #174f72; }
.info-panel p:last-child, .info-panel ul:last-child { margin-bottom: 0; }

.settings-layout { display: grid; gap: 20px; }
.settings-form { display: grid; gap: 20px; }
.settings-fields { padding: 20px; }
.settings-fields .form-group:last-of-type { margin-bottom: 0; }
.settings-submit { margin-top: 0; }
.settings-section > form, .settings-section > p, .settings-section > .btn, .settings-section > .muted { margin-left: 20px; margin-right: 20px; }
.settings-section > form { margin-top: 20px; margin-bottom: 20px; }
.settings-section > .btn { margin-bottom: 20px; }
.session-list li, .health-list li { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; }
.session-list li > span:first-child, .health-list li > span:first-child { display: grid; }
.narrow-grid { max-width: 780px; display: grid; gap: 18px; }
.setup-step { display: grid; grid-template-columns: 38px 1fr; gap: 14px; padding: 20px; }
.step-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 900; }
.step-number.success { background: var(--success); }
.qr-code { display: block; width: 220px; height: 220px; margin: 18px auto; padding: 8px; background: #fff; border: 1px solid var(--border); }
.manual-key code { display: block; padding: 12px; overflow-wrap: anywhere; background: var(--surface-alt); border-radius: 7px; }
.code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0; list-style: none; }
.code-grid code { display: block; padding: 8px; text-align: center; background: var(--surface-alt); border-radius: 6px; }

.list-card { overflow: hidden; }
.list-toolbar { align-items: flex-start; flex-direction: column; padding: 18px; border-bottom: 1px solid var(--border); }
.filter-form { width: 100%; display: grid; gap: 8px; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { background: #f7f9fa; color: var(--muted); font-size: .82rem; white-space: nowrap; }
td small { display: block; }
tbody tr:last-child td { border-bottom: 0; }
.table-actions { text-align: right; }
.pagination { min-height: 68px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); }
.pagination > div:last-child { text-align: right; }
.pagination p { margin: 0; color: var(--muted); }
.member-cell { display: flex; align-items: center; gap: 10px; }
.member-cell > span:last-child { display: grid; }
.form-layout { display: grid; gap: 20px; }
.form-card { padding: 20px; }
.sidebar-note { margin: 0; }
.sidebar-note ul { padding-left: 1.25rem; }
.breadcrumb { margin-bottom: 18px; display: flex; gap: 8px; color: var(--muted); font-size: .88rem; }
.sticky-actions { position: sticky; z-index: 10; bottom: calc(72px + env(safe-area-inset-bottom)); margin: 24px -20px -20px; padding: 12px 20px; background: rgba(255,255,255,.97); border-top: 1px solid var(--border); box-shadow: 0 -4px 12px rgba(22,47,66,.06); }
.version-info { margin-top: 16px; display: grid; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.detail-grid { display: grid; gap: 18px; }
.detail-grid > .card { padding: 20px; }
.detail-grid > .card > h2 { margin-bottom: 16px; }
.detail-list { margin: 0; display: grid; }
.detail-list > div { display: grid; grid-template-columns: minmax(96px, 28%) 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: .86rem; font-weight: 700; }
.detail-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.summary-strip { margin-bottom: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.summary-item { min-width: 0; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.summary-item span { display: block; color: var(--muted); font-size: .8rem; }
.summary-item strong { display: block; overflow-wrap: anywhere; font-size: 1.08rem; }
.order-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.order-total { margin: 18px 0 0; text-align: right; font-size: 1.25rem; font-weight: 800; }
.hash-value { display: block; overflow-wrap: anywhere; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .78rem; }
.timeline { margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); list-style: none; }
.timeline li { position: relative; padding: 0 0 18px 16px; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline li:last-child { padding-bottom: 0; }

.invitation-page { background: var(--surface-alt); }
.invitation-page .public-shell { display: block; padding-inline: 16px; }
.invitation-shell { width: min(100%, 800px); margin: 24px auto; }
.invitation-header { margin-bottom: 24px; text-align: center; }
.invited-email { display: inline-block; padding: 7px 12px; background: var(--surface); border-radius: 99px; }
.multi-section-form { display: grid; gap: 18px; }
.form-section { padding: 20px; }
.form-section-heading { margin-bottom: 22px; display: flex; gap: 12px; }
.form-section-heading > span { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 900; }
.form-section-heading h2 { margin-bottom: 2px; }
.form-section-heading p { margin: 0; color: var(--muted); font-size: .9rem; }
.check-card { display: grid; grid-template-columns: 24px 1fr; gap: 8px; margin-bottom: 10px; padding: 14px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 9px; }
.check-card .field-errors { grid-column: 2; }

.app-dialog { width: min(92vw, 540px); max-height: 90vh; padding: 20px; overflow: auto; border: 0; border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,.25); }
.app-dialog::backdrop { background: rgba(12,28,40,.55); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.dialog-header h2 { margin: 0; }
.icon-button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface-alt); font-size: 1.4rem; }

.error-page { max-width: 650px; margin: 8vh auto; text-align: center; }
.error-symbol { width: 70px; height: 70px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; background: var(--warning-bg); color: var(--warning); font-size: 2rem; font-weight: 900; }
.error-code { margin: 0; color: var(--muted); font-weight: 800; letter-spacing: .15em; }
.request-id { margin-top: 30px; color: var(--muted); font-size: .82rem; }
.health-overview { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; padding: 20px; background: var(--success-bg); border: 1px solid #9ed5bd; border-radius: var(--radius); }
.health-overview.status-degraded { background: var(--warning-bg); border-color: #e8cb7e; }
.health-overview.status-error { background: var(--danger-bg); border-color: #e5aeb2; }
.health-overview h2 { margin-bottom: 3px; }
.health-overview p { margin: 0; }
.health-light { width: 16px; height: 16px; margin-top: 7px; flex: none; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(23,107,75,.15); }
.status-degraded .health-light { background: #d28a00; box-shadow: 0 0 0 5px rgba(210,138,0,.15); }
.status-error .health-light { background: var(--danger); box-shadow: 0 0 0 5px rgba(168,41,47,.15); }
.health-card { overflow: hidden; }
.health-footnote, .last-checked { color: var(--muted); font-size: .82rem; }

@media (min-width: 680px) {
  .organization-chip { display: flex; }
  .account-name { display: inline; }
  .page-header { flex-direction: row; align-items: center; }
  .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .metric-card { min-height: 140px; padding: 20px; }
  .filter-form { width: auto; grid-template-columns: minmax(210px, 1fr) auto auto; }
  .list-toolbar { flex-direction: row; align-items: center; }
  .form-card, .form-section { padding: 26px; }
  .sticky-actions { position: static; margin: 26px -26px -26px; padding: 16px 26px; box-shadow: none; }
  .public-shell { padding: 40px 24px; }
  .summary-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .desktop-nav { display: block; }
  .mobile-nav { display: none; }
  .page-shell { padding-block: 36px 70px; }
  .dashboard-columns { grid-template-columns: minmax(0, 1.55fr) minmax(280px, .8fr); }
  .settings-layout { grid-template-columns: minmax(0, 1fr) 310px; align-items: start; }
  .settings-layout > .settings-section:nth-child(2):last-child { grid-column: 1; }
  .form-layout { grid-template-columns: minmax(0, 720px) 280px; align-items: start; }
  .detail-grid { grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr); align-items: start; }
  .detail-grid > .card:first-child { grid-row: span 2; }
  .sidebar-note { position: sticky; top: 140px; }
  .sticky-actions { bottom: 0; }
}

@media (max-width: 679px) {
  .responsive-table { overflow: visible; }
  .responsive-table table, .responsive-table tbody { display: block; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .responsive-table tr { display: grid; gap: 8px; padding: 16px; border-bottom: 1px solid var(--border); }
  .responsive-table td { display: grid; grid-template-columns: 92px 1fr; gap: 8px; padding: 0; border: 0; }
  .responsive-table td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; }
  .responsive-table td.table-actions { display: block; text-align: left; }
  .responsive-table td.table-actions::before { display: none; }
  .member-cell { align-items: flex-start; }
  .code-grid { grid-template-columns: 1fr; }
  .form-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .app-header, .desktop-nav, .mobile-nav, .btn, .message-stack { display: none !important; }
  body { background: #fff; }
  .page-shell { padding: 0; }
  .card { border-color: #777; box-shadow: none; }
  .recovery-codes { break-inside: avoid; }
}
