:root {
  --canvas: #f5f5f7;
  --card: rgba(255, 255, 255, .82);
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, .12);
  --line-strong: rgba(60, 60, 67, .19);
  --blue: #0071e3;
  --blue-soft: #eaf4ff;
  --navy: #163b6d;
  --orange: #ff9f0a;
  --orange-soft: #fff7e8;
  --teal: #22a06b;
  --teal-soft: #eaf8f2;
  --purple: #7d5cff;
  --purple-soft: #f1edff;
  --apple-red: #ff3b30;
  --surface: rgba(255, 255, 255, .78);
  --surface-solid: #ffffff;
  --surface-muted: rgba(248, 248, 250, .86);
  --shadow: 0 24px 64px rgba(0, 0, 0, .08), 0 2px 10px rgba(0, 0, 0, .035);
  --shadow-soft: 0 12px 36px rgba(0, 0, 0, .06), 0 1px 4px rgba(0, 0, 0, .03);
  --radius: 26px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 8% -12%, rgba(0, 113, 227, .10), transparent 31%),
    radial-gradient(circle at 93% 4%, rgba(90, 200, 250, .10), transparent 25%),
    linear-gradient(180deg, #f8f9fb 0%, var(--canvas) 44%, #f2f3f5 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 4px solid rgba(0, 113, 227, .18);
  outline-offset: 2px;
}

::selection {
  color: #fff;
  background: rgba(0, 113, 227, .78);
}

.app-symbol {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(232, 243, 255, .88));
  box-shadow: 0 10px 26px rgba(0, 78, 170, .18), inset 0 1px 0 rgba(255, 255, 255, .9);
}

.app-symbol i {
  display: block;
  border-radius: 4px;
  background: #0071e3;
}

.app-symbol i:nth-child(2) { background: #64d2ff; }
.app-symbol i:nth-child(3) { background: #5ac8fa; }
.app-symbol i:nth-child(4) { background: #34c759; }

/* Authentication */

body.auth-pending {
  overflow: hidden;
}

body.auth-pending .dashboard {
  display: none;
}

.auth-overlay {
  min-height: 100vh;
  min-height: 100svh;
  overflow: auto;
  overflow-x: hidden;
  place-items: center;
  padding:
    max(22px, env(safe-area-inset-top))
    max(22px, env(safe-area-inset-right))
    max(22px, env(safe-area-inset-bottom))
    max(22px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 10% 8%, rgba(0, 113, 227, .13), transparent 30%),
    radial-gradient(circle at 90% 88%, rgba(52, 199, 89, .10), transparent 28%),
    #f3f5f8;
}

.auth-shell {
  width: min(1120px, 100%);
  min-height: min(720px, calc(100vh - 44px));
  min-height: min(720px, calc(100svh - 44px));
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(400px, .92fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 36px;
  background: rgba(255, 255, 255, .76);
  box-shadow: 0 40px 120px rgba(35, 48, 69, .16), 0 2px 8px rgba(35, 48, 69, .06);
  -webkit-backdrop-filter: blur(32px) saturate(150%);
  backdrop-filter: blur(32px) saturate(150%);
  animation: authEnter .7s var(--ease-out) both;
}

.auth-hero {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(34px, 5vw, 62px);
  color: #fff;
  background:
    radial-gradient(circle at 80% 18%, rgba(255, 255, 255, .22), transparent 30%),
    radial-gradient(circle at 8% 88%, rgba(100, 210, 255, .26), transparent 32%),
    linear-gradient(145deg, #005bbb 0%, #087ae3 48%, #56a2ff 100%);
}

.auth-hero::before,
.auth-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
}

.auth-hero::before {
  width: 420px;
  height: 420px;
  right: -230px;
  top: -210px;
  box-shadow: 0 0 0 54px rgba(255, 255, 255, .035), 0 0 0 116px rgba(255, 255, 255, .025);
}

.auth-hero::after {
  width: 280px;
  height: 280px;
  left: -170px;
  bottom: -170px;
  box-shadow: 0 0 0 45px rgba(255, 255, 255, .03);
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 16px;
  font-weight: 730;
  letter-spacing: -.01em;
}

.auth-brand .app-symbol {
  width: 42px;
  height: 42px;
  padding: 8px;
  border-radius: 13px;
}

.auth-hero-copy {
  position: relative;
  z-index: 1;
  margin: auto 0 30px;
}

.auth-kicker,
.auth-card-kicker,
.masthead-kicker {
  margin: 0;
  color: rgba(255, 255, 255, .76);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: .16em;
}

.auth-hero-copy h1 {
  max-width: 540px;
  margin: 15px 0 0;
  color: #fff;
  font-size: clamp(38px, 5.2vw, 66px);
  font-weight: 720;
  line-height: 1.05;
  letter-spacing: -.055em;
}

.auth-hero-copy > p:last-child {
  max-width: 500px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, .78);
  font-size: 15px;
  line-height: 1.75;
}

.auth-preview {
  position: relative;
  z-index: 1;
  width: min(100%, 500px);
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, .30);
  border-radius: 22px;
  background: rgba(255, 255, 255, .14);
  box-shadow: 0 24px 50px rgba(0, 43, 105, .18);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.auth-preview-top {
  display: flex;
  gap: 5px;
  margin: 1px 2px 11px;
}

.auth-preview-top span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .46);
}

.auth-preview-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.auth-preview-grid i {
  height: 50px;
  grid-column: span 2;
  border-radius: 12px;
  background: rgba(255, 255, 255, .90);
}

.auth-preview-grid b {
  height: 7px;
  align-self: end;
  border-radius: 999px;
  background: rgba(255, 255, 255, .40);
}

.auth-preview-grid b:nth-of-type(2) { height: 27px; }
.auth-preview-grid b:nth-of-type(3) { height: 18px; }
.auth-preview-grid b:nth-of-type(4) { height: 37px; }
.auth-preview-grid b:nth-of-type(5) { height: 24px; }
.auth-preview-grid b:nth-of-type(6) { height: 42px; }

.auth-hero-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  font-weight: 650;
}

.status-orb {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7cf29b;
  box-shadow: 0 0 0 5px rgba(124, 242, 155, .14);
}

.auth-card {
  width: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(38px, 5vw, 70px);
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, .88);
  box-shadow: none;
}

.auth-mobile-brand { display: none; }

.auth-card-kicker {
  color: var(--blue);
}

.auth-card h1 {
  margin: 9px 0 0;
  color: var(--ink);
  font-size: clamp(32px, 3.5vw, 44px);
  font-weight: 720;
  line-height: 1.12;
  letter-spacing: -.045em;
}

.auth-card-subtitle {
  margin: 12px 0 30px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.auth-fields {
  display: grid;
  gap: 16px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #3a3a3c;
  font-size: 12px;
  font-weight: 650;
}

.auth-field label span {
  color: #98989d;
  font-size: 10px;
  font-weight: 550;
}

.auth-field input {
  min-height: 52px;
  border: 1px solid rgba(60, 60, 67, .16);
  border-radius: 14px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(248, 248, 250, .92);
  caret-color: var(--blue);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.auth-field input:hover {
  border-color: rgba(60, 60, 67, .25);
  background: #fff;
}

.auth-field input:focus {
  border-color: rgba(0, 113, 227, .72);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, .12);
  outline: none;
}

.auth-field input::placeholder { color: #a5a5aa; }

.auth-account-summary {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid rgba(0, 113, 227, .14);
  border-radius: 14px;
  background: var(--blue-soft);
}

.auth-account-summary[hidden] { display: none; }

.auth-account-summary span {
  color: var(--muted);
  font-size: 11px;
}

.auth-account-summary strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
}

.auth-actions {
  grid-template-columns: 1.15fr .85fr;
  gap: 10px;
  margin-top: 22px;
}

.auth-button {
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #333336;
  background: #ececf0;
  font-weight: 700;
  box-shadow: none;
  transition: transform .2s var(--ease-out), background .2s ease, box-shadow .2s ease;
}

.auth-button.primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 10px 24px rgba(0, 113, 227, .22);
}

.auth-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #e3e3e8;
}

.auth-button.primary:hover:not(:disabled) {
  background: #0077ed;
  box-shadow: 0 13px 28px rgba(0, 113, 227, .27);
}

.auth-button:active:not(:disabled) { transform: scale(.985); }

.auth-switch-account {
  align-self: center;
  margin-top: 14px;
  border: 0;
  padding: 4px 8px;
  color: var(--blue);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.auth-switch-account:hover { text-decoration: underline; }

.auth-message {
  min-height: 22px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.auth-message.error { color: #c9342c; }
.auth-message.success { color: #15804f; }

.auth-note {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: #86868b;
  font-size: 11px;
  line-height: 1.6;
}

.auth-note span {
  margin-right: 4px;
  color: var(--blue);
  font-size: 8px;
}

@keyframes authEnter {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Application shell */

.dashboard {
  width: min(1760px, calc(100% - clamp(28px, 4.5vw, 78px)));
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 0 max(48px, env(safe-area-inset-bottom));
}

.masthead {
  min-height: 212px;
  overflow: hidden;
  padding: clamp(28px, 3vw, 46px);
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: 32px;
  background:
    radial-gradient(circle at 93% 3%, rgba(0, 113, 227, .10), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(247, 250, 255, .82));
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  backdrop-filter: blur(28px) saturate(150%);
}

.masthead::before {
  top: auto;
  right: 32px;
  bottom: 0;
  left: 32px;
  inset: auto 32px 0;
  width: auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 113, 227, .26), transparent);
}

.masthead::after {
  width: 360px;
  height: 360px;
  right: -170px;
  top: -260px;
  border: 1px solid rgba(0, 113, 227, .08);
  box-shadow: 0 0 0 50px rgba(0, 113, 227, .025), 0 0 0 110px rgba(0, 113, 227, .018);
}

.masthead-content {
  position: relative;
  z-index: 2;
  min-height: 126px;
  display: grid;
  grid-template-columns: minmax(360px, .85fr) minmax(520px, 1.15fr);
  align-items: center;
  gap: clamp(28px, 5vw, 84px);
}

.masthead-brand {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.masthead-brand .app-symbol {
  width: 54px;
  height: 54px;
  border-radius: 17px;
}

.masthead-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.title-block {
  text-align: left;
}

.masthead-kicker {
  color: var(--blue);
}

.masthead .title-block h1 {
  margin-top: 7px;
  color: var(--ink);
  font-size: clamp(34px, 3.3vw, 52px);
  font-weight: 720;
  letter-spacing: -.052em;
}

.masthead-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.masthead-side {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 14px;
}

.software-toolbar {
  justify-content: flex-end;
  gap: 9px;
  margin-top: 0;
}

.software-button,
.cloud-logout,
.reset-button,
.matrix-fullscreen-button,
.system-modal-button,
.system-modal-close,
.score-modal-tool,
.score-modal-close,
.score-modal-dismiss,
.score-appeal-back {
  transition: transform .2s var(--ease-out), background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.software-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  color: #3a3a3c;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .035);
  font-size: 11px;
  font-weight: 680;
}

.software-button.primary {
  border-color: transparent;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(0, 113, 227, .20);
}

.software-button:hover:not(:disabled),
.cloud-logout:hover,
.matrix-fullscreen-button:hover {
  transform: translateY(-1px);
}

.import-status {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(0, 113, 227, .10);
  border-radius: 12px;
  color: #4d6382;
  background: rgba(234, 244, 255, .78);
  font-size: 11px;
}

.cloud-account-bar {
  justify-content: flex-end;
  gap: 7px;
  margin-top: 0;
}

.cloud-pill,
.cloud-logout {
  min-height: 32px;
  border: 1px solid rgba(60, 60, 67, .09);
  border-radius: 999px;
  padding: 0 11px;
  color: #5d5d63;
  background: rgba(242, 242, 247, .82);
  font-size: 10px;
  font-weight: 650;
}

.cloud-pill.admin { color: #8a5300; background: #fff5df; }
.cloud-pill.online { color: #147a4b; background: #e9f8f1; }

.cloud-logout {
  color: #55555a;
  background: rgba(255, 255, 255, .88);
  cursor: pointer;
}

.software-version {
  right: 22px;
  bottom: 18px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(60, 60, 67, .09);
  border-radius: 999px;
  padding: 0 9px;
  color: #8e8e93;
  background: rgba(255, 255, 255, .62);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .04em;
}

/* Filters */

.filter-panel {
  top: max(10px, env(safe-area-inset-top));
  grid-template-columns: minmax(190px, 1.2fr) repeat(5, minmax(112px, .72fr)) auto;
  gap: 10px;
  margin-top: 18px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, .86);
  border-radius: 22px;
  background: rgba(249, 249, 251, .78);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
}

.filter-heading {
  padding: 0 8px 0 4px;
}

.filter-heading strong {
  color: #343438;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.filter-heading::after {
  content: "筛选会同步更新下方全部视图";
  display: block;
  margin-top: 3px;
  color: #929298;
  font-size: 9px;
}

.field label {
  margin: 0 0 6px 3px;
  color: #74747a;
  font-size: 10px;
  font-weight: 650;
}

select,
.system-filter-bar input,
.system-filter-bar select {
  min-height: 42px;
  border: 1px solid rgba(60, 60, 67, .13);
  border-radius: 12px;
  color: #2c2c2e;
  background-color: rgba(255, 255, 255, .94);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .02);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

select:hover,
.system-filter-bar input:hover,
.system-filter-bar select:hover {
  border-color: rgba(60, 60, 67, .23);
  background-color: #fff;
}

select:focus,
.system-filter-bar input:focus,
.system-filter-bar select:focus {
  border-color: rgba(0, 113, 227, .60);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, .10);
  outline: none;
}

.reset-button {
  height: 42px;
  border-radius: 12px;
  padding: 0 16px;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(0, 113, 227, .18);
  font-size: 11px;
  font-weight: 700;
}

.reset-button:hover { background: #0077ed; transform: translateY(-1px); }
.reset-button:active { transform: scale(.98); }

.filter-chips {
  gap: 6px;
  min-height: 20px;
}

.filter-chip {
  border: 1px solid rgba(0, 113, 227, .10);
  border-radius: 999px;
  color: #3f6289;
  background: rgba(234, 244, 255, .76);
  font-size: 10px;
  font-weight: 620;
}

.dashboard-state-banner {
  margin-top: 12px;
  border-radius: 14px;
  font-size: 11px;
}

/* Content surfaces */

.section-label {
  margin: 30px 2px 13px;
}

.section-label h2 {
  color: #262629;
  font-size: clamp(18px, 1.5vw, 22px);
  font-weight: 720;
  letter-spacing: -.025em;
}

.section-label h2::before {
  width: 7px;
  height: 7px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(0, 113, 227, .09);
}

.kpi-grid {
  gap: 14px;
}

.kpi-card,
.panel,
.person-pill,
.score-modal-card {
  border: 1px solid rgba(255, 255, 255, .90);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  backdrop-filter: blur(22px) saturate(145%);
}

.kpi-card {
  min-height: 154px;
  padding: 21px 22px;
  border-radius: 24px;
  transition: transform .28s var(--ease-out), box-shadow .28s ease, border-color .28s ease;
}

.kpi-card::after {
  width: 110px;
  height: 110px;
  right: -56px;
  top: -58px;
  border: 1px solid rgba(0, 113, 227, .08);
  background: transparent;
}

.kpi-label {
  color: #737378;
  font-size: 11px;
  font-weight: 650;
}

.kpi-dot {
  width: 7px;
  height: 7px;
}

.kpi-value {
  margin-top: 13px;
  color: #19191b;
  font-size: clamp(30px, 2.65vw, 44px);
  font-weight: 720;
  letter-spacing: -.045em;
}

.kpi-sub { color: #85858a; }

@media (hover: hover) and (pointer: fine) {
  .kpi-card:hover,
  .panel:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 1);
    box-shadow: 0 18px 46px rgba(0, 0, 0, .075), 0 2px 8px rgba(0, 0, 0, .03);
  }
}

.compare {
  border-radius: 999px;
  font-weight: 650;
}

.chart-grid {
  gap: 16px;
}

.panel {
  padding: clamp(18px, 2vw, 26px);
  border-radius: 28px;
  transition: transform .28s var(--ease-out), box-shadow .28s ease;
}

.panel-head {
  gap: 18px;
  margin-bottom: 18px;
}

.panel-title h3 {
  color: #262629;
  font-size: clamp(15px, 1.3vw, 18px);
  font-weight: 700;
  letter-spacing: -.018em;
}

.panel-title p {
  color: #818187;
  font-size: 10px;
  line-height: 1.55;
}

.segmented {
  padding: 3px;
  border: 1px solid rgba(60, 60, 67, .08);
  border-radius: 11px;
  background: rgba(118, 118, 128, .10);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .025);
}

.segmented button {
  min-width: 38px;
  height: 30px;
  border-radius: 8px;
  color: #68686d;
  font-size: 10px;
  font-weight: 650;
}

.segmented button.active {
  color: #1d1d1f;
  background: #fff;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .11), 0 0 0 .5px rgba(0, 0, 0, .07);
}

.chart {
  height: clamp(300px, 29vw, 410px);
}

.logic-version-badge,
.status-badge,
.score-hour-chip,
.matrix-shift-badge,
.matrix-top20,
.hour-alert-badge {
  border-radius: 999px;
}

.matrix-fullscreen-button {
  min-height: 38px;
  border: 1px solid rgba(60, 60, 67, .12);
  border-radius: 11px;
  color: #404045;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .04);
}

.matrix-fullscreen-button:hover {
  color: var(--blue);
  border-color: rgba(0, 113, 227, .22);
  background: #fff;
}

.work-matrix-wrap,
.score-detail-wrap,
.score-modal-table-wrap,
.score-appeal-table-wrap {
  border-color: rgba(60, 60, 67, .10);
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
  scrollbar-color: rgba(60, 60, 67, .25) transparent;
  scrollbar-width: thin;
}

.work-matrix-wrap::-webkit-scrollbar,
.score-detail-wrap::-webkit-scrollbar,
.score-modal-table-wrap::-webkit-scrollbar,
.score-appeal-table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.work-matrix-wrap::-webkit-scrollbar-thumb,
.score-detail-wrap::-webkit-scrollbar-thumb,
.score-modal-table-wrap::-webkit-scrollbar-thumb,
.score-appeal-table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(60, 60, 67, .25);
  background-clip: padding-box;
}

.work-matrix thead th,
.score-detail-table thead th,
.system-table th,
.score-modal-table th,
.score-appeal-table th {
  color: #68686e;
  background: rgba(246, 246, 248, .94);
  font-weight: 680;
}

.work-matrix tbody th,
.work-matrix tbody td,
.score-detail-table tbody td,
.system-table td,
.score-modal-table td,
.score-appeal-table td {
  border-color: rgba(60, 60, 67, .08);
}

.work-matrix tbody tr:hover th,
.work-matrix tbody tr:hover td,
.score-detail-table tbody tr:hover td,
.system-table tbody tr:hover td {
  background: rgba(0, 113, 227, .025);
}

.matrix-person-button,
.hour-detail-button {
  border-radius: 12px;
  transition: transform .2s var(--ease-out), border-color .2s ease, background .2s ease;
}

.matrix-person-button:hover,
.hour-detail-button:hover { transform: translateY(-1px); }

.matrix-insight,
.score-detail-insight,
.insight,
.data-quality {
  border: 1px solid rgba(0, 113, 227, .10);
  border-radius: 14px;
  color: #53677f;
  background: rgba(238, 246, 255, .68);
}

.footer-note {
  margin-top: 16px;
}

/* Dialogs */

.system-modal-overlay,
.score-modal-overlay {
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: rgba(20, 20, 24, .42);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
}

.system-modal-dialog,
.score-modal-dialog {
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 26px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 34px 110px rgba(0, 0, 0, .28);
}

.system-modal-head,
.score-modal-head {
  border-color: var(--line);
  background: rgba(248, 248, 250, .82);
}

.system-tab {
  border-radius: 10px;
  color: #5f5f65;
  background: #efeff4;
}

.system-tab.active {
  background: var(--blue);
  box-shadow: 0 5px 14px rgba(0, 113, 227, .18);
}

.score-modal-card {
  border-color: rgba(60, 60, 67, .08);
  border-radius: 15px;
  background: rgba(248, 248, 250, .82);
  box-shadow: none;
}

.system-modal-close,
.score-modal-close {
  border-radius: 50%;
  background: #e9e9ed;
  box-shadow: none;
}

/* Width and aspect-ratio adaptation */

@media (max-width: 1280px) {
  .masthead-content {
    grid-template-columns: minmax(330px, .82fr) minmax(470px, 1.18fr);
    gap: 30px;
  }

  .filter-panel {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .filter-heading {
    grid-column: 1 / -1;
  }

  .field { grid-column: span 1; }
  .reset-button { grid-column: span 1; }
}

@media (max-width: 1080px) {
  .masthead-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .masthead-side {
    justify-items: start;
  }

  .software-toolbar,
  .cloud-account-bar { justify-content: flex-start; }

  .filter-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reset-button { grid-column: span 1; }

  .panel.span-8,
  .panel.span-4 { grid-column: span 12; }

  .chart { height: clamp(300px, 42vw, 430px); }
}

@media (max-width: 820px) {
  .dashboard {
    width: calc(100% - 24px);
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .masthead {
    min-height: 0;
    padding: 26px;
    border-radius: 26px;
  }

  .masthead-brand .app-symbol {
    width: 48px;
    height: 48px;
  }

  .masthead .title-block h1 { font-size: clamp(31px, 7vw, 44px); }

  .masthead-side {
    width: 100%;
    justify-items: stretch;
  }

  .software-toolbar,
  .cloud-account-bar {
    width: 100%;
    flex-wrap: wrap;
  }

  .filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 19px;
  }

  .filter-heading { grid-column: 1 / -1; }
  .field { grid-column: span 1; }
  .reset-button { grid-column: span 1; }

  .section-label { margin-top: 25px; }

  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .kpi-card { min-height: 142px; }

  .panel { border-radius: 23px; }
}

@media (max-width: 760px) {
  body {
    background:
      radial-gradient(circle at 10% -5%, rgba(0, 113, 227, .10), transparent 27%),
      #f5f5f7;
  }

  .auth-overlay {
    display: block;
    padding: 0;
    background: #f5f5f7;
  }

  .auth-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    display: block;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: #f5f5f7;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .auth-hero { display: none; }

  .auth-card {
    min-height: 100vh;
    min-height: 100svh;
    justify-content: center;
    padding:
      max(34px, env(safe-area-inset-top))
      max(24px, env(safe-area-inset-right))
      max(34px, env(safe-area-inset-bottom))
      max(24px, env(safe-area-inset-left));
    background:
      radial-gradient(circle at 90% 4%, rgba(0, 113, 227, .10), transparent 28%),
      #f5f5f7;
  }

  .auth-mobile-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 48px;
    color: #3a3a3c;
    font-size: 14px;
    font-weight: 700;
  }

  .auth-mobile-brand .app-symbol {
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: 12px;
  }

  .auth-card h1 { font-size: clamp(34px, 10vw, 44px); }
  .auth-card-subtitle { margin-bottom: 28px; }

  .dashboard {
    width: calc(100% - 16px);
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .masthead {
    padding: 22px 20px 20px;
    border-radius: 23px;
  }

  .masthead-content { gap: 20px; }

  .masthead-brand {
    align-items: center;
    gap: 13px;
  }

  .masthead-brand .app-symbol {
    width: 43px;
    height: 43px;
    padding: 8px;
    border-radius: 13px;
  }

  .masthead-kicker { font-size: 8px; }
  .masthead .title-block h1 { margin-top: 4px; font-size: 30px; }
  .masthead-subtitle { margin-top: 6px; font-size: 11px; }

  .masthead-side {
    width: 100%;
    justify-items: stretch;
    gap: 10px;
  }

  .software-toolbar,
  .cloud-account-bar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    padding-bottom: 2px;
  }

  .software-button,
  .cloud-pill,
  .cloud-logout {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .import-status {
    width: 100%;
    grid-column: 1 / -1;
    justify-content: center;
  }

  .software-version {
    position: static;
    width: fit-content;
    margin-top: 14px;
  }

  .filter-panel {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
    padding: 14px;
    border-radius: 20px;
  }

  .filter-heading,
  .filter-chips { grid-column: 1 / -1; }

  .field,
  .reset-button { grid-column: span 1; }

  .reset-button { align-self: end; }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .kpi-card {
    min-height: 132px;
    padding: 17px;
    border-radius: 20px;
  }

  .kpi-value { font-size: clamp(27px, 9vw, 37px); }

  .chart-grid { gap: 12px; }

  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .panel-head {
    align-items: stretch;
    margin-bottom: 14px;
  }

  .segmented {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chart { height: clamp(280px, 84vw, 360px); }

  .matrix-head-actions,
  .score-head-actions {
    width: 100%;
    align-items: stretch;
  }

  .matrix-fullscreen-button { min-height: 42px; }

  .system-modal-overlay,
  .score-modal-overlay {
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .system-modal-dialog,
  .score-modal-dialog { border-radius: 20px; }
}

@media (max-width: 520px) {
  .auth-mobile-brand { margin-bottom: 38px; }

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

  .auth-button.primary { order: -1; }

  .filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field,
  .reset-button { grid-column: span 1; }

  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .section-label {
    align-items: center;
    flex-direction: row;
  }

  .panel-head { flex-direction: column; }
}

@media (max-width: 390px) {
  .auth-card {
    padding-right: 18px;
    padding-left: 18px;
  }

  .auth-mobile-brand { margin-bottom: 30px; }

  .auth-field input,
  .auth-button { min-height: 50px; }

  .dashboard { width: calc(100% - 12px); }

  .masthead {
    padding: 20px 17px 18px;
    border-radius: 20px;
  }

  .masthead-subtitle { display: none; }

  .filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
  }

  .filter-heading,
  .filter-chips { grid-column: 1 / -1; }

  .field { grid-column: span 1; }
  .reset-button { grid-column: 1 / -1; }

  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-modal-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card { min-height: 124px; }
  .panel { padding: 15px; border-radius: 19px; }

  .cloud-account-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 340px) {
  .filter-panel,
  .kpi-grid,
  .cloud-account-bar { grid-template-columns: 1fr; }

  .filter-heading,
  .field,
  .reset-button,
  .filter-chips { grid-column: 1; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .auth-overlay {
    display: block;
    padding: 0;
  }

  .auth-shell {
    min-height: 100vh;
    min-height: 100svh;
    grid-template-columns: minmax(220px, .7fr) minmax(430px, 1.3fr);
    border: 0;
    border-radius: 0;
  }

  .auth-hero {
    display: flex;
    padding: 22px;
  }

  .auth-hero-copy { margin: auto 0; }
  .auth-hero-copy h1 { font-size: clamp(28px, 5vw, 38px); }
  .auth-hero-copy > p:last-child,
  .auth-preview,
  .auth-hero-foot { display: none; }

  .auth-card {
    min-height: 100vh;
    min-height: 100svh;
    padding: 18px clamp(24px, 5vw, 52px);
  }

  .auth-mobile-brand { display: none; }
  .auth-card h1 { font-size: 28px; }
  .auth-card-subtitle { margin: 5px 0 12px; }
  .auth-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .auth-field input { min-height: 42px; }
  .auth-actions { grid-template-columns: 1.15fr .85fr; margin-top: 10px; }
  .auth-button { min-height: 42px; }
  .auth-message { min-height: 18px; margin-top: 8px; }
  .auth-note { margin-top: 7px; padding-top: 7px; }

  .filter-panel { position: static; }
}

@media (min-width: 1700px) and (min-aspect-ratio: 21 / 9) {
  .dashboard { width: min(1900px, calc(100% - 96px)); }
  .masthead-content { grid-template-columns: .8fr 1.2fr; }
  .chart { height: 380px; }
}

@media (min-width: 768px) and (max-width: 1100px) and (max-aspect-ratio: 3 / 4) {
  .filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-heading,
  .filter-chips { grid-column: 1 / -1; }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(0, 0, 0, .28);
    --line-strong: rgba(0, 0, 0, .42);
  }

  .kpi-card,
  .panel,
  .filter-panel,
  .masthead { border-color: rgba(0, 0, 0, .24); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-shell { animation: none; }

  .kpi-card,
  .panel,
  .auth-button,
  .software-button,
  .cloud-logout,
  .reset-button,
  .matrix-fullscreen-button,
  .matrix-person-button,
  .hour-detail-button { transition: none; }
}

/* Dashboard redesign v2.8.2
   A compact operating-system shell, bento metrics and data-first surfaces. */

.dashboard {
  width: min(1840px, calc(100% - clamp(20px, 3.2vw, 64px)));
  padding-top: max(14px, env(safe-area-inset-top));
}

.masthead {
  min-height: 0;
  padding: 18px 22px;
  border-color: rgba(255, 255, 255, .96);
  border-radius: 24px;
  background:
    radial-gradient(circle at 96% 0, rgba(10, 132, 255, .12), transparent 25%),
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(246, 250, 255, .88));
  box-shadow: 0 18px 48px rgba(35, 54, 82, .075), 0 2px 8px rgba(35, 54, 82, .035);
}

.masthead::before {
  top: 0;
  right: auto;
  bottom: 0;
  left: 0;
  inset: 0 auto 0 0;
  width: 4px;
  height: auto;
  border-radius: 24px 0 0 24px;
  background: linear-gradient(180deg, #0a84ff, #5ac8fa 55%, #30d158);
}

.masthead::after {
  width: 240px;
  height: 240px;
  right: -135px;
  top: -175px;
  box-shadow: 0 0 0 40px rgba(10, 132, 255, .026), 0 0 0 82px rgba(10, 132, 255, .016);
}

.masthead-content {
  min-height: 74px;
  grid-template-columns: minmax(320px, .72fr) minmax(650px, 1.28fr);
  gap: clamp(20px, 3vw, 52px);
}

.masthead-brand { align-items: center; gap: 14px; }

.masthead-brand .app-symbol {
  width: 44px;
  height: 44px;
  padding: 8px;
  border-radius: 14px;
}

.masthead-kicker {
  margin: 0;
  font-size: 9px;
  font-weight: 780;
  letter-spacing: .16em;
}

.masthead .title-block h1 {
  margin: 0;
  font-size: clamp(26px, 2.2vw, 34px);
  font-weight: 760;
  letter-spacing: -.045em;
  line-height: 1.08;
}

.masthead-subtitle { margin-top: 4px; font-size: 10px; line-height: 1.45; }
.masthead-side { gap: 8px; }
.software-toolbar { gap: 7px; }

.software-button,
.import-status {
  min-height: 34px;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 10px;
}

.import-status {
  max-width: min(380px, 42vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-pill,
.cloud-logout { min-height: 28px; padding: 0 10px; font-size: 9px; }

.software-version {
  position: static;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  inset: auto;
  min-height: 21px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  margin: 1px 0 0;
  border: 1px solid rgba(10, 132, 255, .12);
  border-radius: 999px;
  padding: 0 7px;
  color: #55708f;
  background: rgba(234, 244, 255, .82);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .03em;
  line-height: 1;
}

/* Filter dock */

.filter-panel {
  top: max(8px, env(safe-area-inset-top));
  grid-template-columns: minmax(168px, .8fr) repeat(5, minmax(116px, 1fr)) auto;
  grid-template-rows: auto auto;
  gap: 10px 12px;
  margin-top: 12px;
  padding: 13px 14px 10px;
  border-color: rgba(255, 255, 255, .94);
  border-radius: 20px;
  background: rgba(247, 248, 251, .84);
  box-shadow: 0 14px 34px rgba(35, 54, 82, .065), inset 0 1px 0 #fff;
  backdrop-filter: blur(30px) saturate(165%);
}

.filter-heading {
  position: relative;
  align-self: center;
  padding: 0 14px 0 2px;
}

.filter-heading::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 0;
  bottom: 3px;
  width: 1px;
  background: var(--line);
}

.filter-heading::after { display: none; }

.filter-eyebrow {
  display: block;
  margin-bottom: 2px;
  color: #0a84ff;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .12em;
}

.filter-heading strong { font-size: 15px; font-weight: 760; letter-spacing: -.02em; }
.field label { margin-bottom: 4px; font-size: 9px; }

.filter-panel select {
  min-height: 40px;
  border-radius: 11px;
  padding-right: 30px;
  font-size: 11px;
  font-weight: 620;
}

.reset-button { height: 40px; align-self: end; border-radius: 11px; }

.filter-chips {
  grid-column: 1 / -1;
  gap: 5px;
  min-height: 20px;
  padding-top: 1px;
}

.filter-chip {
  min-height: 22px;
  padding: 0 9px;
  font-size: 9px;
}

/* Section rhythm and bento metrics */

.section-label {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin: 24px 2px 10px;
}

.section-label::after {
  content: "";
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.section-label h2 { font-size: clamp(17px, 1.35vw, 21px); }

.section-label p {
  grid-column: 3;
  margin: 0;
  color: #8a8a90;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 11px;
}

.kpi-card {
  grid-column: span 2;
  min-height: 174px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 17px 13px;
  border-color: rgba(94, 126, 170, .16);
  border-color: var(--accent-soft);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,.96), var(--accent-soft));
  box-shadow: 0 12px 30px rgba(35, 54, 82, .07), inset 0 1px 0 rgba(255,255,255,.95);
  -ms-high-contrast-adjust: none;
  forced-color-adjust: none;
}

.kpi-card:nth-child(-n + 2) { grid-column: span 3; }

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: auto;
  bottom: 0;
  left: 0;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  background: linear-gradient(180deg, var(--accent), var(--accent-soft));
}

.kpi-card::after {
  display: none;
}

.kpi-top {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.kpi-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent-soft);
  border-radius: 9px;
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
  font-size: 11px;
  font-weight: 850;
}

.kpi-label {
  overflow: hidden;
  color: #5f5f65;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-order {
  justify-self: end;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  transform: translate(-2px, 1px);
  color: var(--accent);
  font-size: 8px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: .06em;
  text-align: center;
}

.kpi-value {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  overflow: hidden;
  font-size: clamp(27px, 2.15vw, 39px);
  font-weight: 770;
  line-height: 1.04;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-value.name-value { font-size: clamp(22px, 1.8vw, 32px); }

.kpi-sub {
  position: relative;
  z-index: 2;
  display: -webkit-box;
  min-height: 31px;
  margin-top: 5px;
  overflow: hidden;
  color: #7a7a80;
  font-size: 9px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.kpi-card-foot {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(38px, 1fr);
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding-top: 8px;
}

.compare-row { min-width: 0; display: flex; gap: 4px; overflow: hidden; }
.compare-row .compare { flex: 0 0 auto; font-size: 8px; }

.kpi-neutral {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 8px;
  font-weight: 760;
}

.kpi-signal {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #ececf0;
}

.kpi-signal i {
  width: var(--signal);
  min-width: 6px;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
}

/* Analytical panels */

.chart-grid { gap: 13px; }

.panel {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-color: rgba(255, 255, 255, .94);
  border-radius: 22px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 15px 38px rgba(35, 54, 82, .07), inset 0 1px 0 #fff;
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: auto;
  left: 0;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #0a84ff, #64d2ff 50%, transparent 88%);
}

.funnel-panel::before { background: linear-gradient(90deg, #7d5cff, #bf5af2 56%, transparent 90%); }
.work-matrix-panel::before { background: linear-gradient(90deg, #20b486, #63d89d 56%, transparent 90%); }
.score-detail-panel::before { background: linear-gradient(90deg, #ff9f0a, #ffd60a 56%, transparent 90%); }

.panel-head {
  position: relative;
  z-index: 2;
  align-items: flex-start;
  margin: -4px 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(60, 60, 67, .08);
}

.panel-title h3 { font-size: clamp(15px, 1.2vw, 18px); }
.panel-title p { margin-top: 3px; font-size: 9px; }
.chart { height: clamp(290px, 26vw, 390px); border-radius: 15px; background: linear-gradient(180deg, rgba(249,250,252,.82), rgba(255,255,255,.32)); }

.segmented { border-radius: 10px; }
.segmented button { min-width: 42px; height: 28px; }

.matrix-legend span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #f6f6f8;
}

.matrix-fullscreen-button { min-height: 34px; border-radius: 10px; font-size: 9px; }

.work-matrix-wrap,
.score-detail-wrap,
.score-modal-table-wrap,
.score-appeal-table-wrap {
  border: 1px solid rgba(60,60,67,.10);
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(0,0,0,.015);
}

.work-matrix thead th,
.score-detail-table thead th,
.system-table th,
.score-modal-table th,
.score-appeal-table th {
  position: sticky;
  z-index: 3;
  top: 0;
  border-bottom: 1px solid rgba(60,60,67,.12);
  color: #65656b;
  background: rgba(246,247,249,.96);
  backdrop-filter: blur(16px);
  font-size: 9px;
  letter-spacing: .01em;
}

.work-matrix thead th:first-child,
.work-matrix tbody th,
.score-detail-table thead th:first-child,
.score-detail-table tbody td:first-child {
  position: sticky;
  z-index: 2;
  left: 0;
  box-shadow: 1px 0 rgba(60,60,67,.08);
}

.work-matrix thead th:first-child,
.score-detail-table thead th:first-child { z-index: 5; }

.work-matrix tbody tr:nth-child(even):not(.shift-group-heading) td,
.score-detail-table tbody tr:nth-child(even) td,
.system-table tbody tr:nth-child(even) td,
.score-modal-table tbody tr:nth-child(even) td { background-color: rgba(247,248,250,.62); }

.work-matrix tbody tr:hover th,
.work-matrix tbody tr:hover td,
.score-detail-table tbody tr:hover td,
.system-table tbody tr:hover td,
.score-modal-table tbody tr:hover td { background-color: rgba(10,132,255,.055); }

.matrix-person-button,
.hour-detail-button { border-radius: 10px; }

.matrix-insight,
.score-detail-insight,
.insight,
.data-quality {
  border-color: rgba(10,132,255,.11);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(234,244,255,.84), rgba(245,249,255,.64));
}

/* Dialogs use a desktop sheet and become an edge-to-edge sheet on phones. */

.system-modal-overlay,
.score-modal-overlay {
  background: rgba(16, 18, 22, .46);
  backdrop-filter: blur(24px) saturate(130%);
}

.system-modal-dialog,
.score-modal-dialog {
  overflow: hidden;
  border-color: rgba(255,255,255,.92);
  border-radius: 24px;
  background: rgba(252,252,253,.97);
  box-shadow: 0 40px 130px rgba(0,0,0,.31), 0 1px 0 rgba(255,255,255,.8) inset;
}

.system-modal-head,
.score-modal-head {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid rgba(60,60,67,.10);
  background: rgba(248,248,250,.91);
  backdrop-filter: blur(24px) saturate(150%);
}

.system-modal-head h2,
.score-modal-head h2 { font-weight: 750; letter-spacing: -.025em; }

.system-tabs {
  gap: 3px;
  margin: 12px 22px 0;
  padding: 3px;
  border-radius: 11px;
  background: rgba(118,118,128,.11);
}

.system-tab {
  min-height: 30px;
  flex: 1 1 0;
  border-radius: 8px;
  background: transparent;
  font-size: 10px;
}

.system-tab.active {
  color: #1d1d1f;
  background: #fff;
  box-shadow: 0 2px 7px rgba(0,0,0,.10), 0 0 0 .5px rgba(0,0,0,.07);
}

.score-modal-formula {
  border-bottom: 1px solid rgba(60,60,67,.08);
  background: rgba(240,247,255,.78);
}

.score-modal-summary { gap: 9px; }

.score-modal-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(60,60,67,.08);
  border-radius: 14px;
  background: #fff;
}

.score-modal-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: auto;
  bottom: 0;
  left: 0;
  inset: 0 auto 0 0;
  width: 3px;
  background: #0a84ff;
}

.score-modal-card:nth-child(4)::before { background: #20b486; }
.score-modal-card:nth-child(5)::before { background: #ff9f0a; }
.score-modal-card:nth-child(6)::before { background: #ff453a; }

.score-modal-tool,
.system-modal-button,
.score-modal-dismiss { border-radius: 10px; }

.score-modal-close,
.system-modal-close {
  width: 32px;
  height: 32px;
  color: #646469;
  background: #e9e9ed;
}

/* Intermediate desktop and tablet */

@media (max-width: 1380px) {
  .masthead-content { grid-template-columns: minmax(290px, .65fr) minmax(590px, 1.35fr); }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-card,
  .kpi-card:nth-child(-n + 2) { grid-column: auto; min-height: 162px; }
}

@media (max-width: 1120px) {
  .dashboard { width: min(1040px, calc(100% - 24px)); }
  .masthead-content { grid-template-columns: 1fr; gap: 12px; }
  .masthead-side { justify-items: stretch; }
  .software-toolbar,
  .cloud-account-bar { justify-content: flex-start; }
  .filter-panel { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .filter-heading { grid-column: 1 / -1; padding-bottom: 4px; }
  .filter-heading::before { display: none; }
  .field,
  .reset-button { grid-column: span 1; }
  .chart { height: 330px; }
}

@media (max-width: 840px) {
  .dashboard { width: calc(100% - 18px); }
  .masthead { padding: 16px; }
  .software-toolbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .import-status { grid-column: 1 / -1; max-width: none; }
  .filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-heading,
  .filter-chips { grid-column: 1 / -1; }
  .field,
  .reset-button { grid-column: span 1; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-label { grid-template-columns: auto 1fr; }
  .section-label p { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
  .chart-grid { grid-template-columns: 1fr; }
  .panel.span-8,
  .panel.span-4,
  .panel.span-12 { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body { font-size: 13px; }
  .dashboard { width: calc(100% - 12px); padding-top: 6px; }
  .masthead { padding: 14px; border-radius: 18px; }
  .masthead-content { gap: 10px; }
  .masthead-brand .app-symbol { width: 40px; height: 40px; }
  .masthead .title-block h1 { font-size: 25px; }
  .software-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .software-button { padding: 0 8px; }
  .cloud-account-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cloud-pill,
  .cloud-logout { justify-content: center; }

  .filter-panel {
    position: static;
    gap: 8px;
    margin-top: 8px;
    padding: 11px;
    border-radius: 16px;
  }

  .filter-panel select,
  .reset-button { min-height: 42px; height: 42px; }

  .section-label { margin-top: 20px; }
  .kpi-grid { gap: 8px; }
  .kpi-card,
  .kpi-card:nth-child(-n + 2) { min-height: 150px; padding: 13px 12px 11px; border-radius: 16px; }
  .kpi-top { grid-template-columns: 26px minmax(0, 1fr) auto; gap: 6px; }
  .kpi-icon { width: 26px; height: 26px; border-radius: 8px; font-size: 9px; }
  .kpi-value,
  .kpi-value.name-value { font-size: clamp(23px, 7vw, 30px); }
  .kpi-card-foot { grid-template-columns: auto 1fr; gap: 6px; }

  .panel { padding: 14px 10px 12px; border-radius: 17px; }
  .panel-head { margin: 0 2px 10px; padding-bottom: 10px; }
  .chart { height: 300px; border-radius: 12px; }
  .matrix-head-actions { gap: 8px; }

  .work-matrix-wrap { display: none !important; }
  .work-matrix-mobile {
    display: grid !important;
    gap: 11px;
    padding: 0 10px 11px;
    border-top: 0;
  }
  .mobile-shift-group { gap: 8px; }
  .mobile-shift-head {
    margin: 0;
    border-radius: 10px;
    background: linear-gradient(90deg, #edf5ff, #f8fbff);
  }
  .mobile-shift-head.shift-night { background: linear-gradient(90deg, #f1edff, #faf8ff); }
  .mobile-person-card {
    position: relative;
    border-color: rgba(60,60,67,.10);
    border-radius: 14px;
    box-shadow: 0 7px 20px rgba(35,54,82,.065);
  }
  .mobile-person-card::before {
    content: "";
    position: absolute;
    z-index: 3;
    top: 0;
    right: auto;
    bottom: 0;
    left: 0;
    inset: 0 auto 0 0;
    width: 3px;
    background: #0a84ff;
  }
  .mobile-matrix-person { background: linear-gradient(135deg, #fff, #f7faff); }
  .mobile-hour-grid { background: #f7f7f9; }
  .mobile-hour-detail {
    min-height: 108px;
    border-color: rgba(60,60,67,.10);
    border-radius: 11px;
    background: #fff;
  }
  .mobile-hour-detail.status-leading { background: #eefaf6; }
  .mobile-hour-detail.status-below { background: #fff8ee; }
  .mobile-hour-detail.status-low { background: #fff0ed; }

  .score-detail-table tbody tr,
  .score-modal-table tbody tr,
  .score-appeal-table tbody tr {
    border-color: rgba(60,60,67,.11);
    border-radius: 13px;
    box-shadow: 0 6px 18px rgba(35,54,82,.055);
  }

  .score-detail-table tbody td.score-rank { background: #f3f4f7; }
  .score-detail-table tbody td.score-final { background: #eff6ff; }

  .system-modal-overlay,
  .score-modal-overlay { padding: 0; }
  .system-modal-dialog,
  .score-modal-dialog {
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .system-tabs { margin-right: 10px; margin-left: 10px; }
  .score-modal-summary { gap: 7px; }
  .score-modal-card { border-radius: 12px; }
}

@media (max-width: 390px) {
  .masthead-subtitle { display: none; }
  .filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-label { font-size: 9px; }
  .kpi-order { display: none; }
  .kpi-top { grid-template-columns: 26px minmax(0, 1fr); }
  .kpi-sub { font-size: 8px; }
  .compare-row .compare:nth-child(n + 2) { display: none; }
  .panel-title h3 { font-size: 14px; }
  .chart { height: 280px; }
}

@media (max-width: 340px) {
  .filter-panel,
  .kpi-grid { grid-template-columns: 1fr; }
  .score-modal-summary { grid-template-columns: 1fr; }
  .filter-heading,
  .field,
  .reset-button,
  .filter-chips { grid-column: 1; }
}

@media (max-height: 620px) and (orientation: landscape) {
  .masthead { padding-top: 12px; padding-bottom: 12px; }
  .masthead-subtitle { display: none; }
  .filter-panel { position: static; }
  .chart { height: 270px; }
}

/* Sitewide layered motion v2.8.8 */

:root {
  --motion-duration-fast: 200ms;
  --motion-duration-base: 620ms;
  --motion-duration-slow: 1200ms;
  --motion-stagger-step: 70ms;
  --motion-distance: 56px;
  --motion-ease-out: cubic-bezier(.22, 1, .36, 1);
}

@keyframes motion-top-in {
  from { opacity: 0; transform: translate3d(0, calc(var(--motion-distance) * -.75), 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes motion-bottom-in {
  from { opacity: 0; transform: translate3d(0, var(--motion-distance), 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes motion-scale-in {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.97); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes motion-refresh {
  from { opacity: .48; transform: translate3d(0, 7px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes motion-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes motion-layer-drift {
  from { transform: translate3d(-10px, 8px, 0) rotate(-2deg); }
  to { transform: translate3d(12px, -10px, 0) rotate(2deg); }
}

@keyframes motion-signal-in {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes motion-preview-bar-in {
  from { opacity: .2; transform: scaleY(.18); }
  to { opacity: 1; transform: scaleY(1); }
}

html.motion-ready body.auth-pending .auth-shell {
  animation: none;
}

html.motion-ready body.auth-pending .auth-brand {
  animation: motion-top-in 620ms var(--motion-ease-out) 0ms both;
}

html.motion-ready body.auth-pending .auth-kicker {
  animation: motion-bottom-in 560ms var(--motion-ease-out) 70ms both;
}

html.motion-ready body.auth-pending .auth-hero-copy h1 {
  animation: motion-bottom-in 680ms var(--motion-ease-out) 100ms both;
}

html.motion-ready body.auth-pending .auth-hero-copy > p:last-child {
  animation: motion-bottom-in 680ms var(--motion-ease-out) 180ms both;
}

html.motion-ready body.auth-pending .auth-preview {
  animation: motion-bottom-in 760ms var(--motion-ease-out) 260ms both;
}

html.motion-ready body.auth-pending .auth-hero-foot {
  animation: motion-bottom-in 620ms var(--motion-ease-out) 340ms both;
}

html.motion-ready body.auth-pending .auth-card {
  animation: motion-scale-in 680ms var(--motion-ease-out) 180ms both;
}

html.motion-ready body.auth-pending .auth-card-kicker {
  animation: motion-bottom-in 520ms var(--motion-ease-out) 240ms both;
}

html.motion-ready body.auth-pending .auth-card > h1 {
  animation: motion-bottom-in 560ms var(--motion-ease-out) 290ms both;
}

html.motion-ready body.auth-pending .auth-card-subtitle {
  animation: motion-bottom-in 560ms var(--motion-ease-out) 330ms both;
}

html.motion-ready body.auth-pending .auth-fields > :nth-child(1) { --motion-delay: 360ms; }
html.motion-ready body.auth-pending .auth-fields > :nth-child(2) { --motion-delay: 420ms; }
html.motion-ready body.auth-pending .auth-fields > :nth-child(3) { --motion-delay: 480ms; }

html.motion-ready body.auth-pending .auth-fields > * {
  animation: motion-bottom-in 560ms var(--motion-ease-out) var(--motion-delay, 360ms) both;
}

html.motion-ready body.auth-pending .auth-actions {
  animation: motion-bottom-in 560ms var(--motion-ease-out) 540ms both;
}

html.motion-ready body.auth-pending .auth-message,
html.motion-ready body.auth-pending .auth-note {
  animation: motion-bottom-in 520ms var(--motion-ease-out) 620ms both;
}

html.motion-ready body.auth-pending .auth-hero::before {
  animation: motion-layer-drift 14s ease-in-out 900ms infinite alternate;
}

html.motion-ready body.auth-pending .auth-hero::after {
  animation: motion-layer-drift 18s ease-in-out 1200ms infinite alternate-reverse;
}

html.motion-ready body.auth-pending .auth-preview-grid i,
html.motion-ready body.auth-pending .auth-preview-grid b {
  transform-origin: center bottom;
  animation: motion-preview-bar-in 720ms var(--motion-ease-out) both;
}

html.motion-ready body.auth-pending .auth-preview-grid i:nth-child(1) { animation-delay: 420ms; }
html.motion-ready body.auth-pending .auth-preview-grid i:nth-child(2) { animation-delay: 490ms; }
html.motion-ready body.auth-pending .auth-preview-grid i:nth-child(3) { animation-delay: 560ms; }
html.motion-ready body.auth-pending .auth-preview-grid b:nth-of-type(1) { animation-delay: 600ms; }
html.motion-ready body.auth-pending .auth-preview-grid b:nth-of-type(2) { animation-delay: 650ms; }
html.motion-ready body.auth-pending .auth-preview-grid b:nth-of-type(3) { animation-delay: 700ms; }
html.motion-ready body.auth-pending .auth-preview-grid b:nth-of-type(4) { animation-delay: 750ms; }
html.motion-ready body.auth-pending .auth-preview-grid b:nth-of-type(5) { animation-delay: 800ms; }
html.motion-ready body.auth-pending .auth-preview-grid b:nth-of-type(6) { animation-delay: 850ms; }

html.motion-ready body:not(.auth-pending) [data-motion="top"] {
  animation: motion-top-in var(--motion-duration-base) var(--motion-ease-out) both;
}

html.motion-ready body:not(.auth-pending) .masthead { animation-delay: 0ms; }
html.motion-ready body:not(.auth-pending) .filter-panel { animation-delay: 100ms; }

html.motion-ready body:not(.auth-pending) [data-motion="fade"] {
  animation: motion-refresh 480ms var(--motion-ease-out) 180ms both;
}

html.motion-ready [data-motion="scroll"] {
  opacity: 0;
  transform: translate3d(0, var(--motion-distance), 0);
}

html.motion-ready [data-motion="scroll"].is-revealed {
  animation: motion-bottom-in var(--motion-duration-base) var(--motion-ease-out) both;
}

html.motion-ready body:not(.auth-pending) .dashboard [data-motion-group] > .is-revealed,
html.motion-ready .system-modal-overlay.is-opening [data-motion-group] > .is-revealed,
html.motion-ready .score-modal-overlay.is-opening [data-motion-group] > .is-revealed {
  animation: motion-bottom-in var(--motion-duration-base) var(--motion-ease-out) var(--motion-delay, 0ms) both;
}

html.motion-ready .is-updating {
  animation: motion-refresh 420ms var(--motion-ease-out) both;
}

html.motion-ready .system-modal-overlay.is-opening,
html.motion-ready .score-modal-overlay.is-opening {
  animation: motion-overlay-in var(--motion-duration-fast) ease-out both;
}

html.motion-ready .system-modal-overlay.is-opening .system-modal-dialog,
html.motion-ready .score-modal-overlay.is-opening .score-modal-dialog {
  animation: motion-scale-in 520ms var(--motion-ease-out) both;
}

html.motion-ready body:not(.auth-pending) .panel.is-revealed .chart {
  animation: motion-refresh 720ms var(--motion-ease-out) 180ms both;
}

html.motion-ready body:not(.auth-pending) .kpi-card.is-revealed .kpi-signal i {
  transform-origin: left center;
  animation: motion-signal-in var(--motion-duration-slow) var(--motion-ease-out) var(--motion-delay, 0ms) both;
}

html.motion-ready body:not(.auth-pending) .masthead::after {
  animation: motion-layer-drift 16s ease-in-out var(--motion-duration-slow) infinite alternate;
}

body.motion-fullscreen-active .matrix-snapshot-mode,
body.motion-fullscreen-active .score-table-fullscreen-mode,
body.motion-fullscreen-active .score-modal-dialog {
  animation: motion-refresh 420ms var(--motion-ease-out) both;
}

@media (max-width: 760px) {
  :root {
    --motion-distance: 30px;
    --motion-duration-base: 500ms;
    --motion-duration-slow: 800ms;
  }
}

/* Independent profile settings page */

.profile-page {
  margin: 0;
}

.profile-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 250, 252, .86);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
}

.profile-topbar-inner {
  width: min(1120px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.profile-return,
.profile-logout,
.profile-file-button,
.profile-primary-button,
.profile-secondary-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, .82);
  text-decoration: none;
  cursor: pointer;
}

.profile-return {
  width: max-content;
  padding: 0 14px 0 11px;
}

.profile-return svg,
.profile-logout svg {
  width: 20px;
  height: 20px;
}

.profile-product {
  display: flex;
  align-items: center;
  gap: 11px;
}

.profile-product-symbol {
  width: 38px;
  height: 38px;
  padding: 7px;
  border-radius: 11px;
}

.profile-product span:last-child {
  display: grid;
  text-align: left;
}

.profile-product strong {
  font-size: 14px;
  letter-spacing: -.01em;
}

.profile-product small {
  color: var(--muted);
  font-size: 11px;
}

.profile-logout {
  justify-self: end;
  padding: 0 14px;
}

.profile-settings-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 32px auto 64px;
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  align-items: start;
  gap: 28px;
}

.profile-settings-nav {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 6px;
}

.profile-settings-nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 11px;
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
}

.profile-settings-nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, .62);
}

.profile-settings-nav a[aria-current="page"] {
  color: #0058b0;
  background: var(--blue-soft);
}

.profile-settings-content {
  min-width: 0;
  display: grid;
  gap: 22px;
}

.profile-settings-section {
  min-width: 0;
  padding: clamp(22px, 4vw, 40px);
  scroll-margin-top: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
}

.profile-section-heading {
  max-width: 660px;
  margin-bottom: 26px;
}

.profile-section-heading p {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .14em;
}

.profile-section-heading h1,
.profile-section-heading h2 {
  margin: 0;
  font-size: clamp(25px, 4vw, 34px);
  line-height: 1.12;
  letter-spacing: -.035em;
}

.profile-section-heading span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.profile-form {
  display: grid;
  gap: 20px;
}

.profile-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 650;
}

.profile-field input:not([type="range"]) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
}

.profile-field input[aria-invalid="true"] {
  border-color: rgba(255, 59, 48, .7);
}

.profile-field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 450;
}

.profile-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-readonly {
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}

.profile-readonly span {
  color: var(--muted);
  font-size: 12px;
}

.profile-readonly output {
  overflow-wrap: anywhere;
  font-weight: 650;
}

.profile-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 4px;
}

.profile-status {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.profile-status[data-kind="success"] { color: #087a65; }
.profile-status[data-kind="error"] { color: #b42318; }
.profile-status[data-kind="pending"] { color: #7a4a04; }

.profile-primary-button,
.profile-file-button,
.profile-secondary-button {
  flex: 0 0 auto;
  padding: 0 18px;
  min-height: 44px;
  border-radius: 12px;
  font-weight: 700;
}

.profile-primary-button,
.profile-file-button {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.profile-secondary-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: #fff;
}

.profile-primary-button:disabled,
.profile-secondary-button:disabled,
.profile-file-button[aria-disabled="true"] {
  border-color: var(--line);
  color: #8e8e93;
  background: #ececef;
  cursor: not-allowed;
}

.profile-file-button[aria-disabled="true"] { pointer-events: none; }

.profile-avatar-workspace {
  max-width: 520px;
  display: grid;
  gap: 16px;
}

#avatarFileInput {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#avatarCropCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #f0f1f3;
  cursor: grab;
  touch-action: none;
}

#avatarCropCanvas:active { cursor: grabbing; }

.profile-avatar-crop-mask {
  width: min(100%, 320px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(0, 113, 227, .08);
}

.profile-avatar-current {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--blue);
  background: #f2f7ff;
}

.profile-avatar-current img,
.profile-avatar-current svg {
  width: 100%;
  height: 100%;
}

.profile-avatar-current img { object-fit: cover; }
.profile-avatar-current svg { padding: 18px; }

.profile-avatar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#avatarZoom {
  width: min(100%, 360px);
  min-height: 44px;
}

@media (max-width: 760px) {
  .profile-topbar-inner,
  .profile-settings-shell {
    width: min(100% - 24px, 1120px);
  }

  .profile-topbar-inner {
    min-height: 64px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .profile-return,
  .profile-logout {
    width: 44px;
    padding: 0;
  }

  .profile-return span,
  .profile-logout span,
  .profile-product-symbol {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .profile-product {
    justify-content: center;
  }

  .profile-product span:last-child {
    text-align: center;
  }

  .profile-settings-shell {
    margin-top: 16px;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .profile-settings-nav {
    position: sticky;
    z-index: 10;
    top: 65px;
    margin: 0 -12px;
    padding: 4px 12px 8px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    background: rgba(245, 245, 247, .94);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .profile-settings-nav::-webkit-scrollbar { display: none; }

  .profile-settings-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .profile-settings-section {
    padding: 22px 18px;
    scroll-margin-top: 126px;
    border-radius: 20px;
  }

  .profile-readonly-grid,
  .profile-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-primary-button {
    width: 100%;
  }

  .profile-avatar-crop-mask {
    width: min(78vw, 320px);
    justify-self: center;
  }

  .profile-avatar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-secondary-button,
  .profile-avatar-actions .profile-primary-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-settings-nav a,
  .profile-return,
  .profile-logout,
  .profile-primary-button,
  .profile-secondary-button {
    transition-duration: .01ms !important;
  }
}

@media (prefers-contrast: more) {
  .profile-settings-section,
  .profile-readonly,
  .profile-field input:not([type="range"]),
  .profile-return,
  .profile-logout {
    border-color: currentColor;
  }

  .profile-settings-nav a[aria-current="page"] {
    outline: 2px solid currentColor;
    outline-offset: -2px;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  :root {
    --motion-distance: 22px;
    --motion-duration-base: 420ms;
  }
}

@media print, (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }

  html.motion-ready [data-motion="scroll"],
  html.motion-ready [data-motion-group] > *,
  html.motion-ready .auth-brand,
  html.motion-ready .auth-hero-copy > *,
  html.motion-ready .auth-preview,
  html.motion-ready .auth-hero-foot,
  html.motion-ready .auth-card,
  html.motion-ready .auth-card > * {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Apple sidebar navigation v2.8.14 */
:root {
  --sidebar-rail-width: 64px;
  --sidebar-detail-width: 320px;
  --sidebar-row-height: 40px;
  --sidebar-transition: 500ms cubic-bezier(.25, 1.1, .4, 1);
}

body.sidebar-drawer-open {
  overflow: hidden;
}

body.auth-pending .app-shell,
body.auth-pending .mobile-app-bar,
body.auth-pending .sidebar-backdrop {
  display: none !important;
}

.mobile-app-bar,
.sidebar-backdrop {
  display: none;
}

.app-shell {
  display: grid;
  grid-template-columns: calc(var(--sidebar-rail-width) + var(--sidebar-detail-width)) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  transition: grid-template-columns var(--sidebar-transition);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-rail-width) minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  z-index: 80;
  top: 0;
  display: flex;
  align-self: start;
  width: calc(var(--sidebar-rail-width) + var(--sidebar-detail-width));
  height: 100vh;
  height: 100dvh;
  border-right: 1px solid var(--line);
  box-shadow: 18px 0 48px rgba(0, 0, 0, .045);
  transition: width var(--sidebar-transition), transform var(--sidebar-transition), box-shadow 240ms ease;
}

.app-shell.sidebar-collapsed .app-sidebar {
  width: var(--sidebar-rail-width);
}

.sidebar-rail {
  position: relative;
  z-index: 2;
  display: flex;
  width: var(--sidebar-rail-width);
  flex: 0 0 var(--sidebar-rail-width);
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 16px 12px max(16px, env(safe-area-inset-bottom));
  border-right: 1px solid var(--line);
  background: rgba(237, 237, 240, .92);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
}

.sidebar-rail-mark {
  display: grid;
  grid-template-columns: repeat(2, 7px);
  gap: 3px;
  width: 28px;
  height: 28px;
  place-content: center;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 9px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 6px 16px rgba(0, 86, 180, .12);
}

.sidebar-rail-mark i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--blue);
}

.sidebar-rail-mark i:nth-child(2) { background: #64d2ff; }
.sidebar-rail-mark i:nth-child(3) { background: #5ac8fa; }
.sidebar-rail-mark i:nth-child(4) { background: #0a84ff; }

.sidebar-collapse-button,
.sidebar-rail-logout,
.sidebar-mobile-close,
.mobile-sidebar-toggle {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.sidebar-collapse-button svg,
.sidebar-mobile-close svg,
.mobile-sidebar-toggle svg {
  width: 20px;
  height: 20px;
}

.sidebar-collapse-button:hover,
.sidebar-collapse-button:focus-visible,
.sidebar-rail-logout:hover,
.sidebar-rail-logout:focus-visible,
.sidebar-mobile-close:hover,
.sidebar-mobile-close:focus-visible,
.mobile-sidebar-toggle:hover,
.mobile-sidebar-toggle:focus-visible {
  background: rgba(118, 118, 128, .10);
  color: var(--ink);
}

.sidebar-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  margin-top: auto;
  border: 1px solid rgba(0, 113, 227, .14);
  border-radius: 50%;
  background: linear-gradient(145deg, #fff, #eaf4ff);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 7px 18px rgba(0, 90, 190, .10);
}

.sidebar-avatar {
  overflow: hidden;
  text-decoration: none;
}

.sidebar-avatar:focus-visible {
  outline: 3px solid rgba(0, 113, 227, .32);
  outline-offset: 3px;
}

.sidebar-avatar svg,
.sidebar-rail-logout svg {
  width: 20px;
  height: 20px;
}

.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-rail-logout {
  flex: 0 0 40px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .68);
  font-size: 17px;
}

.sidebar-rail-logout:hover,
.sidebar-rail-logout:focus-visible {
  border-color: rgba(255, 59, 48, .18);
  background: rgba(255, 59, 48, .06);
  color: var(--apple-red);
}

.sidebar-detail {
  display: flex;
  width: var(--sidebar-detail-width);
  min-width: 0;
  flex: 0 0 auto;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
  background: rgba(250, 250, 252, .86);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  transition: width var(--sidebar-transition), padding var(--sidebar-transition);
}

.app-shell.sidebar-collapsed .sidebar-detail {
  width: 0;
  padding-right: 0;
  padding-left: 0;
  visibility: hidden;
  pointer-events: none;
}

.sidebar-brand-row {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand-copy {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 1px;
}

.sidebar-brand-copy span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
}

.sidebar-brand-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-brand-row .software-version {
  position: static;
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  margin: 0;
  padding: 0 7px;
  font-size: 9px;
  white-space: nowrap;
}

.sidebar-collapse-button {
  flex: 0 0 40px;
}

.sidebar-mobile-close {
  display: none;
  flex: 0 0 40px;
}

.sidebar-panels {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 0;
  scrollbar-width: thin;
}

.sidebar-panel {
  min-width: 0;
}

.sidebar-panel + .sidebar-panel {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.sidebar-section-title {
  margin: 0 8px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .04em;
}

.sidebar-anchor-list {
  display: grid;
  gap: 7px;
}

.sidebar-anchor {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: var(--sidebar-row-height);
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.sidebar-anchor:hover,
.sidebar-anchor:focus-visible {
  background: rgba(118, 118, 128, .08);
}

.sidebar-anchor:focus-visible {
  outline: 2px solid rgba(0, 113, 227, .55);
  outline-offset: 2px;
}

.sidebar-anchor[aria-current="location"],
.sidebar-anchor.is-active {
  background: var(--blue-soft);
  color: var(--blue);
}

.sidebar-anchor-index {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 7px;
  background: rgba(118, 118, 128, .08);
  color: var(--muted);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.sidebar-anchor[aria-current="location"] .sidebar-anchor-index,
.sidebar-anchor.is-active .sidebar-anchor-index {
  background: rgba(0, 113, 227, .10);
  color: var(--blue);
}

.sidebar-tool-list {
  display: grid;
  gap: 7px;
}

.sidebar-tool {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: var(--sidebar-row-height);
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.sidebar-tool:hover,
.sidebar-tool:focus-visible {
  background: rgba(118, 118, 128, .08);
}

.sidebar-tool.primary {
  background: var(--blue-soft);
  color: var(--blue);
}

.sidebar-tool-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 7px;
  background: rgba(118, 118, 128, .08);
  color: var(--muted);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.sidebar-tool.primary .sidebar-tool-icon {
  background: rgba(0, 113, 227, .10);
  color: var(--blue);
}

.sidebar-tool[hidden] {
  display: none !important;
}

.sidebar-panel .import-status {
  display: block;
  max-width: none;
  margin: 7px 2px 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .66);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
  white-space: normal;
}

.sidebar-panel-note {
  margin: 8px 3px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.sidebar-account {
  display: grid;
  gap: 9px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.sidebar-account-copy {
  display: grid;
  gap: 5px;
}

.sidebar-account .cloud-pill {
  display: block;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account #accountIdentity {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-account #accountRole.admin { color: #8a5300; }
.sidebar-account #cloudStatus.online { color: #147a4b; }

.sidebar-copy {
  opacity: 1;
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-shell.sidebar-collapsed .sidebar-copy {
  width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-5px);
  white-space: nowrap;
}

.app-shell.sidebar-collapsed .sidebar-brand-row {
  justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-collapse-button svg {
  transform: rotate(180deg);
}

.app-shell.sidebar-collapsed .sidebar-tool {
  justify-content: center;
  padding-right: 0;
  padding-left: 0;
}

.app-shell.sidebar-collapsed .sidebar-section-title,
.app-shell.sidebar-collapsed .sidebar-account-copy,
.app-shell.sidebar-collapsed .sidebar-panel-note,
.app-shell.sidebar-collapsed .sidebar-panel .import-status {
  display: none;
}

.app-shell .dashboard {
  width: min(1780px, calc(100% - 32px));
  min-width: 0;
  margin: 0 auto;
  padding-top: 24px;
}

#dashboard-overview,
#dashboard-kpis,
#dashboard-efficiency,
#dashboard-hours,
#dashboard-scores {
  scroll-margin-top: 18px;
}

body.matrix-fallback-fullscreen .app-sidebar,
body.matrix-fallback-fullscreen .mobile-app-bar,
body.score-table-fallback-fullscreen .app-sidebar,
body.score-table-fallback-fullscreen .mobile-app-bar {
  display: none !important;
}

@media (max-width: 760px) {
  .mobile-app-bar {
    position: sticky;
    z-index: 70;
    top: 0;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 16px;
    min-height: 58px;
    align-items: center;
    gap: 10px;
    padding: max(7px, env(safe-area-inset-top)) 14px 7px;
    border-bottom: 1px solid var(--line);
    background: rgba(250, 250, 252, .88);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    backdrop-filter: blur(22px) saturate(150%);
  }

  .mobile-app-bar strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-sidebar-toggle {
    width: 40px;
    height: 40px;
  }

  .mobile-cloud-status-indicator {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 0 0 5px rgba(255, 159, 10, .10);
  }

  .mobile-cloud-status-indicator[data-state="online"] {
    background: var(--teal);
    box-shadow: 0 0 0 5px rgba(34, 160, 107, .10);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 88;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    border: 0;
    background: rgba(29, 29, 31, .20);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }

  .app-shell,
  .app-shell.sidebar-collapsed {
    display: block;
    min-height: 0;
  }

  .app-sidebar,
  .app-shell.sidebar-collapsed .app-sidebar {
    position: fixed;
    z-index: 90;
    top: 0;
    bottom: auto;
    left: 0;
    width: min(92vw, 384px);
    height: 100vh;
    height: 100dvh;
    max-width: 100%;
    border-right: 1px solid var(--line-strong);
    box-shadow: 24px 0 64px rgba(0, 0, 0, .14);
    transform: translateX(-105%);
  }

  .app-sidebar.mobile-open,
  .app-shell.sidebar-collapsed .app-sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-detail,
  .app-shell.sidebar-collapsed .sidebar-detail {
    width: auto;
    flex: 1 1 auto;
    padding: 16px;
    visibility: visible;
    pointer-events: auto;
  }

  .app-shell.sidebar-collapsed .sidebar-copy {
    width: auto;
    overflow: visible;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .app-shell.sidebar-collapsed .sidebar-section-title,
  .app-shell.sidebar-collapsed .sidebar-account-copy,
  .app-shell.sidebar-collapsed .sidebar-panel-note,
  .app-shell.sidebar-collapsed .sidebar-panel .import-status {
    display: block;
  }

  .app-shell.sidebar-collapsed .sidebar-tool {
    justify-content: flex-start;
    padding-right: 11px;
    padding-left: 11px;
  }

  .sidebar-collapse-button {
    display: none;
  }

  .sidebar-mobile-close {
    display: grid;
  }

  .app-shell .dashboard {
    width: calc(100% - 24px);
    margin: 0 auto;
    padding-top: 12px;
  }

  #dashboard-overview,
  #dashboard-kpis,
  #dashboard-efficiency,
  #dashboard-hours,
  #dashboard-scores {
    scroll-margin-top: 72px;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .sidebar-rail,
  .sidebar-detail {
    overflow-y: auto;
  }

  .sidebar-rail {
    gap: 10px;
  }

  .sidebar-panels {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

@media print {
  .app-sidebar,
  .mobile-app-bar,
  .sidebar-backdrop {
    display: none !important;
  }

  .app-shell,
  .app-shell.sidebar-collapsed {
    display: block;
    min-height: 0;
  }

  .app-shell .dashboard {
    width: 100%;
    margin: 0;
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .app-shell,
  .app-sidebar,
  .sidebar-detail,
  .sidebar-copy,
  .sidebar-tool {
    transition-duration: .01ms !important;
  }
}
