:root {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--color-canvas);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--color-text);
  background: var(--color-canvas);
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.is-hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 16px;
  color: var(--color-sidebar-text-active);
  background:
    radial-gradient(circle at 30% 5%, var(--color-sidebar-glow), transparent 30%),
    var(--color-sidebar);
  box-shadow: 8px 0 32px var(--color-sidebar-glow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 28px;
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--color-brand-text);
  background: var(--color-brand);
  box-shadow: inset 0 0 0 1px var(--color-sidebar-border);
}

.brand-badge {
  margin-left: auto;
  padding: 3px 6px;
  border: 1px solid var(--color-sidebar-border);
  border-radius: 5px;
  color: var(--color-sidebar-text);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.nav-label {
  margin: 4px 10px 8px;
  color: var(--color-sidebar-text-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-space {
  margin-top: 28px;
}

.sidebar > nav {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-sidebar-border) transparent;
}

.nav-item,
.project-item {
  width: 100%;
  border: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 9px;
  color: var(--color-sidebar-text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active,
.project-item:hover {
  color: var(--color-sidebar-text-active);
  background: var(--color-sidebar-hover);
}

.nav-item.active {
  background: var(--color-sidebar-active);
  box-shadow:
    inset 3px 0 0 var(--color-brand),
    0 8px 24px var(--color-sidebar-glow);
}

.nav-item:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.nav-item:disabled:hover {
  color: var(--color-sidebar-text);
  background: transparent;
}

.nav-soon {
  margin-left: auto;
  color: var(--color-sidebar-text-muted);
  font-size: 8px;
}

.nav-icon {
  width: 20px;
  color: var(--color-sidebar-text-muted);
  text-align: center;
}

.nav-chat-notifications {
  min-width: 0;
  margin-left: auto;
}

.nav-item.has-notifications > span:nth-child(2) {
  color: var(--color-sidebar-text-active);
  font-weight: 800;
}

.nav-chat-notifications .directory-badges {
  margin-left: 0;
}

.sidebar .directory-badges .unread-badge,
.sidebar .directory-badges .mention-badge {
  color: var(--color-notification-current-text);
  background: var(--color-notification-current-bg);
  box-shadow: inset 0 0 0 1px var(--color-notification-current-border);
}

.project-item {
  align-items: flex-start;
}

.sidebar-project-card {
  position: relative;
}

.sidebar-project-card .project-item {
  padding-right: 42px;
}

.sidebar-project-copy {
  min-width: 0;
  flex: 1;
  display: grid;
}

.sidebar-project-copy strong,
.sidebar-project-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-project-card .directory-badges {
  flex: 0 0 auto;
  margin-left: auto;
}

.sidebar-project-card.has-chat-notifications .sidebar-project-copy strong {
  color: var(--color-sidebar-text-active);
  font-weight: 820;
}

.sidebar-project-card .project-item.active {
  color: var(--color-sidebar-text-active);
  background: var(--color-sidebar-active);
  box-shadow: inset 3px 0 0 var(--color-brand);
}

.sidebar-department-list {
  display: grid;
  gap: 3px;
  padding-bottom: 12px;
}

.sidebar-department-empty {
  margin: 0;
  padding: 9px 11px;
  color: var(--color-sidebar-text-muted);
  font-size: 10px;
  line-height: 1.45;
}

.project-more {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 29px;
  height: 29px;
  border: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--color-sidebar-text-muted);
  background: transparent;
  font-size: 10px;
  letter-spacing: 1px;
  cursor: pointer;
}

.project-more:hover,
.project-more[aria-expanded="true"] {
  color: var(--color-sidebar-text-active);
  background: var(--color-sidebar-hover);
}

.project-more:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-sidebar-glow);
}

.project-more:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sidebar-project-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  color: var(--color-text);
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-lg);
}

.sidebar-project-menu[popover] {
  position: fixed;
  inset: auto;
  margin: 0;
  width: 240px;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
  overflow: auto;
}

.sidebar-project-menu[popover]:popover-open {
  display: block;
}

.sidebar-project-menu button {
  width: 100%;
  border: 0;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--color-text);
  background: transparent;
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.sidebar-project-menu button:disabled {
  opacity: .5;
  cursor: wait;
}

.sidebar-project-menu button:hover,
.sidebar-project-menu button:focus-visible {
  outline: 0;
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

.project-dot {
  width: 9px;
  height: 9px;
  margin: 5px 4px 0 3px;
  border-radius: 3px;
  background: var(--color-warning);
}

.project-item span:nth-child(2),
.profile span:nth-child(2),
.system-status span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.project-item strong,
.profile strong,
.system-status strong {
  font-size: 12px;
  font-weight: 650;
}

.project-item small,
.profile small,
.system-status small {
  color: var(--color-sidebar-text-muted);
  font-size: 10px;
}

.sidebar-foot {
  margin-top: auto;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
  color: var(--color-text-muted);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition:
    color 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease,
    transform 140ms ease;
}

.theme-toggle:hover {
  border-color: var(--color-accent-border);
  color: var(--color-accent);
  background: var(--color-accent-soft);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 0;
  border-color: var(--color-focus-border);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.login-theme-toggle {
  position: absolute;
  top: 22px;
  right: 22px;
}

.sidebar-theme-toggle {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  border-color: var(--color-sidebar-border);
  color: var(--color-sidebar-text);
  background: var(--color-sidebar-raised);
  box-shadow: none;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-theme-toggle:hover {
  border-color: var(--color-sidebar-border);
  color: var(--color-sidebar-text-active);
  background: var(--color-sidebar-hover);
}

.system-status,
.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 9px;
  border-top: 1px solid var(--color-sidebar-border);
}

.status-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 4px var(--color-online-glow);
}

.avatar,
.message-avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 750;
}

.avatar {
  width: 31px;
  height: 31px;
  color: var(--color-accent-strong);
  background: var(--color-success-soft);
}

.profile-more {
  margin-left: auto;
  color: var(--color-sidebar-text-muted);
  font-size: 11px;
  letter-spacing: 1px;
}

.profile-logout {
  width: 29px;
  height: 29px;
  margin-left: auto;
  border: 0;
  border-radius: 8px;
  color: var(--color-sidebar-text-muted);
  background: var(--color-sidebar-hover);
  cursor: pointer;
}

.profile-logout:hover {
  color: var(--color-on-accent);
  background: var(--color-sidebar-hover);
}

main {
  min-width: 0;
  min-height: 100vh;
  padding: 28px 32px 36px;
  background:
    radial-gradient(circle at 85% 0%, var(--color-accent-glow), transparent 28%),
    linear-gradient(180deg, var(--color-canvas-highlight), var(--color-canvas) 300px);
}

#projects-view,
#messages-view {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.profile-directory {
  width: min(1100px, 100%);
  display: grid;
  gap: 14px;
}

.profile-intro,
.user-profile-card {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}

.profile-intro {
  padding: 14px 18px;
  color: var(--color-text-muted);
  font-size: 11px;
}

.user-profile-card {
  overflow: hidden;
}

.user-profile-card > summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.user-profile-card > summary::-webkit-details-marker {
  display: none;
}

.user-profile-card > summary::after {
  content: "+";
  color: var(--color-text-muted);
  font-size: 18px;
}

.user-profile-card[open] > summary::after {
  content: "−";
}

.user-profile-card > summary .avatar {
  width: 38px;
  height: 38px;
}

.user-profile-summary-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.user-profile-summary-copy strong,
.user-profile-summary-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-profile-summary-copy small {
  color: var(--color-text-muted);
  font-size: 10px;
}

.user-profile-body {
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(300px, 1fr);
  gap: 18px;
  border-top: 1px solid var(--color-border);
  padding: 18px;
}

.user-profile-section {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.user-profile-section h3 {
  margin: 0;
  font-size: 13px;
}

.user-profile-facts,
.user-profile-rights {
  display: grid;
  gap: 7px;
}

.user-profile-fact,
.user-profile-right {
  display: grid;
  grid-template-columns: minmax(110px, 0.6fr) minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--color-border);
  padding: 7px 0;
  font-size: 10px;
}

.user-profile-fact span,
.user-profile-right small {
  color: var(--color-text-muted);
}

.user-profile-preferences {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.user-profile-preferences label {
  display: grid;
  gap: 6px;
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 700;
}

.user-profile-preferences select,
.user-profile-preferences input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  padding: 0 10px;
  color: var(--color-text);
  background: var(--color-surface);
  min-width: 0;
}

.profile-master-data-editor { margin-top: 16px; }
.profile-master-data-editor > summary { cursor: pointer; margin-bottom: 12px; }
[data-master-data-error] { grid-column: 1 / -1; color: var(--color-danger); }

.user-profile-help,
.user-profile-empty {
  color: var(--color-text-muted);
  font-size: 9px;
}

.user-profile-actions {
  display: flex;
  justify-content: flex-end;
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .user-profile-body {
    grid-template-columns: 1fr;
  }

  .user-profile-preferences {
    grid-template-columns: 1fr;
  }
}

#projects-view > .topbar,
#messages-view > .topbar {
  flex: 0 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 16px;
}

.topbar-overview {
  min-width: 0;
  flex: 1 1 620px;
  display: flex;
  align-items: center;
  gap: clamp(18px, 2vw, 32px);
}

.topbar-greeting {
  flex: 0 0 auto;
}

.projects-topbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.projects-topbar .topbar-overview,
.projects-topbar .top-actions {
  display: contents;
}

.projects-topbar .topbar-greeting {
  grid-column: 1;
}

.projects-topbar .metrics {
  width: min(100%, 380px);
  grid-column: 2;
  justify-self: center;
}

.projects-topbar .active-timer {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
}

.projects-topbar .world-clock-widget {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.world-clock-widget {
  --geo-card-width: 148px;
  --geo-card-collapsed-height: 48px;
  --geo-card-expanded-height: 200px;
  position: relative;
  min-height: var(--geo-card-collapsed-height);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  overflow: visible;
}

.location-card-list {
  height: var(--geo-card-collapsed-height);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  overflow: visible;
}

.geo-card-slot {
  width: var(--geo-card-width);
  height: var(--geo-card-collapsed-height);
  flex: 0 0 var(--geo-card-width);
  position: relative;
  overflow: visible;
}

.location-weather-card {
  --sun-x: 50%;
  --sun-y: 19px;
  width: var(--geo-card-width);
  height: var(--geo-card-collapsed-height);
  position: absolute;
  z-index: 1;
  inset: 0 auto auto 0;
  overflow: hidden;
  border: 1px solid var(--weather-card-border);
  border-radius: 12px;
  color: var(--weather-card-text);
  background: var(--weather-footer);
  box-shadow: var(--shadow-sm);
  isolation: isolate;
  transition: height 160ms ease, box-shadow 160ms ease;
}

.location-weather-card[data-expanded="true"] {
  height: var(--geo-card-expanded-height);
  z-index: 30;
  box-shadow: var(--shadow-lg);
}

.geo-card-summary {
  position: absolute;
  z-index: 4;
  inset: 0;
  width: 100%;
  height: var(--geo-card-collapsed-height);
  border: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: var(--weather-card-text);
  background: var(--weather-footer);
  text-align: left;
  cursor: pointer;
  transition: opacity 90ms ease, visibility 90ms ease;
}

.geo-card-summary > span {
  overflow: hidden;
  font-size: 11px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.geo-card-summary time {
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
}

button.geo-card-summary:focus-visible {
  outline: 2px solid var(--color-focus-border);
  outline-offset: -3px;
}

.geo-card-expanded-content {
  width: 100%;
  height: var(--geo-card-expanded-height);
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 82px 70px 48px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 110ms ease, visibility 110ms ease;
}

.location-weather-card[data-expanded="true"] .geo-card-summary {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.location-weather-card[data-expanded="true"] .geo-card-expanded-content {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.geo-card-modal-backdrop {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--color-backdrop);
  cursor: zoom-out;
}

.geo-card-modal-backdrop:focus-visible {
  outline: 0;
}

.geo-card-modal-shell {
  width: 296px;
  height: 400px;
  position: relative;
}

.geo-card-modal-visual {
  width: var(--geo-card-width);
  height: var(--geo-card-expanded-height);
  position: absolute;
  z-index: 1;
  inset: 0 auto auto 0;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  transform: scale(2);
  transform-origin: top left;
  transition: none;
}

.geo-card-modal-visual .geo-card-expanded-content {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}

@media (hover: hover) {
  .location-weather-card[data-location-card]:hover {
    height: var(--geo-card-expanded-height);
    z-index: 30;
    box-shadow: var(--shadow-lg);
  }

  .location-weather-card[data-location-card]:hover .geo-card-summary {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .location-weather-card[data-location-card]:hover .geo-card-expanded-content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

.location-weather-scene {
  position: absolute;
  inset: 0 0 auto;
  height: 82px;
  overflow: hidden;
  background: var(--weather-scene-day);
}

.location-weather-card[data-phase="dawn"] .location-weather-scene {
  background: var(--weather-scene-dawn);
}

.location-weather-card[data-phase="dusk"] .location-weather-scene {
  background: var(--weather-scene-dusk);
}

.location-weather-card[data-phase="night"] .location-weather-scene {
  background: var(--weather-scene-night);
}

.location-sky-glow {
  width: 74px;
  height: 74px;
  position: absolute;
  top: -37px;
  left: var(--sun-x);
  border-radius: 50%;
  background: var(--weather-glow-day);
  filter: blur(2px);
  transform: translateX(-50%);
}

.location-weather-card[data-phase="night"] .location-sky-glow {
  background: var(--weather-glow-night);
}

.location-card-head {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 5px;
  padding: 8px 9px 0;
}

.location-card-head > span {
  min-width: 0;
}

.location-card-head strong,
.location-card-head small {
  overflow: hidden;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-card-head strong {
  max-width: 91px;
  font-size: 10px;
  line-height: 1.2;
}

.location-card-head small {
  max-width: 86px;
  margin-top: 2px;
  color: var(--weather-text-muted);
  font-size: 7px;
}

.location-card-head b {
  flex: 0 0 auto;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.06em;
}

.location-weather-icon {
  width: 32px;
  height: 32px;
  position: absolute;
  z-index: 2;
  top: 31px;
  left: 8px;
  color: var(--weather-icon);
  filter: drop-shadow(0 4px 6px var(--weather-icon-shadow));
}

.location-weather-icon svg,
.location-forecast-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.location-weather-card[data-phase="day"] .weather-icon-clear {
  color: var(--weather-sun);
}

.location-sun-path {
  width: 57%;
  height: 29px;
  position: absolute;
  z-index: 2;
  right: 7px;
  bottom: 10px;
  border-top: 1px dashed var(--weather-sun-path);
  border-radius: 50% 50% 0 0;
}

.location-sun-path i {
  width: 7px;
  height: 7px;
  position: absolute;
  top: var(--sun-y);
  left: var(--sun-x);
  border: 1px solid var(--weather-sun-border);
  border-radius: 50%;
  background: var(--weather-sun-marker);
  box-shadow: 0 0 8px var(--weather-sun-shadow);
  transform: translate(-50%, -50%);
}

.location-horizon {
  width: 70%;
  height: 35px;
  position: absolute;
  right: -8%;
  bottom: -18px;
  border-radius: 50% 45% 0 0;
  background: var(--weather-horizon);
}

.location-sunrise,
.location-sunset {
  position: absolute;
  z-index: 3;
  bottom: 3px;
  color: var(--weather-text-muted);
  font-size: 5.5px;
}

.location-sunrise {
  right: 53px;
}

.location-sunset {
  right: 6px;
}

.location-forecast {
  grid-row: 2;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 6px 7px;
  background: var(--weather-forecast);
}

.location-forecast-row {
  min-height: 15px;
  display: grid;
  grid-template-columns: 25px 11px 15px minmax(24px, 1fr) 16px;
  align-items: center;
  gap: 2px;
  font-size: 6.5px;
  font-variant-numeric: tabular-nums;
}

.location-forecast-icon {
  width: 10px;
  height: 10px;
  color: var(--weather-forecast-icon);
}

.location-forecast-low {
  color: var(--weather-forecast-muted);
}

.location-temperature-rail {
  --range-start: 0%;
  --range-end: 0%;
  --current-position: 50%;
  height: 4px;
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  background: var(--weather-temperature-rail);
}

.location-temperature-rail i {
  position: absolute;
  inset-block: 0;
  left: var(--range-start);
  right: var(--range-end);
  border-radius: inherit;
  background: var(--weather-temperature-range);
}

.location-temperature-rail b {
  width: 5px;
  height: 5px;
  position: absolute;
  z-index: 2;
  top: 50%;
  left: var(--current-position);
  border: 1px solid var(--weather-sun-border);
  border-radius: 50%;
  background: var(--weather-sun-marker);
  transform: translate(-50%, -50%);
}

.location-forecast-unavailable {
  align-self: center;
  color: var(--weather-forecast-muted);
  font-size: 7px;
  text-align: center;
}

.location-time-footer {
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 7px 8px 6px;
  border-top: 1px solid var(--weather-divider);
  background: var(--weather-footer);
}

.location-time-footer span,
.location-time-footer strong,
.location-time-footer small {
  display: block;
}

.location-time-footer strong {
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}

.location-time-footer small {
  margin-top: 3px;
  color: var(--weather-forecast-muted);
  font-size: 6.5px;
}

.location-time-footer > i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border: 1px solid var(--weather-remove-border);
  border-radius: 50%;
  color: var(--weather-sun-marker);
  font-size: 6px;
  font-style: normal;
  line-height: 6px;
  text-align: center;
}

.location-card-remove {
  width: 18px;
  height: 18px;
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 8;
  border: 1px solid var(--weather-remove-border);
  border-radius: 50%;
  padding: 0 0 1px;
  color: var(--weather-card-text);
  background: var(--weather-remove);
  font-size: 11px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transform: translateY(-2px);
  transition: 140ms ease;
}

.location-weather-card:hover .location-card-remove,
.location-weather-card:focus-within .location-card-remove {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.location-card-remove:hover {
  border-color: var(--weather-remove-border-hover);
  background: var(--weather-remove-hover);
}

.location-card-loading {
  background: var(--color-surface-muted);
}

.location-card-loading .geo-card-summary {
  cursor: wait;
  opacity: 0.72;
}

.location-card-add {
  position: relative;
  padding-top: 8px;
}

.location-card-add-button {
  width: 31px;
  height: 31px;
  border: 1px dashed var(--color-border-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
  color: var(--color-text-muted);
  background: var(--color-surface-translucent);
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.location-card-add-button:hover,
.location-card-add-button[aria-expanded="true"] {
  border-color: var(--color-accent-border);
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

.location-card-add-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.world-clock-picker {
  width: 260px;
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 20;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-lg);
}

.world-clock-picker > strong {
  font-size: 12px;
}

.world-clock-picker label {
  display: grid;
  gap: 5px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 700;
}

.world-clock-picker select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--color-text);
  background: var(--color-surface);
}

.location-provider {
  color: var(--color-text-subtle);
  font-size: 8px;
}

.location-widget-error {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--color-warning-border);
  border-radius: 10px;
  color: var(--color-warning-text);
  background: var(--color-warning-soft);
  font-size: 9px;
}

.eyebrow,
.task-kicker,
.section-label {
  margin: 0 0 5px;
  color: var(--color-text-subtle);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 660;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.top-actions {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}

.messages-button {
  height: 40px;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border-radius: 11px;
  color: var(--color-text-muted);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.icon-button:hover,
.messages-button:hover {
  border-color: var(--color-accent-border);
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

.active-timer {
  min-width: 350px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 8px 7px 12px;
  border: 1px solid var(--color-success-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: 0 6px 22px var(--shadow-xs);
}

.active-timer.hidden {
  display: none;
}

.timer-live {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-danger);
  box-shadow: 0 0 0 4px var(--color-danger-soft);
}

.active-timer span:nth-child(2) {
  display: grid;
}

.active-timer small {
  color: var(--color-text-muted);
  font-size: 9px;
}

.active-timer strong {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

.active-timer button {
  margin-left: 0;
  border: 0;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.active-timer span:nth-child(2) {
  margin-right: auto;
}

.active-timer.paused .timer-live {
  background: var(--color-warning);
  box-shadow: 0 0 0 4px var(--color-warning-soft);
}

.timer-action {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 8px 13px;
  color: var(--color-on-accent);
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
  transition: filter 120ms ease, opacity 120ms ease, transform 120ms ease;
}

.timer-action:hover:not(:disabled) {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

.timer-action:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.timer-start,
.active-timer .timer-start {
  color: var(--color-on-accent);
  background: var(--color-success);
}

.timer-pause,
.active-timer .timer-pause {
  color: var(--color-warning-text);
  background: var(--color-warning);
}

.timer-stop,
.active-timer .timer-stop {
  color: var(--color-on-accent);
  background: var(--color-danger);
}

.metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric-card {
  min-width: 0;
  min-height: 67px;
  padding: 8px 10px 9px;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.metric-card:nth-child(1) {
  border-top: 3px solid var(--color-accent);
}

.metric-card:nth-child(2) {
  border-top: 3px solid var(--color-info);
}

.metric-card:nth-child(3) {
  border-top: 3px solid var(--color-warning);
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 1px;
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.metric-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 800;
}

.metric-icon.green {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

.metric-icon.blue {
  color: var(--color-info);
  background: var(--color-info-soft);
}

.metric-icon.amber {
  color: var(--color-warning-text);
  background: var(--color-warning-soft);
}

.metric-card > strong {
  display: block;
  margin-bottom: 0;
  font-size: 19px;
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.metric-card strong em {
  color: var(--color-text-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
}

.metric-card small {
  display: none;
}

.progress-track {
  height: 3px;
  overflow: hidden;
  margin: 4px 0 0;
  border-radius: 999px;
  background: var(--color-surface-muted);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-accent);
  transition: width 250ms ease;
}

.workspace {
  min-height: 0;
  height: max(570px, calc(100vh - 150px));
  flex: 1;
  display: grid;
  grid-template-columns: minmax(300px, 0.6fr) minmax(480px, 1.4fr);
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 15px;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}

.task-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-border);
}

.panel-heading,
.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
}

.count-badge {
  min-width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--color-text-muted);
  background: var(--color-surface-muted);
  font-size: 11px;
  font-weight: 700;
}

.panel-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-view-switch {
  display: flex;
  gap: 4px;
  margin: 0 18px 12px;
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-subtle);
}

.project-view-switch button {
  min-width: 0;
  flex: 1;
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  padding: 5px 8px;
  color: var(--color-text-muted);
  background: transparent;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.project-view-switch button:hover {
  color: var(--color-text);
  background: var(--color-surface-hover);
}

.project-view-switch button.active {
  color: var(--color-on-accent);
  background: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.toolbar {
  display: flex;
  gap: 8px;
  padding: 0 18px 14px;
}

.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  color: var(--color-text-subtle);
  background: var(--color-surface-subtle);
}

.search input {
  width: 100%;
  height: 34px;
  border: 0;
  outline: 0;
  color: var(--color-text);
  background: transparent;
  font-size: 11px;
}

.toolbar select {
  border: 1px solid var(--color-border);
  border-radius: 9px;
  padding: 0 9px;
  color: var(--color-text-muted);
  background: var(--color-surface-subtle);
  font-size: 10px;
  outline: none;
}

.task-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid var(--color-border);
}

.task-department-heading {
  position: sticky;
  z-index: 4;
  top: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: var(--color-surface-muted);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--color-border) 75%, transparent);
}

.task-department-heading .project-dot {
  flex: 0 0 auto;
}

.task-department-heading strong {
  min-width: 0;
  overflow: hidden;
  flex: 1;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-department-heading small {
  color: var(--color-text-subtle);
  font-size: 9px;
}

.dashboard-placeholder {
  min-height: min(560px, calc(100vh - 150px));
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  border: 1px dashed var(--color-border-strong);
  border-radius: 16px;
  color: var(--color-text-muted);
  background: var(--color-surface);
  text-align: center;
}

.dashboard-placeholder h2,
.dashboard-placeholder p {
  margin: 0;
}

.dashboard-placeholder p {
  max-width: 520px;
  font-size: 12px;
}

.task-row {
  position: relative;
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px;
  padding-left: calc(7px + var(--task-indent, 0px));
  border: 0;
  border-bottom: 1px solid var(--color-surface-muted);
  background: var(--color-surface);
  text-align: left;
  transition: background 120ms ease;
}

.task-row-child {
  background: var(--color-surface-subtle);
}

.work-item-menu-wrap {
  position: relative;
  margin-right: 5px;
}

.work-item-action-menu {
  position: absolute;
  z-index: 8;
  top: 32px;
  right: 0;
  min-width: 168px;
  display: grid;
  gap: 3px;
  padding: 5px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-dialog);
}

.work-item-action-menu button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 9px;
  color: var(--color-text-muted);
  background: transparent;
  font: inherit;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}

.work-item-action-menu button:hover {
  color: var(--color-text);
  background: var(--color-surface-hover);
}

.work-item-action-menu .archive-work-item:hover {
  color: var(--color-danger-text);
  background: var(--color-danger-soft);
}

.delete-resource-action {
  color: var(--color-danger) !important;
}

.delete-resource-action:hover {
  background: color-mix(in srgb, var(--color-danger) 10%, transparent) !important;
}

.work-item-action-menu .menu-note {
  padding: 7px 9px;
  color: var(--color-text-subtle);
  font-size: 9px;
}

.task-row-child::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--task-indent, 18px) - 2px);
  border-left: 1px solid var(--color-border-strong);
}

.task-row:hover,
.task-row.selected {
  background: var(--color-surface-hover);
}

.task-row.selected::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--color-accent);
}

.task-row-select {
  width: 100%;
  min-width: 0;
  min-height: 69px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto 42px;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 12px 4px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.hierarchy-toggle {
  width: 24px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  color: var(--color-text-subtle);
  background: transparent;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.hierarchy-toggle span {
  display: block;
  transform-origin: center;
}

.hierarchy-toggle:hover {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

.hierarchy-spacer {
  width: 24px;
}

.priority {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-disabled);
}

.priority.high {
  background: var(--color-danger);
}

.task-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.task-title {
  overflow: hidden;
  font-size: 12px;
  font-weight: 630;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.task-title-line .task-title {
  min-width: 0;
}

.task-title-line .directory-badges {
  flex: 0 0 auto;
  margin-left: 0;
}

.task-row.has-chat-notifications .task-title {
  color: var(--color-text);
  font-weight: 820;
}

.task-meta {
  display: flex;
  gap: 5px;
  color: var(--color-text-subtle);
  font-size: 9px;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 680;
  white-space: nowrap;
}

.status-button {
  gap: 6px;
  border: 1px solid transparent;
  font: inherit;
  cursor: pointer;
}

.status-button:hover,
.status-button[aria-expanded="true"] {
  border-color: currentColor;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.status-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.status-button-chevron {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.quick-status-menu {
  position: fixed;
  right: auto;
  min-width: 210px;
}

.quick-status-menu button {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.quick-status-menu button[aria-current="true"] {
  color: var(--color-text);
  background: var(--color-surface-hover);
  font-weight: 750;
}

.quick-status-menu .task-status-led {
  width: 7px;
  height: 7px;
}

.quick-status-current {
  color: var(--color-text-subtle);
  font-size: 9px;
}

.status-tag.work-status-not-started,
.status-tag.work-status-blocked {
  color: var(--color-danger-text);
  background: var(--color-danger-soft);
}

.status-tag.work-status-in-progress {
  color: var(--color-warning-text);
  background: var(--color-warning-soft);
}

.status-tag.work-status-completed {
  color: var(--color-success-text);
  background: var(--color-success-soft);
}

.status-tag.work-status-archived {
  color: color-mix(in srgb, var(--color-success-text) 55%, var(--color-text-disabled));
  background: color-mix(in srgb, var(--color-success-soft) 45%, var(--color-surface-muted));
}

.task-hours {
  color: var(--color-text-subtle);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.detail-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--color-surface-subtle);
}

.detail-panel.is-task-switching > * {
  filter: blur(3px);
  opacity: 0.62;
  pointer-events: none;
  transition: filter 140ms ease, opacity 140ms ease;
}

.detail-panel.is-task-switching::after {
  content: "Projekt wird geladen …";
  position: absolute;
  z-index: 4;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  color: var(--color-text-muted);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.empty-detail {
  min-height: 570px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 30px;
  color: var(--color-text-subtle);
  text-align: center;
}

.empty-detail h2 {
  margin: 14px 0 7px;
  color: var(--color-text);
}

.empty-detail p {
  max-width: 310px;
  font-size: 12px;
  line-height: 1.6;
}

.empty-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  font-size: 19px;
}

.detail-head {
  align-items: flex-start;
  padding-bottom: 13px;
}

.detail-head h2 {
  max-width: 560px;
  font-size: 21px;
  line-height: 1.25;
}

.close-detail {
  border: 0;
  color: var(--color-text-subtle);
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 0 22px 17px;
  border-bottom: 1px solid var(--color-border);
}

.detail-button {
  border: 1px solid var(--color-border);
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--color-text-muted);
  background: var(--color-surface);
  font-size: 10px;
  font-weight: 680;
  cursor: pointer;
}

.detail-button:hover {
  border-color: var(--color-success-border);
  color: var(--color-accent);
  background: var(--color-surface-subtle);
}

.start-button {
  margin-left: auto;
  border: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--color-on-accent);
  background: var(--color-accent-hover);
  font-size: 10px;
  font-weight: 720;
  cursor: pointer;
}

.start-button.running {
  color: var(--color-danger-text);
  background: var(--color-danger-soft);
}

.detail-content {
  min-height: 0;
  overflow: hidden;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(190px, 0.57fr) minmax(320px, 1.43fr);
}

.task-info {
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px;
  border-right: 1px solid var(--color-border);
}

.description {
  min-height: 78px;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.65;
}

.property-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 9px;
  margin: 20px 0;
  padding: 16px 0;
  border-block: 1px solid var(--color-border);
}

.property-grid div {
  display: grid;
  gap: 4px;
}

.property-grid small,
.task-progress span {
  color: var(--color-text-subtle);
  font-size: 9px;
}

.property-grid strong,
.task-progress strong {
  font-size: 11px;
}

.task-progress > div:first-child {
  display: flex;
  justify-content: space-between;
}

.editor-loading {
  min-height: 570px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 30px;
  color: var(--color-text-muted);
  text-align: center;
}

.editor-loading small {
  color: var(--color-text-subtle);
  font-size: 10px;
}

.spinner {
  width: 30px;
  height: 30px;
  margin-bottom: 7px;
  border: 3px solid var(--color-border-strong);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.task-editor {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--color-surface-subtle);
}

.editor-head {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--color-border);
}

.editor-alert {
  margin: 14px 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--color-danger-border);
  border-radius: 9px;
  color: var(--color-danger-text);
  background: var(--color-danger-soft);
  font-size: 10px;
}

.editor-alert.conflict {
  border-color: var(--color-warning-border);
  color: var(--color-warning-text);
  background: var(--color-warning-soft);
}

.editor-alert button {
  flex: none;
  border: 0;
  border-radius: 7px;
  padding: 7px 9px;
  color: inherit;
  background: var(--color-surface-translucent);
  font-size: 9px;
  font-weight: 720;
  cursor: pointer;
}

.editor-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 22px;
  scrollbar-gutter: stable;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.editor-field {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  margin-bottom: 13px;
}

.editor-field-wide {
  grid-column: 1 / -1;
}

.editor-field > span {
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 690;
}

.editor-field input,
.editor-field select,
.editor-field textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  font-size: 11px;
}

.editor-field textarea {
  resize: vertical;
  line-height: 1.55;
}

.editor-field input:focus,
.editor-field select:focus,
.editor-field textarea:focus {
  border-color: var(--color-success-border);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.editor-field input:disabled,
.editor-field select:disabled,
.editor-field textarea:disabled {
  color: var(--color-text-subtle);
  background: var(--color-surface-muted);
  cursor: not-allowed;
}

.field-error {
  color: var(--color-danger-text);
  font-size: 9px;
}

.editor-hint {
  margin: 0;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--color-text-muted);
  background: var(--color-warning-soft);
  font-size: 9px;
  line-height: 1.5;
}

.editor-footer {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 22px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.editor-footer > span {
  margin-right: auto;
  color: var(--color-text-subtle);
  font-size: 9px;
}

.chat-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
}

.chat-head {
  height: 51px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border-bottom: 1px solid var(--color-border);
  font-size: 11px;
}

.chat-head > div {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

#channel-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-hash {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--color-text-muted);
  background: var(--color-surface-muted);
  font-weight: 750;
}

.mattermost-label {
  color: var(--color-text-subtle);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-body {
  position: relative;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-body.is-chat-switching > * {
  filter: blur(3px);
  opacity: 0.55;
  pointer-events: none;
}

.chat-body.is-chat-switching::after {
  content: "Chat wird geladen …";
  position: absolute;
  z-index: 3;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  padding: 8px 11px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text-muted);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.chat-body iframe {
  width: 100%;
  min-height: 414px;
  flex: 1;
  border: 0;
}

.chat-loading,
.chat-error {
  height: 100%;
  display: grid;
  place-content: center;
  color: var(--color-text-subtle);
  font-size: 11px;
  text-align: center;
}

.chat-error {
  color: var(--color-danger-text);
}

.chat-error small,
.load-error small {
  display: block;
  max-width: 330px;
  margin-top: 7px;
  color: var(--color-text-subtle);
}

.demo-chat {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chat-notice {
  padding: 7px 12px;
  color: var(--color-text-muted);
  background: var(--color-warning-soft);
  font-size: 8px;
  text-align: center;
}

.messages {
  flex: 1;
  padding: 14px 14px 5px;
}

.message {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 9px;
  margin-bottom: 17px;
}

.message-avatar {
  width: 28px;
  height: 28px;
  color: var(--color-success-text);
  background: var(--color-border);
}

.message-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.message-head strong {
  font-size: 10px;
}

.message-head small {
  color: var(--color-text-disabled);
  font-size: 8px;
}

.message p {
  margin: 4px 0 0;
  color: var(--color-text-muted);
  font-size: 10px;
  line-height: 1.5;
}

.fake-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 9px;
  padding: 8px 8px 8px 11px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  color: var(--color-text-disabled);
  font-size: 9px;
}

.fake-composer span {
  flex: 1;
}

.fake-composer button {
  border: 0;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--color-text-muted);
  background: var(--color-surface-muted);
  font-size: 8px;
}

.no-results,
.load-error {
  padding: 70px 20px;
  color: var(--color-text-subtle);
  font-size: 11px;
  text-align: center;
}

.skeleton-row {
  height: 70px;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(90deg, var(--color-shimmer-base) 20%, var(--color-shimmer-highlight) 50%, var(--color-shimmer-base) 80%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  to {
    background-position: -200% 0;
  }
}

.toast-region {
  position: fixed;
  z-index: 20;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 8px;
}

.toast {
  max-width: 390px;
  padding: 11px 14px;
  border: 1px solid var(--color-success-border);
  border-radius: 10px;
  color: var(--color-success-text);
  background: var(--color-success-soft);
  box-shadow: var(--shadow-lg);
  font-size: 11px;
}

.toast.warning {
  border-color: var(--color-warning-border);
  color: var(--color-warning-text);
  background: var(--color-warning-soft);
}

.toast.error {
  border-color: var(--color-danger-border);
  color: var(--color-danger-text);
  background: var(--color-danger-soft);
}

.login-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 25% 15%, var(--color-login-glow), transparent 30%),
    radial-gradient(circle at 80% 80%, var(--color-accent-glow), transparent 26%),
    var(--color-sidebar);
}

.login-card {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid var(--color-sidebar-hover);
  border-radius: 20px;
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-dialog);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--color-border);
}

.login-brand > div {
  display: grid;
  gap: 2px;
}

.login-brand strong {
  font-size: 17px;
}

.login-brand small,
.login-copy p,
.login-local-note {
  color: var(--color-text-muted);
}

.login-copy {
  padding: 29px 0 18px;
}

.login-copy h1 {
  margin-bottom: 10px;
}

.login-copy > p:last-child {
  margin-bottom: 0;
  font-size: 12px;
  line-height: 1.65;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  height: 43px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0 12px;
  outline: 0;
  background: var(--color-surface);
}

.login-form input:focus {
  border-color: var(--color-focus-border);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.activation-card {
  width: min(560px, 100%);
}

.activation-code-request {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 14px;
  background: var(--color-surface-subtle);
}

.activation-code-request p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.55;
}

.activation-success,
.activation-invalid {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 34px 0 4px;
  text-align: center;
}

.activation-success > span,
.activation-invalid > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--color-success-text);
  background: var(--color-success-soft);
  font-size: 20px;
  font-weight: 800;
}

.activation-invalid > span {
  color: var(--color-danger-text);
  background: var(--color-danger-soft);
}

.activation-success h1,
.activation-invalid h1,
.activation-success p,
.activation-invalid p {
  margin: 0;
}

.activation-success p,
.activation-invalid p {
  color: var(--color-text-muted);
  font-size: 12px;
}

.primary-button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 0 15px;
  color: var(--color-on-accent);
  background: var(--color-accent);
  box-shadow: 0 8px 20px var(--color-accent-glow);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

.primary-button:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 10px 26px var(--color-accent-glow);
  transform: translateY(-1px);
}

.primary-button:disabled,
.message-composer button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.primary-button.compact {
  min-height: 36px;
  margin-top: 4px;
}

.login-error {
  margin: 0;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--color-danger-text);
  background: var(--color-danger-soft);
  font-size: 10px;
}

.login-link-button {
  border: 0;
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
  font: inherit;
  padding: 0.35rem;
  text-align: center;
}

.login-link-button:hover {
  text-decoration: underline;
}

.login-success {
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-success) 12%, transparent);
  color: var(--color-success);
  padding: 0.75rem;
}

.login-local-note {
  margin: 17px 0 0;
  font-size: 9px;
  text-align: center;
}

.department-dialog {
  width: min(430px, calc(100vw - 28px));
  margin: auto;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  color: var(--color-text);
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-dialog);
}

.department-dialog::backdrop {
  background: var(--color-backdrop);
  backdrop-filter: blur(3px);
}

.department-dialog form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.department-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dialog-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  color: var(--color-text-muted);
  background: var(--color-surface);
  font-size: 19px;
  cursor: pointer;
}

.dialog-close:hover {
  color: var(--color-danger-text);
  background: var(--color-danger-soft);
}

.department-dialog-copy {
  margin: -6px 0 0;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.55;
}

.department-dialog-field {
  display: grid;
  gap: 7px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 700;
}

.department-dialog-field input,
.department-dialog-field select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0 12px;
  outline: 0;
  color: var(--color-text);
  background: var(--color-surface);
}

.department-dialog-field input:focus,
.department-dialog-field select:focus {
  border-color: var(--color-focus-border);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.department-dialog-error {
  margin: -6px 0 0;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--color-danger-text);
  background: var(--color-danger-soft);
  font-size: 10px;
}

.department-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.department-dialog-actions .primary-button {
  min-height: 38px;
}

.action-confirmation-dialog {
  width: min(400px, calc(100vw - 28px));
}

.typed-confirmation-dialog {
  width: min(520px, calc(100vw - 28px));
}

.typed-confirmation-message {
  white-space: pre-line;
}

.typed-confirmation-hint {
  margin: 8px 0 0;
  color: var(--color-text-subtle);
  font-size: 10px;
}

.action-confirmation-button {
  border-color: var(--color-danger-border);
  color: var(--color-on-accent);
  background: var(--color-danger);
}

.action-confirmation-button:hover {
  background: var(--color-danger-text);
}

.dialog-action-spacer {
  flex: 1;
}

.scoped-invite-dialog {
  width: min(650px, calc(100vw - 28px));
}

.scoped-invite-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.scoped-invite-level {
  grid-column: 1 / -1;
}

.scoped-invite-summary {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--color-text-muted);
  background: var(--color-surface-subtle);
  font-size: 10px;
  line-height: 1.5;
}

.scoped-invite-summary strong {
  color: var(--color-text);
}

.access-editor-dialog {
  width: min(860px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
}

.access-scope-grid,
.access-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.access-scope-note {
  margin: -9px 0 0;
  color: var(--color-text-subtle);
  font-size: 10px;
  line-height: 1.5;
}

.access-levels {
  margin: 0;
  border: 0;
  padding: 0;
}

.access-levels legend {
  margin-bottom: 8px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 750;
}

.access-level-card {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 84px;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  padding: 13px 13px 13px 38px;
  background: var(--color-surface);
  cursor: pointer;
}

.access-level-card:has(input:checked) {
  border-color: var(--color-focus-border);
  background: var(--color-accent-soft);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.access-level-card input {
  position: absolute;
  top: 15px;
  left: 13px;
}

.access-level-card strong {
  font-size: 11px;
}

.access-level-card small {
  color: var(--color-text-muted);
  font-size: 9px;
  line-height: 1.45;
}

.access-user-section,
.access-effective-section {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
}

.access-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.access-section-head h3 {
  margin: 2px 0 0;
  font-size: 13px;
}

.access-user-list,
.access-effective-list {
  max-height: 190px;
  overflow: auto;
  display: grid;
  gap: 6px;
}

.access-user-row,
.access-effective-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 9px 11px;
  background: var(--color-surface);
}

.access-user-row {
  grid-template-columns: auto auto minmax(0, 1fr);
  cursor: pointer;
}

.access-user-row:has(input:disabled) {
  opacity: 0.62;
  cursor: not-allowed;
}

.access-user-copy,
.access-effective-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.access-user-copy strong,
.access-user-copy small,
.access-effective-copy strong,
.access-effective-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-user-copy strong,
.access-effective-copy strong {
  font-size: 10px;
}

.access-user-copy small,
.access-effective-copy small {
  color: var(--color-text-muted);
  font-size: 9px;
}

.access-inheritance-badge {
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--color-accent-strong);
  background: var(--color-accent-soft);
  font-size: 8px;
  font-weight: 750;
}

.access-revoke {
  border: 0;
  border-radius: 7px;
  padding: 5px 7px;
  color: var(--color-danger-text);
  background: var(--color-danger-soft);
  font-size: 9px;
  cursor: pointer;
}

.access-empty {
  margin: 0;
  padding: 12px;
  color: var(--color-text-subtle);
  font-size: 10px;
  text-align: center;
}

.linked-channel {
  overflow: hidden;
  max-width: 210px;
  color: var(--color-text-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linked-channel.muted {
  color: var(--color-text-subtle);
}

.channel-empty {
  height: 100%;
  min-height: 414px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 30px;
  text-align: center;
}

.channel-empty-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--color-success-text);
  background: var(--color-border);
  font-size: 18px;
  font-weight: 800;
}

.channel-empty h3 {
  margin: 13px 0 6px;
  font-size: 13px;
}

.channel-empty p {
  max-width: 270px;
  margin-bottom: 13px;
  color: var(--color-text-subtle);
  font-size: 10px;
  line-height: 1.55;
}

.native-conversation {
  min-height: 0;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.native-messages {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.conversation-empty {
  height: 100%;
  min-height: 250px;
  display: grid;
  place-content: center;
  color: var(--color-text-subtle);
  font-size: 10px;
}

.message p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-mention {
  color: var(--color-text);
  font-weight: 850;
}

.message-composer {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 9px;
  padding: 7px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
}

.mention-suggestions {
  position: absolute;
  z-index: 20;
  right: 7px;
  bottom: calc(100% + 6px);
  left: 7px;
  max-height: 260px;
  overflow-y: auto;
  display: grid;
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-dialog);
}

.mention-suggestion {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 7px;
  padding: 6px 8px;
  color: var(--color-text-muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.mention-suggestion:hover,
.mention-suggestion.active {
  color: var(--color-text);
  background: var(--color-accent-soft);
}

.mention-suggestion > span:last-child {
  min-width: 0;
  display: grid;
}

.mention-suggestion small {
  color: var(--color-text-subtle);
  font-size: 9px;
}

.message-composer textarea {
  width: 100%;
  max-height: 100px;
  resize: vertical;
  border: 0;
  padding: 6px;
  outline: 0;
  color: var(--color-text);
  background: transparent;
  font: inherit;
  font-size: 10px;
  line-height: 1.45;
}

.message-composer button {
  border: 0;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--color-on-accent);
  background: var(--color-accent-hover);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.message-file-button {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  color: var(--color-text-muted);
  background: var(--color-surface-muted);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.message-file-button:hover,
.message-file-button.is-busy {
  border-color: var(--color-success-border);
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

.message-file-button.is-busy {
  pointer-events: none;
  opacity: 0.65;
}

.chat-file-list {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.messages-panel {
  width: 100%;
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 15px;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}

.chat-sidebar {
  min-width: 0;
  overflow-y: auto;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
}

.chat-sidebar-head {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 22px 19px 17px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
}

.new-message-button {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--color-accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 9px;
  color: var(--color-accent-strong);
  background: var(--color-accent-soft);
  font: inherit;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.chat-create-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 7px;
}

.new-message-button:hover {
  background: var(--color-accent-soft-hover);
}

.new-message-button span:first-child {
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}

.chat-directory {
  padding: 10px;
}

.directory-section {
  margin-bottom: 19px;
}

.directory-section h3 {
  margin: 10px 9px 7px;
  color: var(--color-text-subtle);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.directory-list {
  display: grid;
  gap: 2px;
}

.directory-channel-group {
  display: grid;
  gap: 2px;
}

.directory-group-toggle {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 7px;
  padding: 5px 8px;
  color: var(--color-text-muted);
  background: transparent;
  font: inherit;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}

.directory-group-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-hover);
}

.directory-group-toggle.level-project {
  padding-left: 20px;
  font-size: 9px;
}

.directory-group-toggle > strong {
  overflow: hidden;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-group-toggle.has-notifications > strong {
  color: var(--color-text);
  font-weight: 820;
}

.grouped-channel-list {
  padding-left: 17px;
}

.directory-item {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 31px;
  align-items: center;
  border-radius: 8px;
}

.directory-item.has-channel-actions {
  grid-template-columns: minmax(0, 1fr) 31px 31px;
}

.directory-item:hover {
  background: var(--color-surface-hover);
}

.directory-item.active {
  background: var(--color-accent-soft);
}

.directory-item.muted:not(.has-notifications) .directory-copy {
  opacity: 0.58;
}

.directory-conversation {
  width: 100%;
  min-height: 39px;
  border: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--color-text-muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.directory-conversation:hover,
.directory-item.active .directory-conversation {
  color: var(--color-accent-strong);
}

.directory-copy {
  overflow: hidden;
  display: grid;
  min-width: 0;
  font-size: 10px;
  text-overflow: ellipsis;
}

.directory-copy strong,
.directory-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-muted {
  flex: 0 0 auto;
  color: var(--color-text-subtle);
  font-size: 12px;
  line-height: 1;
}
.conversation-muted svg { display:block; width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }

.directory-copy strong {
  font-weight: 560;
}

.directory-item.has-notifications .directory-copy strong {
  color: var(--color-text);
  font-weight: 820;
}

.directory-copy small {
  color: var(--color-text-subtle);
  font-size: 8px;
}

.directory-list .avatar {
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
}

.directory-symbol {
  width: 27px;
  flex: 0 0 auto;
  color: var(--color-text-muted);
  font-size: 15px;
  font-weight: 750;
  text-align: center;
}

.conversation-favorite {
  flex-shrink: 0;
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 7px;
  color: var(--color-text-subtle);
  background: transparent;
  font-size: 15px;
  cursor: pointer;
}
.conversation-favorite:disabled { cursor:default; opacity:.5; }
.conversation-favorite:focus-visible { outline:2px solid var(--color-accent); outline-offset:2px; }

.conversation-favorite:hover,
.conversation-favorite.active {
  color: var(--color-warning-text);
  background: var(--color-warning-soft);
}

.conversation-actions {
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 7px;
  color: var(--color-text-subtle);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.conversation-actions:hover,
.conversation-actions[aria-expanded="true"] {
  color: var(--color-text);
  background: var(--color-surface-muted);
}

.channel-action-menu {
  position: absolute;
  z-index: 4;
  top: 34px;
  right: 3px;
  min-width: 142px;
  display: grid;
  gap: 3px;
  padding: 5px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-dialog);
}

.channel-action-menu button {
  min-height: 31px;
  border: 0;
  border-radius: 6px;
  padding: 0 9px;
  color: var(--color-text-muted);
  background: transparent;
  font: inherit;
  font-size: 9px;
  text-align: left;
  cursor: pointer;
}

.channel-action-menu button:hover {
  color: var(--color-text);
  background: var(--color-surface-hover);
}

.channel-action-menu .archive-channel:hover {
  color: var(--color-danger-text);
  background: var(--color-danger-soft);
}

.channel-editor-dialog {
  width: min(480px, calc(100vw - 28px));
}

.channel-members-dialog {
  width: min(520px, calc(100vw - 28px));
}

.channel-members-list {
  overflow-y: auto;
  max-height: min(390px, 48vh);
  display: grid;
  gap: 5px;
}

.channel-member-row {
  min-height: 52px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface);
}

.channel-member-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.channel-member-copy strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-member-copy small {
  color: var(--color-text-subtle);
  font-size: 8px;
}

.channel-member-toggle {
  min-height: 30px;
  border: 1px solid var(--color-accent-border);
  border-radius: 7px;
  padding: 0 9px;
  color: var(--color-accent-strong);
  background: var(--color-accent-soft);
  font: inherit;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.channel-member-toggle.remove {
  border-color: var(--color-danger-border);
  color: var(--color-danger-text);
  background: var(--color-danger-soft);
}

.channel-member-toggle:disabled {
  border-color: var(--color-border);
  color: var(--color-text-subtle);
  background: var(--color-surface-muted);
  cursor: default;
}

.unread-badge {
  min-width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 10px;
  color: var(--color-on-accent);
  background: var(--color-accent);
  font-size: 8px;
  font-weight: 750;
}

.directory-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.mention-badge {
  min-width: 22px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 10px;
  color: var(--color-danger-text);
  background: var(--color-danger-soft);
  font-size: 8px;
  font-weight: 800;
}

.directory-badges.notification-current .unread-badge,
.directory-badges.notification-current .mention-badge {
  color: var(--color-notification-current-text);
  background: var(--color-notification-current-bg);
  box-shadow: inset 0 0 0 1px var(--color-notification-current-border);
}

.directory-badges.notification-descendant .unread-badge,
.directory-badges.notification-descendant .mention-badge {
  color: var(--color-notification-descendant-text);
  background: var(--color-notification-descendant-bg);
  box-shadow: inset 0 0 0 1px var(--color-notification-descendant-border);
}

.directory-empty {
  padding: 8px 9px;
  color: var(--color-text-subtle);
  font-size: 9px;
}

.chat-main {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.empty-conversation {
  height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  color: var(--color-text-subtle);
  text-align: center;
}

.empty-conversation > span {
  font-size: 30px;
}

.empty-conversation h2 {
  margin: 13px 0 5px;
}

.empty-conversation p {
  font-size: 11px;
}

.conversation-head {
  height: 73px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--color-border);
}

.conversation-head > div {
  display: grid;
  gap: 3px;
}

.conversation-head strong {
  font-size: 13px;
}

.conversation-head small {
  color: var(--color-text-subtle);
  font-size: 9px;
}

.hub-conversation {
  min-height: 0;
  overflow: hidden;
  flex: 1;
  display: flex;
}

.new-message-dialog {
  width: min(500px, calc(100vw - 28px));
}

.new-message-results {
  overflow-y: auto;
  max-height: min(390px, 48vh);
  display: grid;
  gap: 5px;
}

.new-message-results > button {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--color-text-muted);
  background: var(--color-surface);
  text-align: left;
  cursor: pointer;
}

.new-message-results > button:hover {
  border-color: var(--color-accent-border);
  color: var(--color-accent-strong);
  background: var(--color-accent-soft);
}

.new-message-results > button > span:nth-child(2) {
  overflow: hidden;
  display: grid;
  gap: 2px;
}

.new-message-results strong,
.new-message-results small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-message-results small {
  color: var(--color-text-subtle);
  font-size: 9px;
}

.hub-conversation .native-conversation {
  min-height: 0;
}

.conversation-ai-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 7px 9px 0;
}

.conversation-ai-button {
  min-height: 30px;
  border: 1px solid var(--color-accent-border);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--color-accent-strong);
  background: var(--color-accent-soft);
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.conversation-ai-button:hover {
  background: var(--color-surface-hover);
}

.conversation-ai-button:disabled {
  color: var(--color-text-subtle);
  background: var(--color-surface-muted);
  cursor: not-allowed;
}

.translation-retry {
  margin-top: 6px;
  border: 0;
  padding: 0;
  color: var(--color-accent-strong);
  background: transparent;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.ai-assistance-workspace {
  position: fixed;
  z-index: 900;
  inset: 0 0 0 244px;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 26px 26px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(8%) scaleX(0.84);
  transform-origin: right center;
  background:
    radial-gradient(circle at 8% 0%, var(--color-accent-glow), transparent 30%),
    var(--color-canvas);
  transition:
    opacity 180ms ease,
    transform 220ms ease,
    visibility 0s linear 220ms;
}

.ai-assistance-workspace.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition-delay: 0s;
}

.ai-assistance-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.ai-assistance-head h1 {
  margin: 2px 0 3px;
  font-size: clamp(20px, 2vw, 28px);
}

.ai-assistance-head small {
  color: var(--color-text-subtle);
  font-size: 10px;
}

.ai-assistance-head-actions {
  display: flex;
  align-items: end;
  gap: 9px;
}

.ai-assistance-head-actions label {
  display: grid;
  gap: 4px;
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 700;
}

.ai-assistance-head-actions select {
  min-width: 150px;
  min-height: 34px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--color-text);
  background: var(--color-surface);
}

.ai-assistance-layout {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.08fr);
  gap: 14px;
}

.ai-writing-panel,
.ai-reference-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 15px;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}

.ai-writing-panel {
  display: grid;
  grid-template-rows: auto minmax(90px, 1fr) auto minmax(150px, 0.8fr);
}

.ai-assistance-intro {
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
}

.ai-assistance-intro strong {
  font-size: 12px;
}

.ai-assistance-intro p {
  margin: 5px 0 0;
  color: var(--color-text-muted);
  font-size: 10px;
  line-height: 1.5;
}

.ai-assistant-thread {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px 16px;
}

.ai-empty-state {
  align-self: center;
  justify-self: center;
  max-width: 320px;
  color: var(--color-text-subtle);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.ai-thread-message {
  max-width: 86%;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--color-text-muted);
  background: var(--color-surface-muted);
  font-size: 10px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.ai-thread-message.user {
  justify-self: end;
  color: var(--color-accent-strong);
  background: var(--color-accent-soft);
}

.ai-assistance-composer {
  display: grid;
  gap: 8px;
  padding: 12px 16px;
  border-block: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
}

.ai-assistance-composer textarea {
  width: 100%;
  min-height: 74px;
  max-height: 150px;
  resize: vertical;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  padding: 10px 11px;
  outline: 0;
  color: var(--color-text);
  background: var(--color-surface);
  font: inherit;
  font-size: 10px;
  line-height: 1.5;
}

.ai-assistance-composer textarea:focus {
  border-color: var(--color-accent-border);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.ai-assistance-composer > div,
.ai-draft-actions,
.ai-draft-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ai-assistance-composer small,
#ai-assistance-status {
  color: var(--color-text-subtle);
  font-size: 9px;
}

.ai-draft-card {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
}

.ai-draft-head strong {
  font-size: 11px;
}

.ai-draft-text {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  margin: 11px 0;
  padding: 12px;
  border: 1px solid var(--color-success-border);
  border-radius: 10px;
  color: var(--color-text-muted);
  background: var(--color-success-soft);
  font-size: 10px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ai-draft-actions {
  min-height: 36px;
}

.ai-reference-panel {
  display: flex;
  flex-direction: column;
}

.ai-reference-panel > header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
}

.ai-reference-panel > header strong {
  font-size: 12px;
}

.ai-reference-chat {
  min-height: 0;
  flex: 1;
  overflow: hidden;
  display: flex;
}

.ai-reference-chat .native-conversation {
  min-height: 0;
}

body.ai-assistance-open {
  overflow: hidden;
}

.documents-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 17px 19px;
  border: 1px solid var(--color-success-border);
  border-radius: 13px;
  background: var(--color-success-soft);
}

.documents-notice strong {
  font-size: 12px;
}

.documents-notice p {
  max-width: 760px;
  margin: 5px 0 0;
  color: var(--color-text-muted);
  font-size: 10px;
  line-height: 1.55;
}

.source-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 7px;
  color: var(--color-success-text);
  background: var(--color-success-soft);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.documents-panel {
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 15px;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}

.documents-toolbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.files-toolbar-actions {
  min-width: min(680px, 70%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.files-toolbar-actions select {
  min-width: 210px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  padding: 0 31px 0 10px;
  color: var(--color-text);
  background: var(--color-surface);
  font: inherit;
  font-size: 9px;
}

.file-upload-button {
  flex: 0 0 auto;
  cursor: pointer;
}

.file-upload-button.is-disabled,
.file-upload-button.is-busy {
  pointer-events: none;
  opacity: 0.48;
}

.file-dropzone {
  margin: 12px 20px 0;
  padding: 10px 14px;
  border: 1px dashed var(--color-border-strong);
  border-radius: 10px;
  color: var(--color-text-subtle);
  background: var(--color-surface-subtle);
  font-size: 9px;
  text-align: center;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.file-dropzone.is-dragging,
.task-file-dropzone.is-dragging {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

.document-search {
  width: min(320px, 45%);
  min-height: 36px;
}

.documents-content {
  min-height: 480px;
}

.document-list {
  border-bottom: 1px solid var(--color-border);
}

.document-row {
  min-height: 78px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--color-surface-muted);
}

.document-row:last-child {
  border-bottom: 0;
}

.document-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--color-success-text);
  background: var(--color-border);
  font-size: 16px;
}

.document-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.document-main strong {
  font-size: 11px;
}

.document-main small,
.document-meta small,
.project-document-card small {
  color: var(--color-text-subtle);
  font-size: 8px;
}

.document-main p {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--color-text-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-meta {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.document-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.document-meta a,
.document-meta button,
.project-document-card a {
  padding: 0;
  border: 0;
  color: var(--color-success-text);
  background: transparent;
  font-size: 9px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.document-meta .file-row-delete {
  color: var(--color-danger-text);
}

.document-detail-dialog {
  width: min(560px, calc(100vw - 28px));
}

.document-detail-content {
  display: grid;
  gap: 16px;
}

.document-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.document-detail-meta span {
  padding: 5px 8px;
  border-radius: 7px;
  color: var(--color-text-muted);
  background: var(--color-surface-muted);
  font-size: 9px;
}

.document-detail-description {
  margin: 0;
  color: var(--color-text);
  font-size: 11px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.document-detail-dates {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--color-text-subtle);
  font-size: 9px;
}

.document-manage-link {
  justify-self: end;
  text-decoration: none;
}

.documents-empty {
  min-height: 245px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 30px;
  color: var(--color-text-subtle);
  text-align: center;
}

.documents-empty > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--color-success-text);
  background: var(--color-border);
  font-size: 19px;
}

.documents-empty h3 {
  margin: 13px 0 5px;
  color: var(--color-text);
  font-size: 13px;
}

.documents-empty p {
  font-size: 10px;
}

.project-document-section {
  padding: 20px;
}

.project-document-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.project-document-head h3 {
  margin: 0;
  font-size: 13px;
}

.project-document-head > span {
  color: var(--color-text-subtle);
  font-size: 9px;
}

.project-document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.project-document-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-subtle);
}

.project-document-card .project-dot {
  margin: 0;
}

.project-document-card > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.project-document-card strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-link-wrap {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, auto);
  align-items: stretch;
  gap: 5px;
}

.file-link {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  color: var(--color-text);
  background: var(--color-surface);
  text-decoration: none;
}

.file-link:hover {
  border-color: var(--color-success-border);
  background: var(--color-surface-subtle);
}

.file-link-unavailable,
.file-link-unavailable:hover {
  border-color: var(--color-border);
  color: var(--color-text-subtle);
  background: var(--color-surface-muted);
}

.file-type-icon {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--color-success-text);
  background: var(--color-border);
  font-size: 7px;
  font-weight: 800;
}

.file-link-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.file-link-copy strong,
.file-link-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-link-copy strong {
  font-size: 9px;
}

.file-link-copy small {
  color: var(--color-text-subtle);
  font-size: 7px;
}

.file-link-wrap.compact {
  max-width: 360px;
}

.file-link-wrap.compact .file-link {
  grid-template-columns: 28px minmax(0, 1fr);
  padding: 6px;
}

.file-link-download {
  min-width: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  color: var(--color-success-text);
  background: var(--color-surface);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.file-link-download:hover {
  border-color: var(--color-success-border);
  background: var(--color-surface-subtle);
}

.file-link-delete {
  min-width: 28px;
  border: 1px solid var(--color-danger-border);
  border-radius: 9px;
  color: var(--color-danger-text);
  background: var(--color-danger-soft);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.file-link-delete:hover {
  background: var(--color-danger-border);
}

.task-files {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.task-files.is-uploading {
  pointer-events: none;
  opacity: 0.62;
}

.task-files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-files-head > div {
  display: grid;
  gap: 3px;
}

.task-files-head .section-label {
  margin: 0;
}

.task-files-head strong {
  font-size: 10px;
}

.task-file-upload {
  cursor: pointer;
}

.task-file-dropzone {
  padding: 8px;
  border: 1px dashed var(--color-border-strong);
  border-radius: 8px;
  color: var(--color-text-subtle);
  background: var(--color-surface);
  font-size: 8px;
  text-align: center;
}

.task-file-group,
.task-file-rollup,
.task-file-child-group,
.task-file-list {
  display: grid;
  gap: 7px;
}

.task-files-empty {
  margin: 0;
  color: var(--color-text-subtle);
  font-size: 8px;
}

.task-file-divider {
  position: relative;
  margin: 4px 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.task-file-divider span {
  position: relative;
  top: -7px;
  padding: 0 7px;
  color: var(--color-text-subtle);
  background: var(--color-surface-subtle);
  font-size: 7px;
}

.task-file-child-group > strong {
  color: var(--color-text-muted);
  font-size: 8px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(560px, 1.28fr);
  gap: 16px;
  align-items: start;
}

.admin-panel {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 15px;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}

.admin-panel-head {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.admin-user-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  padding: 20px;
}

.admin-user-form label,
.admin-invite-project-field,
.identity-mapping {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.admin-user-form label > span,
.admin-invite-project-field > span,
.identity-mapping > span {
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 700;
}

.admin-user-form .admin-field-help {
  color: var(--color-text-subtle);
  font-size: 8px;
  line-height: 1.45;
}

.admin-project-picker {
  position: relative;
}

.admin-project-picker > summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  color: var(--color-text);
  background: var(--color-surface-subtle);
  font-size: 10px;
  cursor: pointer;
  list-style: none;
}

.admin-project-picker > summary::-webkit-details-marker {
  display: none;
}

.admin-project-picker > summary::after {
  content: "⌄";
  position: absolute;
  right: 12px;
  color: var(--color-text-muted);
}

.admin-project-picker[open] > summary {
  border-color: var(--color-success-border);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.admin-project-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow: auto;
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}

.admin-project-options label {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
}

.admin-project-options label:hover {
  background: var(--color-surface-subtle);
}

.admin-user-form .admin-project-options input {
  width: 15px;
  height: 15px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
}

.admin-project-options small {
  color: var(--color-text-subtle);
  padding: 6px 8px;
}

.admin-invite-project-field.is-disabled {
  opacity: 0.55;
}

.admin-invite-project-field.is-disabled .admin-project-picker {
  pointer-events: none;
}

.admin-user-form input,
.admin-user-form select,
.identity-mapping select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  padding: 0 10px;
  outline: 0;
  background: var(--color-surface-subtle);
  font-size: 10px;
}

.admin-user-form input:focus,
.admin-user-form select:focus,
.identity-mapping select:focus {
  border-color: var(--color-success-border);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.admin-password-field,
.admin-user-form .primary-button,
.admin-user-form > .time-form-error {
  grid-column: 1 / -1;
}

.admin-password-field small {
  color: var(--color-text-subtle);
  font-size: 8px;
  line-height: 1.45;
}

.admin-user-form .primary-button {
  min-height: 40px;
}

.admin-invitation-list {
  display: grid;
  border-top: 1px solid var(--color-border);
}

.admin-invitation-readiness {
  background: color-mix(in srgb, var(--color-success) 9%, transparent);
  border-radius: 10px;
  color: var(--color-success);
  margin: 0;
  padding: 0.65rem 0.8rem;
}

.admin-invitation-readiness.is-error,
.invitation-delivery-failed {
  background: color-mix(in srgb, var(--color-danger) 10%, transparent);
  color: var(--color-danger);
}

.invitation-delivery-smtp_accepted {
  background: color-mix(in srgb, var(--color-success) 12%, transparent);
  color: var(--color-success);
}

.admin-invitation-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.75fr) minmax(180px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-surface-muted);
}

.admin-invitation-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-invitation-row strong,
.admin-invitation-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-invitation-state {
  justify-items: start;
}

.admin-invitation-actions {
  display: flex !important;
  grid-auto-flow: column;
  gap: 7px !important;
  align-items: center;
}

.admin-invitation-actions .detail-button,
.admin-invitation-actions .access-revoke {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 8px;
}

.admin-invitation-row strong {
  font-size: 10px;
}

.admin-invitation-row small {
  color: var(--color-text-muted);
  font-size: 8px;
}

.admin-project-panel {
  grid-column: 1 / -1;
}

.admin-email-panel {
  grid-column: 1 / -1;
}

.admin-ai-prompt-panel {
  grid-column: 1 / -1;
}

.admin-ai-prompt-form {
  border-bottom: 1px solid var(--color-border);
}

.admin-prompt-explanation {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 9px;
  line-height: 1.55;
}

.admin-ai-prompt-form textarea {
  min-height: 110px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  line-height: 1.5;
}

.admin-prompt-history {
  display: grid;
}

.admin-prompt-version-row {
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) minmax(180px, 2fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--color-surface-muted);
  font-size: 9px;
}

.admin-prompt-version-row:last-child {
  border-bottom: 0;
}

.admin-prompt-version-row small {
  color: var(--color-text-muted);
}

.admin-project-content {
  min-height: 150px;
}

.admin-project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-project-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 10px minmax(150px, 0.7fr) minmax(180px, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-right: 1px solid var(--color-surface-muted);
  border-bottom: 1px solid var(--color-surface-muted);
  padding: 14px 17px;
}

.admin-project-row:nth-child(2n) {
  border-right: 0;
}

.admin-project-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-project-row strong,
.admin-project-row small,
.admin-project-row p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-project-row strong {
  font-size: 10px;
}

.admin-project-row small {
  color: var(--color-text-muted);
  font-size: 8px;
}

.admin-project-row p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 9px;
}

.admin-project-row button {
  height: 31px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--color-text-muted);
  background: var(--color-surface-subtle);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}

.admin-project-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  padding: 20px;
}

.admin-project-form label {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
}

.admin-project-form label > span {
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 700;
}

.admin-project-form input:not([type="checkbox"]),
.admin-project-form select,
.admin-project-form textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  padding: 9px 10px;
  outline: 0;
  color: var(--color-text);
  background: var(--color-surface-subtle);
  font: inherit;
  font-size: 10px;
}

.admin-project-form input:not([type="checkbox"]),
.admin-project-form select {
  height: 38px;
}

.admin-project-form textarea {
  resize: vertical;
}

.admin-project-form input:focus,
.admin-project-form select:focus,
.admin-project-form textarea:focus {
  border-color: var(--color-success-border);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.admin-project-form label > small {
  color: var(--color-text-muted);
  font-size: 8px;
}

.admin-project-wide,
.admin-project-form > .time-form-error,
.admin-project-actions {
  grid-column: 1 / -1;
}

.admin-project-check {
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: start;
}

.admin-project-check input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.admin-project-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 3px;
}

.admin-directory {
  min-height: 220px;
}

.identity-list {
  display: grid;
}

.identity-row {
  min-width: 0;
  border-bottom: 1px solid var(--color-surface-muted);
}

.identity-row:last-child {
  border-bottom: 0;
}

.identity-toggle {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 34px minmax(160px, 1fr) auto 28px;
  align-items: center;
  gap: 11px;
  border: 0;
  padding: 13px 16px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.identity-toggle:hover,
.identity-toggle[aria-expanded="true"] {
  background: var(--color-surface-hover);
}

.identity-chevron {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--color-text-muted);
  background: var(--color-surface-muted);
  font-size: 15px;
}

.identity-editor {
  display: grid;
  gap: 10px;
  padding: 2px 16px 16px 61px;
}

.identity-mapping-editor {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.identity-lifecycle-actions {
  align-items: center;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
}

.identity-lifecycle-actions small {
  color: var(--color-text-muted);
  flex: 1 1 280px;
}

.identity-user {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.identity-user strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-user small {
  overflow: hidden;
  color: var(--color-text-subtle);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapping-save {
  height: 32px;
  border: 1px solid var(--color-success-border);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--color-success-text);
  background: var(--color-success-soft);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.mapping-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mapping-provision {
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--color-text-muted);
  background: var(--color-surface);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}

.mapping-state {
  justify-self: end;
  font-size: 8px;
  font-weight: 700;
}

.mapping-state.complete {
  color: var(--color-success-text);
}

.mapping-state.incomplete {
  color: var(--color-warning-text);
}

.membership-control {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(105px, 0.7fr) auto;
  align-items: center;
  gap: 6px;
  padding-top: 3px;
}

.membership-control select {
  width: 100%;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0 8px;
  background: var(--color-surface-subtle);
  font-size: 8px;
}

.membership-control button {
  height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  color: var(--color-on-accent);
  background: var(--color-accent-hover);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}

.membership-summary {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.membership-summary span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--color-success-text);
  background: var(--color-success-soft);
  font-size: 8px;
  font-weight: 700;
}

.membership-summary span button {
  width: 17px;
  height: 17px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: var(--color-danger-text);
  background: var(--color-danger-soft);
  line-height: 1;
}

.authorization-control {
  margin-top: 2px;
  border-top: 1px dashed var(--color-border);
  padding-top: 9px;
}

.authorization-summary span {
  color: var(--color-accent-strong);
  background: var(--color-accent-soft);
}

.membership-summary small {
  color: var(--color-warning-text);
  font-size: 8px;
}

.time-summary {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 14px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 18px 20px;
  background: var(--color-surface);
}

.time-summary h2,
.time-panel-head h2 {
  margin: 3px 0 0;
  color: var(--color-text);
  font-size: 18px;
}

.time-summary p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--color-text-muted);
  font-size: 10px;
}

.time-week-controls {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 9px;
}

.time-week-controls button {
  min-width: 36px;
  height: 34px;
  border: 0;
  border-right: 1px solid var(--color-border);
  padding: 0 11px;
  color: var(--color-text-muted);
  background: var(--color-surface-subtle);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.time-week-controls button:last-child {
  border-right: 0;
}

.time-week-controls button:hover {
  background: var(--color-success-soft);
}

.time-total {
  min-width: 88px;
  border-left: 1px solid var(--color-border);
  padding-left: 22px;
}

.time-total small {
  display: block;
  color: var(--color-text-muted);
  font-size: 9px;
}

.time-total strong {
  color: var(--color-accent-hover);
  font-size: 22px;
}

.time-admin-switch {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 14px;
}

.time-admin-switch span {
  margin-right: 5px;
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.time-admin-switch button {
  height: 31px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--color-text-muted);
  background: var(--color-surface);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.time-admin-switch button.active {
  border-color: var(--color-success-border);
  color: var(--color-accent-hover);
  background: var(--color-success-soft);
}

.time-user-summary {
  margin-bottom: 14px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
  overflow: hidden;
}

.time-user-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--color-border);
  padding: 14px 18px;
}

.time-user-summary-head h2 {
  margin: 2px 0 0;
  font-size: 14px;
}

.time-user-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.time-user-total {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-right: 1px solid var(--color-border);
  padding: 14px 16px;
}

.time-user-total:last-child {
  border-right: 0;
}

.time-user-total > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--color-accent-hover);
  background: var(--color-accent-soft);
  font-size: 9px;
  font-weight: 800;
}

.time-user-total > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.time-user-total strong,
.time-user-total small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-user-total strong {
  font-size: 10px;
}

.time-user-total small {
  color: var(--color-text-muted);
  font-size: 8px;
}

.time-user-total b {
  color: var(--color-accent-hover);
  font-size: 14px;
  white-space: nowrap;
}

.time-layout {
  display: grid;
  grid-template-columns: minmax(310px, 0.72fr) minmax(440px, 1.28fr);
  gap: 14px;
}

.time-entry-panel,
.time-list-panel {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
}

.time-entry-panel {
  align-self: start;
  overflow: hidden;
}

.time-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--color-border);
  padding: 17px 18px;
}

.time-entry-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 18px;
}

.time-entry-form label {
  display: grid;
  align-content: start;
  gap: 6px;
}

.time-entry-form label > span {
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 750;
}

.time-entry-form input,
.time-entry-form select,
.time-entry-form textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--color-text);
  background: var(--color-surface-subtle);
  font: inherit;
  font-size: 10px;
}

.time-entry-form input,
.time-entry-form select {
  height: 36px;
}

.time-entry-form textarea {
  min-height: 72px;
  resize: vertical;
}

.time-entry-form input:focus,
.time-entry-form select:focus,
.time-entry-form textarea:focus {
  outline: 2px solid var(--color-success-border);
  border-color: var(--color-success-border);
}

.time-entry-form label > small {
  color: var(--color-text-muted);
  font-size: 8px;
  line-height: 1.4;
}

.time-field-wide,
.time-entry-form > .primary-button,
.time-form-error {
  grid-column: 1 / -1;
}

.time-tracker-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: 11px;
  padding: 13px 14px;
  background: var(--color-surface-subtle);
}

.time-tracker-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.time-tracker-copy > span {
  color: var(--color-accent);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.time-tracker-copy > strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.time-tracker-copy > small {
  overflow: hidden;
  max-width: 260px;
  color: var(--color-text-muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-tracker-actions,
.task-timer-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.task-timer-actions {
  margin-left: auto;
}

.time-form-error {
  margin: 0;
  border: 1px solid var(--color-danger-border);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--color-danger-text);
  background: var(--color-danger-soft);
  font-size: 9px;
  line-height: 1.45;
}

.time-entry-list {
  min-height: 280px;
}

.time-entry-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 62px auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--color-border);
  padding: 15px 18px;
}

.time-entry-row:last-child {
  border-bottom: 0;
}

.time-entry-date,
.time-entry-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.time-entry-date strong,
.time-entry-main strong {
  overflow: hidden;
  color: var(--color-text);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-entry-date small,
.time-entry-main span {
  color: var(--color-text-muted);
  font-size: 8px;
}

.time-entry-main p {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--color-text-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-audit-note {
  color: var(--color-warning-text);
  font-size: 8px;
}

.time-entry-hours {
  color: var(--color-accent-hover);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.time-correct {
  height: 30px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--color-text-muted);
  background: var(--color-surface-subtle);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}

.time-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 64px 20px;
  color: var(--color-text-muted);
  text-align: center;
}

.time-empty span {
  font-size: 24px;
}

.time-empty h3,
.time-empty p {
  margin: 0;
}

.time-empty h3 {
  color: var(--color-text);
  font-size: 13px;
}

.time-empty p {
  font-size: 9px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 10px;
  }

  .brand {
    justify-content: center;
    padding-inline: 0;
    font-size: 0;
  }

  .brand-badge,
  .nav-label,
  .project-item span:nth-child(2),
  .project-more,
  .sidebar-project-menu {
    display: none;
  }

  .sidebar-foot .system-status,
  .sidebar-foot .profile,
  .sidebar-theme-toggle [data-theme-label] {
    display: none;
  }

  .sidebar-theme-toggle {
    width: 40px;
    margin-inline: auto;
  }

  .nav-item,
  .project-item {
    justify-content: center;
    font-size: 0;
  }

  .nav-soon {
    display: none;
  }

  .nav-icon {
    font-size: 16px;
  }

  .workspace {
    grid-template-columns: minmax(300px, 0.65fr) minmax(430px, 1.35fr);
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-project-list {
    grid-template-columns: 1fr;
  }

  .admin-project-row,
  .admin-project-row:nth-child(2n) {
    border-right: 0;
  }

  .detail-content {
    grid-template-columns: 1fr;
  }

  .time-layout {
    grid-template-columns: minmax(280px, 0.8fr) minmax(390px, 1.2fr);
  }

  .task-info {
    display: none;
  }
}

@media (max-width: 1600px) {
  .projects-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .projects-topbar .topbar-greeting {
    grid-column: 1;
    grid-row: 1;
  }

  .projects-topbar .metrics {
    grid-column: 2;
    grid-row: 1;
  }

  .projects-topbar .world-clock-widget {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
  }

  .projects-topbar .active-timer {
    grid-row: 3;
    grid-column: 1 / -1;
  }
}

@media (hover: none) {
  .location-card-remove {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .location-weather-card[data-expanded="true"] {
    position: fixed;
    top: 76px;
    right: 14px;
    left: auto;
    z-index: 1000;
  }
}

@media (prefers-reduced-motion: reduce) {
  .location-weather-card,
  .geo-card-summary,
  .geo-card-expanded-content {
    transition: none;
  }

  .ai-assistance-workspace {
    transition: none;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: 62px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    overflow: hidden;
  }

  .ai-assistance-workspace {
    inset: 62px 0 0;
    padding: 14px;
  }

  .ai-assistance-head {
    align-items: flex-start;
  }

  .ai-assistance-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .ai-writing-panel,
  .ai-reference-panel {
    min-height: 620px;
  }

  .ai-reference-panel {
    min-height: 480px;
  }

  .sidebar-foot {
    flex: 0 0 auto;
    margin-top: 0;
  }

  .sidebar-theme-toggle {
    margin: 0;
  }

  .brand {
    flex: 0 0 auto;
    padding: 0;
  }

  .sidebar nav {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .sidebar nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar .nav-item {
    width: 40px;
    min-width: 40px;
    height: 40px;
    flex: 0 0 40px;
    padding: 8px;
  }

  .project-item {
    display: none;
  }

  .sidebar-project-card,
  .sidebar-department-list {
    display: none;
  }

  main {
    padding: 20px 14px;
  }

  #projects-view,
  #messages-view {
    height: calc(100vh - 62px);
  }

  #projects-view {
    overflow-y: auto;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-overview {
    flex-basis: 100%;
  }

  .projects-topbar {
    grid-template-columns: 1fr;
  }

  .projects-topbar .topbar-greeting,
  .projects-topbar .metrics,
  .projects-topbar .active-timer,
  .projects-topbar .world-clock-widget {
    grid-column: 1;
  }

  .projects-topbar .world-clock-widget {
    grid-row: 2;
    width: 100%;
    justify-self: start;
  }

  .location-card-list {
    max-width: calc(100vw - 72px);
    overflow-x: auto;
    padding: 0 2px 5px;
    scrollbar-width: thin;
  }

  .projects-topbar .metrics {
    grid-row: 3;
  }

  .projects-topbar .active-timer {
    width: 100%;
    grid-row: 4;
  }

  .icon-button {
    display: none;
  }

  .active-timer {
    min-width: 190px;
  }

  .workspace {
    display: block;
    min-height: 570px;
    overflow-y: auto;
  }

  .task-panel {
    border-right: 0;
  }

  .detail-panel {
    border-top: 1px solid var(--color-border);
  }

  .task-editor {
    height: auto;
    min-height: 570px;
    overflow: visible;
  }

  .editor-body {
    overflow-y: visible;
  }

  .messages-panel {
    min-height: 0;
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .project-document-grid {
    grid-template-columns: 1fr;
  }

  .time-summary {
    grid-template-columns: minmax(200px, 1fr) auto;
  }

  .time-total {
    display: none;
  }

  .time-layout {
    grid-template-columns: 1fr;
  }

  .time-user-summary-grid {
    grid-template-columns: 1fr;
  }

  .time-user-total {
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .time-user-total:last-child {
    border-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 560px) {
  .topbar {
    display: grid;
  }

  .active-timer {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
  }

  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow-x: auto;
  }

  .toolbar {
    display: grid;
  }

  .toolbar select {
    height: 34px;
  }

.task-row-select {
    grid-template-columns: 8px minmax(0, 1fr) auto;
  }

  .task-hours {
    display: none;
  }

  .detail-head h2 {
    font-size: 18px;
  }

  .editor-grid {
    grid-template-columns: 1fr;
  }

  .editor-field-wide {
    grid-column: auto;
  }

  .editor-footer {
    flex-wrap: wrap;
  }

  .editor-footer > span {
    width: 100%;
  }

  .time-tracker-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .time-tracker-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .login-screen {
    padding: 12px;
  }

  .login-card {
    padding: 25px 20px;
  }

  .messages-button {
    font-size: 0;
  }

  .messages-button span {
    font-size: 14px;
  }

  .messages-panel {
    width: 100%;
    min-height: 0;
    grid-template-columns: 135px minmax(0, 1fr);
  }

  .chat-sidebar-head {
    padding: 16px 10px;
  }

  .chat-sidebar-head h2 {
    font-size: 14px;
  }

  .directory-conversation {
    padding-inline: 5px;
  }

  .directory-item {
    grid-template-columns: minmax(0, 1fr) 27px;
  }

  .directory-symbol,
  .directory-list .avatar {
    display: none;
  }

  .documents-notice,
  .documents-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .document-search {
    width: 100%;
  }

  .document-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .document-meta {
    grid-column: 2;
    justify-items: start;
  }

  .admin-user-form {
    grid-template-columns: 1fr;
  }

  .admin-user-form label,
  .admin-user-form .primary-button {
    grid-column: 1;
  }

  .admin-project-form {
    grid-template-columns: 1fr;
  }

  .admin-project-wide,
  .admin-project-form > .time-form-error,
  .admin-project-actions {
    grid-column: 1;
  }

  .admin-project-row {
    grid-template-columns: 10px minmax(0, 1fr) auto;
  }

  .admin-invitation-row {
    grid-template-columns: 1fr auto;
  }

  .admin-invitation-row > div:nth-child(2),
  .admin-invitation-state,
  .admin-invitation-actions {
    grid-column: 1 / -1;
  }

  .admin-invitation-actions {
    justify-content: flex-start;
  }

  .admin-project-row p {
    grid-column: 2 / -1;
  }

  .identity-toggle {
    grid-template-columns: 30px minmax(0, 1fr) 24px;
    padding: 12px;
  }

  .mapping-state {
    display: none;
  }

  .identity-editor {
    padding: 2px 12px 14px 53px;
  }

  .identity-mapping-editor,
  .membership-control {
    grid-template-columns: 1fr;
  }

  .membership-summary {
    grid-column: 1;
  }

  .time-summary {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .time-week-controls {
    width: max-content;
    max-width: 100%;
  }

  .time-entry-form {
    grid-template-columns: 1fr;
  }

  .time-field-wide,
  .time-entry-form > .primary-button,
  .time-form-error {
    grid-column: 1;
  }

  .time-entry-row {
    grid-template-columns: 70px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 13px 12px;
  }

  .time-correct {
    grid-column: 2 / -1;
    justify-self: start;
  }
}

.task-rights-button {
  width: 30px;
  height: 30px;
  align-self: center;
  border: 0;
  border-radius: 8px;
  color: var(--color-text-muted);
  background: transparent;
  font-size: 10px;
  letter-spacing: 1px;
  cursor: pointer;
}

.task-rights-button:hover {
  color: var(--color-text);
  background: var(--color-surface-muted);
}

@media (max-width: 700px) {
  .access-scope-grid,
  .access-levels,
  .scoped-invite-grid {
    grid-template-columns: 1fr;
  }

  .scoped-invite-level {
    grid-column: 1;
  }

  .access-editor-dialog form,
  .scoped-invite-dialog form {
    padding: 18px;
  }
}
.chat-translation-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  flex-shrink: 0;
  padding: 6px 12px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
  color: var(--color-text-muted);
  font-size: 11px;
}
.chat-translation-tools .detail-button { font-size: 11px; }
.chat-history-navigation { display:flex; gap:8px; padding:4px 12px; flex-shrink:0; background:var(--color-surface-subtle); }
.chat-history-navigation .detail-button { font-size:11px; padding:3px 8px; }
