:root { color-scheme: light; }
* { box-sizing: border-box; }
html, body, #app { height: 100%; max-width: 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; font-size: 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: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); }
.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: 44px; width: 100%; font-size: 16px; }
.chip {
  min-height: 44px; 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-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.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; overflow-wrap: anywhere; }
.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: 44px; 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; }
.sso-client { align-items: flex-start; flex-wrap: wrap; padding: 8px 0; }
.sso-client-copy { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.sso-client-copy .hint { overflow-wrap: anywhere; }
.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; padding-top: calc(8px + env(safe-area-inset-top)); }
  .content-inner { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
  .meta div { grid-template-columns: minmax(0, 1fr); }
  .dialog-footer { position: sticky; bottom: 0; background: var(--md-sys-color-surface-container-high); padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .bottom-nav .nav-item { flex: 1; min-width: 0; }
  .bottom-nav .nav-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fab { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .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; }
}

/* People v2. Scoped to .v2 so the phase-1 screens stay as they are. Inventory-like: cream field, forest accent, cards, 48px targets. */
.v2 { min-height: 100dvh; background: #E6DCD0; color: #1c1917; font-family: Roboto, system-ui, sans-serif; overflow-x: clip; }
.v2 h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 4px; }
.v2 h2 { font-size: 1.05rem; margin: 20px 0 8px; }
.v2 a { color: #1b4332; }
.v2-skip { position: absolute; left: 8px; top: -40px; background: #fff; padding: 8px; z-index: 5; }
.v2-skip:focus { top: 8px; }
.v2-side { display: none; }
.v2-column { min-width: 0; }
.v2-top { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; background: #fffdf8; border-bottom: 1px solid #e4dccf; position: sticky; top: 0; z-index: 2; }
.v2-company { display: flex; flex-direction: column; gap: 2px; font-size: 0.75rem; min-width: 0; flex: 1; }
.v2-company select, .v2-form input, .v2-form select, .v2-inline input, .v2-form textarea { font: inherit; font-size: 16px; color: inherit; background: #fff; border: 1px solid #d9d0c3; border-radius: 10px; min-height: 48px; padding: 8px 12px; width: 100%; }
.v2-who { font-size: 0.875rem; }
.v2-main { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); max-width: 880px; overflow-wrap: anywhere; }
.v2-muted { color: #3f3a34; font-size: 0.875rem; margin: 0 0 8px; }
.v2-error { color: #7f1d1d; background: #fde8e8; padding: 10px 12px; border-radius: 10px; }
.v2-ok { color: #14532d; }
.v2-empty { color: #3f3a34; background: #fffdf8; border: 1px dashed #d9d0c3; border-radius: 12px; padding: 16px; }
.v2-cards { display: grid; gap: 12px; margin: 12px 0; }
.v2-card, .v2-form { background: #fffdf8; border: 1px solid #e4dccf; border-radius: 14px; padding: 14px; }
.v2-card h2 { margin-top: 0; }
.v2-code { font-variant-numeric: tabular-nums; font-size: 0.8125rem; color: #3f3a34; }
.v2-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.v2-list a, .v2-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; background: #fffdf8; border: 1px solid #e4dccf; border-radius: 12px; padding: 12px; text-decoration: none; color: inherit; min-height: 44px; }
.v2-list a span, .v2-list li span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v2-list em { font-style: normal; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: #3f3a34; }
.v2-title-row, .v2-inline { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.v2-form { display: grid; gap: 12px; margin-top: 16px; }
.v2-form label, .v2-inline label { display: grid; gap: 4px; font-size: 0.875rem; }
.v2-check { display: flex !important; align-items: center; gap: 8px; }
.v2-check input { width: 20px; height: 20px; min-height: 0; }
.v2-btn, .v2 a.v2-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px; border-radius: 999px; border: 0; background: #2A3C2E; color: #fff; font: inherit; text-decoration: none; }
.v2-btn-quiet, .v2 a.v2-btn.v2-btn-quiet { background: transparent; color: #2A3C2E; border: 1px solid #2A3C2E; }
.v2-btn:disabled { opacity: 0.6; }
.v2-dl { display: grid; gap: 8px; margin: 12px 0; }
.v2-dl div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 8px; }
.v2-dl dt { color: #3f3a34; }
.v2-dl dd { margin: 0; overflow-wrap: anywhere; }
.v2-tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #fffdf8; border-top: 1px solid #e4dccf; z-index: 3; padding-bottom: env(safe-area-inset-bottom); }
.v2-tabbar a, .v2-nav a { flex: 1; min-height: 56px; display: flex; align-items: center; justify-content: center; text-decoration: none; color: #3f3a34; font-size: 0.75rem; }
.v2-tabbar a.is-active, .v2-nav a.is-active { color: #2A3C2E; font-weight: 700; }
.v2-banner { background: #f3e2b8; padding: 8px 16px; }
.v2 input:focus, .v2 select:focus, .v2-btn:focus-visible, .v2 a:focus-visible { outline: 2px solid #2A3C2E; outline-offset: 2px; }
.v2-tabbar { display: none; }
@media (min-width: 900px) {
  .v2 { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
  .v2-side { display: flex; flex-direction: column; gap: 16px; padding: 16px; background: #2A3C2E; color: #E6DCD0; min-height: 100dvh; position: sticky; top: 0; }
  .v2-side a, .v2-side button { color: #f4efe6; background: transparent; border: 0; font: inherit; text-align: left; padding: 0; }
  .v2-brand { display: flex; gap: 10px; align-items: center; }
  .v2-mark { width: 36px; height: 36px; border-radius: 10px; background: #f4efe6; color: #1b4332; display: grid; place-items: center; font-weight: 700; }
  .v2-side .v2-muted { color: #d9d0c3; }
  .v2-tabbar { display: none; }
  .v2-nav { position: static; flex-direction: column; background: transparent; border: 0; padding: 0; }
  .v2-nav a { display: flex; align-items: center; gap: 10px; justify-content: flex-start; color: #E6DCD0; min-height: 44px; font-size: 1rem; padding: 0 8px; border-radius: 8px; }
  .v2-menu-openbtn { display: none; }
  .v2-nav a.is-active { background: rgba(255,255,255,0.12); color: #fff; }
  .v2-side-foot { margin-top: auto; display: grid; gap: 8px; }
  .v2-main { padding: 24px 28px 32px; }
  .v2-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.v2-menu { width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: #2A3C2E; display: grid; place-items: center; flex: none; }
.v2-burger, .v2-burger::before, .v2-burger::after { display: block; width: 18px; height: 2px; background: #2A3C2E; border-radius: 2px; }
.v2-burger { position: relative; }
.v2-burger::before, .v2-burger::after { content: ""; position: absolute; left: 0; }
.v2-burger::before { top: -6px; }
.v2-burger::after { top: 6px; }
.v2-drawer-scrim { position: fixed; inset: 0; background: rgba(42, 60, 46, 0.45); z-index: 30; }
.v2-drawer { position: absolute; top: 0; bottom: 0; left: 0; width: min(320px, 88vw); background: #2A3C2E; color: #E6DCD0; padding: calc(12px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 4px; overflow: auto; }
.v2-drawer a, .v2-drawer button { color: #E6DCD0; background: transparent; border: 0; font: inherit; text-align: left; min-height: 48px; display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 0 8px; border-radius: 10px; }
.v2-drawer a.is-active { background: rgba(230, 220, 208, 0.16); }
.v2-drawer-head { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.v2-drawer .v2-menu { color: #E6DCD0; }
.v2-menu-open { height: 100dvh; overflow: hidden; }
.home-hero { background: #2A3C2E; color: #E6DCD0; border-radius: 20px; padding: 20px; display: grid; gap: 4px; }
.home-hero h1, .home-hero p { color: inherit; margin: 0; }
.home-kicker { font-size: 0.875rem; letter-spacing: 0.04em; text-transform: uppercase; }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.home-tile, .v2 a.home-tile { min-height: 104px; background: #fffdf8; color: #2A3C2E; border: 1px solid #d9d0c3; border-radius: 16px; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; text-decoration: none; }
.home-tile .icon { width: 28px; height: 28px; }
@media (min-width: 720px) { .home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .home-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) { button.v2-menu-openbtn { display: none; } }
@media (max-width: 899px) {
  .v2-form > .v2-btn { position: sticky; bottom: calc(8px + env(safe-area-inset-bottom)); width: 100%; z-index: 2; }
  .v2-dl div { grid-template-columns: minmax(0, 1fr); }
  .v2-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
  .v2-inline { align-items: stretch; }
  .v2-inline > label, .v2-inline > .v2-btn { flex: 1 1 100%; }
  .section-head, .logo-row, .account-head { flex-wrap: wrap; align-items: flex-start; }
}

.kiosk-app {
  min-height: 100dvh; box-sizing: border-box; background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface);
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  display: grid; align-content: start; gap: 16px; width: min(480px, 100%); margin: 0 auto;
}
.kiosk-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.kiosk-card { display: grid; gap: 12px; }
.kiosk-title { font-size: 1.75rem; line-height: 1.2; margin: 0; }
.kiosk-muted { color: var(--md-sys-color-on-surface-variant); margin: 0; }
.kiosk-clock { font-size: clamp(2.5rem, 10vw, 4.5rem); font-variant-numeric: tabular-nums; margin: 0; letter-spacing: -0.03em; }
.kiosk-dots { font-size: 2rem; letter-spacing: 0.4em; min-height: 2.5rem; margin: 0; }
.kiosk-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kiosk-key, .kiosk-go, .kiosk-text {
  min-height: 64px; border-radius: 16px; font: inherit; font-size: 1.35rem; border: 0; cursor: pointer;
}
.kiosk-key { background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface); }
.kiosk-go { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.kiosk-text { background: transparent; color: var(--md-sys-color-primary); }
.kiosk-field { display: grid; gap: 4px; }
.kiosk-field input, .kiosk-app input {
  min-height: 56px; border-radius: 12px; border: 1px solid var(--md-sys-color-outline); padding: 0 14px;
  font: inherit; font-size: 16px; width: 100%; background: var(--md-sys-color-surface);
}
.kiosk-error { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); padding: 12px; border-radius: 12px; margin: 0; }
.kiosk-pill { border-radius: 999px; padding: 6px 12px; background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); font-size: 0.9rem; }
.kiosk-pill-off { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.kiosk-preview { position: relative; width: 168px; height: 210px; border-radius: 24px; overflow: hidden; background: #111; justify-self: center; }
.kiosk-preview video, .kiosk-scan video { width: 100%; height: 100%; object-fit: cover; }
.kiosk-scan video { max-height: 240px; border-radius: 16px; background: #111; }
.kiosk-oval {
  position: absolute; inset: 18px 28px; border: 3px solid #fff; border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); pointer-events: none;
}
.kiosk-schedule { margin: 0; font-size: 1.05rem; }
.kiosk-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; gap: 8px;
  background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface);
  border-radius: 28px 28px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.16);
}
.kiosk-sheet h2 { margin: 0; }
.kiosk-sheet dl { display: grid; gap: 8px; margin: 0; }
.kiosk-sheet div { display: flex; justify-content: space-between; gap: 12px; }
.kiosk-sheet dt { color: var(--md-sys-color-on-surface-variant); }
.kiosk-sheet dd { margin: 0; text-align: right; }
.pair-code { font-size: 2rem; letter-spacing: 0.2em; font-weight: 700; margin: 8px 0; }
.pair-qr svg { width: min(240px, 100%); height: auto; }
.pair-qr { background: #fff; padding: 12px; border-radius: 12px; display: inline-block; }
@media (min-width: 700px) {
  .kiosk-app { width: min(840px, 100%); padding-top: calc(28px + env(safe-area-inset-top)); }
  .kiosk-person { grid-template-columns: 200px 1fr; align-items: center; }
  .kiosk-clock, .kiosk-title, .kiosk-schedule, .kiosk-go, .kiosk-text, .kiosk-muted { grid-column: 2; }
  .kiosk-preview { grid-column: 1; grid-row: 1 / span 5; width: 180px; height: 230px; }
}
