:root { color-scheme: light; }
* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body {
  margin: 0;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-family: var(--md-sys-typescale-body-large-font);
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line-height);
  letter-spacing: var(--md-sys-typescale-body-large-tracking);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--md-sys-color-primary); }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--md-sys-color-secondary); outline-offset: 2px; }
.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;
}
.skip-link {
  position: absolute; left: 8px; top: -40px; z-index: 20;
  background: var(--md-sys-color-inverse-surface); color: var(--md-sys-color-inverse-on-surface);
  padding: 8px 12px; border-radius: 8px;
}
.skip-link:focus { top: 8px; }
.headline-small {
  font-family: var(--md-sys-typescale-headline-small-font);
  font-size: var(--md-sys-typescale-headline-small-size);
  line-height: var(--md-sys-typescale-headline-small-line-height);
  font-weight: var(--md-sys-typescale-headline-small-weight);
  letter-spacing: var(--md-sys-typescale-headline-small-tracking);
  margin: 0;
}
.title-medium {
  font-family: var(--md-sys-typescale-title-medium-font);
  font-size: var(--md-sys-typescale-title-medium-size);
  line-height: var(--md-sys-typescale-title-medium-line-height);
  font-weight: var(--md-sys-typescale-title-medium-weight);
  margin: 0;
}
.title-small {
  font-family: var(--md-sys-typescale-title-small-font);
  font-size: var(--md-sys-typescale-title-small-size);
  line-height: var(--md-sys-typescale-title-small-line-height);
  font-weight: var(--md-sys-typescale-title-small-weight);
  letter-spacing: var(--md-sys-typescale-title-small-tracking);
  margin: 0;
}
.body-medium { font-size: var(--md-sys-typescale-body-medium-size); line-height: var(--md-sys-typescale-body-medium-line-height); margin: 0; }
.hint { color: var(--md-sys-color-on-surface-variant); font-size: var(--md-sys-typescale-body-medium-size); }
.icon { width: 24px; height: 24px; fill: currentColor; flex: none; display: block; }
.icon-sm { width: 18px; height: 18px; }
.shell { height: 100dvh; display: flex; overflow: hidden; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.content { flex: 1; overflow: auto; }
.content-inner { width: min(1200px, 100%); margin: 0 auto; padding: 16px 16px 112px; }
.topbar {
  min-height: 64px; display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  background: var(--md-sys-color-surface); z-index: 4; flex: none;
}
.top-slot { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.top-slot h1 { flex: 1; min-width: 0; }
.top-slot h1:focus { outline: none; }
.top-slot h1:focus-visible { outline: 3px solid var(--md-sys-color-secondary); outline-offset: 2px; }
.topbar-switch { min-width: 0; max-width: 60%; }
.topbar-switch .menu-wrap,
.topbar-switch .switcher-btn,
.topbar-switch .switcher-plain { max-width: 100%; min-width: 0; }
.topbar-switch .switcher-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rail { display: none; }
.hide-compact { display: none; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; height: 80px; z-index: 4;
  display: flex; justify-content: space-around; align-items: stretch;
  background: var(--md-sys-color-surface-container);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  min-height: 48px; min-width: 48px; border: 0; background: transparent; text-decoration: none;
  color: var(--md-sys-color-on-surface-variant); border-radius: var(--md-sys-shape-corner-full);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 8px; font-size: 0.75rem;
}
.nav-item.active { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.bottom-nav .nav-item { background: transparent; color: var(--md-sys-color-on-surface-variant); }
.bottom-nav .nav-item .icon {
  width: 64px; height: 32px; padding: 4px 20px; box-sizing: border-box;
  border-radius: var(--md-sys-shape-corner-full);
}
.bottom-nav .nav-item.active { background: transparent; color: var(--md-sys-color-on-surface); }
.bottom-nav .nav-item.active .icon {
  background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container);
}
.offline-banner {
  display: flex; gap: 8px; align-items: center; padding: 10px 16px;
  background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface);
}
.btn {
  min-height: 40px; border-radius: var(--md-sys-shape-corner-full); border: 0; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  font-family: var(--md-sys-typescale-label-large-font);
  font-size: var(--md-sys-typescale-label-large-size);
  font-weight: var(--md-sys-typescale-label-large-weight);
  letter-spacing: var(--md-sys-typescale-label-large-tracking);
}
.btn:disabled { opacity: 0.5; }
.btn.hide-compact { display: none; }
.top-slot .btn, .section-head .btn { position: relative; height: 40px; min-height: 40px; }
.top-slot .btn::after, .section-head .btn::after { content: ""; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
.btn-filled { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.btn-text { background: transparent; color: var(--md-sys-color-primary); }
.btn-outlined { background: transparent; color: var(--md-sys-color-primary); border: 1px solid var(--md-sys-color-outline); }
.btn-danger { background: var(--md-sys-color-error); color: var(--md-sys-color-on-error); }
.btn.btn-danger-text { color: var(--md-sys-color-error); border-color: var(--md-sys-color-error); }
.icon-btn {
  width: 48px; height: 48px; border: 0; border-radius: var(--md-sys-shape-corner-full);
  background: transparent; color: var(--md-sys-color-on-surface-variant); display: grid; place-items: center;
}
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.field { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; }
.field label, .field legend { color: var(--md-sys-color-on-surface-variant); font-size: var(--md-sys-typescale-body-medium-size); }
.field input, .field select, .affix input {
  min-height: 56px; width: 100%; border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-extra-small); background: var(--md-sys-color-surface);
  padding: 0 16px;
}
.field select {
  appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--md-sys-color-on-surface-variant) 50%), linear-gradient(135deg, var(--md-sys-color-on-surface-variant) 50%, transparent 50%);
  background-position: calc(100% - 20px) center, calc(100% - 14px) center;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
.field select:focus, .field select:focus-visible { outline: none; border-color: var(--md-sys-color-primary); box-shadow: inset 0 0 0 1px var(--md-sys-color-primary); }
.field-invalid input, .field-invalid select { border-color: var(--md-sys-color-error); }
.field-error { color: var(--md-sys-color-error); margin: 0; font-size: var(--md-sys-typescale-body-medium-size); }
.affix { display: flex; align-items: center; border: 1px solid var(--md-sys-color-outline); border-radius: var(--md-sys-shape-corner-extra-small); background: var(--md-sys-color-surface); }
.field-invalid .affix { border-color: var(--md-sys-color-error); }
.affix input { border: 0; background: transparent; }
.affix-text { padding: 0 12px; color: var(--md-sys-color-on-surface-variant); }
.avatar {
  display: grid; place-items: center; border-radius: var(--md-sys-shape-corner-full); object-fit: cover;
  background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container);
  font-weight: 500; flex: none;
}
.card {
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
}
.stack { display: flex; flex-direction: column; gap: 16px; }
.auth-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: min(400px, 100%); display: flex; flex-direction: column; gap: 12px;
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-sys-shape-corner-medium); padding: 24px;
}
.auth-card form, .auth-card { display: flex; flex-direction: column; gap: 12px; }
.auth-mark {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); font-weight: 500;
}
.password-field { position: relative; }
.password-toggle { position: absolute; right: 4px; top: 28px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip-scroller { display: contents; }
.chip-clear { display: none; }
.search-field {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
  border-radius: var(--md-sys-shape-corner-full); background: var(--md-sys-color-surface-container);
  flex: 1 1 220px;
}
.search-field input { border: 0; background: transparent; min-height: 40px; width: 100%; }
.chip {
  min-height: 32px; border-radius: var(--md-sys-shape-corner-small); border: 1px solid var(--md-sys-color-outline);
  background: transparent; color: var(--md-sys-color-on-surface-variant); padding: 0 12px;
  display: inline-flex; align-items: center; gap: 4px;
}
.chip-filled { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); border-color: transparent; }
.chip-x { border: 0; background: transparent; color: inherit; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.result-count { color: var(--md-sys-color-on-surface-variant); }
.list { display: flex; flex-direction: column; }
.list-row, .plain-row {
  min-height: 72px; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; background: transparent; border-bottom: 1px solid var(--md-sys-color-outline-variant); padding: 8px 4px;
}
.list-row.selected { background: var(--md-sys-color-secondary-container); }
.row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row-trail { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.table-wrap { overflow: auto; }
.data-table, .matrix { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td, .matrix th, .matrix td {
  text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--md-sys-color-outline-variant); vertical-align: middle;
}
.data-table thead th, .matrix thead th { position: sticky; top: 0; background: var(--md-sys-color-surface); }
td.wp-num { text-align: right; }
.data-table tr.selected { background: var(--md-sys-color-secondary-container); }
.sort-btn, .name-btn { border: 0; background: transparent; display: inline-flex; align-items: center; gap: 8px; padding: 0; text-align: left; }
.name-btn span { display: flex; flex-direction: column; }
.status-chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 0 8px;
  border-radius: var(--md-sys-shape-corner-small); font-size: 0.75rem;
}
.status-invited { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.status-deactivated { background: var(--md-sys-color-surface-container-highest); color: var(--md-sys-color-on-surface); }
.staff-layout.split { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 24px; align-items: start; }
.detail-pane, .detail {
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-sys-shape-corner-medium); padding: 16px;
}
.detail-head { display: flex; gap: 12px; align-items: center; }
.meta { display: grid; gap: 8px; margin: 12px 0; }
.meta div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px; }
.meta dt { color: var(--md-sys-color-on-surface-variant); }
.meta dd { margin: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fab {
  position: fixed; right: 16px; bottom: 96px; z-index: 5; height: 56px; border: 0;
  border-radius: var(--md-sys-shape-corner-large); padding: 0 16px; display: inline-flex; align-items: center; gap: 8px;
  background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--md-sys-color-shadow) 30%, transparent);
}
.fab.collapsed span { display: none; }
.fab.collapsed { width: 56px; padding: 0; justify-content: center; border-radius: var(--md-sys-shape-corner-large); }
.menu-wrap { position: relative; }
.menu {
  position: absolute; z-index: 8; min-width: 220px; max-height: 360px; overflow: auto;
  background: var(--md-sys-color-surface-container); border-radius: var(--md-sys-shape-corner-extra-small);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--md-sys-color-shadow) 28%, transparent);
  padding: 8px; display: flex; flex-direction: column;
}
.switcher-menu { min-width: 280px; }
.menu-item, .switcher-row {
  min-height: 48px; border: 0; background: transparent; text-align: left; display: flex; align-items: center; gap: 12px;
  border-radius: 8px; padding: 8px; width: 100%;
}
.menu-item:hover, .switcher-row:hover { background: var(--md-sys-color-surface-container-high); }
.switcher-copy { display: flex; flex-direction: column; flex: 1; }
.avatar-name { display: none; }
.switcher-btn, .switcher-plain, .avatar-btn {
  border: 0; background: transparent; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 4px 8px;
  border-radius: var(--md-sys-shape-corner-full); color: var(--md-sys-color-on-surface);
}
.switcher-new { justify-content: flex-start; }
.choice-group { margin: 12px 0; }
.choice-group:focus { outline: none; }
.choice-group:focus-visible { outline: 3px solid var(--md-sys-color-secondary); outline-offset: 2px; }
.check-row { display: flex; align-items: center; justify-content: flex-start; gap: 0; min-height: 48px; width: 100%; text-align: left; }
.check-row input[type="checkbox"], .check-row input[type="radio"] {
  width: 18px; height: 18px; margin: 15px; flex: none; accent-color: var(--md-sys-color-primary);
}
.segmented { display: flex; border: 1px solid var(--md-sys-color-outline); border-radius: var(--md-sys-shape-corner-full); overflow: hidden; }
.segmented button { flex: 1; min-height: 40px; border: 0; background: transparent; }
.segmented button.on { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.scrim { position: fixed; inset: 0; background: color-mix(in srgb, var(--md-sys-color-scrim) 32%, transparent); z-index: 20; display: grid; place-items: center; padding: 24px; }
.scrim-full { padding: 0; place-items: stretch; }
.sheet-handle { width: 32px; height: 4px; border-radius: var(--md-sys-shape-corner-full); background: var(--md-sys-color-outline); margin: 8px auto 0; }
.dialog {
  width: min(560px, 100%); max-height: min(720px, 100%); overflow: auto;
  background: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-sys-shape-corner-extra-large); padding: 8px 8px 16px;
}
.dialog-full { width: 100%; height: 100%; max-height: none; border-radius: 0; }
.dialog-sheet { align-self: end; width: 100%; border-radius: 28px 28px 0 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.dialog-sheet .switcher-row, .dialog-sheet .switcher-new { min-height: 72px; width: 100%; justify-content: flex-start; }
.scrim-sheet { align-items: end; padding: 0; }
.scrim-side { display: flex; justify-content: flex-end; align-items: stretch; padding: 0; }
.dialog-side { width: min(400px, 100%); height: 100%; max-height: none; border-radius: 0; }
.dialog-confirm { width: min(400px, 100%); }
.danger-zone { margin-top: 16px; padding: 16px; border-radius: 12px; background: var(--md-sys-color-surface-container-low); }
.section-label { margin: 16px 0 0; }
.dialog-bar { display: flex; align-items: center; gap: 8px; min-height: 56px; position: sticky; top: 0; background: inherit; }
.dialog-bar h2 { flex: 1; margin: 0; }
.dialog-toolbar, .dialog-footer { display: flex; justify-content: flex-end; gap: 8px; }
.dialog-body { padding: 0 16px 8px; }
.dialog-footer { padding: 8px 16px 0; }
.error-summary { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); padding: 12px; border-radius: 12px; }
.error-summary a { color: inherit; }
.empty, .error-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 32px 8px; }
.skeleton { background: var(--md-sys-color-surface-container-high); border-radius: 8px; }
.skeleton-row { display: flex; gap: 12px; align-items: center; min-height: 72px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-line { height: 16px; flex: 1; }
.skeleton-card { width: min(400px, 100%); height: 220px; }
.snackbar {
  position: fixed; left: 16px; right: 16px; bottom: 96px; z-index: 12;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--md-sys-color-inverse-surface); color: var(--md-sys-color-inverse-on-surface);
  border-radius: 8px; padding: 8px 16px; min-height: 48px;
}
.snackbar-action { color: var(--md-sys-color-inverse-primary); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; gap: 12px; align-items: center; min-height: 72px; }
.branch-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; flex: 1; min-width: 0; }
.branch-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.branch-meta .btn { min-height: 32px; height: auto; padding: 0 4px; }
.branch-row .menu-wrap { margin-left: auto; flex: none; }
.section-head, .logo-row, .account-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.logo-row, .account-head { justify-content: flex-start; }
.photo-btn { position: relative; cursor: pointer; }
.expand-row {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%;
  min-height: 48px; border: 0; background: transparent; color: var(--md-sys-color-primary); padding: 0; text-align: left;
}
.expand-row[aria-expanded="true"] .icon { transform: rotate(180deg); }
.perm-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.perm-list li { display: flex; gap: 8px; align-items: center; }
.invite-box { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
body.scroll-lock { overflow: hidden; }
@media (max-width: 599px) {
  .topbar { flex-wrap: wrap; }
  .topbar-switch { order: 1; }
  .topbar-avatar { order: 2; margin-left: auto; }
  .top-slot { order: 3; flex: 1 0 100%; }
  .filters { flex-direction: column; align-items: stretch; }
  .search-field { width: 100%; flex: 1 1 auto; }
  .chip-scroller { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; width: 100%; }
  .chip-scroller .menu-wrap, .chip-clear { flex: none; }
  .chip-clear { display: inline-flex; }
  .active-filters { display: none; }
}
@media (min-width: 600px) {
  .content-inner { padding: 24px 24px 32px; }
  .bottom-nav, .fab { display: none; }
  .rail { display: flex; flex-direction: column; width: 80px; padding: 12px 8px; gap: 8px; background: var(--md-sys-color-surface); }
  .rail-footer { margin-top: auto; width: 100%; }
  .rail-footer .menu { top: auto; bottom: calc(100% + 4px); left: 0; }
  .rail .nav-item span, .switcher-name, .switcher-btn .icon, .avatar-name { display: none; }
  .rail .nav-item { width: 56px; }
  .hide-wide { display: none; }
  .btn.hide-compact { display: inline-flex; }
  .snackbar { left: auto; right: 24px; width: min(420px, calc(100% - 48px)); bottom: 24px; }
}
@media (min-width: 840px) {
  .content-inner { padding: 24px 32px 32px; }
  .rail { width: 240px; padding: 12px; }
  .rail .nav-item { width: 100%; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: var(--md-sys-typescale-label-large-size); }
  .rail .nav-item span, .switcher-name, .switcher-btn .icon, .rail .avatar-name { display: inline; }
  .switcher-btn .icon { display: block; }
  .rail .menu-wrap { width: 100%; min-width: 0; }
  .rail .switcher-btn, .rail .switcher-plain, .rail .avatar-btn { width: 100%; justify-content: flex-start; min-width: 0; }
  .rail .switcher-name, .rail .avatar-name {
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; text-align: left;
  }
}
@media (min-width: 1200px) {
  .staff-layout.split .search-field { flex: 1 0 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}
