@font-face {
  font-family: "Satoshi";
  src: url("/assets/fonts/Satoshi-Light.woff") format("woff");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Satoshi";
  src: url("/assets/fonts/Satoshi-Regular.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Satoshi";
  src: url("/assets/fonts/Satoshi-Bold.woff") format("woff");
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
}

@font-face {
  font-family: "Stem";
  src: url("/assets/fonts/Stem-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
}

:root {
  --md-sys-color-primary: #625CFD;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #E4E2FF;
  --md-sys-color-on-primary-container: #1D1768;
  --md-sys-color-secondary: #5E5A8A;
  --md-sys-color-secondary-container: #E3E1FF;
  --md-sys-color-tertiary: #4a5f7d;
  --md-sys-color-tertiary-container: #d3e3ff;
  --md-sys-color-error: #ba1a1a;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-surface: #F8F8FF;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #F3F2FF;
  --md-sys-color-surface-container: #ECEBFF;
  --md-sys-color-surface-container-high: #E4E3F8;
  --md-sys-color-on-surface: #191c1b;
  --md-sys-color-on-surface-variant: #49465F;
  --md-sys-color-outline: #77728F;
  --md-sys-color-outline-variant: #C9C6E8;
  --md-ref-typeface-brand: "Satoshi", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --md-ref-typeface-display: "Stem", "Satoshi", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --md-sys-shape-corner-small: 10px;
  --md-sys-shape-corner-medium: 14px;
  --md-sys-shape-corner-large: 18px;
  --md-sys-shape-corner-extra-large: 24px;
  --bg: var(--md-sys-color-surface);
  --surface: var(--md-sys-color-surface-container-lowest);
  --surface-2: var(--md-sys-color-surface-container-low);
  --surface-3: var(--md-sys-color-surface-container);
  --surface-soft: #FAFAFF;
  --text: var(--md-sys-color-on-surface);
  --muted: var(--md-sys-color-on-surface-variant);
  --line: var(--md-sys-color-outline-variant);
  --brand: var(--md-sys-color-primary);
  --brand-2: var(--md-sys-color-tertiary);
  --danger: var(--md-sys-color-error);
  --warn: #a75f00;
  --ok: #146c2e;
  --shadow: 0 1px 2px rgba(21, 31, 29, 0.08), 0 10px 26px rgba(21, 31, 29, 0.08);
  --state-layer: rgba(98, 92, 253, 0.10);
}

@media (max-width: 760px) {
  .notification-row {
    align-items: stretch;
  }
  .notification-row .row-badges {
    justify-content: flex-start;
    min-width: 0;
  }
  .notification-open-chip {
    width: 100%;
    border-radius: 14px;
  }
  .pm-hero {
    align-items: flex-start;
  }
  .pm-today-grid,
  .pm-project-grid {
    grid-template-columns: 1fr;
  }
  .pm-card-row,
  .pm-team-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .pm-card-row em,
  .pm-team-row em {
    text-align: left;
  }
  .pm-project-meta {
    grid-template-columns: 1fr;
  }
}

body.theme-dark {
  --md-sys-color-primary: #C9C6FF;
  --md-sys-color-on-primary: #1F1A72;
  --md-sys-color-primary-container: #4740C4;
  --md-sys-color-on-primary-container: #E7E5FF;
  --md-sys-color-secondary: #CBC8F6;
  --md-sys-color-secondary-container: #373268;
  --md-sys-color-tertiary: #b8c9e8;
  --md-sys-color-tertiary-container: #334761;
  --md-sys-color-error: #ffb4ab;
  --md-sys-color-error-container: #690005;
  --md-sys-color-surface: #101413;
  --md-sys-color-surface-container-lowest: #171b1a;
  --md-sys-color-surface-container-low: #1d2220;
  --md-sys-color-surface-container: #242927;
  --md-sys-color-surface-container-high: #2f3532;
  --md-sys-color-on-surface: #e2e7e4;
  --md-sys-color-on-surface-variant: #C9C6E8;
  --md-sys-color-outline: #89938f;
  --md-sys-color-outline-variant: #49465F;
  --bg: var(--md-sys-color-surface);
  --surface: var(--md-sys-color-surface-container-lowest);
  --surface-2: var(--md-sys-color-surface-container-low);
  --surface-3: var(--md-sys-color-surface-container);
  --surface-soft: #141918;
  --text: var(--md-sys-color-on-surface);
  --muted: var(--md-sys-color-on-surface-variant);
  --line: var(--md-sys-color-outline-variant);
  --brand: var(--md-sys-color-primary);
  --danger: #ffb4ab;
  --warn: #ffca7a;
  --ok: #8dd89b;
  --shadow: 0 1px 2px rgba(0,0,0,.42), 0 18px 38px rgba(0,0,0,.28);
  --state-layer: rgba(201, 198, 255, .14);
  color-scheme: dark;
}

/* Mobile app polish: Material-style navigation drawer, sticky topbar and swipe rows. */
@media (max-width: 980px) {
  body.nav-open {
    overflow: hidden;
  }
  .app-shell {
    display: block;
    min-height: 100svh;
  }
  .mobile-menu-button {
    display: inline-grid;
    flex: 0 0 auto;
  }
  .sidebar-close {
    display: inline-grid;
    place-items: center;
  }
  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    background: rgba(15, 23, 21, .36);
    backdrop-filter: blur(2px);
  }
  body.nav-open .mobile-sidebar-backdrop {
    display: block;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 90;
    width: min(86vw, 340px);
    height: 100svh;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    border-right: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 0 28px 28px 0;
    box-shadow: 0 20px 48px rgba(16, 24, 22, .24);
    transform: translateX(-104%);
    transition: transform .24s cubic-bezier(.2, 0, 0, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  .sidebar .brand {
    padding-right: 48px;
  }
  .sidebar .nav {
    display: grid;
    grid-template-columns: 1fr;
  }
  .sidebar .nav-item {
    min-height: 46px;
    padding: 11px 14px;
    border-radius: 999px;
    font-size: 14px;
  }
  .workspace {
    max-width: none;
    min-height: 100svh;
    padding: max(14px, env(safe-area-inset-top)) 16px 96px;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    margin: -8px -8px 14px;
    padding: 8px;
    border: 1px solid rgba(190, 201, 197, .78);
    border-radius: 0 0 24px 24px;
    background: rgba(247, 250, 248, .92);
    backdrop-filter: blur(16px);
  }
  .topbar h1 {
    font-size: clamp(22px, 6vw, 28px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar .eyebrow {
    margin-bottom: 2px;
    font-size: 10px;
  }
  .top-actions {
    justify-content: flex-end;
    width: auto;
  }
  #enableNotificationsBtn {
    display: none;
  }
  #contextActionBtn {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 70;
    min-height: 52px;
    max-width: calc(100vw - 32px);
    padding: 0 20px;
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(98, 92, 253, .28);
  }
  .panel,
  .metric,
  .task-card,
  .client-row,
  .notification-row,
  .activity-row {
    border-radius: 22px;
  }
  .toolbar,
  .graphic-chip-row,
  .calendar-filter-row,
  .settings-nav-group,
  .row-badges,
  .task-type-tabs,
  .calendar-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .toolbar::-webkit-scrollbar,
  .graphic-chip-row::-webkit-scrollbar,
  .calendar-filter-row::-webkit-scrollbar,
  .settings-nav-group::-webkit-scrollbar,
  .row-badges::-webkit-scrollbar,
  .task-type-tabs::-webkit-scrollbar,
  .calendar-actions::-webkit-scrollbar {
    display: none;
  }
  .toolbar > *,
  .graphic-chip-row > *,
  .calendar-filter-row > *,
  .settings-nav-button,
  .row-badges > *,
  .task-type-tabs > *,
  .calendar-actions > * {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
  .metrics,
  .mini-metrics,
  .team-load-metrics,
  .calendar-summary {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 74vw);
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .metrics::-webkit-scrollbar,
  .mini-metrics::-webkit-scrollbar,
  .team-load-metrics::-webkit-scrollbar,
  .calendar-summary::-webkit-scrollbar {
    display: none;
  }
  .table-wrap,
  .board,
  .team-day-view,
  .day-view,
  .week-grid {
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 640px) {
  body {
    background: var(--md-sys-color-surface);
  }
  .workspace {
    padding-inline: 12px;
  }
  .topbar {
    margin-inline: -4px;
    grid-template-columns: auto minmax(0, 1fr);
  }
  .top-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .panel {
    padding: 14px;
  }
  .panel + .panel,
  .list + .panel {
    margin-top: 10px;
  }
  .graphic-dashboard-layout,
  .calendar-layout,
  .calendar-admin-grid,
  .calendar-focus-grid,
  .settings-shell,
  .settings-form-grid,
  .grid-2,
  .notes-grid,
  .client-grid,
  .role-summary {
    grid-template-columns: 1fr;
  }
  .brand-kit-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 86vw);
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .brand-kit-grid > * {
    scroll-snap-align: start;
  }
  .panel-head {
    gap: 8px;
  }
  .panel-head .primary,
  .panel-head .ghost {
    width: auto;
  }
  .task-foot,
  .client-row,
  .notification-row,
  .activity-row,
  .upload-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .task-card {
    padding: 13px;
  }
  .drawer {
    width: 100%;
    max-width: none;
    height: 100svh;
    border-radius: 0;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
  .drawer-head {
    position: static;
    z-index: 2;
    background: rgba(247, 250, 248, .96);
    backdrop-filter: blur(14px);
  }
  .checklist-view-row {
    align-items: flex-start;
  }
  .task-edit-shortcut {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
  .task-edit-shortcut .ghost,
  .checklist-composer-actions .ghost,
  .checklist-composer-actions .primary {
    width: 100%;
  }
  .actions {
    gap: 8px;
  }
  .actions .primary,
  .actions .ghost,
  .actions .danger {
    flex: 1 1 auto;
    min-width: min(148px, 100%);
  }
  .app-dialog-backdrop {
    align-items: end;
    padding: 12px;
  }
  .app-dialog {
    border-radius: 24px 24px max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-bottom));
    padding: 18px;
  }
  .app-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .app-dialog-actions .ghost,
  .app-dialog-actions .danger,
  .app-dialog-actions .primary {
    width: 100%;
  }
  input,
  select,
  textarea {
    min-height: 46px;
    font-size: 16px;
  }
  .settings-nav-panel {
    position: sticky;
    top: 76px;
    z-index: 20;
    margin-inline: -2px;
    background: rgba(247, 250, 248, .94);
    backdrop-filter: blur(12px);
  }
  .settings-nav-group {
    display: flex;
  }
  .settings-nav-group p {
    display: none;
  }
  .calendar-sync-row {
    align-items: stretch;
  }
  .calendar-sync-row .ghost,
  .calendar-actions .primary {
    width: auto;
  }
  .calendar-nav {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
  }
  .calendar-nav h2 {
    min-width: max-content;
  }
}

* { box-sizing: border-box; }

html,
body,
button,
a,
label,
[role="button"],
[tabindex],
.nav-item,
.task-card,
.activity-row,
.client-row,
.calendar-event,
.event {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--md-ref-typeface-brand);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
}

body :is(
  h1,
  h2,
  h3,
  .brand strong,
  .login-hero h1,
  .form-card h2,
  .topbar h1,
  .panel-head h2,
  .drawer-head h2,
  .settings-section-head h2,
  .calendar-nav h2,
  .admin-overview-hero h2,
  .pm-hero h2,
  .graphic-dashboard-head h2,
  .task-list-head h2
) {
  font-family: var(--md-ref-typeface-display);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; line-height: 1.15; }
button:disabled {
  cursor: progress;
  opacity: .68;
}
a { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(98, 92, 253, .28);
  outline-offset: 2px;
}

.hidden { display: none !important; }
.full { width: 100%; }
.muted { color: var(--muted); }
.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, .82fr) minmax(360px, 1fr);
}

.login-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 6vw, 68px);
  color: white;
  background:
    linear-gradient(rgba(23, 18, 84, .82), rgba(23, 18, 84, .64)),
    url("https://images.unsplash.com/photo-1552664730-d307ca884978?auto=format&fit=crop&w=1400&q=80") center/cover;
}

.login-hero h1 {
  margin: 0;
  font-size: 68px;
  line-height: .96;
  letter-spacing: 0;
}

.login-hero p:not(.eyebrow) {
  max-width: 560px;
  font-size: 20px;
  line-height: 1.45;
}

.login-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-metrics span {
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  border-radius: var(--md-sys-shape-corner-large);
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 28px;
}

.form-card {
  width: min(430px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: var(--md-sys-shape-corner-extra-large);
}

.form-card h2 { margin: 0; font-size: 28px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 760; }

.link-button {
  width: fit-content;
  min-height: 0;
  padding: 0;
  border: 0;
  color: var(--brand);
  background: transparent;
  box-shadow: none;
  font-weight: 850;
  text-align: left;
  text-decoration: none;
}

.link-button:hover {
  color: var(--brand);
  text-decoration: underline;
}

input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container-lowest);
  color: var(--text);
  padding: 10px 13px;
  outline: none;
  accent-color: var(--brand);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
  opacity: 1;
  font-weight: 650;
}

select {
  appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--brand) 50%),
    linear-gradient(135deg, var(--brand) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 16px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}

select[multiple],
select[size]:not([size="1"]) {
  min-height: auto;
  padding: 8px;
  background-image: none;
}

select option {
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface);
}

input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"] {
  min-height: 48px;
  padding-right: 12px;
  color-scheme: light;
  font-weight: 760;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  width: 30px;
  height: 30px;
  margin-left: 6px;
  border-radius: 999px;
  padding: 4px;
  cursor: pointer;
  opacity: .78;
  background-color: color-mix(in srgb, var(--brand) 10%, transparent);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="month"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background-color: var(--state-layer);
}

input[type="file"]::file-selector-button {
  min-height: 34px;
  margin-right: 10px;
  padding: 7px 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 999px;
  color: var(--brand);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  font-weight: 820;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  background: var(--state-layer);
  border-color: var(--brand);
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border-radius: 5px;
  flex: 0 0 auto;
}

input[type="radio"] {
  border-radius: 999px;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--brand);
  background: transparent;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: var(--state-layer);
}

.remember-login {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 820;
}
.remember-login input {
  width: 18px;
  min-height: 18px;
}

.password-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(98,92,253,.14); }

.primary, .ghost, .danger {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0;
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease, border-color .16s ease;
}

.primary { color: var(--md-sys-color-on-primary); background: var(--brand); box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.primary:hover { background: #514BE8; box-shadow: 0 2px 7px rgba(98,92,253,.24); }
.ghost { color: var(--brand); background: transparent; border-color: var(--md-sys-color-outline); }
.ghost:hover { background: var(--state-layer); border-color: var(--brand); }
.danger { color: white; background: var(--danger); }
.danger:hover { background: #8c1111; }
.danger-text {
  color: var(--danger);
  border-color: #fecaca;
}
.danger-text:hover {
  color: #8c1111;
  background: #fef2f2;
  border-color: #fca5a5;
}
.primary:active, .ghost:active, .danger:active { transform: translateY(1px); }
.top-actions .primary,
.top-actions .ghost,
.form-card .primary {
  min-height: 38px;
  padding-inline: 14px;
}
.top-actions .primary,
.top-actions .ghost {
  max-width: 220px;
  white-space: nowrap;
}
.panel-head .primary,
.panel-head .ghost,
.client-row .primary,
.client-row .ghost,
.notification-row .ghost,
.activity-row .ghost,
.table .ghost,
.row-badges .ghost,
.upload-row .ghost,
.note-card .ghost {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}
.table .ghost + .ghost {
  margin-left: 4px;
}
.actions .primary,
.actions .ghost,
.actions .danger {
  min-height: 36px;
  padding: 7px 13px;
}
.form-error { min-height: 20px; margin: 0; color: var(--danger); font-weight: 700; }
.form-error.success-message {
  color: var(--ok);
}
.form-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}
.mobile-menu-button,
.sidebar-close,
.mobile-sidebar-backdrop {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: var(--md-sys-color-surface-container-lowest);
}
.sidebar-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand);
  background: var(--surface);
  font-size: 0;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.sidebar-close::before,
.sidebar-close::after,
.icon-close::before,
.icon-close::after,
.remove-step-button::before,
.remove-step-button::after,
.drawer-head #closeDrawerBtn.ghost::before,
.drawer-head #closeDrawerBtn.ghost::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
}
.sidebar-close::before,
.icon-close::before,
.remove-step-button::before,
.drawer-head #closeDrawerBtn.ghost::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
.sidebar-close::after,
.icon-close::after,
.remove-step-button::after,
.drawer-head #closeDrawerBtn.ghost::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 14px;
  border-radius: var(--md-sys-shape-corner-large);
  cursor: pointer;
  transition: background .18s ease, box-shadow .18s ease;
}

.brand:hover,
.brand:focus-visible {
  background: var(--state-layer);
}

.brand:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--brand);
  font-weight: 900;
  border-radius: var(--md-sys-shape-corner-large);
  box-shadow: inset 0 -10px 18px rgba(0,0,0,.12);
  overflow: hidden;
}

.brand-mark img,
.settings-avatar img,
.profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand small { display: block; color: var(--muted); margin-top: 2px; }
.nav { display: grid; gap: 7px; }
.nav-item {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}
.nav-item.active, .nav-item:hover {
  color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
  border-color: var(--line);
}
.admin-enter-user {
  min-height: 32px;
  padding: 7px 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(98, 92, 253, .22);
}
.admin-enter-user:hover,
.admin-enter-user:focus-visible,
.admin-enter-user:active {
  color: #fff !important;
  border-color: #514BE8 !important;
  background: #514BE8 !important;
}
.nav-badge {
  min-width: 22px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 2px 6px;
  color: var(--md-sys-color-on-primary);
  background: var(--brand);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.workspace {
  min-width: 0;
  max-width: 1480px;
  width: 100%;
  padding: 20px clamp(18px, 3vw, 34px) 52px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  min-height: 68px;
}
.topbar > div:first-of-type {
  min-width: 0;
}
.topbar .eyebrow {
  max-width: 100%;
  margin-bottom: 4px;
}
.mobile-menu-button {
  width: 42px;
  height: 42px;
  place-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(21,31,29,.08);
}
.mobile-menu-button span {
  width: 18px;
  height: 2px;
  display: block;
  border-radius: 999px;
  background: var(--brand);
}
.topbar h1 { margin: 0; font-size: 30px; line-height: 1.15; letter-spacing: 0; }
.top-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: flex-end; }

.notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #ecfdf5;
  color: #14532d;
  font-weight: 800;
  border-radius: var(--md-sys-shape-corner-large);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric, .panel, .task-card, .client-row, .notification-row, .activity-row {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--md-sys-shape-corner-large);
}

.metric { padding: 18px; box-shadow: 0 1px 2px rgba(21,31,29,.05); }
.metric strong { display: block; font-size: 30px; line-height: 1; letter-spacing: 0; }
.metric span { color: var(--muted); font-weight: 700; }

.admin-overview-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-overview-hero h2 {
  max-width: 760px;
  margin: 2px 0 0;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.18;
}
.admin-kpis .metric {
  min-height: 96px;
}
.admin-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 14px;
}
.admin-overview-main {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
}
.admin-alert-list {
  display: grid;
  gap: 10px;
}
.admin-alert-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-medium);
  font-weight: 800;
}
.dot.high { background: var(--danger); }
.dot.warn { background: var(--warning); }
.dot.info { background: var(--brand); }
.admin-action-grid.clean {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.admin-action-grid.clean .ghost {
  justify-content: flex-start;
  width: 100%;
  min-height: 40px;
}
.admin-team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.admin-team-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--md-sys-shape-corner-large);
}
.admin-team-card strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
}
.admin-team-card small,
.admin-team-meta {
  color: var(--muted);
  font-weight: 750;
}
.admin-team-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 13px;
}
.admin-team-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.admin-team-footer .ghost {
  min-height: 32px;
  padding: 6px 12px;
}
.admin-supervision {
  align-self: start;
}
.admin-supervision-group {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.admin-supervision-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.admin-supervision-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.admin-supervision-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  color: inherit;
  text-align: left;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-medium);
  cursor: pointer;
}
.admin-supervision-row strong,
.admin-supervision-row small {
  display: block;
}
.admin-supervision-row small {
  color: var(--muted);
  font-weight: 750;
}
.compact-more {
  margin: 0;
  font-weight: 800;
}
.admin-recent-activity .activity-row.compact {
  padding: 11px 12px;
}

.pm-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.pm-hero h2 {
  margin: 0 0 4px;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.08;
}
.pm-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.pm-kpi-chip {
  min-height: 38px;
  gap: 6px;
}
.pm-kpi-chip strong {
  font-size: 17px;
}
.pm-today-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.pm-dashboard-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.pm-today-panel,
.pm-wide-section,
.pm-team-snapshot,
.pm-recent-activity {
  margin-bottom: 0;
}
.pm-dashboard-stack .pm-today-panel .list {
  display: grid;
  gap: 10px;
}
.pm-card-row,
.pm-team-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  color: inherit;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--surface);
}
.pm-card-row:hover,
.pm-team-row:hover {
  border-color: var(--brand);
  background: var(--state-layer);
}
.pm-card-row span,
.pm-team-row span {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.pm-card-row strong,
.pm-team-row strong {
  font-size: 15px;
  line-height: 1.2;
}
.pm-card-row small,
.pm-team-row small {
  color: var(--muted);
  font-weight: 720;
}
.pm-card-row em,
.pm-team-row em {
  flex: 0 0 auto;
  color: var(--brand);
  font-style: normal;
  font-size: 12px;
  font-weight: 850;
  text-align: right;
}
.pm-card-row.risk {
  border-color: rgba(220, 38, 38, .22);
}
.pm-card-row.decision {
  border-color: rgba(98, 92, 253, .28);
}
.pm-team-list,
.pm-project-grid {
  display: grid;
  gap: 10px;
}
.pm-project-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.pm-project-card {
  display: grid;
  gap: 12px;
}
.pm-project-progress {
  height: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}
.pm-project-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}
.pm-project-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}
.pm-calm-state {
  text-align: center;
}

.panel { padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(21,31,29,.05); }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head.compact-head {
  margin-bottom: 10px;
}
.panel-head h2 { margin: 0; font-size: 20px; line-height: 1.25; }
.panel-head .muted { margin: 4px 0 0; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar input, .toolbar select { width: auto; min-width: 170px; }
.table {
  min-width: 620px;
}
.table-wrap {
  overflow-x: auto;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.column {
  min-width: 230px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-large);
}
.column h3 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 4px;
  font-size: 14px;
}

.task-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  text-align: left;
  box-shadow: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease;
}
.task-card:hover { border-color: var(--brand); background: #fbfffd; box-shadow: 0 4px 14px rgba(21,31,29,.08); transform: translateY(-1px); }
body.theme-dark .task-card:hover,
body.theme-dark .task-row-button:hover,
body.theme-dark .ped-content-row:hover {
  background: var(--surface-3);
}
.task-title { margin: 0; font-weight: 900; line-height: 1.25; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 760;
}
.pill.high { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
.pill.warn { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.pill.ok { color: #14532d; background: #ecfdf5; border-color: #bbf7d0; }
.pill.info { color: #1d4ed8; background: #dbeafe; border-color: #bfdbfe; }
body.theme-dark .pill.high { color: #ffdad6; background: #4f1515; border-color: #7f1d1d; }
body.theme-dark .pill.warn { color: #ffe1a6; background: #3d2d09; border-color: #7c4a03; }
body.theme-dark .pill.ok { color: #bbf7d0; background: #12331d; border-color: #1f6d39; }
body.theme-dark .pill.info { color: #bfdbfe; background: #162d4f; border-color: #1d4ed8; }
.task-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }

.list { display: grid; gap: 10px; }
.task-management-panel {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.task-management-row {
  background: var(--md-sys-color-surface-container-low);
}
.task-list-page {
  display: grid;
  gap: 12px;
}
.task-list-page .panel-head {
  margin-bottom: 0;
}
.task-list-search input {
  width: 100%;
  min-height: 46px;
}
.task-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.task-status-chip {
  background: var(--surface);
}
.task-status-chip.active {
  color: var(--brand);
  background: var(--state-layer);
  border-color: var(--brand);
}
.task-list-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.task-list-controls label {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 820;
}
.task-list-controls select {
  width: auto;
  min-height: 36px;
  padding: 6px 32px 6px 12px;
}
.task-list-stack {
  display: grid;
  gap: 10px;
}
.task-list-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.task-list-card:hover,
.task-list-card:focus-visible {
  border-color: var(--brand);
  background: #fbfffd;
  box-shadow: 0 4px 14px rgba(21,31,29,.06);
  outline: none;
  transform: translateY(-1px);
}
.task-list-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.22;
}
.task-list-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 740;
}
.task-list-card-chips,
.task-list-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.task-list-card-foot,
.task-list-card-extra {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}
.task-list-card-foot span:not(:last-child)::after {
  content: "·";
  margin-left: 6px;
  color: var(--line-strong);
}
.task-list-empty {
  padding: 22px;
  text-align: center;
}
.task-quick-edit-panel {
  margin-top: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--surface);
}
.task-quick-edit-panel summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}
.task-quick-edit-panel summary::-webkit-details-marker {
  display: none;
}
.task-quick-edit-panel summary span {
  display: grid;
  gap: 3px;
}
.task-quick-edit-panel summary small {
  color: var(--muted);
  font-weight: 730;
}
.task-quick-edit-panel summary em {
  color: var(--brand);
  font-style: normal;
  font-weight: 850;
}
.task-quick-edit-list {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}
.task-quick-edit-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(4, minmax(130px, 1fr)) auto;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container-low);
}
.task-quick-edit-title {
  display: grid;
  gap: 3px;
}
.task-quick-edit-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}
.task-quick-edit-row label {
  font-size: 12px;
}
.task-quick-edit-row select,
.task-quick-edit-row input {
  min-height: 38px;
  padding-top: 7px;
  padding-bottom: 7px;
}
.task-mini-summary {
  margin-top: 18px;
  margin-bottom: 8px;
  background: var(--md-sys-color-surface-container-low);
}
.task-mini-summary .eyebrow {
  margin-bottom: 4px;
}
.task-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.task-summary-grid span {
  display: grid;
  gap: 2px;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--md-sys-shape-corner-medium);
}
.task-summary-grid strong {
  color: var(--text);
  font-size: 12px;
}
.mini-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.small-metric {
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--md-sys-color-secondary-container);
  border-radius: var(--md-sys-shape-corner-large);
}
.small-metric strong { display: block; font-size: 24px; }
.small-metric span, .role-card small { color: var(--muted); font-weight: 800; }

.graphic-dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.graphic-dashboard-head h2 {
  margin: 0 0 4px;
  font-size: 26px;
}
.graphic-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.graphic-filter-chip {
  min-height: 34px;
  border-color: var(--line);
  background: var(--surface);
}
.graphic-filter-chip.active {
  color: var(--brand);
  background: var(--state-layer);
  border-color: var(--brand);
}
.graphic-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, .34fr);
  gap: 14px;
  align-items: start;
}
.graphic-dashboard-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.graphic-section {
  margin-bottom: 0;
}
.graphic-task-row {
  align-items: center;
}
.graphic-task-row .task-meta {
  margin-top: 5px;
}
.graphic-side-panel {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 18px;
  align-self: start;
}
.graphic-side-panel h3 {
  margin: 0 0 8px;
  font-size: 15px;
}
.graphic-side-block {
  display: grid;
  gap: 8px;
}
.graphic-side-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  color: inherit;
  text-align: left;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
}
.graphic-side-row:first-of-type {
  border-top: 0;
}
.graphic-side-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}
.graphic-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}
.graphic-summary-row:last-child {
  border-bottom: 0;
}
.graphic-summary-row strong {
  color: var(--text);
}
.graphic-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
}
.graphic-empty h2,
.graphic-empty p {
  margin: 0;
}
.team-load-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.team-load-card {
  display: grid;
  gap: 16px;
  grid-template-rows: 82px auto 46px;
  margin-bottom: 0;
  min-height: 258px;
  overflow: hidden;
  padding: 18px;
}
.team-load-card .panel-head {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 0;
  min-height: 82px;
}
.team-load-card .panel-head > div {
  min-width: 0;
}
.team-load-card .panel-head .pill {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  justify-self: end;
  min-height: 34px;
  min-width: 86px;
  padding: 6px 14px;
  text-align: center;
  white-space: nowrap;
}
.team-load-card .ghost.full {
  align-self: end;
  justify-self: stretch;
  margin-top: 0;
  min-height: 46px;
}
.team-member-heading {
  align-items: center;
  display: flex;
  gap: 10px;
  min-height: 48px;
}
.team-member-heading span:last-child {
  display: -webkit-box;
  line-height: 1.08;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.availability-dot {
  border: 2px solid color-mix(in srgb, var(--surface) 82%, transparent);
  border-radius: 999px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--line) 72%, transparent);
  display: inline-block;
  flex: 0 0 auto;
  height: 12px;
  width: 12px;
}
.availability-dot.available {
  background: #22C55E;
  box-shadow: 0 0 0 3px color-mix(in srgb, #22C55E 18%, transparent);
}
.availability-dot.unavailable {
  background: #EF4444;
  box-shadow: 0 0 0 3px color-mix(in srgb, #EF4444 18%, transparent);
}
.team-load-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 0;
}
.team-load-metric {
  align-items: center;
  min-width: 0;
  display: flex;
  gap: 12px;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  background: color-mix(in srgb, var(--brand) 5%, var(--surface-2));
  border-radius: var(--md-sys-shape-corner-medium);
}
.team-load-metric strong {
  color: var(--text);
  flex: 0 0 auto;
  font-size: 28px;
  line-height: 1;
}
.team-load-metric span {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.16;
}
.role-summary, .client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}
.brand-kit-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.brand-kit-card {
  margin-bottom: 0;
}
.brand-kit-card .panel-head {
  align-items: flex-start;
}
.danger-hint {
  color: var(--danger);
  font-weight: 780;
}
.brand-kit-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.brand-kit-links a,
.brand-kit-links > span:not(.brand-access-chip) {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 820;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}
.brand-kit-links small {
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--brand) 12%, white);
  font-size: 10px;
  font-weight: 900;
}
.brand-kit-links a:hover {
  border-color: var(--brand);
  background: var(--state-layer);
}
.brand-access-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}
.brand-access-main {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
}
.brand-access-chip button,
.brand-access-chip .brand-access-action {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand);
  background: var(--surface);
  font-size: 11px;
  font-weight: 880;
  text-decoration: none;
}
.brand-access-chip button:hover,
.brand-access-chip .brand-access-action:hover {
  border-color: var(--brand);
  background: var(--state-layer);
}
.brand-access-popover {
  position: fixed;
  z-index: 1200;
  width: min(360px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.brand-access-popover-head,
.brand-access-credential-row,
.brand-access-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-access-popover-head {
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.brand-access-popover-grid {
  display: grid;
  gap: 8px;
}
.brand-access-credential-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--surface-2);
}
.brand-access-credential-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.brand-access-credential-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 14px;
  letter-spacing: .02em;
}
.brand-access-row-actions {
  justify-content: flex-end;
}
.brand-access-popover button {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand);
  background: var(--surface);
  font-size: 12px;
  font-weight: 850;
}
.brand-access-popover button:hover {
  border-color: var(--brand);
  background: var(--state-layer);
}
.access-close-button {
  min-height: 26px !important;
  padding: 4px 8px !important;
  color: var(--muted) !important;
}
.access-eye-button {
  width: 32px;
  min-width: 32px;
  height: 30px;
  padding: 0 !important;
  display: grid;
  place-items: center;
}
.access-copy-button {
  width: 32px;
  min-width: 32px;
  height: 30px;
  padding: 0 !important;
  display: grid;
  place-items: center;
}
.copy-icon {
  width: 15px;
  height: 16px;
  position: relative;
  display: inline-block;
}
.copy-icon::before,
.copy-icon::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
  border-radius: 3px;
  background: var(--surface);
}
.copy-icon::before {
  left: 1px;
  top: 4px;
  width: 9px;
  height: 10px;
}
.copy-icon::after {
  left: 5px;
  top: 0;
  width: 9px;
  height: 10px;
}
.eye-icon {
  width: 17px;
  height: 11px;
  position: relative;
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 999px / 70%;
}
.eye-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.access-eye-button.is-hidden .eye-icon::after {
  content: "";
  position: absolute;
  left: -3px;
  top: 4px;
  width: 23px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-35deg);
}
.link-service-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
}
.link-service-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}
.link-service-icon img {
  width: 16px;
  height: 16px;
  display: block;
  border-radius: 4px;
  object-fit: contain;
}
.link-service-badge {
  color: var(--brand);
  font-size: 10px;
  font-weight: 900;
  border: 1px solid currentColor;
  border-radius: 5px;
  background: var(--surface);
}
.link-service-meta {
  color: #0866ff;
}
.link-service-facebook {
  color: #1877f2;
}
.link-service-tiktok {
  color: #ff0050;
}
.link-service-youtube {
  color: #ff0000;
}
.link-service-linkedin {
  color: #0a66c2;
}
.link-service-admin {
  color: #0f766e;
}
.link-service-password {
  color: #7c3aed;
}
.brand-kit-link-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--surface-2);
}
.brand-kit-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--surface);
}
.brand-link-row-top {
  display: grid;
  grid-template-columns: 38px minmax(180px, 1fr) 38px;
  align-items: end;
  gap: 12px;
}
.brand-link-row-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.brand-link-row-fields,
.brand-link-row-credentials {
  min-width: 0;
  display: grid;
  gap: 10px;
}
.brand-link-row-fields {
  grid-template-columns: minmax(180px, 1fr);
}
.brand-kit-link-row.has-credentials .brand-link-row-fields {
  grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr);
}
.brand-link-row-credentials {
  grid-template-columns: repeat(2, minmax(110px, 1fr));
}
.brand-link-row-credentials.hidden {
  display: none;
}
.brand-remove-link {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 0;
  position: relative;
}
.brand-remove-link::before,
.brand-remove-link::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}
.brand-remove-link::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
.brand-remove-link::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
.brand-link-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.brand-link-suggestions button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-inline: 10px;
}
.website-control-room .panel-head {
  align-items: flex-start;
}
.website-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 10px;
}
.website-site-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}
.website-site-head,
.website-task-list-head,
.website-card-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.website-site-head h2 {
  margin: 2px 0 0;
  font-size: 19px;
}
.website-access-strip,
.website-brand-links,
.website-progress-block,
.website-task-list {
  display: grid;
  gap: 8px;
}
.website-access-strip {
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: var(--md-sys-shape-corner-medium);
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
}
.website-access-strip > strong,
.website-brand-links > strong,
.website-task-list-head > strong {
  color: var(--text);
  font-size: 13px;
}
.website-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.website-section-head strong {
  color: var(--text);
  font-size: 13px;
}
.website-section-head .ghost {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}
.website-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}
.website-progress-meta strong {
  color: var(--text);
}
.website-progress-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}
.website-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #22c55e);
}
.website-countdown {
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 850;
}
.website-countdown.late {
  color: #991b1b;
  border-color: #fecaca;
  background: #fef2f2;
}
.website-card-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}
.website-card-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.website-card-meta .late {
  color: #b91c1c;
}
.website-task-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--surface);
}
.website-task-row:hover {
  border-color: var(--brand);
  background: var(--state-layer);
}
.website-task-row span {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.website-task-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.website-task-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.website-task-row em {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}
.website-task-row em.late {
  color: #b91c1c;
}
.website-card-actions {
  justify-content: space-between;
  flex-wrap: wrap;
}
.website-card-actions .primary,
.website-card-actions .ghost {
  min-height: 34px;
  padding: 7px 12px;
}
.website-detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.website-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.assignment-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}
.assignment-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--surface-2);
}
.assignment-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}
.assignment-check span {
  display: grid;
  gap: 2px;
  font-weight: 850;
}
.assignment-check small {
  color: var(--muted);
  font-weight: 760;
}
.task-row-button {
  width: 100%;
  text-align: left;
  border-radius: var(--md-sys-shape-corner-large);
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.task-row-button:hover {
  background: #fbfffd;
  border-color: var(--brand);
  transform: translateY(-1px);
}
.row-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.badge-row, .legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}
.dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  background: var(--gray);
}
.dot.todo, .seg.todo { background: #9ca3af; }
.dot.work, .seg.work { background: #2563eb; }
.dot.review, .seg.review { background: #f59e0b; }
.dot.changes, .seg.changes { background: #7c3aed; }
.dot.done, .seg.done { background: #16a34a; }
.dot.late, .seg.late { background: #dc2626; }
.ped-bar {
  height: 10px;
  display: flex;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-bottom: 10px;
  border-radius: 999px;
}
.seg { min-width: 0; }
.ped-overview-panel .legend {
  margin-top: 12px;
}
.ped-clean-grid {
  align-items: start;
}
.ped-card {
  display: grid;
  gap: 12px;
}
.ped-count-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.ped-count-row span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}
.ped-content-list {
  gap: 8px;
}
.ped-content-row {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--surface);
}
.ped-content-row:hover {
  border-color: var(--brand);
  background: #fbfffd;
}
.ped-content-row span:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.ped-content-row strong,
.ped-content-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ped-content-row small {
  color: var(--muted);
  font-weight: 760;
}
.note-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.note-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.note-search-row input {
  flex: 1;
}
.notes-grid {
  align-items: start;
}
.note-card {
  display: grid;
  gap: 12px;
}
.note-card.pinned {
  border-color: rgba(98,92,253,.38);
  background: #FAFAFF;
}
body.theme-dark .note-card.pinned {
  background: #10211f;
  border-color: rgba(201,198,255,.38);
}
.note-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.note-card p {
  white-space: pre-wrap;
}
.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}
.calendar-admin-grid, .calendar-focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}
.admin-calendar-hero {
  background: var(--md-sys-color-primary-container);
  border-color: #9acdc6;
}
.calendar-legend, .admin-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.admin-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.admin-action-grid .ghost {
  min-height: 36px;
  padding: 7px 12px;
}
.event-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 6px;
  background: var(--brand);
}
.event-dot.ok { background: var(--ok); }
.event-dot.warn { background: var(--warn); }
.event-dot.info { background: var(--brand-2); }
.event-dot.danger { background: var(--danger); }
.calendar-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.calendar-summary-item {
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.58);
  border-radius: var(--md-sys-shape-corner-large);
}
.calendar-summary-item strong {
  display: block;
  font-size: 26px;
  line-height: 1;
}
.calendar-summary-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.calendar-summary-item.ok { border-color: #bbf7d0; }
.calendar-summary-item.warn { border-color: #fde68a; }
.calendar-summary-item.danger { border-color: #fecaca; }
.calendar-summary-item.info { border-color: #bfdbfe; }
.calendar-main {
  min-height: auto;
}
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.calendar-weekdays span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}
.calendar-day {
  min-height: 116px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--surface-soft);
  min-width: 0;
}
.calendar-day.today {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}
.calendar-day.selected {
  background: #eef6ff;
}
.calendar-day.muted-day {
  background: transparent;
  border-color: transparent;
}
.day-number {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.day-number strong { color: var(--text); }
.day-events {
  display: grid;
  align-content: start;
  gap: 5px;
}
.event {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 5px 7px;
  border-radius: 9px;
  background: var(--md-sys-color-secondary-container);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event.ok { background: #dcfce7; color: #166534; }
.event.warn { background: #fef3c7; color: #92400e; }
.event.info { background: #dbeafe; color: #1d4ed8; }
.event.danger { background: #fee2e2; color: #991b1b; }
.free-slot {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}
.calendar-shell {
  display: grid;
  gap: 12px;
  padding: 16px;
  overflow: hidden;
}
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.calendar-nav,
.calendar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.calendar-nav h2 {
  margin: 0;
  font-size: 22px;
  text-transform: capitalize;
}
.icon-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
}
.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}
.segmented button {
  border: 0;
  border-radius: 999px;
  min-height: 30px;
  padding: 6px 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}
.segmented button.active {
  color: var(--md-sys-color-on-primary);
  background: var(--brand);
}
.calendar-sync-row,
.calendar-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}
.calendar-sync-row {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--surface-soft);
}
.filter-pill {
  min-height: 30px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 850;
}
.filter-pill.active {
  color: var(--brand);
  border-color: rgba(98,92,253,.35);
  background: rgba(98,92,253,.10);
}
.calendar-month {
  min-width: 0;
}
.month-grid {
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--line);
}
.month-day {
  border: 0;
  border-radius: 0;
  background: #fff;
  min-height: 132px;
  cursor: pointer;
  transition: background .16s ease, box-shadow .16s ease;
}
.month-day:hover {
  background: #FAFAFF;
  box-shadow: inset 0 0 0 1px rgba(98,92,253,.20);
}
.month-day.selected {
  background: #F1F0FF;
}
.calendar-day.today {
  border-color: transparent;
  box-shadow: inset 0 0 0 2px rgba(98,92,253,.38);
}
.day-number em {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--md-sys-color-on-primary);
  background: var(--brand);
  font-style: normal;
  font-size: 10px;
  text-transform: uppercase;
}
.more-events {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}
.calendar-availability-note {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 11px;
  font-weight: 850;
}
.calendar-event,
.timed-event {
  display: block;
  width: 100%;
  min-height: 24px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-left-width: 4px;
  border-radius: 8px;
  color: var(--text);
  background: #eef6ff;
  font-size: 11px;
  font-weight: 850;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calendar-event:hover,
.timed-event:hover {
  filter: brightness(.985);
  transform: none;
}
.event-task { background: #eff6ff; border-left-color: #2563eb; }
.event-deadline { background: #fff1f2; border-left-color: #dc2626; }
.event-meeting { background: #f5f3ff; border-left-color: #7c3aed; }
.event-publication { background: #ecfdf5; border-left-color: #16a34a; }
.event-google { background: #eef6ff; border-left-color: #60a5fa; }
.event-busy { background: #f3f4f6; border-left-color: #9ca3af; color: #4b5563; }
.day-view {
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-large);
  background: #fff;
  overflow: hidden;
}
.all-day-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.all-day-row > span,
.all-day-row > div {
  padding: 10px;
}
.all-day-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  border-right: 1px solid var(--line);
}
.all-day-row > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.day-timeline {
  display: grid;
  grid-template-columns: 92px minmax(680px, 1fr);
  max-height: 680px;
  overflow: auto;
}
.time-column {
  display: grid;
  grid-template-rows: repeat(16, 68px);
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
}
.time-column span {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  border-bottom: 1px solid var(--line);
}
.time-grid {
  position: relative;
  min-height: 1088px;
  background:
    repeating-linear-gradient(to bottom, transparent 0, transparent 67px, var(--line) 68px);
}
.time-slot {
  display: block;
  width: 100%;
  height: 68px;
  border: 0;
  background: transparent;
}
.time-slot:hover {
  background: rgba(98,92,253,.06);
}
.time-slot.unavailable-slot {
  background: repeating-linear-gradient(
    -45deg,
    rgba(243,244,246,.72),
    rgba(243,244,246,.72) 8px,
    rgba(249,250,251,.72) 8px,
    rgba(249,250,251,.72) 16px
  );
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  padding-left: 10px;
}
.time-slot.unavailable-slot span {
  opacity: .72;
}
.timed-event {
  position: absolute;
  z-index: 2;
  min-height: 34px;
  white-space: normal;
  box-shadow: 0 2px 8px rgba(15,23,42,.08);
}
.timed-event strong,
.timed-event span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timed-event span {
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}
.now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 4;
  background: #dc2626;
}
.now-line::before {
  content: '';
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #dc2626;
}
.team-day-view {
  --team-user-col: 220px;
  --team-time-col: 76px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-large);
  background: #fff;
  overflow: auto;
  max-width: 100%;
}
.team-scroll-hint {
  position: sticky;
  left: 0;
  z-index: 5;
  width: fit-content;
  margin: 8px;
  padding: 6px 10px;
  color: var(--muted);
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}
.team-day-header,
.team-day-grid {
  display: grid;
  grid-template-columns: var(--team-time-col) repeat(var(--team-columns), var(--team-user-col));
  min-width: calc(var(--team-time-col) + (var(--team-columns) * var(--team-user-col)));
}
.team-day-header {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}
.team-day-header > span,
.team-day-header strong {
  padding: 10px;
  border-right: 1px solid var(--line);
  font-size: 12px;
}
.team-day-header small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}
.team-day-header > span,
.team-hour {
  position: sticky;
  left: 0;
  z-index: 3;
}
.team-day-header > span {
  z-index: 6;
  background: var(--surface-soft);
}
.team-hour,
.team-person-slot {
  min-height: 68px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.team-hour {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 850;
}
.team-person-slot {
  display: grid;
  align-content: start;
  gap: 5px;
}
.event-detail-grid {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 9px 14px;
}
.event-detail-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.event-detail-grid strong small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.calendar-form-section {
  gap: 12px;
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 2px;
}
.section-title strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
}
.section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  text-align: right;
}
.calendar-option-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, max-content));
}
.conflict-box,
.integration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid #fde68a;
  border-radius: var(--md-sys-shape-corner-large);
  background: #fffbeb;
  margin-top: 14px;
}
.integration-row {
  border-color: var(--line);
  background: var(--surface-soft);
  margin-top: 0;
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, max-content));
  gap: 10px 18px;
  align-items: start;
}
.check-grid label {
  width: fit-content;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 820;
}
.task-quick-form .check-grid {
  padding: 2px 0;
}
.task-quick-form .check-grid label {
  max-width: 220px;
}
.settings-jump-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.settings-jump-row span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.settings-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.settings-nav-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 18px;
}
.settings-scroll-hint {
  display: none;
}
.settings-nav-group {
  display: grid;
  gap: 7px;
}
.settings-nav-group p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.settings-nav-button {
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  border: 1px solid transparent;
  border-radius: var(--md-sys-shape-corner-large);
  background: transparent;
  color: var(--text);
  font-weight: 850;
  box-shadow: none;
}
.settings-nav-button:hover {
  background: var(--surface-soft);
  border-color: var(--line);
}
.settings-nav-button.active {
  background: var(--state-layer);
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  color: var(--brand);
}
.settings-content-panel {
  min-width: 0;
}
.settings-section {
  display: grid;
  gap: 16px;
}
.settings-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.settings-section-head h2,
.settings-card-soft h3 {
  margin: 0;
}
.settings-avatar {
  width: 56px;
  height: 56px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 18px;
  background: var(--brand);
  color: var(--md-sys-color-on-primary);
  font-weight: 950;
  overflow: hidden;
}
.profile-photo-editor {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--md-radius-card);
  background: var(--md-sys-color-surface-container);
}
.profile-photo-preview {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background: var(--brand);
  color: var(--md-sys-color-on-primary);
  font-size: 28px;
  font-weight: 950;
  overflow: hidden;
}
.file-button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
}
.file-button input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.compact-actions {
  margin-top: 10px;
}
.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.settings-form-grid .actions {
  grid-column: 1 / -1;
}
.settings-stack {
  display: grid;
  gap: 14px;
}
.settings-card-soft {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--surface-soft);
}
.settings-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  font-weight: 780;
}
.settings-toggle-row input {
  width: 18px;
  min-height: 18px;
}
.settings-list {
  display: grid;
  gap: 9px;
}
.settings-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--surface-soft);
}
.settings-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.settings-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.settings-chip-list span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.settings-danger-zone {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #fecaca;
  border-radius: var(--md-sys-shape-corner-large);
  background: #fef2f2;
}
.availability-editor {
  display: grid;
  gap: 16px;
}
.availability-editor-block {
  display: grid;
  gap: 10px;
}
.availability-days {
  display: grid;
  gap: 8px;
}
.availability-day-row {
  display: grid;
  grid-template-columns: minmax(130px, .7fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(112px, auto);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: var(--md-sys-shape-corner-large);
}
.availability-day-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 850;
}
.availability-day-toggle input,
.availability-exception-row input {
  width: 18px;
  min-height: 18px;
}
.availability-day-state {
  justify-self: end;
  padding: 5px 9px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 850;
}
.availability-day-state.off {
  background: #f3f4f6;
  color: #6b7280;
}
.availability-exceptions {
  display: grid;
  gap: 8px;
}
.availability-exception-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--surface-soft);
  font-weight: 760;
}
.task-type-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.task-type-tabs label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 850;
}
.task-type-tabs label:has(input:checked) {
  color: var(--md-sys-color-on-primary);
  background: var(--brand);
  border-color: var(--brand);
}
.task-type-tabs label.disabled {
  opacity: .45;
  cursor: not-allowed;
}
.task-type-tabs input {
  width: auto;
  min-height: auto;
}
.availability-list {
  display: grid;
  gap: 9px;
}
.availability-row {
  display: grid;
  grid-template-columns: minmax(150px, .75fr) minmax(220px, 1fr) minmax(130px, auto);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--md-sys-shape-corner-large);
  min-width: 0;
}
.availability-person {
  display: grid;
  gap: 2px;
}
.availability-person span,
.availability-status small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}
.availability-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.availability-slots span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}
.availability-status {
  display: grid;
  justify-items: end;
  gap: 4px;
}
.week-grid {
  display: grid;
  grid-template-columns: minmax(96px, .72fr) repeat(5, minmax(44px, 1fr));
  gap: 8px;
  min-width: 0;
}
.week-person,
.week-cell {
  min-height: 52px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--md-sys-shape-corner-medium);
}
.week-person span,
.week-cell small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}
.week-cell {
  text-align: center;
  font-weight: 850;
  overflow: hidden;
}
.week-cell small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.week-cell.ok { background: #ecfdf5; border-color: #bbf7d0; }
.week-cell.warn { background: #fffbeb; border-color: #fde68a; }
.week-cell.danger { background: #fef2f2; border-color: #fecaca; }
.action-panel {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.task-summary-actions {
  display: grid;
  margin: 0 0 14px;
}
.task-action-grid {
  display: grid;
  gap: 8px;
}
.task-action-primary {
  display: grid;
}
.task-action-primary-row {
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  gap: 8px;
}
.task-primary-action {
  min-height: 44px;
  font-size: 15px;
}
.task-postpone-action {
  min-width: 150px;
  min-height: 44px;
}
@media (max-width: 560px) {
  .task-action-primary-row {
    grid-template-columns: 1fr;
  }
  .task-postpone-action {
    width: 100%;
  }
}
.task-action-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.task-action-secondary .ghost,
.task-action-secondary .danger {
  min-height: 36px;
}
.task-manage-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 16px;
}
.task-manage-actions .ghost {
  min-width: 128px;
}
.review-submit-form {
  padding-top: 18px;
}
.review-delivery-card {
  background: var(--md-sys-color-surface-container-low);
}
.review-existing-files {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--surface);
}
.review-existing-files a {
  color: var(--brand);
  font-weight: 820;
  overflow-wrap: anywhere;
}
.review-output-card {
  background: #f8fafc;
}
.review-output-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-full);
  color: var(--brand);
  background: var(--surface);
  font-weight: 850;
  text-decoration: none;
}
.review-changes-card {
  border-color: #fecaca;
  background: #fff7f7;
}
.review-reason-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.review-reason-chip {
  min-height: 38px;
  padding: 7px 12px;
}
.review-reason-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.review-reason-chip:has(input:checked) {
  border-color: var(--danger);
  color: #991b1b;
  background: #fee2e2;
}
.review-changes-form textarea {
  min-height: 132px;
  resize: vertical;
}
.client-row, .notification-row, .activity-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}
.client-row {
  align-items: center;
}
.notification-row.unread { border-color: var(--brand); background: #F1F0FF; }
.notification-row {
  align-items: center;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.notification-row:hover {
  border-color: var(--brand);
  background: var(--state-layer);
}
.notification-row .row-badges {
  align-items: center;
  justify-content: flex-end;
  min-width: 74px;
}
.notification-open-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--brand);
  background: var(--surface);
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
}
.notification-row:hover .notification-open-chip {
  border-color: var(--brand);
  background: var(--surface);
}
.activity-row { color: var(--muted); }
.notification-metrics {
  margin-bottom: 14px;
}
.notification-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.notification-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.notification-title-line strong {
  color: var(--text);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, .34);
  z-index: 10;
}
.drawer {
  width: min(720px, 100%);
  height: 100vh;
  overflow-y: auto;
  padding: 20px;
  background: var(--md-sys-color-surface);
  box-shadow: var(--shadow);
}
.drawer-head {
  position: static;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: -20px -20px 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 250, 248, .94);
  backdrop-filter: blur(12px);
}
.drawer-head h2 { margin: 0; }
.drawer-head #closeDrawerBtn.ghost {
  position: relative;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  font-size: 0;
}
.drawer-head #closeDrawerBtn.ghost::before {
  width: 16px;
}
.create-task-head {
  align-items: flex-start;
}
.create-task-head .muted {
  margin: 4px 0 0;
}
.icon-close {
  position: relative;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--brand);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0;
}
.icon-close:hover {
  background: var(--state-layer);
  border-color: var(--brand);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.task-quick-form {
  display: grid;
  gap: 14px;
}
.task-create-form {
  display: grid;
  gap: 14px;
  padding-top: 14px;
  padding-bottom: 74px;
}
.form-section {
  display: grid;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--md-sys-shape-corner-large);
}
details.form-section { display: block; }
details.form-section[open] { display: grid; }
.form-section summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 850;
}
.form-section-title {
  display: grid;
  gap: 2px;
}
.form-section-title strong {
  font-size: 16px;
}
.form-section-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.task-type-section {
  gap: 10px;
}
.task-type-tabs.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.task-type-tabs.compact label {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 12px;
  font-size: 13px;
}
.task-type-tabs.compact input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.create-essential {
  gap: 18px;
}
.create-essential [data-task-fields] {
  display: grid;
  gap: 16px;
}
.create-essential .grid-2 {
  column-gap: 16px;
  row-gap: 14px;
}
.create-essential label {
  gap: 7px;
}
.create-assignee-select {
  min-height: 96px;
}
.create-assignee-field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.create-essential .chip-field,
.create-essential .choice-chips {
  margin-top: 2px;
}
.chip-field {
  display: grid;
  gap: 8px;
}
.chip-field > span {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}
.choice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.choice-chips label {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 820;
}
.choice-chips input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice-chips label:has(input:checked) {
  color: var(--md-sys-color-on-primary);
  background: var(--brand);
  border-color: var(--brand);
}
.pm-work-form .form-section {
  gap: 16px;
}
.pm-work-form .task-type-tabs.wrap {
  row-gap: 8px;
}
.pm-work-form [data-pm-linked-task-field] select {
  width: 100%;
}
.client-combobox {
  position: relative;
}
.client-combo-wrap {
  position: relative;
  display: block;
}
.client-combo-wrap input {
  padding-right: 48px;
}
.client-combo-trigger {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 9%, transparent);
}
.client-combo-trigger::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translate(-50%, -62%) rotate(45deg);
}
.client-combobox.open .client-combo-trigger {
  background: var(--state-layer);
}
.client-combobox.open .client-combo-trigger::before {
  transform: translate(-50%, -38%) rotate(225deg);
}
.client-combo-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 150;
  width: 100%;
  min-width: min(360px, 100%);
  max-height: 264px;
  overflow: auto;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(16, 24, 22, .18);
}
.client-combo-menu[hidden] {
  display: none !important;
}
.client-combo-menu::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 26px;
  width: 14px;
  height: 14px;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  background: var(--surface);
  transform: rotate(45deg);
}
.client-combo-menu button,
.client-combo-empty {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  color: var(--text);
  background: transparent;
  font-weight: 780;
  text-align: left;
}
.client-combo-menu button:hover,
.client-combo-menu button:focus-visible {
  color: var(--brand);
  background: var(--state-layer);
  outline: none;
}
.client-combo-empty {
  color: var(--muted);
  font-weight: 700;
}
.pm-work-form [data-pm-project-field].hidden {
  display: none;
}
.pm-work-form .pm-client-project-grid:has([data-pm-project-field].hidden) {
  grid-template-columns: 1fr;
}
.pm-work-form textarea {
  min-height: 96px;
}
.pm-work-form .form-hint {
  margin: 0;
  max-width: 620px;
}
.pm-work-form .task-create-footer {
  z-index: 12;
}

.app-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 24, 22, .38);
  backdrop-filter: blur(4px);
}

.app-dialog {
  width: min(520px, 100%);
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-extra-large);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(16, 24, 22, .22);
  animation: dialogIn .16s ease-out;
}

.app-dialog.shake {
  animation: dialogShake .22s ease-in-out;
}

.app-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-dialog-head h2 {
  margin: 0;
  font-size: clamp(22px, 4vw, 28px);
}

.app-dialog-message {
  margin: 0;
  color: var(--muted);
  font-weight: 690;
}

.app-dialog-input {
  color: var(--text);
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dialogShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.optional-task-details {
  padding: 0;
  overflow: hidden;
}
.optional-task-details summary,
.task-edit-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  list-style: none;
}
.optional-task-details summary::-webkit-details-marker,
.task-edit-details summary::-webkit-details-marker {
  display: none;
}
.optional-task-details summary span,
.task-edit-details summary span {
  display: grid;
  gap: 3px;
}
.optional-task-details summary small,
.task-edit-details summary small {
  color: var(--muted);
  font-weight: 730;
}
.optional-task-details summary em,
.task-edit-details summary em {
  color: var(--brand);
  font-style: normal;
  font-weight: 850;
}
.optional-task-details[open],
.task-edit-details[open] {
  padding: 0 14px 14px;
}
.optional-task-details[open] summary,
.task-edit-details[open] summary {
  margin: 0 -14px;
  border-bottom: 1px solid var(--line);
}
.task-edit-details {
  padding: 0;
  overflow: hidden;
}
.checklist-trello-head {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.checklist-simple-head {
  margin-bottom: 0;
}
.checklist-simple-head h2 {
  font-size: 20px;
  line-height: 1.25;
}
.checklist-progress-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 44px minmax(0, 1fr);
}
.checklist-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 70%, transparent);
}
.checklist-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}
.task-checklist-top .check-row {
  min-height: 42px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  font-weight: 760;
}
.task-checklist-list {
  display: grid;
  gap: 4px;
}
.checklist-view-row {
  align-items: flex-start;
  justify-content: space-between;
}
.checklist-view-row label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.checklist-view-row span,
.checklist-step-main {
  min-width: 0;
  overflow-wrap: anywhere;
}
.checklist-step-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  flex: 1 1 auto;
}
.checklist-step-main input[type="checkbox"] {
  margin-top: 4px;
}
.checklist-step-main strong {
  display: block;
  line-height: 1.35;
}
.checklist-view-row.is-done strong {
  color: var(--muted);
  text-decoration: line-through;
}
.checklist-step-main small {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}
.checklist-step-main em {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 780;
  padding: 2px 7px;
}
.checklist-row-tools {
  display: flex;
  gap: 6px;
}
.compact-move {
  align-items: center;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  min-height: 32px;
  min-width: 32px;
  padding: 0;
  width: 32px;
}
.compact-move:disabled {
  opacity: .35;
  pointer-events: none;
}
.compact-remove {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  color: var(--danger);
  border-color: #fecaca;
  font-size: 0;
}
.checklist-add-trigger {
  justify-content: flex-start;
  margin-top: 10px;
  width: auto;
}
.checklist-composer {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.checklist-composer > input {
  min-height: 40px;
}
.checklist-composer-actions {
  display: flex;
  gap: 8px;
}
.task-edit-shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.task-edit-shortcut h2 {
  margin: 0 0 4px;
}
.task-detail-edit-form {
  padding-top: 18px;
  padding-bottom: 74px;
}
.task-create-footer {
  position: sticky;
  bottom: -20px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 4px -20px -20px;
  padding: 12px 20px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(247, 250, 248, .96);
  backdrop-filter: blur(14px);
}
.create-task-missing-hint {
  flex: 1 1 auto;
  margin: 0;
  text-align: left;
}
.task-create-footer .primary:disabled {
  opacity: .48;
  cursor: not-allowed;
  box-shadow: none;
}
.checklist-empty-state {
  margin: 0;
  padding: 10px 0;
}
.multi-select {
  min-height: 122px;
}
.toggle-row {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--md-sys-shape-corner-medium);
}
.toggle-row input {
  width: 18px;
  min-height: 18px;
}
.template-builder {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-sys-shape-corner-large);
}
.template-option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-medium);
}
.template-option input {
  width: 18px;
  min-height: 18px;
}
.template-option span {
  display: grid;
  gap: 2px;
}
.template-option small {
  color: var(--muted);
  font-weight: 760;
}
.weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.weekday-grid label {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 999px;
}
.weekday-grid input {
  width: 16px;
  min-height: 16px;
}
.comment {
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--md-sys-shape-corner-medium);
}
.comment strong { display: block; }
.upload-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}
.check-row input[type="checkbox"] { width: 18px; min-height: 18px; }
.checklist-editor {
  display: grid;
  gap: 8px;
}
.checklist-editor-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--surface-2);
}
.checklist-editor-row input[name="checklist_label"] {
  min-height: 38px;
  background: var(--surface);
}
.remove-step-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  color: var(--danger);
  border-color: #fecaca;
  font-size: 0;
}
.remove-step-button::before,
.remove-step-button::after {
  width: 12px;
  height: 2px;
}
.check-square {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
}
.check-square input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.check-square span {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--md-sys-color-outline);
  border-radius: 6px;
  background: var(--surface);
}
.check-square input:checked + span {
  border-color: var(--brand);
  background: var(--brand);
}
.check-square input:checked + span::after {
  content: "";
  width: 10px;
  height: 5px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
}

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
}

@media (max-width: 980px) {
  .login-page, .app-shell { grid-template-columns: 1fr; }
  .login-hero { min-height: 42vh; }
  .login-hero h1 { font-size: 46px; }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    padding-bottom: 8px;
  }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-overview-grid,
  .admin-overview-main {
    grid-template-columns: 1fr;
  }
  .calendar-layout { grid-template-columns: 1fr; }
  .calendar-admin-grid { grid-template-columns: 1fr; }
  .calendar-focus-grid { grid-template-columns: 1fr; }
  .calendar-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-main { min-height: auto; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { justify-content: flex-start; width: 100%; }
  .availability-row { grid-template-columns: 1fr; }
  .availability-status { justify-items: start; }
  .week-grid {
    grid-template-columns: minmax(120px, .7fr) repeat(5, minmax(68px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .week-person, .week-cell { min-width: 82px; }
  .day-timeline {
    grid-template-columns: 74px minmax(620px, 1fr);
  }
  .all-day-row {
    grid-template-columns: 74px 1fr;
  }
  .team-day-view {
    --team-user-col: 190px;
  }
  .graphic-dashboard-layout {
    grid-template-columns: 1fr;
  }
  .graphic-side-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .login-panel, .workspace, .sidebar { padding: 16px; }
  body { font-size: 14px; }
  .login-hero {
    min-height: 34vh;
    padding: 24px;
  }
  .login-hero h1 { font-size: 42px; }
  .login-hero p:not(.eyebrow) { font-size: 16px; }
  .form-card {
    padding: 20px;
    border-radius: var(--md-sys-shape-corner-large);
  }
  .brand-mark {
    width: 38px;
    height: 38px;
  }
  .nav-item {
    min-height: 38px;
    padding: 8px 11px;
  }
  .topbar {
    gap: 12px;
    min-height: auto;
    margin-bottom: 16px;
  }
  .topbar h1 { font-size: 26px; }
  .top-actions .primary,
  .top-actions .ghost {
    flex: 1;
    min-width: 136px;
  }
  .panel {
    padding: 14px;
    border-radius: var(--md-sys-shape-corner-medium);
  }
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .panel-head .primary,
  .panel-head .ghost {
    width: 100%;
  }
  .graphic-dashboard-head {
    display: grid;
  }
  .graphic-dashboard-head .primary {
    width: 100%;
  }
  .graphic-chip-row {
    display: grid;
    grid-template-columns: 1fr;
  }
  .graphic-task-row {
    align-items: flex-start;
  }
  .metrics, .grid-2 { grid-template-columns: 1fr; }
  .admin-overview-hero h2 {
    font-size: 22px;
  }
  .admin-team-grid {
    grid-template-columns: 1fr;
  }
  .admin-team-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .admin-team-footer .ghost {
    width: 100%;
  }
  .admin-supervision-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .brand-kit-link-row,
  .brand-kit-link-row.has-credentials {
    grid-template-columns: 1fr;
  }
  .brand-link-row-icon {
    justify-self: start;
  }
  .brand-link-row-top,
  .brand-link-row-fields,
  .brand-link-row-credentials {
    grid-template-columns: 1fr;
  }
  .brand-remove-link {
    justify-self: start;
  }
  .profile-photo-editor {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .checklist-editor-row { grid-template-columns: auto minmax(0, 1fr); }
  .checklist-editor-row [data-remove-checklist-step] { grid-column: 2; justify-self: start; }
  .nav { grid-template-columns: 1fr; }
  .toolbar input, .toolbar select { width: 100%; }
  .client-row, .notification-row, .activity-row { flex-direction: column; }
  .drawer {
    width: 100%;
    padding: 16px;
  }
  .drawer-head {
    margin: -16px -16px 14px;
    padding: 14px 16px 12px;
  }
  .drawer-head h2 {
    font-size: 20px;
  }
  .task-create-form {
    padding-bottom: 84px;
  }
  .task-create-footer {
    margin: 4px -16px -16px;
    padding-inline: 16px;
  }
  .task-create-footer .ghost,
  .task-create-footer .primary {
    flex: 1;
  }
  .choice-chips,
  .task-type-tabs.compact {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .choice-chips label,
  .task-type-tabs.compact label {
    white-space: nowrap;
  }
  .actions .primary,
  .actions .ghost,
  .actions .danger {
    flex: 1;
    min-width: 138px;
  }
  .mini-metrics { grid-template-columns: 1fr; }
  .team-load-card {
    grid-template-rows: auto auto auto;
    min-height: 0;
  }
  .team-load-card .panel-head {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
  }
  .team-load-card .panel-head .pill {
    min-width: 92px;
  }
  .team-load-metrics { grid-template-columns: 1fr; }
  .team-load-metric {
    min-height: 58px;
  }
  .calendar-weekdays { display: none; }
  .calendar-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    border: 0;
    background: transparent;
  }
  .calendar-day {
    min-height: auto;
    grid-template-columns: 54px 1fr;
    align-items: start;
    padding: 10px 12px;
  }
  .calendar-day.muted-day { display: none; }
  .day-number {
    display: grid;
    justify-items: start;
    gap: 2px;
  }
  .day-number strong {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: var(--surface-2);
  }
  .calendar-day.today .day-number strong {
    color: var(--md-sys-color-on-primary);
    background: var(--brand);
  }
  .day-events {
    min-width: 0;
  }
  .event {
    width: fit-content;
    max-width: 100%;
  }
  .calendar-toolbar,
  .calendar-nav,
  .calendar-actions,
  .calendar-sync-row,
  .calendar-filter-row {
    align-items: stretch;
    width: 100%;
  }
  .calendar-nav h2 {
    font-size: 19px;
  }
  .segmented,
  .calendar-actions .primary {
    width: 100%;
  }
  .segmented button {
    flex: 1;
  }
  .calendar-event {
    white-space: normal;
  }
  .day-view,
  .team-day-view {
    margin-left: -6px;
    margin-right: -6px;
    border-radius: var(--md-sys-shape-corner-medium);
  }
  .team-day-view {
    --team-user-col: 168px;
    --team-time-col: 62px;
  }
  .day-timeline {
    grid-template-columns: 62px minmax(540px, 1fr);
    max-height: 70vh;
  }
  .all-day-row {
    grid-template-columns: 62px 1fr;
  }
  .time-column {
    grid-template-rows: repeat(16, 64px);
  }
  .time-grid {
    min-height: 1024px;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 63px, var(--line) 64px);
  }
  .time-slot {
    height: 64px;
  }
  .event-detail-grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .integration-row,
  .conflict-box {
    flex-direction: column;
    align-items: stretch;
  }
  .settings-shell,
  .settings-form-grid {
    grid-template-columns: 1fr;
  }
  .settings-nav-panel {
    position: static;
  }
  .settings-nav-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings-nav-group p {
    grid-column: 1 / -1;
  }
  .settings-section-head,
  .settings-list-row {
    flex-direction: column;
    align-items: stretch;
  }
  .availability-day-row {
    grid-template-columns: 1fr;
  }
  .task-type-tabs {
    grid-template-columns: 1fr;
  }
  .free-slot {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
  }
  .row-badges { justify-content: flex-start; }
  .weekday-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-summary { grid-template-columns: 1fr; }
  .calendar-summary-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }
  .availability-row {
    gap: 10px;
  }
  .note-search-row {
    flex-direction: column;
    align-items: stretch;
  }
  .note-card-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .availability-slots {
    display: grid;
    grid-template-columns: 1fr;
  }
  .availability-slots span {
    border-radius: var(--md-sys-shape-corner-medium);
  }
  .week-grid {
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .week-person {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-2);
  }
  .week-cell {
    grid-template-columns: 52px 1fr;
    text-align: left;
  }
}

/* Final mobile overrides kept at the end so they win over legacy responsive rules. */
@media (max-width: 980px) {
  body.nav-open { overflow: hidden; }
  .app-shell { display: block; min-height: 100svh; }
  .mobile-menu-button { display: inline-grid; flex: 0 0 auto; }
  .sidebar-close { display: inline-grid; place-items: center; }
  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    background: rgba(15, 23, 21, .36);
    backdrop-filter: blur(2px);
  }
  body.nav-open .mobile-sidebar-backdrop { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 90;
    width: min(86vw, 340px);
    height: 100svh;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    border-right: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 0 28px 28px 0;
    box-shadow: 0 20px 48px rgba(16, 24, 22, .24);
    transform: translateX(-104%);
    transition: transform .24s cubic-bezier(.2, 0, 0, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar .brand { padding-right: 48px; }
  .sidebar .nav { display: grid; grid-template-columns: 1fr; }
  .sidebar .nav-item {
    min-height: 46px;
    padding: 11px 14px;
    border-radius: 999px;
    font-size: 14px;
  }
  .workspace {
    max-width: none;
    min-height: 100svh;
    padding: max(14px, env(safe-area-inset-top)) 16px 96px;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    margin: -8px -8px 14px;
    padding: 8px;
    border: 1px solid rgba(190, 201, 197, .78);
    border-radius: 0 0 24px 24px;
    background: rgba(247, 250, 248, .92);
    backdrop-filter: blur(16px);
  }
  .topbar h1 {
    font-size: clamp(22px, 6vw, 28px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar .eyebrow { margin-bottom: 2px; font-size: 10px; }
  .top-actions { justify-content: flex-end; width: auto; }
  #enableNotificationsBtn { display: none; }
  #contextActionBtn {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 70;
    min-height: 52px;
    max-width: calc(100vw - 32px);
    padding: 0 20px;
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(98, 92, 253, .28);
  }
  .toolbar,
  .graphic-chip-row,
  .calendar-filter-row,
  .settings-nav-group,
  .row-badges,
  .task-type-tabs,
  .calendar-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .toolbar::-webkit-scrollbar,
  .graphic-chip-row::-webkit-scrollbar,
  .calendar-filter-row::-webkit-scrollbar,
  .settings-nav-group::-webkit-scrollbar,
  .row-badges::-webkit-scrollbar,
  .task-type-tabs::-webkit-scrollbar,
  .calendar-actions::-webkit-scrollbar { display: none; }
  .toolbar > *,
  .graphic-chip-row > *,
  .calendar-filter-row > *,
  .settings-nav-button,
  .row-badges > *,
  .task-type-tabs > *,
  .calendar-actions > * {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
  .metrics,
  .mini-metrics,
  .team-load-metrics,
  .calendar-summary {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 74vw);
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .metrics::-webkit-scrollbar,
  .mini-metrics::-webkit-scrollbar,
  .team-load-metrics::-webkit-scrollbar,
  .calendar-summary::-webkit-scrollbar { display: none; }
  .table-wrap,
  .board,
  .team-day-view,
  .day-view,
  .week-grid { -webkit-overflow-scrolling: touch; }
}

@media (max-width: 640px) {
  .workspace { padding-inline: 12px; }
  .topbar {
    margin-inline: -4px;
    grid-template-columns: auto minmax(0, 1fr);
  }
  .top-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .panel { padding: 14px; border-radius: 22px; }
  .graphic-dashboard-layout,
  .calendar-layout,
  .calendar-admin-grid,
  .calendar-focus-grid,
  .settings-shell,
  .settings-form-grid,
  .grid-2,
  .notes-grid,
  .client-grid,
  .role-summary { grid-template-columns: 1fr; }
  .brand-kit-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 86vw);
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .brand-kit-grid > * { scroll-snap-align: start; }
  .panel-head { gap: 8px; }
  .panel-head .primary,
  .panel-head .ghost { width: auto; }
  .task-list-page {
    gap: 10px;
  }
  .task-list-head h2 {
    font-size: 23px;
  }
  .task-list-search input {
    min-height: 44px;
    border-radius: 18px;
  }
  .task-status-chips,
  .task-list-controls {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
    -webkit-overflow-scrolling: touch;
  }
  .task-status-chips::-webkit-scrollbar,
  .task-list-controls::-webkit-scrollbar {
    display: none;
  }
  .task-status-chip {
    flex: 0 0 auto;
    min-height: 32px;
    padding-inline: 10px;
  }
  .task-list-controls {
    justify-content: flex-start;
  }
  .task-list-controls label {
    flex: 0 0 auto;
    min-width: max-content;
  }
  .task-list-card {
    padding: 13px;
    border-radius: 20px;
  }
  .task-list-card h3 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 16px;
  }
  .task-list-card .pill {
    min-height: 22px;
    padding: 3px 9px;
    font-size: 11px;
  }
  .task-list-card-extra {
    display: none;
  }
  .task-quick-edit-panel summary {
    align-items: flex-start;
  }
  .task-quick-edit-row {
    grid-template-columns: 1fr;
  }
  .task-quick-edit-row .ghost {
    width: 100%;
  }
  .task-foot,
  .client-row,
  .notification-row,
  .activity-row,
  .upload-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .drawer {
    width: 100%;
    max-width: none;
    height: 100svh;
    border-radius: 0;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
  .drawer-head {
    position: static;
    background: rgba(247, 250, 248, .96);
    backdrop-filter: blur(14px);
  }
  input,
  select,
  textarea {
    min-height: 46px;
    font-size: 16px;
  }
  .settings-nav-panel {
    position: sticky;
    top: 76px;
    z-index: 20;
    margin-inline: -2px;
    background: rgba(247, 250, 248, .94);
    backdrop-filter: blur(12px);
  }
  .settings-nav-group { display: flex; }
  .settings-nav-group p { display: none; }
  .calendar-sync-row { align-items: stretch; }
  .calendar-sync-row .ghost,
  .calendar-actions .primary { width: auto; }
  .calendar-nav {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
  }
  .calendar-nav h2 { min-width: max-content; }
}

/* Calendar mobile readability */
@media (max-width: 700px) {
  .calendar-shell {
    gap: 12px;
    padding: 12px;
    border-radius: 22px;
  }
  .calendar-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
  }
  .calendar-nav {
    display: grid;
    grid-template-columns: auto auto auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    overflow-x: visible;
  }
  .calendar-nav h2 {
    margin: 0;
    min-width: 0;
    font-size: 20px;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .calendar-nav .ghost {
    min-width: 40px;
    min-height: 40px;
    padding-inline: 10px;
  }
  .calendar-actions {
    justify-content: flex-start;
  }
  .calendar-sync-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }
  .calendar-filter-row {
    margin-inline: -2px;
    padding-inline: 2px;
  }
  .calendar-filter-row .filter-pill {
    min-height: 34px;
    padding-inline: 12px;
  }
  .calendar-month .calendar-grid,
  .month-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    border: 0;
    background: transparent;
  }
  .calendar-day.month-day,
  .calendar-day {
    min-height: 92px;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
  }
  .calendar-day.muted-day {
    display: none;
  }
  .calendar-day .day-events {
    display: grid;
    gap: 6px;
  }
  .calendar-event,
  .event {
    width: 100%;
    max-width: 100%;
    min-height: 30px;
    white-space: normal;
  }
  .day-view,
  .team-day-view {
    overflow-x: auto;
    border-radius: 18px;
  }
  .day-timeline {
    min-width: 640px;
  }
  .team-day-view {
    --team-user-col: 176px;
    --team-time-col: 60px;
  }
}

/* Mobile heading/button refinement */
@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;
    border-color: rgba(190, 201, 197, .62);
    box-shadow: 0 8px 24px rgba(21, 31, 29, .08);
  }
  .mobile-menu-button {
    width: 38px;
    height: 38px;
    padding: 0;
    gap: 3px;
    align-content: center;
    justify-content: center;
  }
  .mobile-menu-button span { width: 16px; height: 2px; }
  .topbar > div:first-of-type {
    min-width: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    text-align: center;
  }
  .topbar h1 {
    font-size: clamp(21px, 5.8vw, 27px);
    line-height: 1.08;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar .eyebrow {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    width: auto;
  }
  #enableNotificationsBtn {
    display: none !important;
  }
  .top-actions .ghost,
  .top-actions .primary {
    min-height: 38px;
    padding: 8px 13px;
    font-size: 12px;
  }
  .primary,
  .ghost,
  .danger {
    min-height: 40px;
    padding: 9px 14px;
  }
  #contextActionBtn {
    position: static;
    min-width: 0;
    max-width: 132px;
    min-height: 38px;
    padding: 8px 13px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .panel-head,
  .graphic-dashboard-head,
  .settings-section-head,
  .calendar-toolbar {
    align-items: flex-start;
  }
  .panel-head h2,
  .graphic-dashboard-head h2,
  .settings-section-head h2 {
    font-size: clamp(18px, 5vw, 22px);
    line-height: 1.2;
  }
}

@media (max-width: 640px) {
  .topbar {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    min-height: 56px;
    padding: 7px 9px;
    border-radius: 0 0 22px 22px;
  }
  .topbar h1 {
    font-size: clamp(19px, 5.2vw, 23px);
    line-height: 1.08;
    max-width: 100%;
  }
  .topbar .eyebrow {
    margin-bottom: 1px;
    font-size: 9px;
    letter-spacing: .055em;
    max-width: 100%;
  }
  .top-actions {
    display: flex;
    width: auto;
    height: auto;
    overflow: hidden;
  }
  #contextActionBtn {
    position: static;
    min-height: 36px;
    max-width: clamp(82px, 27vw, 112px);
    padding: 8px 11px;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(98, 92, 253, .20);
  }
  .panel-head .primary,
  .panel-head .ghost,
  .graphic-dashboard-head .primary,
  .calendar-actions .primary,
  .calendar-actions .ghost,
  .settings-section-head .primary,
  .settings-section-head .ghost {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 12px;
  }
  .calendar-toolbar {
    gap: 10px;
  }
  .calendar-nav,
  .calendar-actions {
    width: 100%;
  }
  .calendar-actions {
    justify-content: flex-start;
  }
}

/* Final mobile header alignment */
@media (max-width: 980px) {
  .topbar {
    position: sticky;
    display: grid;
    grid-template-columns: minmax(78px, 1fr) minmax(0, auto) minmax(78px, 1fr);
    align-items: center;
    justify-content: stretch;
    gap: 8px;
    min-height: 58px;
  }
  .mobile-menu-button {
    grid-column: 1;
    justify-self: start;
    position: static;
    z-index: 1;
    width: 38px;
    height: 38px;
  }
  .topbar > div:first-of-type {
    grid-column: 2;
    justify-self: center;
    position: static;
    z-index: 1;
    width: auto;
    min-width: 0;
    transform: none;
    pointer-events: none;
    text-align: center;
    justify-items: center;
  }
  .top-actions {
    grid-column: 3;
    justify-self: end;
    position: static;
    z-index: 2;
    width: auto;
    margin-left: 0;
  }
  #contextActionBtn {
    position: static;
    max-width: 110px;
  }
}

@media (max-width: 640px) {
  .topbar {
    grid-template-columns: minmax(72px, 1fr) minmax(0, auto) minmax(72px, 1fr);
    min-height: 56px;
    padding-inline: 10px;
  }
  .topbar > div:first-of-type {
    width: auto;
  }
  .topbar h1 {
    font-size: clamp(18px, 4.8vw, 22px);
  }
  .topbar .eyebrow {
    font-size: 8.5px;
  }
  #contextActionBtn {
    max-width: clamp(72px, 23vw, 96px);
    padding-inline: 9px;
  }
  .settings-nav-panel {
    position: sticky;
    top: 68px;
    display: block;
    overflow: hidden;
    padding: 12px;
  }
  .settings-scroll-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .settings-nav-panel::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 42px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(247, 250, 248, 0), var(--surface));
  }
  body.theme-dark .settings-nav-panel::after {
    background: linear-gradient(90deg, rgba(16, 20, 19, 0), var(--surface));
  }
  .settings-nav-group {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 32px 2px 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .settings-nav-group + .settings-nav-group {
    margin-top: 8px;
  }
  .settings-nav-group::-webkit-scrollbar {
    display: none;
  }
  .settings-nav-button {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* Dark theme contrast fixes */
body.theme-dark .topbar,
body.theme-dark .settings-nav-panel,
body.theme-dark .drawer-head {
  background: rgba(16, 20, 19, .94);
  border-color: var(--line);
}

body.theme-dark .mobile-menu-button,
body.theme-dark .sidebar-close,
body.theme-dark .password-toggle,
body.theme-dark .segmented,
body.theme-dark .filter-pill,
body.theme-dark .settings-nav-button,
body.theme-dark .file-button {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line);
}

body.theme-dark .ghost {
  color: var(--brand);
  background: transparent;
  border-color: var(--line);
}

body.theme-dark .ghost:hover,
body.theme-dark .settings-nav-button:hover,
body.theme-dark .filter-pill:hover {
  color: var(--brand);
  background: var(--state-layer);
  border-color: var(--brand);
}

body.theme-dark .danger-text {
  color: #ffb4ab;
  border-color: #8c1d18;
  background: rgba(140, 29, 24, .18);
}

body.theme-dark .danger-text:hover {
  color: #ffdad6;
  background: rgba(140, 29, 24, .34);
  border-color: #ffb4ab;
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark .multi-select {
  color: var(--text);
  background: #111816;
  border-color: var(--line);
}

body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder {
  color: #91a19d;
}

body.theme-dark input[type="date"],
body.theme-dark input[type="time"],
body.theme-dark input[type="datetime-local"],
body.theme-dark input[type="month"] {
  color-scheme: dark;
}

body.theme-dark input[type="file"]::file-selector-button {
  color: var(--brand);
  background: var(--surface-2);
  border-color: var(--line);
}

body.theme-dark input[type="file"]::file-selector-button:hover {
  background: var(--state-layer);
  border-color: var(--brand);
}

body.theme-dark option {
  color: var(--text);
  background: #171b1a;
}

body.theme-dark .notice,
body.theme-dark .app-dialog,
body.theme-dark .client-combo-menu,
body.theme-dark .client-combo-menu::before,
body.theme-dark .action-panel,
body.theme-dark .review-output-card,
body.theme-dark .review-changes-card,
body.theme-dark .notification-row.unread,
body.theme-dark .note-card.pinned,
body.theme-dark .settings-card-soft,
body.theme-dark .settings-danger-zone,
body.theme-dark .calendar-sync-row,
body.theme-dark .calendar-summary-item,
body.theme-dark .calendar-day,
body.theme-dark .month-day,
body.theme-dark .day-view,
body.theme-dark .team-day-view,
body.theme-dark .team-scroll-hint,
body.theme-dark .all-day-row,
body.theme-dark .time-column,
body.theme-dark .team-day-header,
body.theme-dark .team-day-header > span,
body.theme-dark .team-hour,
body.theme-dark .integration-row,
body.theme-dark .conflict-box,
body.theme-dark .week-person,
body.theme-dark .week-cell,
body.theme-dark .calendar-availability-note,
body.theme-dark .task-type-tabs label,
body.theme-dark .template-option,
body.theme-dark .availability-exception-row,
body.theme-dark .checklist-editor-row,
body.theme-dark .upload-row,
body.theme-dark .comment,
body.theme-dark .pm-card-row,
body.theme-dark .pm-team-row,
body.theme-dark .notification-open-chip {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line);
}

body.theme-dark .panel,
body.theme-dark .metric,
body.theme-dark .task-card,
body.theme-dark .client-row,
body.theme-dark .notification-row,
body.theme-dark .activity-row,
body.theme-dark .small-metric,
body.theme-dark .graphic-dashboard-head,
body.theme-dark .pm-hero,
body.theme-dark .pm-project-card,
body.theme-dark .ped-card,
body.theme-dark .ped-content-row,
body.theme-dark .note-card,
body.theme-dark .drawer,
body.theme-dark .column {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}

body.theme-dark .task-card:hover,
body.theme-dark .client-row:hover,
body.theme-dark .activity-row:hover,
body.theme-dark .task-row-button:hover,
body.theme-dark .ped-content-row:hover,
body.theme-dark .pm-card-row:hover,
body.theme-dark .pm-team-row:hover,
body.theme-dark .month-day:hover {
  color: var(--text);
  background: var(--surface-3);
  border-color: var(--brand);
}

body.theme-dark .muted,
body.theme-dark label,
body.theme-dark .task-meta,
body.theme-dark .task-foot,
body.theme-dark .free-slot,
body.theme-dark .day-number,
body.theme-dark .more-events,
body.theme-dark .settings-scroll-hint,
body.theme-dark .team-day-header small,
body.theme-dark .timed-event span,
body.theme-dark .event-detail-grid span,
body.theme-dark .settings-jump-row span,
body.theme-dark .settings-list-row small,
body.theme-dark .ped-content-row small,
body.theme-dark .calendar-sync-row,
body.theme-dark .calendar-filter-row {
  color: var(--muted);
}

body.theme-dark .task-create-footer,
body.theme-dark .choice-chips label,
body.theme-dark .review-output-link,
body.theme-dark .optional-task-details summary,
body.theme-dark .task-edit-details summary,
body.theme-dark .icon-close {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line);
}

body.theme-dark .optional-task-details[open] summary,
body.theme-dark .task-edit-details[open] summary {
  border-color: var(--line);
}

body.theme-dark .day-number strong,
body.theme-dark .notification-title-line strong,
body.theme-dark .ped-content-row strong,
body.theme-dark .timed-event strong,
body.theme-dark .task-row-button strong {
  color: var(--text);
}

body.theme-dark .calendar-day.selected,
body.theme-dark .month-day.selected,
body.theme-dark .filter-pill.active,
body.theme-dark .settings-nav-button.active,
body.theme-dark .task-type-tabs label:has(input:checked),
body.theme-dark .choice-chips label:has(input:checked),
body.theme-dark .review-reason-chip:has(input:checked),
body.theme-dark .template-option:has(input:checked) {
  color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
  border-color: var(--brand);
}

body.theme-dark .pill {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line);
}

body.theme-dark .event,
body.theme-dark .calendar-event,
body.theme-dark .timed-event {
  color: #e2e7e4;
  background: #17332f;
  border-color: #31534d;
}

body.theme-dark .event.ok,
body.theme-dark .event-publication,
body.theme-dark .week-cell.ok {
  color: #bbf7d0;
  background: #12331d;
  border-color: #1f6d39;
}

body.theme-dark .event.warn,
body.theme-dark .event-meeting,
body.theme-dark .week-cell.warn {
  color: #ffe1a6;
  background: #3d2d09;
  border-color: #7c4a03;
}

body.theme-dark .event.info,
body.theme-dark .event-task,
body.theme-dark .event-google {
  color: #bfdbfe;
  background: #162d4f;
  border-color: #1d4ed8;
}

body.theme-dark .event.danger,
body.theme-dark .event-deadline,
body.theme-dark .week-cell.danger {
  color: #ffdad6;
  background: #4f1515;
  border-color: #7f1d1d;
}

body.theme-dark .event-busy,
body.theme-dark .calendar-availability-note {
  color: #d1d5db;
  background: #27302d;
  border-color: #4b5563;
}

body.theme-dark .time-grid {
  background:
    repeating-linear-gradient(to bottom, transparent 0, transparent 67px, var(--line) 68px);
}

body.theme-dark .time-slot:hover {
  background: rgba(201, 198, 255, .10);
}

body.theme-dark .time-slot.unavailable-slot {
  background: repeating-linear-gradient(
    -45deg,
    rgba(63, 73, 70, .38),
    rgba(63, 73, 70, .38) 8px,
    rgba(36, 41, 39, .38) 8px,
    rgba(36, 41, 39, .38) 16px
  );
}

/* Team calendar mobile polish */
@media (max-width: 760px) {
  .team-day-view {
    --team-user-col: 148px;
    --team-time-col: 54px;
    max-height: min(72vh, 720px);
    margin-inline: -4px;
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 10px 28px rgba(21, 31, 29, .08);
    scroll-snap-type: x proximity;
  }
  .team-scroll-hint {
    top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 8px 8px 6px;
    padding: 7px 11px;
    color: var(--brand);
    background: color-mix(in srgb, var(--surface) 88%, var(--brand) 12%);
    box-shadow: 0 4px 14px rgba(21, 31, 29, .08);
  }
  .team-scroll-hint span {
    font-size: 15px;
    line-height: 1;
  }
  .team-day-header,
  .team-day-grid {
    grid-template-columns: var(--team-time-col) repeat(var(--team-columns), var(--team-user-col));
  }
  .team-day-header {
    top: 0;
    z-index: 8;
    box-shadow: 0 1px 0 var(--line), 0 8px 18px rgba(21, 31, 29, .06);
  }
  .team-day-header > span {
    min-height: 58px;
    display: grid;
    place-items: center;
    padding: 8px 6px;
    font-size: 11px;
    box-shadow: 8px 0 16px rgba(21, 31, 29, .06);
  }
  .team-day-header strong.team-user-head {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 8px;
    scroll-snap-align: start;
    background: var(--surface-soft);
  }
  .team-day-header .team-user-head em {
    display: none;
  }
  .team-user-head em {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: var(--md-sys-color-on-primary);
    background: var(--brand);
    font-size: 11px;
    font-style: normal;
    font-weight: 950;
  }
  .team-user-head span {
    min-width: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .team-user-head small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .team-hour,
  .team-person-slot {
    min-height: 62px;
    padding: 6px;
  }
  .team-hour {
    display: grid;
    place-items: start center;
    padding-top: 8px;
    font-size: 11px;
    box-shadow: 8px 0 16px rgba(21, 31, 29, .05);
  }
  .team-person-slot {
    background: var(--surface);
    scroll-snap-align: start;
  }
  .team-person-slot:nth-child(odd) {
    background: var(--surface-soft);
  }
  .team-person-slot:empty::after {
    content: "";
    width: 24px;
    height: 2px;
    align-self: center;
    justify-self: center;
    border-radius: 999px;
    background: var(--line);
    opacity: .65;
  }
  .team-day-view .calendar-event,
  .team-day-view .event {
    min-height: 28px;
    padding: 5px 6px;
    border-radius: 10px;
    font-size: 10.5px;
    line-height: 1.2;
    white-space: normal;
  }
}

@media (max-width: 420px) {
  .team-day-view {
    --team-user-col: 136px;
    --team-time-col: 50px;
  }
  .team-user-head em {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }
  .team-day-header strong.team-user-head {
    gap: 0;
    padding-inline: 7px;
  }
}

body.theme-dark .team-scroll-hint {
  color: var(--brand);
  background: color-mix(in srgb, var(--surface) 86%, var(--brand) 14%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .24);
}

body.theme-dark .team-day-header {
  box-shadow: 0 1px 0 var(--line), 0 8px 18px rgba(0, 0, 0, .28);
}

body.theme-dark .team-day-header strong.team-user-head,
body.theme-dark .team-person-slot {
  background: var(--surface);
}

body.theme-dark .team-person-slot:nth-child(odd) {
  background: var(--surface-soft);
}

/* Mobile header safe area: content and overlays must never sit under the header */
@media (max-width: 980px) {
  :root {
    --app-mobile-header-height: 64px;
  }
  .topbar {
    z-index: 60;
    margin-bottom: 16px;
  }
  .workspace {
    scroll-padding-top: calc(var(--app-mobile-header-height) + 14px);
  }
  #appView,
  .notice {
    scroll-margin-top: calc(var(--app-mobile-header-height) + 14px);
  }
  .drawer-backdrop {
    z-index: 220;
  }
  .drawer {
    height: 100dvh;
    max-height: 100dvh;
    padding-top: max(20px, env(safe-area-inset-top));
  }
  .drawer-head {
    padding-top: max(16px, env(safe-area-inset-top));
  }
}

@media (max-width: 640px) {
  :root {
    --app-mobile-header-height: 58px;
  }
  .topbar {
    margin-bottom: 14px;
  }
  .drawer {
    padding-inline: 16px;
  }
  .drawer-head {
    position: static !important;
    top: auto !important;
  }
}

.upload-form {
  display: grid;
  gap: 10px;
}
.upload-panel-compact {
  padding-block: 14px;
}
.upload-panel-compact .panel-head {
  margin-bottom: 8px;
}
.upload-panel-compact .panel-head h2 {
  font-size: 20px;
}
.upload-form-compact {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}
.upload-compact-file {
  min-height: 40px;
  width: 100%;
}
.upload-final-compact {
  white-space: nowrap;
}
.upload-submit-compact {
  min-height: 38px;
  padding-inline: 14px;
}
.upload-hint-compact {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  font-size: 13px;
}
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 650;
}
.inline-check input {
  width: 18px;
  min-height: 18px;
}
.upload-list {
  display: grid;
  gap: 10px;
}
.upload-panel-compact .upload-list {
  gap: 6px;
  margin-top: 8px;
}
.upload-panel-compact .upload-list > .muted {
  margin: 4px 0 0;
}
.upload-row.rich {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--surface);
}
.upload-row.rich.compact {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  padding: 8px;
}
.upload-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}
.upload-row.compact .upload-preview {
  width: 40px;
  height: 40px;
}
@media (max-width: 700px) {
  .upload-form-compact {
    grid-template-columns: 1fr;
  }
  .upload-final-compact,
  .upload-submit-compact {
    width: 100%;
  }
}
.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.upload-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.upload-info a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
}
.upload-info .muted {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.upload-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-size: 11px;
  font-weight: 800;
}
.upload-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ghost.mini {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}
@media (max-width: 640px) {
  .upload-row.rich {
    grid-template-columns: 44px minmax(0, 1fr);
  }
  .upload-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.system-log-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--surface);
}
.system-log-row.ok { border-left-color: var(--ok); }
.system-log-row.warn { border-left-color: var(--warn); }
.system-log-row.danger { border-left-color: var(--danger); }
.system-log-row p {
  margin: 4px 0 0;
  word-break: break-word;
}
@media (max-width: 640px) {
  .system-log-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

.ai-assistant-panel {
  display: grid;
  gap: 18px;
}

.ai-assistant-form {
  display: grid;
  gap: 14px;
}

.ai-assistant-form textarea {
  min-height: 150px;
  resize: vertical;
}

.ai-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-answer {
  color: var(--text);
  line-height: 1.65;
}

.ai-draft-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.ai-draft-grid span {
  background: rgba(98, 92, 253, .08);
  border: 1px solid rgba(98, 92, 253, .16);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  gap: 4px;
  padding: 12px;
}

.ai-draft-grid strong {
  color: var(--text);
  font-size: .78rem;
  text-transform: uppercase;
}

.client-task-groups,
.client-task-group {
  display: grid;
  gap: 10px;
}

.client-task-group {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.client-task-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.client-task-group-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.meeting-hero-panel .panel-head {
  align-items: flex-start;
}

.meeting-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.meeting-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.meeting-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.meeting-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 230px;
}

.meeting-card.is-live {
  border-color: rgba(28, 185, 116, .42);
  box-shadow: 0 14px 34px rgba(28, 185, 116, .08);
}

.meeting-card-top {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.meeting-card-top h2 {
  font-size: 1.08rem;
  line-height: 1.25;
  margin: 4px 0 0;
}

.meeting-card-meta {
  color: var(--muted);
  display: grid;
  font-size: .9rem;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meeting-participants {
  color: var(--text);
  font-size: .92rem;
  margin: 0;
}

.meeting-token-box {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.meeting-token-box textarea {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  resize: vertical;
}

.meeting-detail-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin-bottom: 16px;
}

.meeting-detail-kpis span {
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  gap: 4px;
  padding: 12px;
}

.meeting-detail-kpis strong {
  color: var(--text);
  font-size: 1.15rem;
}

.meeting-meta-form {
  display: grid;
  gap: 12px;
}

.meeting-transcript-panel {
  margin-top: 14px;
}

.meeting-transcript-tools {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.meeting-transcript-tools .icon-only {
  height: 34px;
  min-height: 34px;
  min-width: 34px;
  padding: 0 !important;
}

.meeting-ai-import-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.meeting-ai-import-panel textarea {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  min-height: 180px;
  resize: vertical;
}

.meeting-ai-prompt-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.meeting-ai-prompt-row p {
  flex: 1 1 260px;
  margin: 0;
}

.meeting-ai-prompt-row .ghost {
  min-height: 34px;
  padding: 7px 12px;
}

.meeting-ai-preview {
  display: grid;
  gap: 12px;
}

.meeting-ai-block {
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.meeting-ai-block > strong {
  color: var(--text);
}

.meeting-ai-block p,
.meeting-ai-block ul {
  margin: 0;
}

.meeting-ai-block ul {
  padding-left: 20px;
}

.meeting-ai-block pre {
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  line-height: 1.45;
  margin: 0;
  padding: 10px;
  white-space: pre-wrap;
}

.meeting-ai-tasks {
  display: grid;
  gap: 10px;
}

.meeting-ai-task-card {
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

.meeting-ai-task-card h3 {
  font-size: 1rem;
  margin: 0 0 6px;
}

.meeting-ai-task-card p {
  line-height: 1.45;
  margin: 0;
}

.meeting-ai-task-card p + p {
  margin-top: 8px;
}

.meeting-transcript-lines {
  display: grid;
  gap: 10px;
  max-height: 58vh;
  overflow: auto;
  padding-right: 4px;
}

.meeting-segment-line {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: 52px minmax(90px, 150px) minmax(0, 1fr);
  padding: 10px 0;
}

.meeting-segment-line span {
  color: var(--muted);
  font-size: .82rem;
}

.meeting-segment-line strong {
  font-size: .9rem;
}

.meeting-segment-line p {
  line-height: 1.45;
  margin: 0;
}

@media (max-width: 720px) {
  .meeting-segment-line {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .meeting-segment-line p {
    grid-column: 1 / -1;
  }

  .meeting-ai-task-card {
    display: grid;
  }
}
