:root {
  color-scheme: light;
  --app-background: #f2f1ec;
  --sidebar-background: #17201e;
  --surface: #fbfaf6;
  --surface-secondary: #f0efe9;
  --surface-elevated: #ffffff;
  --surface-hover: #e9ede8;
  --text-primary: #17201e;
  --text-secondary: #53605c;
  --text-muted: #626d69;
  --border: #c9cec8;
  --border-subtle: #dde0db;
  --accent: #236a70;
  --accent-hover: #19565b;
  --accent-soft: #dcebea;
  --success: #34735b;
  --success-soft: #dcece3;
  --warning: #9a681d;
  --warning-soft: #f5e9d3;
  --danger: #a34d43;
  --danger-soft: #f5e2de;
  --info: #365f8d;
  --info-soft: #e0e9f3;
  --radius-small: 4px;
  --radius-medium: 8px;
  --radius-large: 14px;
  --shadow-small: 0 1px 2px rgb(23 32 30 / 7%), 0 4px 12px rgb(23 32 30 / 4%);
  --shadow-medium: 0 18px 50px rgb(15 24 22 / 16%);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --motion-fast: 120ms;
  --motion-ui: 180ms;
  --motion-sheet: 240ms;
  --ease-standard: cubic-bezier(.2, 0, 0, 1);
  --ease-enter: cubic-bezier(0, 0, .2, 1);
  --ease-exit: cubic-bezier(.4, 0, 1, 1);
  --z-nav: 30;
  --z-popover: 50;
  --z-modal: 70;

  /* Legacy variable bridge keeps every existing functional component on-theme. */
  --ink: var(--text-primary);
  --ink-soft: var(--text-secondary);
  --ink-faint: var(--text-muted);
  --paper: var(--surface);
  --mist: var(--surface-secondary);
  --mist-deep: #e4e4dd;
  --rule: var(--border-subtle);
  --rule-strong: var(--border);
  --navy: var(--text-primary);
  --blue: var(--accent);
  --blue-dark: var(--accent-hover);
  --starpark-soft: var(--accent-soft);
  --sage: var(--success);
  --sage-soft: var(--success-soft);
  --coral: var(--danger);
  --coral-soft: var(--danger-soft);
  --amber: var(--warning);
  --amber-soft: var(--warning-soft);
  --radius: var(--radius-medium);
  --shadow: var(--shadow-small);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --app-background: #101513;
  --sidebar-background: #0c1210;
  --surface: #161d1a;
  --surface-secondary: #1c2521;
  --surface-elevated: #202a26;
  --surface-hover: #26312c;
  --text-primary: #edf1ed;
  --text-secondary: #abb6b0;
  --text-muted: #818e88;
  --border: #46514b;
  --border-subtle: #303a35;
  --accent: #7eb9ba;
  --accent-hover: #9acbca;
  --accent-soft: #1d3a39;
  --success: #73b28f;
  --success-soft: #19352a;
  --warning: #d5a75b;
  --warning-soft: #3b2e18;
  --danger: #df8c82;
  --danger-soft: #3d2421;
  --info: #88add0;
  --info-soft: #1d3043;
  --mist-deep: #28322e;
  --shadow-small: 0 1px 2px rgb(0 0 0 / 24%), 0 6px 18px rgb(0 0 0 / 16%);
  --shadow-medium: 0 22px 60px rgb(0 0 0 / 48%);
}

html[data-theme="dark"] .sidebar .company-option[data-company="ai"].is-active {
  color: #f7faf8;
  background: rgb(126 185 186 / 10%);
  border-color: rgb(126 185 186 / 28%);
}
html[data-theme="dark"] body[data-company="ai"] .nav-item.is-active {
  color: #fff;
  background: rgb(255 255 255 / 7%);
}
html[data-theme="dark"] .sidebar .company-option[data-company="ai"].is-active .company-glyph {
  color: #17201e;
  background: #8fc4c3;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  min-width: 320px;
  background: var(--app-background);
  scrollbar-color: var(--border) transparent;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text-primary);
  background: var(--app-background);
  font-family: Aptos, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-block strong, .login-brand strong, .mobile-brand strong {
  font-family: Aptos, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
}

h1, h2, h3, p { text-wrap: pretty; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }

:where(button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon { stroke-width: 1.75; }

/* Access console */
.login-screen {
  min-height: 100dvh;
  overflow: hidden;
  color: var(--text-primary);
  background: var(--surface-secondary);
}

.brand-block {
  gap: 11px;
  letter-spacing: .01em;
}

.brand-mark, .brand-monogram {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: #eef7f4;
  background: var(--accent);
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: var(--radius-small);
  font-family: Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: .78rem;
  font-weight: 760;
  letter-spacing: .08em;
}

.brand-logo {
  display: block;
  width: 42px;
  height: 42px;
  margin: -4px -4px -4px -5px;
  flex: 0 0 auto;
  object-fit: contain;
}

.login-main {
  display: grid;
  width: 100%;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr);
  align-items: stretch;
  gap: 0;
}

.login-theme-toggle {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 3;
  width: 42px;
  height: 42px;
  color: var(--text-secondary);
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-small);
}

.login-theme-toggle:hover {
  color: var(--text-primary);
  background: var(--surface);
}

.login-context {
  position: relative;
  display: grid;
  min-width: 0;
  overflow: hidden;
  align-self: stretch;
  place-items: center;
  background: var(--sidebar-background);
}

.login-context-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.login-form-wrap {
  position: relative;
  width: 100%;
  max-width: 460px;
  min-width: 0;
  padding: 40px;
  align-self: center;
  justify-self: center;
  background: var(--surface-elevated);
  border: 0;
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-medium);
}

.login-form-wrap::before {
  content: none;
}

.login-mode-switch {
  display: grid;
  padding: 3px;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-medium);
}

.login-mode {
  min-width: 0;
  min-height: 38px;
  padding-inline: 8px;
  color: var(--text-secondary);
  border-radius: 5px;
  transition: color var(--motion-fast) var(--ease-standard), background-color var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard);
}

.login-mode.is-active {
  color: var(--text-primary);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-small);
}

.login-heading { margin: 34px 0 24px; }
.login-heading h2 { margin-bottom: 6px; font-size: 2rem; letter-spacing: -.03em; }
.login-heading p, .prototype-warning { color: var(--text-secondary); }

#login-form { min-width: 0; gap: 17px; }
#login-form input, #login-form select { width: 100%; min-width: 0; }
#login-form label, .side-sheet label, .document-review label, .task-detail-aside label {
  color: var(--text-secondary);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .015em;
}

input, select, textarea,
.work-toolbar input, .work-toolbar select, .task-detail-aside select {
  min-height: 42px;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  transition: border-color var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard), background-color var(--motion-fast) var(--ease-standard);
}

input:hover, select:hover, textarea:hover { border-color: var(--text-muted); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

#login-form input, #login-form select { min-height: 48px; }
.login-submit {
  min-height: 48px;
  transition: background-color var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}
.login-submit:active { transform: scale(.98); }

.login-context-image,
.login-form-wrap {
  animation: login-enter var(--motion-sheet) var(--ease-standard) both;
}

.login-context-image { animation-delay: 40ms; }
.login-form-wrap { animation-name: login-form-enter; animation-delay: 120ms; }

@keyframes login-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes login-form-enter {
  from { opacity: 0; transform: translateX(12px) scale(.985); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@media (min-width: 761px) and (max-height: 780px) {
  .login-form-wrap { padding: 32px; }
  .login-heading { margin: 28px 0 20px; }
}

.prototype-warning {
  margin-top: 22px;
  padding: 14px 0 0;
  border-top: 1px solid var(--border-subtle);
  font-size: .72rem;
}

/* Application frame */
.app-shell {
  min-height: 100dvh;
  background: transparent;
}

.sidebar {
  width: 240px;
  padding: 0;
  color: #cbd4cf;
  background: var(--sidebar-background);
  border: 0;
  box-shadow: inset -1px 0 rgb(255 255 255 / 7%);
  transition: transform var(--motion-sheet) var(--ease-standard);
}

.brand-block {
  min-height: 72px;
  padding: 15px 18px;
  color: #f1f5f2;
  border-bottom: 1px solid rgb(255 255 255 / 9%);
}

.brand-block strong { font-size: 1.04rem; font-weight: 670; }
.brand-block small, .sidebar .company-option small, .sidebar .privacy-note, .sidebar .profile-chip small { color: #89968f; }

.company-switcher {
  gap: 3px;
  margin: 0;
  padding: 14px 12px 12px;
  border-bottom: 1px solid rgb(255 255 255 / 9%);
}

.company-option {
  min-height: 48px;
  padding: 8px 9px;
  color: #aeb9b3;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  transition: color var(--motion-fast) var(--ease-standard), background-color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard);
}

.company-option:hover { color: #fff; background: rgb(255 255 255 / 5%); }
.company-option.is-active {
  color: #f7faf8;
  background: rgb(126 185 186 / 10%);
  border-color: rgb(126 185 186 / 28%);
}
.sidebar .company-option[data-company="ai"].is-active {
  color: #f7faf8;
  background: rgb(126 185 186 / 10%);
  border-color: rgb(126 185 186 / 28%);
}

.company-option .company-glyph {
  color: #dbe7e2;
  background: rgb(255 255 255 / 8%);
  border-color: rgb(255 255 255 / 10%);
}

.company-option.is-active .company-glyph { color: #17201e; background: #8fc4c3; }
.sidebar .company-option[data-company="ai"] .company-glyph { color: #dbe7e2; background: rgb(255 255 255 / 8%); }
.sidebar .company-option[data-company="ai"].is-active .company-glyph { color: #17201e; background: #8fc4c3; }
.company-check { color: #9bcac8; }

.primary-nav {
  min-height: 0;
  flex: 1 1 auto;
  align-content: start;
  gap: 2px;
  padding: 14px 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgb(143 196 195 / 35%) transparent;
}

.nav-item {
  position: relative;
  height: 44px;
  min-height: 44px;
  padding: 0 10px;
  color: #aeb9b3;
  background: transparent;
  border-radius: var(--radius-small);
  font-size: .82rem;
  transition: color var(--motion-fast) var(--ease-standard), background-color var(--motion-fast) var(--ease-standard);
}

.nav-item::before {
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: 0;
  width: 2px;
  content: "";
  background: transparent;
  border-radius: 2px;
}

.nav-item:hover { color: #f0f5f1; background: rgb(255 255 255 / 5%); }
.nav-item.is-active { color: #fff; background: rgb(255 255 255 / 7%); }
body[data-company="ai"] .nav-item.is-active { color: #fff; background: rgb(255 255 255 / 7%); }
.nav-item.is-active::before { background: #8fc4c3; }
.nav-item .icon { width: 17px; height: 17px; }
#work-nav-label { min-width: 0; flex: 1 1 auto; text-align: left; }

.starpark-nav-group { display: grid; }
.starpark-nav-group[hidden] { display: none; }
.starpark-nav-trigger { width: 100%; }
.starpark-nav-chevron {
  margin-left: auto;
  transition: transform var(--motion-ui) var(--ease-standard);
}
.starpark-nav-group.is-expanded .starpark-nav-chevron { transform: rotate(90deg); }
.starpark-tool-menu {
  display: grid;
  max-height: 0;
  margin: 0 4px;
  gap: 1px;
  overflow: hidden;
  opacity: 0;
  transition: opacity var(--motion-ui) var(--ease-standard);
}
.starpark-nav-group.is-expanded .starpark-tool-menu {
  max-height: 240px;
  margin-top: 3px;
  margin-bottom: 6px;
  opacity: 1;
}
.starpark-tool-link {
  position: relative;
  display: grid;
  min-height: 44px;
  padding: 7px 9px 7px 30px;
  grid-template-columns: 15px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #91a099;
  background: transparent;
  border: 0;
  border-radius: var(--radius-small);
  font: inherit;
  font-size: .72rem;
  line-height: 1.2;
  text-align: left;
  transition: color var(--motion-fast) var(--ease-standard), background-color var(--motion-fast) var(--ease-standard);
}
.starpark-tool-link::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 18px;
  width: 1px;
  content: "";
  background: rgb(255 255 255 / 12%);
}
.starpark-tool-link .icon { width: 14px; height: 14px; }
.starpark-tool-link:hover { color: #eef5f1; background: rgb(255 255 255 / 5%); }
.starpark-tool-link.is-active { color: #fff; background: rgb(143 196 195 / 11%); }
.starpark-tool-link.is-active::before { background: #8fc4c3; }

.nav-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  color: #17201e;
  background: #8fc4c3;
  border-radius: 999px;
  font-size: .66rem;
}
#work-nav-count, #leave-nav-count { color: #17201e; background: #8fc4c3; }

.sidebar-foot {
  padding: 10px;
  border-top: 1px solid rgb(255 255 255 / 9%);
}

.privacy-note { padding: 5px 8px 12px; }
.profile-chip {
  min-height: 52px;
  padding: 7px 8px;
  color: #eff5f1;
  background: transparent;
  border-radius: var(--radius-small);
}
.profile-chip:hover { background: rgb(255 255 255 / 6%); }
.profile-chip .avatar { color: #17201e; background: #8fc4c3; }
.profile-menu { bottom: 74px; left: 10px; right: 10px; color: var(--text-primary); background: var(--surface-elevated); border: 1px solid var(--border); }

.workspace {
  margin-left: 240px;
  min-width: 0;
}

body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .workspace { margin-left: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  min-height: 64px;
  padding: 0 clamp(20px, 3vw, 42px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px) saturate(125%);
}

.mobile-brand { display: flex; min-width: 145px; flex-direction: column; }
.mobile-brand strong { font-size: 1rem; }
.mobile-brand span { color: var(--text-muted); font-size: .68rem; }

.global-search {
  width: min(460px, 42vw);
  height: 38px;
  background: var(--surface-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-small);
}
.global-search:focus-within { background: var(--surface-elevated); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.global-search input { min-height: 36px; background: transparent; border: 0; box-shadow: none; }

.demo-label {
  padding: 4px 7px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: .62rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.icon-button, .mobile-menu {
  width: 38px;
  height: 38px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  transition: color var(--motion-fast) var(--ease-standard), background-color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard);
}
.icon-button:hover, .mobile-menu:hover { color: var(--text-primary); background: var(--surface-secondary); border-color: var(--border-subtle); }
.sidebar-toggle {
  position: relative;
  display: grid;
  width: 38px;
  padding: 0;
  flex: 0 0 auto;
  place-items: center;
}
.sidebar-toggle .icon { width: 17px; height: 17px; }
.sidebar-toggle #sidebar-toggle-label {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: calc(var(--z-nav) + 1);
  width: max-content;
  padding: 7px 9px;
  color: #f4f8f5;
  background: var(--sidebar-background);
  border-radius: 6px;
  font-size: .69rem;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}
.sidebar-toggle:is(:hover, :focus-visible) #sidebar-toggle-label {
  opacity: 1;
  transform: translateY(0);
}
body.sidebar-collapsed .sidebar-toggle {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}

#main-content {
  width: 100%;
  min-width: 0;
  padding: clamp(28px, 4vw, 52px) clamp(24px, 4vw, 56px) 56px;
}

.view { max-width: 1540px; margin: 0 auto; }
.view.is-active { animation: view-reveal 140ms var(--ease-enter) both; }
@keyframes view-reveal { from { opacity: 0; } }

.page-heading {
  margin: 0 0 28px;
  align-items: flex-end;
  gap: 24px;
}
.page-heading h1 {
  margin: 0;
  font-size: clamp(1.9rem, 2.6vw, 2.75rem);
  font-weight: 620;
  line-height: .98;
  letter-spacing: -.035em;
}
.page-heading p { margin-top: 9px; color: var(--text-secondary); font-size: .86rem; }

.starpark-app-view { max-width: none; }
body.starpark-workspace-active #main-content { height: calc(100dvh - 64px); padding: 0; overflow: hidden; }
body.starpark-workspace-active .starpark-app-view { height: 100%; }
body.starpark-workspace-active .starpark-tool-toolbar { display: none; }
body.starpark-workspace-active .starpark-frame-shell { height: 100%; border: 0; border-radius: 0; }
.starpark-tool-toolbar {
  display: flex;
  min-height: 52px;
  padding: 7px 9px 7px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius-medium) var(--radius-medium) 0 0;
}
.starpark-tool-toolbar > div { display: flex; min-width: 0; align-items: baseline; gap: 10px; }
.starpark-tool-toolbar span { color: var(--text-muted); font-size: .68rem; }
.starpark-tool-toolbar strong { overflow: hidden; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.starpark-tool-toolbar .button { min-height: 34px; }
.starpark-frame-shell {
  min-height: 0;
  height: calc(100% - 52px);
  overflow: hidden;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-medium) var(--radius-medium);
}
.starpark-frame-shell iframe {
  display: block;
  width: 100%;
  height: 100%;
  background: #f7f7f5;
  border: 0;
}

.section-header {
  min-height: 64px;
  padding: 15px 18px;
  background: transparent;
  border-bottom: 1px solid var(--border-subtle);
}
.section-header h2 { font-size: 1.08rem; font-weight: 680; letter-spacing: -.012em; }
.section-header p { color: var(--text-muted); font-size: .7rem; }

.button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-small);
  font-size: .78rem;
  font-weight: 700;
  transition: color var(--motion-fast) var(--ease-standard), background-color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}
.button:active, .icon-button:active, .nav-item:active, .company-option:active, .task-card:active { transform: scale(.98); }
.button.primary { color: #f5fbf9; background: var(--accent); border-color: var(--accent); box-shadow: 0 1px 1px rgb(0 0 0 / 10%); }
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
body[data-company="ai"] .button.primary { background: var(--accent); border-color: var(--accent); }
body[data-company="ai"] .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.secondary, .button.quiet { color: var(--text-primary); background: var(--surface); border-color: var(--border); }
.button.secondary:hover, .button.quiet:hover { background: var(--surface-hover); border-color: var(--text-muted); }
.button.danger { color: var(--danger); background: transparent; border-color: color-mix(in srgb, var(--danger) 48%, var(--border)); }
.button.danger:hover { color: var(--danger); background: var(--danger-soft); border-color: var(--danger); }
.text-button { color: var(--accent); font-weight: 680; }
.text-button:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

.page-heading-actions { display: flex; align-items: center; gap: 8px; }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); align-items: start; gap: 20px; }
.profile-security { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-medium); }
.profile-security form { display: grid; padding: 18px; gap: 14px; }
.profile-security .password-input input { width: 100%; padding-right: 48px; }
.profile-security .form-actions { margin-top: 2px; padding-top: 14px; }
.temporary-password-notice {
  display: grid;
  margin: 16px 18px 0;
  padding: 12px;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--warning);
  background: var(--warning-soft);
  border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border));
  border-radius: var(--radius-small);
}
.temporary-password-notice[hidden] { display: none; }
.temporary-password-notice .icon { width: 18px; height: 18px; margin-top: 1px; }
.temporary-password-notice strong { color: var(--text-primary); font-size: .8rem; }
.temporary-password-notice p { margin: 3px 0 0; color: var(--text-secondary); font-size: .72rem; }
.account-setup-summary code { color: var(--text-primary); font-family: Aptos, "Segoe UI", system-ui, sans-serif; font-size: .92rem; font-weight: 760; letter-spacing: .08em; }
.account-setup-summary > p { margin: 12px 0 0; color: var(--text-secondary); font-size: .75rem; line-height: 1.45; }

/* Overview: a briefing ledger, not a card dashboard. */
#view-overview.is-active {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(300px, .78fr);
  align-items: start;
  gap: 22px 26px;
}
#view-overview .page-heading, #view-overview .attention-ledger { grid-column: 1 / -1; }
#view-overview .command-grid { grid-column: 1; }
#view-overview .activity-section { grid-column: 2; }

.attention-ledger {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(160px, 1fr));
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  box-shadow: none;
}
.attention-ledger > h2 {
  display: flex;
  min-height: 112px;
  margin: 0;
  padding: 20px;
  align-items: flex-end;
  font-size: 1.22rem;
  font-weight: 650;
  background: var(--text-primary);
  color: var(--surface);
}
.attention-cell {
  min-height: 112px;
  padding: 18px;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border-subtle);
  border-radius: 0;
  text-align: left;
  transition: background-color var(--motion-fast) var(--ease-standard);
}
.attention-cell:hover { background: var(--surface-hover); }
.attention-cell strong { color: var(--text-primary); font-family: Aptos, "Segoe UI", system-ui, sans-serif; font-size: 2rem; font-variant-numeric: tabular-nums; }
.attention-cell small { color: var(--text-muted); }

.command-grid { background: transparent; border: 0; }
.review-panel, .activity-section, .people-table-wrap, .calendar-panel, .leave-balance-panel, .request-history, .scan-zone-section, .document-review, .saved-documents, .profile-record {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  box-shadow: none;
}

.review-list { display: block; }
.review-item {
  padding: 16px 18px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
}
.review-item:last-child { border-bottom: 0; }
.review-item:hover { background: var(--surface-hover); }
.review-actions .button { min-height: 34px; }
.status-stamp, .count-stamp { border-radius: 999px; letter-spacing: .045em; }

.activity-list { max-height: 528px; overflow: auto; }
.activity-row {
  display: grid;
  padding: 15px 17px;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 3px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.activity-row:last-child { border-bottom: 0; }
.activity-row span:first-child { grid-row: 1 / span 2; color: var(--text-muted); font-family: Aptos, "Segoe UI", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.activity-row span:nth-child(3) { grid-column: 2; color: var(--text-muted); font-size: .72rem; }
.activity-row span:last-child { display: none; }

/* Directory and records */
.directory-toolbar {
  min-height: 54px;
  padding: 8px;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius-medium) var(--radius-medium) 0 0;
}
.inline-search { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-small); }
.inline-search input { border: 0; box-shadow: none; }
.directory-filter { display: flex; min-width: 172px; align-items: center; gap: 7px; padding-left: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-small); }
.directory-filter .icon { flex: 0 0 auto; }
.directory-filter select { width: 100%; border: 0; box-shadow: none; }
.bulk-select-all { display: inline-flex; min-height: 38px; padding: 0 10px; align-items: center; gap: 7px; color: var(--text-secondary); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-small); font-size: .75rem; font-weight: 680; white-space: nowrap; }
.bulk-select-all input, .people-select-cell input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.directory-count { color: var(--text-muted); font-family: Aptos, "Segoe UI", system-ui, sans-serif; letter-spacing: .01em; }
.bulk-leave-trigger { margin-left: auto; }
.people-table-wrap { border-radius: 0 0 var(--radius-medium) var(--radius-medium); }
.people-select-heading, .people-select-cell { width: 48px; text-align: center; }
.people-select-cell span { color: var(--text-muted); }
.people-table th {
  height: 40px;
  padding: 0 16px;
  color: var(--text-muted);
  background: var(--surface-secondary);
  border-bottom: 1px solid var(--border);
  font-family: Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: .68rem;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.people-table td { padding: 14px 16px; background: transparent; border-bottom: 1px solid var(--border-subtle); }
.people-table tbody tr { transition: background-color var(--motion-fast) var(--ease-standard); }
.people-table tbody tr:hover { background: var(--surface-hover); }
.person-cell strong { font-weight: 670; }
.bulk-leave-selected { display: flex; padding-bottom: 16px; flex-wrap: wrap; gap: 7px; border-bottom: 1px solid var(--border-subtle); }
.bulk-leave-selected > span { width: 100%; color: var(--text-muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.bulk-leave-selected > strong { padding: 6px 9px; color: var(--text-secondary); background: var(--surface-secondary); border-radius: 999px; font-size: .72rem; font-weight: 650; }
.bulk-leave-operation { min-width: 0; margin: 0; padding: 0; border: 0; }
.bulk-leave-operation legend { margin-bottom: 8px; color: var(--text-secondary); font-size: .76rem; font-weight: 700; }
.bulk-leave-operation > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bulk-leave-operation label { display: grid; min-width: 0; min-height: 76px; padding: 12px; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 9px; color: var(--text-primary); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-small); cursor: pointer; }
.bulk-leave-operation label:has(input:checked) { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 52%, var(--border)); }
.bulk-leave-operation input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }
.bulk-leave-operation span, .bulk-leave-operation strong, .bulk-leave-operation small { display: block; min-width: 0; }
.bulk-leave-operation small { margin-top: 4px; color: var(--text-muted); font-size: .7rem; font-weight: 500; line-height: 1.4; }
.field-optional { color: var(--text-muted); font-weight: 500; }
.bulk-leave-preview { border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.bulk-leave-preview > p { margin: 0; padding: 14px 0; color: var(--text-muted); }
.bulk-leave-preview-row { display: grid; min-width: 0; padding: 11px 0; grid-template-columns: minmax(0, 1fr) auto 18px auto; align-items: center; gap: 9px; border-bottom: 1px solid var(--border-subtle); font-variant-numeric: tabular-nums; }
.bulk-leave-preview-row:last-child { border-bottom: 0; }
.bulk-leave-preview-row > span:first-child, .bulk-leave-preview-row > span:first-child strong, .bulk-leave-preview-row > span:first-child small { display: block; min-width: 0; }
.bulk-leave-preview-row > span:first-child strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-leave-preview-row > span:first-child small { margin-top: 2px; color: var(--text-muted); font-size: .68rem; }
.bulk-leave-preview-row > span:nth-child(2) { color: var(--text-secondary); }
.bulk-leave-preview-row > .icon { width: 16px; height: 16px; color: var(--text-muted); }
.bulk-leave-preview-row.is-invalid > strong { color: var(--danger); }
.bulk-leave-warning { margin: 0; }

/* Leave and documents */
.leave-layout { grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 22px; }
.leave-balance-list { display: grid; }
.leave-balance-row {
  min-height: 82px;
  padding: 14px 18px;
  background: transparent;
  border-top: 1px solid var(--border-subtle);
}
.leave-balance-row:first-child { border-top: 0; }
.leave-balance-row > strong { font-family: Aptos, "Segoe UI", system-ui, sans-serif; font-size: 2rem; font-weight: 650; }
.leave-balance-icon { color: var(--accent); background: var(--accent-soft); border-radius: var(--radius-small); }
.leave-balance-row.medical .leave-balance-icon { color: var(--success); background: var(--success-soft); }
.history-item, .document-row { padding: 16px 18px; background: transparent; border-bottom: 1px solid var(--border-subtle); }
.history-item:last-child, .document-row:last-child { border-bottom: 0; }
.history-item:hover, .document-row:hover { background: var(--surface-hover); }

.documents-layout { gap: 22px; }
.upload-zone, .task-upload-zone {
  color: var(--text-secondary);
  background: var(--surface-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius-medium);
  transition: color var(--motion-ui) var(--ease-standard), background-color var(--motion-ui) var(--ease-standard), border-color var(--motion-ui) var(--ease-standard);
}
.upload-zone:hover, .upload-zone.is-dragging, .task-upload-zone:hover, .task-upload-zone.is-dragging {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}
.document-review form { padding: 18px; }
.scan-zone-section { padding: 20px; }
.scan-zone-section > p { color: var(--text-secondary); }
.upload-zone { color: var(--accent); }
.receipt-upload-zone {
  min-height: 82px;
  color: var(--text-secondary);
  background: var(--surface-secondary);
  border-color: var(--border);
  border-radius: var(--radius-medium);
}
.receipt-upload-zone strong { color: var(--text-primary); }
.receipt-upload-zone small, .upload-zone span { color: var(--text-muted); }
.upload-steps span { color: var(--text-muted); }
.upload-steps .is-active { color: var(--accent); border-color: var(--accent); }

/* Full calendar: dense, legible, one viewport. */
#view-calendar.is-active { display: flex; height: calc(100dvh - 122px); flex-direction: column; }
#view-calendar .page-heading { flex: 0 0 auto; margin-bottom: 18px; }
#view-calendar .calendar-panel { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.calendar-header { min-height: 68px; padding: 12px 16px; background: var(--surface); }
.calendar-header h2 { font-size: 1.16rem; }
.calendar-weekdays { background: var(--surface-secondary); border-block: 1px solid var(--border-subtle); }
.calendar-weekdays span { padding: 8px 5px; color: var(--text-muted); font-family: Aptos, "Segoe UI", system-ui, sans-serif; font-size: .66rem; letter-spacing: .045em; }
#view-calendar .calendar-grid-large { min-height: 0; flex: 1; grid-template-rows: repeat(6, minmax(46px, 1fr)); }
.calendar-day { min-width: 0; padding: 7px; background: var(--surface); border-color: var(--border-subtle); }
.calendar-day.is-outside { color: var(--text-muted); background: var(--surface-secondary); }
.calendar-day.is-today > span:first-child { color: var(--surface); background: var(--text-primary); }
.calendar-event {
  min-height: 20px;
  padding: 3px 5px;
  border: 0;
  border-left: 3px solid currentColor;
  border-radius: 2px;
  font-size: .65rem;
}
.calendar-event.annual { color: var(--info); background: var(--info-soft); }
.calendar-event.medical { color: var(--success); background: var(--success-soft); }
.calendar-event.unpaid { color: var(--warning); background: var(--warning-soft); }
.calendar-legend { min-height: 34px; padding: 8px 14px; color: var(--text-muted); background: var(--surface-secondary); border-top: 1px solid var(--border-subtle); }

/* Work registry */
.work-toolbar {
  display: grid;
  margin-bottom: 18px;
  padding: 10px;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, auto) auto;
  align-items: center;
  gap: 8px;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
}
.work-toolbar > span { margin-left: 0; color: var(--text-muted); font-family: Aptos, "Segoe UI", system-ui, sans-serif; font-size: .76rem; text-align: right; }
.work-toolbar input, .work-toolbar select { width: 100%; min-width: 0; background: var(--surface); border-color: var(--border); }
.work-status-tabs, .mobile-tabbar { display: none; }
.work-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  align-items: stretch;
  gap: 1px;
  overflow-x: auto;
  padding: 0;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
}
.work-column, .work-column.status-todo, .work-column.status-incoming, .work-column.status-progress, .work-column.status-done {
  min-width: 230px;
  min-height: min(620px, calc(100dvh - 270px));
  background: var(--surface-secondary);
  border: 0;
  border-radius: 0;
}
.work-column-head {
  position: relative;
  top: auto;
  z-index: 2;
  min-height: 48px;
  padding: 13px 14px;
  background: color-mix(in srgb, var(--surface-secondary) 92%, transparent);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
}
.work-column-head h2 { color: var(--text-secondary); font-family: Aptos, "Segoe UI", system-ui, sans-serif; font-size: .75rem; letter-spacing: .045em; }
.work-column-head span { color: var(--text-secondary); background: var(--surface); border: 1px solid var(--border-subtle); border-radius: 999px; }
.work-column-list { gap: 8px; padding: 10px; }
.task-card {
  min-height: 112px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-small);
  box-shadow: 0 1px 0 rgb(23 32 30 / 4%);
  transition: background-color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}
.task-card:hover { background: var(--surface-elevated); border-color: var(--accent); box-shadow: var(--shadow-small); }
.task-card h3 { margin-bottom: 24px; color: var(--text-primary); font-size: .88rem; font-weight: 620; line-height: 1.35; }
.task-card-meta { grid-template-columns: auto auto 1fr 28px; color: var(--text-muted); }
.task-key { color: var(--accent); font-family: Aptos, "Segoe UI", system-ui, sans-serif; font-weight: 700; letter-spacing: .01em; }
.task-priority { padding-left: 7px; border-left: 2px solid currentColor; font-family: Aptos, "Segoe UI", system-ui, sans-serif; text-transform: uppercase; }
.task-priority.normal { color: var(--text-muted); }
.task-priority.high { color: var(--warning); }
.task-priority.urgent { color: var(--danger); }
.task-card-meta .avatar { color: #fff; background: var(--success); }
.work-empty { padding: 40px 14px; color: var(--text-muted); }

/* Popovers and focused record surfaces */
.notification-panel {
  top: calc(100% + 8px);
  width: min(390px, calc(100vw - 24px));
  max-height: min(560px, calc(100dvh - 90px));
  color: var(--text-primary);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-medium);
  transform-origin: top right;
  transition: opacity var(--motion-ui) var(--ease-enter), transform var(--motion-ui) var(--ease-enter);
}
.notification-panel:not([hidden]) { opacity: 1; transform: translateY(0) scale(1); }
@starting-style { .notification-panel:not([hidden]) { opacity: 0; transform: translateY(-6px) scale(.985); } }
.notification-header { background: var(--surface-secondary); border-bottom: 1px solid var(--border-subtle); }
.notification-item { border-bottom: 1px solid var(--border-subtle); }
.notification-item.is-unread { background: var(--accent-soft); }
.notification-item[role="button"] { cursor: pointer; }
.notification-item[role="button"]:hover { background: var(--surface-hover); }

.sheet-backdrop {
  z-index: calc(var(--z-modal) - 1);
  background: rgb(13 19 17 / 48%);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity var(--motion-sheet) var(--ease-standard), visibility var(--motion-sheet);
}
.sheet-backdrop.is-open { opacity: 1; }
.side-sheet {
  z-index: var(--z-modal);
  color: var(--text-primary);
  background: var(--surface-elevated);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-medium);
  transition: transform var(--motion-sheet) var(--ease-standard), opacity var(--motion-sheet) var(--ease-standard), visibility var(--motion-sheet);
}
.side-sheet:not(.task-detail-sheet) {
  inset: 50% auto auto 50%;
  width: min(680px, calc(100vw - 64px));
  max-width: none;
  max-height: calc(100dvh - 64px);
  padding-bottom: 0;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  opacity: 0;
  transform: translate(-50%, -48%) scale(.985);
}
.side-sheet:not(.task-detail-sheet).is-open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.sheet-header { min-height: 76px; padding: 18px 22px; background: var(--surface-elevated); border-bottom: 1px solid var(--border); }
.side-sheet form { padding: 22px; }
.task-detail-sheet {
  inset: 50% auto auto 50%;
  width: min(1100px, calc(100vw - 64px));
  height: min(820px, calc(100dvh - 64px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-medium);
  opacity: 0;
  transform: translate(-50%, -48%) scale(.985);
}
.task-detail-sheet.is-open { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.people-table tbody tr[role="button"] { cursor: pointer; }
.people-table tbody tr[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.form-error.is-info { color: var(--accent-strong); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.account-approval-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; background: var(--surface-secondary); border: 1px solid var(--border); border-radius: var(--radius-medium); }
.account-approval-panel span { display: grid; gap: 3px; }
.account-approval-panel small { color: var(--text-muted); }
.account-approval-panel > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.managed-account-actions { align-items: center; justify-content: space-between; flex-wrap: wrap; }
.form-action-group { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.side-sheet.account-delete-sheet { width: min(520px, calc(100vw - 64px)); }
.delete-account-content { display: grid; gap: 18px; padding: 22px; }
.delete-account-content > p { margin: 0; color: var(--text-secondary); font-size: .82rem; line-height: 1.55; }
.account-delete-summary { display: grid; padding: 16px; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 12px; background: var(--danger-soft); border-radius: var(--radius-medium); }
.account-delete-summary > span:last-child { min-width: 0; }
.account-delete-summary strong, .account-delete-summary small { display: block; overflow-wrap: anywhere; }
.account-delete-summary small { margin-top: 3px; color: var(--text-secondary); font-size: .72rem; }

.leave-history-header { align-items: center; gap: 20px; }
.leave-history-header > div:first-child { min-width: 0; }
.leave-history-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.leave-history-filters label { margin: 0; }
.leave-history-filters select { width: auto; min-width: 142px; min-height: 40px; padding-inline: 12px 34px; font-size: .76rem; }
#request-history-list { overflow: hidden; }
.history-list-head,
.history-item {
  display: grid;
  grid-template-columns: 40px minmax(240px, 1fr) minmax(132px, .44fr) 138px 252px;
  align-items: center;
  column-gap: 14px;
}
.history-list-head {
  min-height: 38px;
  padding: 8px 18px;
  color: var(--text-muted);
  background: var(--surface-secondary);
  border-bottom: 1px solid var(--border-subtle);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.history-list-head span:nth-child(4), .history-list-head span:nth-child(5) { text-align: left; }
.history-item { position: relative; min-height: 76px; padding: 13px 18px; }
.history-item.type-annual { background: color-mix(in srgb, var(--info-soft) 30%, var(--surface)); }
.history-item.type-medical { background: color-mix(in srgb, var(--success-soft) 31%, var(--surface)); }
.history-item.type-unpaid { background: color-mix(in srgb, var(--warning-soft) 32%, var(--surface)); }
.history-item.status-declined { background: color-mix(in srgb, var(--danger-soft) 45%, var(--surface)); }
.history-item:hover { background: var(--surface-hover); }
.history-summary { min-width: 0; }
.history-summary strong, .history-summary small { display: block; overflow-wrap: anywhere; }
.history-summary strong { font-size: .86rem; line-height: 1.25; }
.history-summary small { margin-top: 4px; color: var(--text-secondary); font-size: .72rem; line-height: 1.35; }
.history-date { color: var(--text-primary); font-size: .79rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.history-status { width: 100%; max-width: 132px; justify-self: start; text-align: center; white-space: nowrap; }
.history-item.is-targeted, .document-row.is-targeted { outline: 2px solid var(--accent); outline-offset: -3px; }
.history-actions { display: grid; width: 100%; grid-template-columns: minmax(100px, 1fr) 58px 68px; align-items: center; justify-content: stretch; gap: 7px; }
.history-actions .button { width: 100%; min-width: 0; padding-inline: 9px; white-space: nowrap; }
.history-delete:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 48%, var(--border)); }
.leave-conversation { display: grid; gap: 10px; }
.leave-message-list { display: grid; max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-medium); }
.leave-message { padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); overflow-wrap: anywhere; }
.leave-message:last-child { border-bottom: 0; }
.leave-message > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.leave-message time { color: var(--text-muted); font-size: .68rem; white-space: nowrap; }
.leave-message p { margin: 5px 0 0; color: var(--text-secondary); font-size: .8rem; line-height: 1.45; }
.leave-message-empty { padding: 18px; color: var(--text-muted); text-align: center; }
.leave-record-summary { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px; background: var(--surface-secondary); border-radius: var(--radius-medium); }
.leave-record-summary small { display: block; margin-top: 3px; color: var(--text-muted); }
.task-detail-layout { grid-template-columns: minmax(0, 1fr) 280px; height: 100%; min-height: 0; }
.task-detail-main { padding: 30px 34px; background: var(--surface-elevated); border-right: 1px solid var(--border); }
.task-detail-aside { padding: 26px 22px; background: var(--surface-secondary); }
.task-description-body, .task-detail-image, .task-detail-file {
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
}
.task-description-body a, .task-detail-image span, .task-detail-file { color: var(--accent); }
.task-detail-image img { background: var(--surface-secondary); }
.task-detail-file:hover { background: var(--accent-soft); border-color: var(--accent); }

.image-viewer {
  z-index: calc(var(--z-modal) + 5);
  background: rgb(7 10 9 / 94%);
  backdrop-filter: blur(10px);
}

.profile-record dl > div { background: transparent; border-color: var(--border-subtle); }
.avatar { overflow: hidden; font-family: Aptos, "Segoe UI", system-ui, sans-serif; font-weight: 700; }
.avatar-photo { display: block; width: 100%; height: 100%; object-fit: cover; }

.account-review-status { color: var(--accent); }

.side-sheet.profile-photo-sheet { width: min(560px, calc(100vw - 64px)); }
.profile-photo-requirement {
  display: grid;
  padding: 13px 14px;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  color: var(--text-primary);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: var(--radius-medium);
}
.profile-photo-requirement .icon { width: 19px; height: 19px; margin-top: 2px; color: var(--accent); }
.profile-photo-requirement strong, .profile-photo-requirement p { display: block; }
.profile-photo-requirement p { margin-top: 4px; color: var(--text-secondary); font-size: .74rem; line-height: 1.45; }
.profile-photo-upload {
  display: grid;
  min-height: 148px;
  padding: 18px;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  color: var(--text-primary) !important;
  background: var(--surface-secondary);
  border: 1px dashed color-mix(in srgb, var(--accent) 48%, var(--border));
  border-radius: var(--radius-medium);
  cursor: pointer;
  transition: background-color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard);
}
.profile-photo-upload:hover { background: var(--surface-hover); border-color: var(--accent); }
.profile-photo-upload:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.profile-photo-upload input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.profile-photo-upload > span:last-child { min-width: 0; }
.profile-photo-upload strong, .profile-photo-upload small { display: block; }
.profile-photo-upload strong { font-size: .92rem; }
.profile-photo-upload small { margin-top: 6px; color: var(--text-muted); font-size: .72rem; font-weight: 520; line-height: 1.45; }
.profile-photo-preview {
  display: grid;
  width: 96px;
  height: 96px;
  overflow: hidden;
  place-items: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 750;
}
.profile-photo-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
#view-profile .page-heading-actions { flex-wrap: wrap; justify-content: flex-end; }

/* Profile: one focused identity record with a compact security callout. */
#view-profile.is-active {
  width: min(100%, 1180px);
  margin-inline: auto;
}

#view-profile .page-heading {
  margin-bottom: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

#view-profile .profile-password-notice {
  width: min(100%, 570px);
  margin: 0 0 16px;
  padding: 11px 13px;
  border-radius: var(--radius-medium);
}

#view-profile .profile-record {
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(0, 1.65fr);
  min-height: 286px;
  background: var(--surface);
}

#view-profile .profile-record-head {
  min-width: 0;
  padding: clamp(26px, 3vw, 38px);
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  background: var(--surface-secondary);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 0;
}

#view-profile .profile-record-head .avatar {
  width: 64px;
  height: 64px;
  font-size: 1rem;
}

#view-profile .profile-record-head h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  letter-spacing: -.025em;
}

#view-profile .profile-record-head p {
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--text-secondary);
  font-size: .79rem;
}

.profile-role-stamp {
  padding: 5px 8px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: var(--radius-small);
  font-size: .69rem;
  font-weight: 720;
}

#view-profile .profile-record dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: stretch;
}

#view-profile .profile-record dl > div {
  min-height: 104px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#view-profile .profile-record dt {
  color: var(--text-muted);
  font-size: .67rem;
  letter-spacing: .045em;
  text-transform: uppercase;
}

#view-profile .profile-record dd {
  margin-top: 7px;
  color: var(--text-primary);
  font-size: .92rem;
  font-weight: 680;
}

@media (max-width: 1180px) {
  #view-overview.is-active { grid-template-columns: 1fr; }
  #view-overview .page-heading, #view-overview .attention-ledger, #view-overview .command-grid, #view-overview .activity-section { grid-column: 1; }
  .attention-ledger { grid-template-columns: minmax(190px, 1.15fr) repeat(3, 1fr); }
  .activity-list { max-height: 340px; }
  .work-board { grid-template-columns: repeat(4, 260px); }
  .history-list-head { display: none; }
  .history-item {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas:
      "type summary status"
      ". date actions";
    row-gap: 9px;
  }
  .history-type { grid-area: type; }
  .history-summary { grid-area: summary; }
  .history-date { grid-area: date; }
  .history-status { grid-area: status; }
  .history-actions { grid-area: actions; max-width: 252px; justify-self: end; }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: calc(var(--z-modal) + 2);
    width: min(86vw, 320px);
    transform: translateX(-102%);
    transition: transform var(--motion-sheet) var(--ease-standard);
  }
  body.mobile-nav-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-medium); }
  .mobile-nav-backdrop { z-index: calc(var(--z-modal) + 1); background: rgb(13 19 17 / 45%); }
  .workspace { margin-left: 0; }
  .mobile-menu { display: grid; }
  .sidebar-toggle { display: none; }
  .login-main { gap: 48px; }
  .attention-ledger { grid-template-columns: 1fr 1fr; }
  .attention-ledger > h2 { grid-column: 1 / -1; min-height: 78px; align-items: center; }
  .attention-cell { min-height: 94px; border-top: 1px solid var(--border-subtle); }
  .attention-cell:nth-of-type(1) { border-left: 0; }
  .attention-cell:nth-of-type(3) { grid-column: 1 / -1; border-top: 1px solid var(--border-subtle); border-left: 0; }
  .leave-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { background: var(--app-background); font-size: 14px; }
  .login-main {
    display: block;
    width: 100%;
    min-height: 0;
    padding: 0 0 calc(28px + env(safe-area-inset-bottom));
  }
  .login-context { min-height: 0; }
  .login-theme-toggle {
    top: max(14px, env(safe-area-inset-top));
    right: 14px;
    color: #d8e6e0;
    background: rgb(255 255 255 / 8%);
    border-color: rgb(255 255 255 / 16%);
    box-shadow: none;
  }
  .login-theme-toggle:hover { color: #fff; background: rgb(255 255 255 / 13%); }
  .login-context-image { height: auto; }
  .login-form-wrap { width: min(calc(100% - 28px), 500px); margin: 24px auto 0; padding: 26px 20px; border-radius: 12px; }
  .login-heading { margin: 28px 0 22px; }
  input, select, textarea { font-size: 16px; }
  #view-profile .page-heading-actions { width: 100%; justify-content: stretch; }
  #view-profile .page-heading-actions .button { flex: 1 1 150px; }
  .profile-photo-upload { grid-template-columns: 1fr; justify-items: center; text-align: center; }

  .sidebar { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .starpark-tool-link { min-height: 44px; }
  .topbar {
    min-height: calc(58px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 10px 0;
  }
  .global-search, .demo-label { display: none; }
  .mobile-brand { margin-left: 4px; }
  .topbar-actions { margin-left: auto; gap: 2px; }
  .topbar .icon-button, .mobile-menu { width: 44px; height: 44px; }
  #main-content { padding: 24px 14px calc(94px + env(safe-area-inset-bottom)); }
  .view { max-width: none; }
  .page-heading { margin-bottom: 20px; align-items: flex-start; flex-wrap: wrap; gap: 14px; }
  .page-heading > div { min-width: 0; flex: 1 1 210px; }
  .page-heading h1 { font-size: 1.9rem; }
  .page-heading p { margin-top: 6px; font-size: .8rem; }
  .starpark-app-view { margin: -8px -4px 0; }
  body.starpark-workspace-active #main-content { height: calc(100dvh - 58px - env(safe-area-inset-top)); padding: 0 0 calc(76px + env(safe-area-inset-bottom)); }
  body.starpark-workspace-active .starpark-app-view { margin: 0; }
  .starpark-tool-toolbar { min-height: 48px; padding-left: 12px; }
  .starpark-tool-toolbar > div { display: grid; gap: 1px; }
  .starpark-tool-toolbar .button { width: 44px; padding: 0; font-size: 0; }
  .starpark-tool-toolbar .button .icon { margin: 0; }
  .starpark-frame-shell { min-height: 0; height: calc(100% - 48px); border-right: 0; border-left: 0; border-radius: 0; }
  .page-heading > .button, .page-heading > #create-task-button, .page-heading > #edit-profile-button { min-width: 44px; min-height: 44px; }
  .page-heading-actions { width: 100%; }
  .page-heading-actions .button { min-height: 44px; flex: 1 1 0; }
  #view-profile .profile-record { grid-template-columns: 1fr; }
  #view-profile .profile-record-head {
    padding: 24px 20px;
    flex-direction: row;
    justify-content: flex-start;
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  #view-profile .profile-record-head .avatar { width: 52px; height: 52px; }
  #view-profile .profile-role-stamp { margin-left: auto; }
  #view-profile .profile-record dl > div { min-height: 88px; padding: 18px 20px; }

  #view-overview.is-active { display: block; }
  #view-overview > * + * { margin-top: 16px; }
  .attention-ledger { display: grid; grid-template-columns: 1fr 1fr; }
  .attention-ledger > h2 { min-height: 72px; padding: 16px; }
  .attention-cell { min-height: 96px; padding: 14px; }
  .attention-cell strong { font-size: 1.7rem; }
  .command-grid, .review-panel, .activity-section { overflow: visible; }
  .review-item { padding: 15px 14px; }
  .review-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .review-actions .button { min-height: 44px; }
  .activity-list { max-height: none; }

  .directory-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .inline-search { grid-column: 1 / -1; width: 100%; }
  .directory-filter { min-width: 0; }
  .bulk-select-all { justify-content: center; }
  .directory-count { grid-column: 1 / -1; align-self: center; }
  .bulk-leave-trigger { grid-column: 1 / -1; width: 100%; margin-left: 0; }
  .people-table { min-width: 0; }
  .people-table thead { display: none; }
  .people-table, .people-table tbody, .people-table tr, .people-table td { display: block; width: 100%; }
  .people-table tr { position: relative; padding: 13px 14px 13px 50px; border-bottom: 1px solid var(--border-subtle); }
  .people-table td { display: grid; padding: 6px 0; grid-template-columns: 102px minmax(0, 1fr); align-items: center; gap: 10px; border: 0; }
  .people-table td::before { content: attr(data-label); color: var(--text-muted); font-family: Aptos, "Segoe UI", system-ui, sans-serif; font-size: .67rem; letter-spacing: .045em; text-transform: uppercase; }
  .people-table td:first-child, .people-table td:last-child { grid-template-columns: 1fr; }
  .people-table td:first-child::before, .people-table td:last-child::before, .people-table td[colspan]::before { display: none; }
  .people-table td.people-select-cell { position: absolute; top: 17px; left: 16px; width: 18px; padding: 0; }
  .people-table td:nth-child(2) { padding-top: 0; grid-template-columns: 1fr; }
  .people-table td:nth-child(2)::before { display: none; }
  .people-table .table-action { min-height: 44px; }
  .bulk-leave-operation > div { grid-template-columns: 1fr; }

  .leave-layout, .documents-layout { gap: 14px; }
  .leave-balance-row { min-height: 72px; padding: 12px 14px; }
  .leave-history-header { align-items: flex-start; flex-direction: column; gap: 12px; }
  .leave-history-filters { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .leave-history-filters select { width: 100%; min-width: 0; min-height: 44px; }
  .history-item, .document-row { padding: 14px; }
  .history-item {
    min-height: 0;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-areas:
      "type summary"
      ". date"
      ". status"
      "actions actions";
    column-gap: 11px;
    row-gap: 8px;
  }
  .history-date { display: block; color: var(--text-secondary); font-size: .75rem; }
  .history-status { width: auto; max-width: 100%; }
  .history-actions { display: flex; width: 100%; max-width: none; padding-top: 4px; justify-self: stretch; }
  .history-actions .button { width: auto; min-height: 44px; }
  .history-actions .history-message { flex: 1 1 auto; }
  .history-actions .history-edit, .history-actions .history-delete { flex: 0 0 76px; }
  .document-row-actions { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .document-row-actions .button { min-height: 44px; }

  #view-calendar.is-active { height: calc(100dvh - 176px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 500px; }
  #view-calendar .page-heading { margin-bottom: 12px; }
  #view-calendar .calendar-grid-large { grid-template-rows: repeat(6, minmax(50px, 1fr)); }
  .calendar-header { min-height: 58px; padding: 8px 10px; }
  .calendar-controls .button { display: none; }
  .calendar-controls .icon-button { width: 44px; height: 44px; }
  .calendar-weekdays span { padding: 6px 1px; font-size: .58rem; }
  .calendar-day { padding: 4px 3px; }
  .calendar-event { min-height: 8px; padding: 0; font-size: 0; border-left-width: 0; border-radius: 999px; }
  .calendar-event::before { display: block; width: 7px; height: 7px; margin: auto; content: ""; background: currentColor; border-radius: 50%; }
  .calendar-legend { font-size: .61rem; }

  .work-toolbar { display: grid; padding: 8px; grid-template-columns: 1fr; }
  .work-toolbar .work-search, .work-toolbar label { width: 100%; }
  .work-toolbar > span { text-align: left; }
  .work-status-tabs {
    display: flex;
    margin: 0 -14px 14px;
    padding: 0 14px;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
  }
  .work-status-tabs::-webkit-scrollbar { display: none; }
  .work-status-tabs button {
    min-height: 44px;
    padding: 0 10px;
    flex: 0 0 auto;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    font-family: Aptos, "Segoe UI", system-ui, sans-serif;
    font-weight: 650;
  }
  .work-status-tabs button.is-active { color: var(--text-primary); border-bottom-color: var(--accent); }
  .work-status-tabs span { display: inline-grid; min-width: 20px; height: 20px; margin-left: 4px; place-items: center; background: var(--surface-secondary); border-radius: 999px; font-size: .65rem; }
  .work-board { display: block; overflow: visible; padding: 0; background: transparent; border: 0; }
  .work-column, .work-column.status-todo, .work-column.status-incoming, .work-column.status-progress, .work-column.status-done {
    display: none;
    min-width: 0;
    min-height: 0;
    background: transparent;
  }
  .work-column.is-mobile-active { display: block; }
  .work-column-head { display: none; }
  .work-column-list { gap: 10px; padding: 0; }
  .task-card { min-height: 118px; padding: 16px; border-radius: var(--radius-medium); }
  .task-card h3 { min-height: auto; margin-bottom: 26px; font-size: .94rem; }
  .task-card-meta { grid-template-columns: auto auto 1fr 32px; }
  .task-card-meta .avatar { width: 32px; height: 32px; }

  .profile-layout { grid-template-columns: 1fr; gap: 14px; }

  .mobile-tabbar {
    position: fixed;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    z-index: var(--z-nav);
    display: grid;
    min-height: 64px;
    padding: 5px;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    background: color-mix(in srgb, var(--surface-elevated) 92%, transparent);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgb(15 24 22 / 18%);
    backdrop-filter: blur(18px) saturate(130%);
  }
  .mobile-tabbar button {
    position: relative;
    min-width: 0;
    min-height: 52px;
    padding: 5px 2px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 11px;
    font-size: .61rem;
    transition: color var(--motion-fast) var(--ease-standard), background-color var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
  }
  .mobile-tabbar button.is-active { color: var(--accent); background: var(--accent-soft); }
  .mobile-tabbar .icon { width: 19px; height: 19px; }

  .notification-panel { position: fixed; top: calc(60px + env(safe-area-inset-top)); right: 10px; left: 10px; width: auto; }
  .side-sheet { inset: 0; width: 100vw; max-width: none; height: 100dvh; border: 0; transform: translateY(14px); }
  .side-sheet.is-open { transform: translateY(0); }
  .side-sheet:not(.task-detail-sheet) {
    inset: 0;
    width: 100vw;
    max-width: none;
    max-height: none;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    opacity: 1;
    transform: translateY(14px);
  }
  .side-sheet:not(.task-detail-sheet).is-open { transform: translateY(0); }
  .side-sheet .sheet-header { position: sticky; top: 0; z-index: 2; min-height: 68px; padding: max(14px, env(safe-area-inset-top)) 16px 14px; }
  .side-sheet form { padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }
  .managed-account-actions, .form-action-group { width: 100%; }
  .managed-account-actions > .button.danger { order: 2; width: 100%; }
  .form-action-group { order: 1; }
  .form-action-group .button { flex: 1 1 0; }
  .delete-account-content { padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }
  .task-detail-sheet { inset: 0; width: 100vw; height: 100dvh; border: 0; border-radius: 0; transform: translateY(14px); }
  .task-detail-sheet.is-open { transform: translateY(0); }
  .task-detail-layout { grid-template-columns: 1fr; }
  .task-detail-main { padding: 22px 16px; border: 0; }
  .task-detail-aside { padding: 20px 16px calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }

  button, .nav-item, .company-option, .calendar-event, .leave-range-day { min-height: 44px; }
}

@media (max-width: 390px) {
  #main-content { padding-inline: 11px; }
  .attention-ledger { grid-template-columns: 1fr; }
  .attention-ledger > h2, .attention-cell:nth-of-type(3) { grid-column: 1; }
  .attention-cell { border-left: 0; }
  .attention-cell + .attention-cell { border-top: 1px solid var(--border-subtle); }
  .mobile-tabbar { right: 5px; left: 5px; }
  .mobile-tabbar button { font-size: .57rem; }
  .document-row-actions { grid-template-columns: 1fr; }
}

@media (hover: hover) and (pointer: fine) {
  .task-card:hover { transform: translateY(-1px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .button, .icon-button, .nav-item, .company-option, .task-card, .side-sheet, .task-detail-sheet, .notification-panel, .sheet-backdrop, .mobile-tabbar button {
    transition-duration: 100ms !important;
    transform: none !important;
  }
  .login-context-image,
  .login-form-wrap {
    animation-name: login-fade !important;
    animation-duration: 100ms !important;
    animation-delay: 0ms !important;
  }
}

@keyframes login-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar, .work-column-head, .mobile-tabbar, .sheet-backdrop, .image-viewer { backdrop-filter: none; }
  .topbar, .work-column-head, .mobile-tabbar { background: var(--surface-elevated); }
}
