/*
 * ESNO Workspace vNext
 * --------------------
 * Final visual layer for the authenticated workspace.  The legacy stylesheet
 * still owns feature-specific geometry; this file normalises the shared shell,
 * controls, data surfaces and dialog language without changing feature DOM.
 */

.app-shell {
  --esno-nav: #102b3a;
  --esno-nav-raised: #294a59;
  --esno-nav-deep: #062c3a;
  --esno-yellow: #ffd21c;
  --esno-ink: #17252e;
  --esno-copy: #385361;
  --esno-muted: #586f7b;
  --esno-canvas: #eef3f5;
  --esno-surface: #ffffff;
  --esno-surface-muted: #f4f8f9;
  --esno-line: #d8e2e6;
  --esno-control-line: #728690;
  --esno-primary: #073746;
  --esno-primary-hover: #0b4a5d;
  --esno-blue: #076fa7;
  --esno-blue-hover: #055f94;
  --esno-blue-soft: #e8f4fa;
  --esno-success: #176f5f;
  --esno-success-soft: #e5f5ee;
  --esno-success-line: #8dc9ad;
  --esno-warning: #a44b0b;
  --esno-warning-soft: #fff0e5;
  --esno-danger: #b54238;
  --esno-danger-soft: #fff0ee;
  --esno-focus: #0780be;
  --esno-shadow-card: 0 10px 28px rgb(16 43 56 / 6%);
  --esno-shadow-overlay: 0 30px 90px rgb(5 25 35 / 22%);
  --esno-scrim: rgb(6 28 38 / 54%);
  --esno-radius-control: 10px;
  --esno-radius-card: 14px;
  --esno-radius-panel: 18px;
  --esno-radius-hero: 24px;
  --esno-motion-fast: 120ms;
  --esno-motion-standard: 180ms;
  --esno-motion-panel: 240ms;
  --esno-ease: cubic-bezier(.2, 0, 0, 1);

  /* Backwards-compatible aliases used by the feature styles. */
  --bg: var(--esno-canvas);
  --panel: var(--esno-surface);
  --ink: var(--esno-ink);
  --muted: var(--esno-muted);
  --line: var(--esno-line);
  --blue: var(--esno-blue);
  --blue-dark: var(--esno-blue-hover);
  --yellow: var(--esno-yellow);
  --green: var(--esno-success);
  --danger: var(--esno-danger);
  --danger-soft: var(--esno-danger-soft);
  --soft-blue: var(--esno-blue-soft);
  --surface-hover: #f7fafb;
  --surface-muted: var(--esno-surface-muted);
  --surface-blue: var(--esno-blue-soft);
  --surface-green: var(--esno-success-soft);
  --surface-info: #edf6fb;
  --shadow: var(--esno-shadow-card);

  grid-template-columns: minmax(228px, 264px) minmax(0, 1fr);
  background: var(--esno-canvas);
  color: var(--esno-ink);
  font-family: "Avenir Next", "Arial Nova", Arial, ui-sans-serif, system-ui, sans-serif;
}

[data-theme="dark"] .app-shell {
  --esno-nav: #081f2a;
  --esno-nav-raised: #173b4c;
  --esno-nav-deep: #041820;
  --esno-ink: #edf5f7;
  --esno-copy: #c5d5dc;
  --esno-muted: #a6b8c1;
  --esno-canvas: #091116;
  --esno-surface: #111d23;
  --esno-surface-muted: #17262e;
  --esno-line: #31434c;
  --esno-control-line: #7b929e;
  --esno-primary: #1b6178;
  --esno-primary-hover: #237792;
  --esno-blue: #38afe7;
  --esno-blue-hover: #50bbeb;
  --esno-blue-soft: #102b39;
  --esno-success: #7fd7c1;
  --esno-success-soft: #132d27;
  --esno-success-line: #397965;
  --esno-warning: #f0a04a;
  --esno-warning-soft: #332515;
  --esno-danger: #ff8b82;
  --esno-danger-soft: #3b201e;
  --esno-focus: #62c7f3;
  --esno-shadow-card: 0 14px 36px rgb(0 0 0 / 26%);
  --esno-shadow-overlay: 0 34px 96px rgb(0 0 0 / 55%);
  --esno-scrim: rgb(0 8 12 / 72%);
  --surface-hover: #17262e;
  --surface-info: #142a36;
}

.app-shell .sidebar {
  width: auto;
  padding: 0 16px 18px;
  border: 0;
  background: var(--esno-nav);
  box-shadow: 10px 0 36px rgb(16 43 58 / 8%);
}

.app-shell .brand {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  grid-template-areas:
    "logo logo"
    "product version";
  justify-self: end;
  width: min(100%, 18rem);
  min-height: 0;
  gap: 8px 16px;
  margin-inline-start: auto;
  padding: 24px 10px 22px;
  border: 0;
  color: inherit;
  background: var(--esno-nav);
  text-decoration: none;
}

.app-shell .workspace-nav-toggle {
  display: none;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 10px;
  background: rgb(255 255 255 / 8%);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.app-shell .workspace-nav-toggle:hover,
.app-shell .workspace-nav-toggle[aria-expanded="true"] {
  border-color: rgb(255 255 255 / 34%);
  background: var(--esno-nav-raised);
}

.app-shell .brand-logo {
  grid-area: logo;
  justify-self: start;
  width: 148px;
  max-width: 100%;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-shell .brand-product {
  grid-area: product;
  justify-self: start;
  margin: 0;
  padding: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.app-shell .brand-version {
  grid-area: version;
  justify-self: end;
  color: rgb(238 247 251 / 62%);
  font-size: 12px;
  font-weight: 800;
}

.app-shell .tabs {
  gap: 4px;
}

.app-shell .tabs-section-label {
  margin: 19px 10px 6px;
  color: rgb(238 247 251 / 50%);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
}

.app-shell .tab {
  min-height: 44px;
  gap: 11px;
  padding: 0 12px;
  border-radius: 10px;
  color: rgb(238 247 251 / 76%);
  font-size: 14px;
  font-weight: 700;
  transition:
    color var(--esno-motion-fast) var(--esno-ease),
    background-color var(--esno-motion-fast) var(--esno-ease);
}

.app-shell .tab:hover {
  color: #fff;
  background: rgb(255 255 255 / 8%);
}

.app-shell .tab.active,
.app-shell .tab-parent.active,
.app-shell .tab-group.active-group > .tab-parent {
  color: #fff;
  background: var(--esno-nav-raised);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 4%);
}

.app-shell .tab:focus-visible,
.app-shell .subtab:focus-visible {
  outline: 3px solid var(--esno-yellow);
  outline-offset: 2px;
}

.app-shell .subtabs {
  margin-left: 19px;
  padding-left: 11px;
  border-left: 1px solid rgb(255 255 255 / 16%);
}

.app-shell .workspace {
  min-width: 0;
  max-width: none;
  padding: clamp(20px, 2.7vw, 42px);
  padding-bottom: 48px;
  background: var(--esno-canvas);
}

.app-shell .topbar {
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 26px;
}

.app-shell .topbar h1 {
  color: var(--esno-ink);
  font-size: clamp(30px, 2.35vw, 40px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.08;
}

.app-shell .topbar p {
  max-width: 720px;
  margin-top: 7px;
  color: var(--esno-muted);
  font-size: 15px;
  line-height: 1.45;
}

.app-shell .topbar-actions {
  align-items: center;
  gap: 10px;
}

.app-shell .user-chip,
.app-shell .theme-toggle,
.app-shell #logoutBtn {
  min-height: 44px;
  border: 1px solid var(--esno-line);
  border-radius: var(--esno-radius-control);
  background: var(--esno-surface);
  box-shadow: 0 7px 20px rgb(16 43 56 / 6%);
}

.app-shell .view.active {
  gap: 20px;
  min-width: 0;
  animation: esno-vnext-view-in var(--esno-motion-standard) var(--esno-ease);
}

.app-shell .panel {
  min-width: 0;
  padding: clamp(18px, 1.7vw, 24px);
  border: 1px solid var(--esno-line);
  border-radius: var(--esno-radius-card);
  background: var(--esno-surface);
  box-shadow: var(--esno-shadow-card);
}

.app-shell .panel-head {
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.app-shell .panel-head h2,
.app-shell .panel-head h3,
.app-shell .panel h2,
.app-shell .panel h3 {
  color: var(--esno-ink);
  font-weight: 800;
  letter-spacing: -.015em;
}

.app-shell .row-sub,
.app-shell .panel-head p,
.app-shell .panel > p {
  color: var(--esno-muted);
  line-height: 1.5;
}

.app-shell .grid.two {
  align-items: start;
  gap: clamp(16px, 1.7vw, 24px);
}

.app-shell .form-grid {
  gap: 15px;
}

.app-shell label,
.app-shell .field-label,
.app-shell legend {
  color: var(--esno-muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
}

.app-shell input,
.app-shell textarea,
.app-shell select,
.app-shell .rich-editor {
  border-color: var(--esno-control-line);
  border-radius: var(--esno-radius-control);
  background: var(--esno-surface);
  color: var(--esno-ink);
}

.app-shell input:not([type="file"]),
.app-shell select {
  min-height: 44px;
  height: 44px;
}

.app-shell textarea {
  min-height: 96px;
  resize: vertical;
}

.app-shell input:hover,
.app-shell textarea:hover,
.app-shell select:hover {
  border-color: color-mix(in srgb, var(--esno-blue) 42%, var(--esno-control-line));
}

.app-shell input:focus,
.app-shell textarea:focus,
.app-shell select:focus,
.app-shell .rich-content:focus,
.app-shell [contenteditable="true"]:focus {
  outline: 2px solid var(--esno-focus);
  outline-offset: 2px;
  border-color: var(--esno-focus);
  box-shadow: none;
}

.app-shell input::placeholder,
.app-shell textarea::placeholder {
  color: color-mix(in srgb, var(--esno-muted) 78%, transparent);
}

.app-shell .checkbox-field {
  min-height: 44px;
  align-items: center;
}

.app-shell .checkbox-field input[type="checkbox"],
.app-shell input[type="checkbox"],
.app-shell input[type="radio"] {
  width: 19px;
  height: 19px;
  accent-color: var(--esno-blue);
}

.app-shell .primary,
.app-shell .ghost,
.app-shell .icon-text,
.app-shell .danger,
.app-shell .button-link {
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--esno-radius-control);
  font-size: 13px;
  font-weight: 800;
  transition:
    transform var(--esno-motion-fast) var(--esno-ease),
    box-shadow var(--esno-motion-fast) var(--esno-ease),
    background-color var(--esno-motion-fast) var(--esno-ease),
    border-color var(--esno-motion-fast) var(--esno-ease);
}

.app-shell .primary {
  border-color: var(--esno-primary);
  background: var(--esno-primary);
  color: #fff;
  box-shadow: 0 8px 20px rgb(7 55 70 / 18%);
}

.app-shell .primary:hover {
  border-color: var(--esno-primary-hover);
  background: var(--esno-primary-hover);
  transform: translateY(-1px);
}

.app-shell #leadAddTopBtn,
.app-shell #projectAddTopBtn,
.app-shell #calendarAddTopBtn,
.app-shell #todoAddTaskBtn {
  border-color: var(--esno-blue);
  background: var(--esno-blue);
  box-shadow: 0 8px 20px rgb(7 111 167 / 18%);
}

.app-shell #leadAddTopBtn:hover,
.app-shell #projectAddTopBtn:hover,
.app-shell #calendarAddTopBtn:hover,
.app-shell #todoAddTaskBtn:hover {
  border-color: var(--esno-blue-hover);
  background: var(--esno-blue-hover);
}

.app-shell .ghost,
.app-shell .icon-text,
.app-shell .button-link {
  border: 1px solid var(--esno-control-line);
  background: var(--esno-surface);
  color: var(--esno-ink);
  box-shadow: none;
}

.app-shell .ghost:hover,
.app-shell .icon-text:hover,
.app-shell .button-link:hover {
  border-color: var(--esno-blue);
  background: var(--esno-blue-soft);
  color: var(--esno-primary);
}

.app-shell .danger {
  border-color: var(--esno-danger);
  background: var(--esno-danger-soft);
  color: var(--esno-danger);
  box-shadow: none;
}

.app-shell button:focus-visible,
.app-shell a:focus-visible,
.app-shell [role="button"]:focus-visible,
.app-shell [tabindex]:focus-visible {
  outline: 3px solid var(--esno-focus);
  outline-offset: 2px;
}

.app-shell button:disabled,
.app-shell input:disabled,
.app-shell select:disabled,
.app-shell textarea:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.app-shell .table-wrap,
.app-shell .workforce-table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface);
  scrollbar-gutter: stable;
}

.app-shell table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.app-shell th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 13px;
  border-bottom: 1px solid var(--esno-line);
  background: var(--esno-surface-muted);
  color: var(--esno-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .065em;
  text-align: left;
  text-transform: uppercase;
}

.app-shell td {
  padding: 13px;
  border-bottom: 1px solid var(--esno-line);
  background: var(--esno-surface);
  color: var(--esno-copy);
}

.app-shell tbody tr:last-child td {
  border-bottom: 0;
}

.app-shell tbody tr:hover td {
  background: var(--surface-hover);
}

.app-shell .list,
.app-shell .catalog,
.app-shell .mini-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.app-shell .list-row,
.app-shell .catalog-item,
.app-shell .mini-row {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--esno-line);
  border-radius: 12px;
  background: var(--esno-surface);
  box-shadow: 0 4px 14px rgb(16 43 56 / 4%);
}

.app-shell .empty,
.app-shell .todo-empty,
.app-shell .pipeline-empty,
.app-shell .workforce-empty,
.app-shell .lead-activity-empty,
.app-shell .project-workspace-empty {
  min-height: 88px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px dashed color-mix(in srgb, var(--esno-control-line) 55%, var(--esno-line));
  border-radius: 12px;
  background: var(--esno-surface-muted);
  color: var(--esno-muted);
  text-align: center;
}

/* Unified dialog language. Feature-specific dimensions remain in styles.css. */
.app-shell #leadModal {
  place-items: center;
  padding: 12px;
}

.app-shell #leadModal .crm-record-dialog {
  width: min(920px, 100%);
  height: 100%;
  min-height: 0;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border-radius: var(--esno-radius-panel);
  animation-name: esno-vnext-modal-in;
}

.app-shell #leadModal .lead-record-head {
  top: 0;
  margin: 0;
  background: var(--lead-panel);
}

@media (max-width: 820px) {
  .app-shell #leadModal {
    padding: 0;
  }

  .app-shell #leadModal .crm-record-dialog {
    width: 100%;
    border-radius: 0;
  }
}

.app-shell .modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  padding: clamp(12px, 2vw, 28px);
  background: transparent;
  backdrop-filter: none;
}

.app-shell .modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--esno-scrim);
  backdrop-filter: blur(3px);
}

.app-shell .modal-dialog {
  position: relative;
  z-index: 1;
  max-width: min(920px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--esno-line);
  border-radius: var(--esno-radius-panel);
  background: var(--esno-surface);
  box-shadow: var(--esno-shadow-overlay);
  color: var(--esno-ink);
  animation: esno-vnext-modal-in var(--esno-motion-panel) var(--esno-ease) both;
  scrollbar-gutter: stable;
}

.app-shell .modal-head,
.app-shell .workspace-dialog-head {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 76px;
  align-items: flex-start;
  gap: 16px;
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--esno-line);
  background: color-mix(in srgb, var(--esno-surface) 94%, transparent);
  backdrop-filter: blur(14px);
}

.app-shell .modal-head h2,
.app-shell .workspace-dialog-head h2 {
  margin: 3px 0 0;
  color: var(--esno-ink);
  font-size: clamp(20px, 2vw, 25px);
  line-height: 1.2;
}

.app-shell .modal-head p,
.app-shell .workspace-dialog-body p {
  color: var(--esno-muted);
  line-height: 1.5;
}

.app-shell .modal-eyebrow,
.app-shell .workspace-dialog-eyebrow,
.app-shell .crm-board-eyebrow {
  color: var(--esno-blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.app-shell .workspace-dialog-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--esno-blue-soft);
  color: var(--esno-blue);
}

.app-shell .workspace-dialog-close {
  width: 42px;
  height: 42px;
  border: 1px solid var(--esno-line);
  border-radius: 10px;
  background: var(--esno-surface);
  color: var(--esno-ink);
  font-size: 22px;
}

.app-shell .workspace-dialog-body {
  padding: 22px;
}

.app-shell .workspace-dialog-actions,
.app-shell .calendar-modal-actions,
.app-shell .lead-detail-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--esno-line);
  background: color-mix(in srgb, var(--esno-surface) 95%, transparent);
  backdrop-filter: blur(14px);
}

.app-shell .modal-inline-status {
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid var(--esno-line);
  border-radius: 10px;
  background: var(--surface-info);
  color: var(--esno-copy);
}

.app-shell .modal-inline-status:empty,
.app-shell .modal-inline-status.hidden {
  display: none;
}

.app-shell .modal-inline-status.error,
.app-shell .status.err,
.app-shell .section-status.error {
  border-color: color-mix(in srgb, var(--esno-danger) 42%, var(--esno-line));
  background: var(--esno-danger-soft);
  color: var(--esno-danger);
}

@keyframes esno-vnext-view-in {
  /* Opacity only: retained transform animations trap fixed component pickers. */
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes esno-vnext-modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: minmax(118px, 1fr) auto;
    align-items: center;
    height: auto;
    min-height: 76px;
    gap: 14px;
    overflow: visible;
    padding: 10px 14px;
    box-shadow: 0 12px 30px rgb(5 22 30 / 16%);
  }

  .app-shell .brand {
    position: relative;
    top: auto;
    grid-template-columns: 1fr;
    grid-template-areas: "logo" "product";
    justify-self: start;
    width: 108px;
    gap: 2px;
    margin: 0;
    padding: 0;
  }

  .app-shell .brand-logo {
    width: 98px;
  }

  .app-shell .brand-product {
    padding-left: 0;
    font-size: 11px;
  }

  .app-shell .brand-version {
    display: none;
  }

  .app-shell .workspace-nav-toggle {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .app-shell #workspacePrimaryNav {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-height: calc(100dvh - 92px);
    gap: 5px;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 10px 0 max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid rgb(255 255 255 / 14%);
    scrollbar-gutter: stable;
  }

  .app-shell #workspacePrimaryNav[hidden] {
    display: none !important;
  }

  .app-shell #workspacePrimaryNav > .tabs-section-label {
    display: block;
    grid-column: 1 / -1;
    margin: 13px 8px 3px;
  }

  .app-shell #workspacePrimaryNav > .tab,
  .app-shell #workspacePrimaryNav > .tab-group,
  .app-shell #workspacePrimaryNav .tab-parent {
    width: 100%;
    min-width: 0;
  }

  .app-shell #workspacePrimaryNav > .tab-group {
    display: grid;
    align-content: start;
  }

  .app-shell #workspacePrimaryNav > .tab-group.open {
    grid-column: 1 / -1;
  }

  .app-shell #workspacePrimaryNav .subtabs {
    display: none !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin: 4px 0 0;
    padding: 4px 0 0 10px;
  }

  .app-shell #workspacePrimaryNav .tab-group.open .subtabs {
    display: grid !important;
  }

  .app-shell.workspace-nav-open .sidebar {
    box-shadow: 0 22px 48px rgb(5 22 30 / 24%);
  }

  .app-shell .workspace {
    padding: 24px 18px 38px;
  }

  .app-shell .topbar {
    flex-wrap: wrap;
  }

  .app-shell .grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell .sidebar {
    grid-template-columns: minmax(104px, 1fr) auto;
    gap: 8px;
    padding-inline: 10px;
  }

  .app-shell .brand {
    width: 94px;
  }

  .app-shell .brand-logo {
    width: 84px;
  }

  .app-shell #workspacePrimaryNav {
    grid-template-columns: 1fr;
  }

  .app-shell #workspacePrimaryNav > * {
    grid-column: 1 / -1;
  }

  .app-shell #workspacePrimaryNav .subtabs {
    grid-template-columns: 1fr;
  }

  .app-shell #workspacePrimaryNav .tab {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    padding: 0 12px;
  }

  .app-shell #workspacePrimaryNav .tab > span:not(.tab-badge):not(.tab-chevron) {
    display: inline;
  }

  .app-shell #workspacePrimaryNav .tab-chevron {
    display: inline;
    margin-left: auto;
  }

  .app-shell #workspacePrimaryNav .tab-badge:not(.hidden) {
    display: inline-grid;
  }

  .app-shell .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
  }

  .app-shell .topbar-actions {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .app-shell .panel {
    padding: 16px;
  }

  .app-shell .action-row {
    flex-wrap: wrap;
  }

  .app-shell .modal:not(.workspace-dialog-modal) {
    place-items: stretch;
    padding: 0;
  }

  .app-shell .modal:not(.workspace-dialog-modal) .modal-dialog {
    width: 100vw !important;
    max-width: none;
    height: 100dvh !important;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .app-shell .workspace-dialog-modal {
    place-items: end center;
    padding: 12px;
  }

  .app-shell .workspace-dialog {
    width: 100%;
    max-height: calc(100dvh - 24px);
  }
}

@media (max-width: 520px) {
  .app-shell .workspace {
    padding: 18px 12px 32px;
  }

  .app-shell .topbar h1 {
    font-size: 29px;
  }

  .app-shell .panel {
    padding: 14px;
    border-radius: 12px;
  }

  .app-shell .primary,
  .app-shell .ghost,
  .app-shell .icon-text,
  .app-shell .danger,
  .app-shell .button-link {
    max-width: 100%;
  }

  .app-shell .workspace-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .app-shell .list-row,
  .app-shell .catalog-item,
  .app-shell .mini-row {
    grid-template-columns: 1fr;
  }
}

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