:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --ink: #151821;
  --muted: #697184;
  --line: #dfe5ee;
  --brand: #0d9488;
  --brand-dark: #0f766e;
  --accent: #f59e0b;
  --blue: #2563eb;
  --soft-blue: #eaf2ff;
  --soft-green: #e8f8f5;
  --shadow: 0 24px 70px rgba(20, 28, 45, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(223, 229, 238, 0.82);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
}

.header-inner,
.hero-inner,
.footer-inner,
.footer-bottom {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--blue));
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.main-nav > ul,
.submenu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav > ul {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav li {
  position: relative;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 13px;
  border-radius: 9px;
  color: #2e3544;
  font-size: 14px;
  font-weight: 650;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  background: #eef6f6;
  color: var(--brand-dark);
  outline: none;
}

.has-submenu > a::after {
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg) translateY(-2px);
}

.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 230px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(21, 24, 33, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.submenu a {
  width: 100%;
  justify-content: flex-start;
}

.has-submenu:hover .submenu,
.has-submenu:focus-within .submenu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ghost-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.user-email {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  border: 0;
  padding: 0 18px;
  color: #ffffff;
  background: var(--brand);
  box-shadow: 0 14px 30px rgba(13, 148, 136, 0.26);
}

.primary-button:hover {
  background: var(--brand-dark);
}

.secondary-button {
  padding: 0 18px;
  border: 1px solid var(--line);
  color: #263042;
  background: #ffffff;
}

.full-button {
  width: 100%;
}

.large {
  min-height: 52px;
  padding: 0 24px;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 19px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.hero {
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(232, 248, 245, 0.92) 0%, rgba(255, 255, 255, 0.92) 42%, rgba(234, 242, 255, 0.95) 100%);
}

.hero-inner {
  display: grid;
  min-height: calc(100vh - 76px);
  grid-template-columns: minmax(0, 0.9fr) minmax(460px, 1fr);
  align-items: center;
  gap: 58px;
  padding: 66px 0 48px;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 8px 12px;
  border: 1px solid rgba(13, 148, 136, 0.24);
  border-radius: 999px;
  color: var(--brand-dark);
  background: rgba(13, 148, 136, 0.08);
  font-size: 13px;
  font-weight: 800;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 5vw, 64px);
  line-height: 1.03;
  letter-spacing: 0;
}

.hero-text {
  max-width: 640px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 19px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.hero-stats {
  display: grid;
  max-width: 620px;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 38px 0 0;
}

.hero-stats div {
  padding: 16px;
  border: 1px solid rgba(13, 148, 136, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.hero-stats dt {
  font-size: 23px;
  font-weight: 800;
}

.hero-stats dd {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.hero-product {
  position: relative;
}

.browser-window {
  overflow: hidden;
  border: 1px solid rgba(151, 163, 184, 0.36);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--shadow);
  transform: rotate(0.6deg);
}

.browser-top {
  display: flex;
  height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.browser-top span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #cbd5e1;
}

.browser-top span:nth-child(1) {
  background: #ef4444;
}

.browser-top span:nth-child(2) {
  background: #f59e0b;
}

.browser-top span:nth-child(3) {
  background: #22c55e;
}

.dashboard-preview {
  display: grid;
  min-height: 430px;
  grid-template-columns: 92px 1fr;
  background: linear-gradient(180deg, #f8fafc 0%, #eaf7f5 100%);
}

.dashboard-preview aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  background: #0f172a;
}

.dashboard-preview aside span {
  width: 46px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.dashboard-preview aside .preview-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--brand));
}

.dashboard-preview section {
  padding: 26px;
}

.preview-heading {
  width: 58%;
  height: 22px;
  margin-bottom: 22px;
  border-radius: 999px;
  background: #cbd5e1;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.preview-grid article {
  min-height: 118px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
}

.preview-grid strong,
.preview-grid span,
.widget-card strong,
.widget-card span {
  display: block;
}

.preview-grid strong {
  font-size: 13px;
}

.preview-grid span {
  margin-top: 18px;
  color: var(--brand-dark);
  font-size: 18px;
  font-weight: 800;
}

.widget-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 70px;
  padding: 22px;
  border: 1px solid rgba(13, 148, 136, 0.28);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(13, 148, 136, 0.16);
}

.widget-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.widget-card button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 800;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #101828;
  color: #ffffff;
}

body.is-dashboard .site-footer {
  display: none;
}

.dashboard-view {
  min-height: calc(100vh - 76px);
  background:
    linear-gradient(180deg, #f8fafc 0%, #eef6f5 100%);
}

.app-shell {
  display: grid;
  min-height: calc(100vh - 76px);
  grid-template-columns: 286px minmax(0, 1fr);
}

.app-sidebar {
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbfb 100%);
  padding: 26px 18px;
}

.sidebar-title {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
}

.sidebar-link {
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #313847;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  padding: 0 10px;
}

.sidebar-link.is-active {
  background: rgba(13, 148, 136, 0.11);
  color: var(--brand-dark);
}

.sidebar-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand);
  font-size: 13px;
}

.sidebar-projects {
  display: grid;
  gap: 6px;
  margin-left: 13px;
  padding: 4px 0 0 20px;
  border-left: 1px solid rgba(13, 148, 136, 0.18);
}

.sidebar-project-link {
  display: grid;
  width: 100%;
  min-height: 42px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #485163;
  cursor: pointer;
  font-weight: 750;
  padding: 8px 10px;
  text-align: left;
}

.sidebar-project-link span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-project-link small {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-project-link:hover,
.sidebar-project-link.is-active {
  background: #ffffff;
  color: var(--brand-dark);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.app-content {
  min-width: 0;
  padding: 40px clamp(22px, 4vw, 56px) 56px;
}

.dashboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.dashboard-top h1 {
  max-width: 720px;
  font-size: clamp(36px, 4.4vw, 58px);
}

.dashboard-top p:not(.eyebrow) {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.dashboard-metrics div {
  padding: 18px;
  border: 1px solid rgba(226, 232, 240, 0.86);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
}

.dashboard-metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dashboard-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.projects-layout {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 20px;
}

.projects-panel,
.project-detail,
.empty-dashboard,
.project-card,
.widget-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.projects-panel,
.project-detail {
  min-height: 520px;
  padding: 22px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
}

.panel-head,
.project-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-head h2,
.project-detail-head h2 {
  margin: 0;
  font-size: 22px;
}

.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.projects-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.project-card {
  width: 100%;
  padding: 16px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.project-card:hover {
  border-color: rgba(13, 148, 136, 0.32);
  transform: translateY(-1px);
}

.project-card.is-active {
  border-color: rgba(13, 148, 136, 0.46);
  box-shadow: 0 12px 30px rgba(13, 148, 136, 0.12);
  background:
    linear-gradient(135deg, rgba(13, 148, 136, 0.08), rgba(255, 255, 255, 0.95));
}

.project-card strong,
.widget-item strong {
  display: block;
  font-size: 16px;
}

.project-card span,
.widget-item span,
.project-site {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.empty-dashboard {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: clamp(24px, 4vw, 44px);
  border-style: dashed;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.94));
}

.empty-dashboard h2 {
  max-width: 540px;
  margin: 0;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.12;
}

.empty-dashboard p {
  max-width: 560px;
  margin: 16px 0 22px;
  color: var(--muted);
  font-size: 17px;
}

.project-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.project-summary div {
  padding: 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}

.project-summary strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.project-summary span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.widgets-section {
  margin-top: 26px;
}

.widgets-section h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.widgets-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.widget-item {
  padding: 18px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.widget-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: rgba(13, 148, 136, 0.1);
  font-size: 12px;
  font-weight: 800;
}

.auth-modal,
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.54);
  backdrop-filter: blur(8px);
}

.auth-modal[hidden],
.app-modal[hidden],
.auth-form,
.landing-view[hidden],
.dashboard-view[hidden],
.auth-open[hidden],
.user-email[hidden],
.logout-button[hidden] {
  display: none;
}

.auth-panel {
  position: relative;
  width: min(100%, 460px);
  padding: 28px;
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.auth-tab {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.auth-tab.is-active {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.auth-form.is-active {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.auth-form h2 {
  margin: 0 0 4px;
  font-size: 28px;
  line-height: 1.15;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: #313847;
  font-size: 14px;
  font-weight: 750;
}

.auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
}

.auth-form input:focus {
  border-color: rgba(13, 148, 136, 0.72);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
  outline: none;
}

.auth-form .forgot-open {
  justify-self: start;
  min-height: auto;
  padding: 0;
}

.reset-token-box {
  display: grid;
  gap: 12px;
  margin-top: 2px;
}

.reset-token-box[hidden] {
  display: none;
}

.project-form,
.widget-form {
  display: grid;
  gap: 16px;
}

.project-form h2,
.widget-form h2 {
  margin: 0 0 4px;
  font-size: 28px;
  line-height: 1.15;
}

.project-form label {
  display: grid;
  gap: 8px;
  color: #313847;
  font-size: 14px;
  font-weight: 750;
}

.project-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
}

.project-form input:focus {
  border-color: rgba(13, 148, 136, 0.72);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
  outline: none;
}

.widget-choice {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.widget-choice legend {
  margin-bottom: 4px;
  color: #313847;
  font-size: 14px;
  font-weight: 750;
}

.widget-choice label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(13, 148, 136, 0.32);
  border-radius: 12px;
  background: rgba(13, 148, 136, 0.06);
}

.widget-choice input {
  margin-top: 4px;
}

.widget-choice strong,
.widget-choice small {
  display: block;
}

.widget-choice small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.form-message.is-error {
  color: #b42318;
}

.form-message.is-success {
  color: var(--brand-dark);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 48px;
  padding: 46px 0 34px;
}

.footer-brand p {
  max-width: 340px;
  margin: 18px 0 0;
  color: #b8c2d4;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.footer-nav h2 {
  margin: 0 0 14px;
  font-size: 15px;
}

.footer-nav a {
  display: block;
  margin-top: 9px;
  color: #b8c2d4;
  font-size: 14px;
}

.footer-nav a:hover {
  color: #ffffff;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #b8c2d4;
  font-size: 14px;
}

@media (max-width: 980px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .menu-toggle {
    display: inline-flex;
    order: 3;
  }

  .main-nav {
    display: none;
    order: 5;
    width: 100%;
  }

  .main-nav.is-open {
    display: block;
  }

  .main-nav > ul {
    display: grid;
    gap: 8px;
    padding: 0 0 18px;
  }

  .main-nav a {
    width: 100%;
    justify-content: space-between;
    padding: 0 14px;
    background: #f8fafc;
  }

  .submenu {
    position: static;
    display: grid;
    width: auto;
    margin-top: 8px;
    border-radius: 12px;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .browser-window {
    transform: none;
  }

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

  .app-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px;
  }

  .sidebar-title {
    margin-bottom: 10px;
  }

  .sidebar-nav {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    overflow-x: auto;
  }

  .sidebar-link {
    width: auto;
    flex: 0 0 auto;
  }

  .sidebar-projects {
    display: flex;
    flex: 1 0 auto;
    min-width: min(100%, 320px);
    margin: 0;
    padding: 0;
    border-left: 0;
    overflow-x: auto;
  }

  .sidebar-project-link {
    width: 220px;
    flex: 0 0 auto;
  }

  .app-content {
    padding: 28px 18px 46px;
  }

  .projects-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .header-inner,
  .hero-inner,
  .footer-inner,
  .footer-bottom {
    width: min(1180px, calc(100% - 24px));
  }

  .header-actions {
    order: 4;
    width: 100%;
    justify-content: space-between;
  }

  .header-actions .primary-button,
  .header-actions .ghost-link {
    flex: 1;
  }

  .hero-inner {
    min-height: auto;
    padding: 52px 0 38px;
  }

  h1 {
    font-size: clamp(38px, 14vw, 52px);
  }

  .hero-text {
    font-size: 18px;
  }

  .hero-actions,
  .hero-actions a {
    width: 100%;
  }

  .hero-stats,
  .preview-grid,
  .footer-inner,
  .footer-nav {
    grid-template-columns: 1fr;
  }

  .dashboard-preview {
    grid-template-columns: 62px 1fr;
    min-height: 370px;
  }

  .dashboard-preview aside {
    padding: 16px 10px;
  }

  .dashboard-preview aside span {
    width: 36px;
  }

  .dashboard-preview section {
    padding: 18px;
  }

  .widget-card {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 22px;
  }

  .widget-card button {
    width: 100%;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-top {
    flex-direction: column;
  }

  .dashboard-top .secondary-button,
  .dashboard-top .primary-button {
    width: 100%;
  }

  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .project-detail-head {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-head .secondary-button,
  .project-detail-head .primary-button {
    width: 100%;
  }

  .project-summary {
    grid-template-columns: 1fr;
  }

  .projects-panel,
  .project-detail {
    padding: 16px;
  }

  .auth-panel {
    padding: 22px;
  }
}

body.is-dashboard .site-header {
  display: none;
}

body.is-dashboard {
  background: #f3f7f8;
}

body.is-dashboard .dashboard-view {
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 6%, rgba(13, 148, 136, 0.14), transparent 28%),
    linear-gradient(135deg, #f8fafc 0%, #eef7f6 100%);
}

body.is-dashboard .app-shell {
  min-height: 100vh;
  grid-template-columns: 292px minmax(0, 1fr);
}

body.is-dashboard .app-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  border-right: 1px solid rgba(203, 213, 225, 0.72);
  background:
    linear-gradient(180deg, #0f172a 0%, #13231f 100%);
  color: #ffffff;
  padding: 22px 16px;
  overflow-y: auto;
}

body.is-dashboard .sidebar-title {
  color: rgba(255, 255, 255, 0.55);
}

body.is-dashboard .sidebar-link {
  color: rgba(255, 255, 255, 0.76);
}

body.is-dashboard .sidebar-link.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body.is-dashboard .sidebar-icon {
  color: #0f172a;
  background: #5eead4;
}

body.is-dashboard .sidebar-projects {
  border-left-color: rgba(94, 234, 212, 0.22);
}

body.is-dashboard .sidebar-project-link {
  color: rgba(255, 255, 255, 0.74);
}

body.is-dashboard .sidebar-project-link small {
  color: rgba(255, 255, 255, 0.52);
}

body.is-dashboard .sidebar-project-link:hover,
body.is-dashboard .sidebar-project-link.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  box-shadow: none;
}

.sidebar-account {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
}

.sidebar-account > span {
  color: rgba(255, 255, 255, 0.52);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-user,
.sidebar-logout {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  font-weight: 800;
}

.sidebar-user {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout {
  border: 0;
  color: #0f172a;
  background: #5eead4;
  cursor: pointer;
}

body.is-dashboard .app-content {
  padding: 30px clamp(18px, 3vw, 42px) 42px;
}

body.is-dashboard .dashboard-top {
  align-items: flex-start;
}

body.is-dashboard .dashboard-top .eyebrow {
  margin-bottom: 12px;
}

body.is-dashboard .dashboard-top h1 {
  font-size: clamp(34px, 4vw, 52px);
}

body.is-dashboard .dashboard-top p:not(.eyebrow) {
  max-width: 620px;
  font-size: 16px;
}

body.is-dashboard .dashboard-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

body.is-dashboard .dashboard-metrics div {
  padding: 14px 16px;
  border-color: rgba(203, 213, 225, 0.72);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

body.is-dashboard .dashboard-metrics strong {
  font-size: 24px;
}

.projects-board {
  margin-top: 16px;
}

.board-card {
  padding: 18px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 54px rgba(15, 23, 42, 0.08);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 16px;
  width: 100%;
}

.project-workspace-card {
  display: grid;
  gap: 0;
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fcfb 100%);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
  cursor: pointer;
}

.project-workspace-card.is-active {
  border-color: rgba(13, 148, 136, 0.42);
  box-shadow: 0 20px 48px rgba(13, 148, 136, 0.12);
}

.project-card-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(300px, 0.86fr) auto;
  align-items: center;
  gap: 16px;
}

.project-card-title {
  min-width: 0;
}

.project-card-head h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.project-card-head a {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.project-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: rgba(13, 148, 136, 0.1);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.project-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  min-width: 0;
}

.project-mini-stats div {
  padding: 10px;
  border-radius: 10px;
  background: #f1f5f9;
}

.project-card-details {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  cursor: default;
}

.project-card-details[hidden] {
  display: none;
}

.project-mini-stats strong {
  display: block;
  font-size: 20px;
  line-height: 1;
}

.project-mini-stats span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.project-widgets-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 2px;
}

.project-widgets-section {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.project-widgets-head strong {
  font-size: 15px;
}

.project-widgets-list {
  display: grid;
  gap: 8px;
}

.compact-widget-card,
.compact-empty-widget {
  padding: 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  background: #ffffff;
}

.compact-widget-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.compact-widget-card strong,
.compact-widget-card span,
.compact-empty-widget strong,
.compact-empty-widget span {
  display: block;
}

.compact-widget-card strong,
.compact-empty-widget strong {
  font-size: 15px;
}

.compact-widget-card span,
.compact-empty-widget span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.compact-widget-card .widget-badge {
  margin: 0;
}

.compact-empty-widget {
  background: #f8fafc;
}

.project-card-actions {
  display: flex;
  gap: 10px;
}

.project-card-actions .primary-button,
.project-card-actions .secondary-button {
  flex: 1;
}

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

  .inbox-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .inbox-list {
    max-height: 280px;
  }

  body.is-dashboard .app-sidebar {
    position: static;
    display: block;
    height: auto;
    padding: 14px;
  }

  body.is-dashboard .sidebar-projects {
    border-left: 0;
  }

  .sidebar-account {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .sidebar-account > span {
    display: none;
  }

  .sidebar-logout {
    width: auto;
    padding: 0 14px;
  }
}

@media (max-width: 720px) {
  body.is-dashboard .app-content {
    padding: 18px 12px 32px;
  }

  body.is-dashboard .dashboard-metrics,
  .project-mini-stats,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .board-card,
  .project-workspace-card {
    padding: 14px;
  }

  .project-card-head,
  .project-widgets-head,
  .project-card-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

body.is-dashboard .dashboard-view {
  background: #f6f8fb;
}

body.is-dashboard .app-shell {
  grid-template-columns: 224px minmax(0, 1fr);
}

body.is-dashboard .app-sidebar {
  background: #ffffff;
  color: var(--ink);
  border-right: 1px solid #e2e8f0;
  box-shadow: 8px 0 28px rgba(15, 23, 42, 0.04);
  padding: 16px 12px;
}

body.is-dashboard .sidebar-title {
  margin-bottom: 10px;
  color: #8a94a6;
  font-size: 11px;
}

body.is-dashboard .sidebar-link {
  min-height: 40px;
  border-radius: 9px;
  color: #445066;
  padding: 0 8px;
  font-size: 14px;
}

body.is-dashboard .sidebar-link small {
  margin-left: auto;
  min-width: 22px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--brand);
  font-size: 11px;
  line-height: 22px;
  text-align: center;
}

body.is-dashboard .sidebar-link.is-active {
  background: #eaf7f5;
  color: var(--brand-dark);
}

body.is-dashboard .sidebar-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand);
}

body.is-dashboard .sidebar-projects {
  gap: 5px;
  margin-left: 10px;
  padding: 2px 0 0 14px;
  border-left-color: #d8eeeb;
}

body.is-dashboard .sidebar-project-link {
  min-height: 34px;
  border-radius: 8px;
  color: #566176;
  padding: 6px 8px;
  font-size: 13px;
}

body.is-dashboard .sidebar-project-link small {
  color: #8791a3;
  font-size: 11px;
}

body.is-dashboard .sidebar-project-link:hover,
body.is-dashboard .sidebar-project-link.is-active {
  background: #f4faf9;
  color: var(--brand-dark);
  box-shadow: none;
}

body.is-dashboard .sidebar-account {
  gap: 6px;
  padding-top: 14px;
}

body.is-dashboard .sidebar-account > span {
  color: #8a94a6;
  font-size: 11px;
}

body.is-dashboard .sidebar-user {
  min-height: 36px;
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #566176;
  font-size: 13px;
  padding: 0 10px;
}

body.is-dashboard .sidebar-logout {
  min-height: 38px;
  color: #ffffff;
  background: var(--brand);
  font-size: 14px;
}

body.is-dashboard .app-content {
  padding: 24px clamp(16px, 2.5vw, 34px) 34px;
}

body.is-dashboard .dashboard-top {
  gap: 16px;
}

body.is-dashboard .dashboard-top .eyebrow {
  min-height: 30px;
  margin-bottom: 8px;
  padding: 5px 10px;
  font-size: 12px;
}

body.is-dashboard .dashboard-top h1 {
  font-size: clamp(30px, 3.3vw, 44px);
  line-height: 1;
}

body.is-dashboard .dashboard-top p:not(.eyebrow) {
  max-width: 560px;
  margin-top: 8px;
  font-size: 15px;
}

body.is-dashboard .dashboard-top .primary-button {
  min-height: 44px;
  border-radius: 10px;
  padding: 0 16px;
  box-shadow: 0 12px 26px rgba(13, 148, 136, 0.18);
}

body.is-dashboard .dashboard-metrics {
  gap: 8px;
  margin-top: 16px;
}

body.is-dashboard .dashboard-metrics div {
  padding: 11px 12px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

body.is-dashboard .dashboard-metrics span {
  font-size: 12px;
}

body.is-dashboard .dashboard-metrics strong {
  margin-top: 5px;
  font-size: 22px;
}

.pwa-notifications-panel {
  margin-top: 10px;
}

.pwa-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid rgba(191, 219, 254, 0.75);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(240, 253, 250, 0.92), rgba(255, 255, 255, 0.96));
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.pwa-card-main {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.pwa-icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #ffffff;
  background: var(--brand);
  font-size: 13px;
  font-weight: 900;
}

.pwa-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pwa-title-row h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
}

.pwa-status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.pwa-status.is-on {
  color: #0f766e;
  background: rgba(204, 251, 241, 0.9);
}

.pwa-status.is-waiting {
  color: #1d4ed8;
  background: #dbeafe;
}

.pwa-status.is-blocked {
  color: #b42318;
  background: #fee2e2;
}

.pwa-card p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.pwa-steps {
  display: grid;
  gap: 3px;
  margin: 8px 0 0;
  padding-left: 20px;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}

.pwa-message {
  font-weight: 800;
}

.pwa-message.is-success {
  color: #0f766e;
}

.pwa-message.is-error {
  color: #b42318;
}

.pwa-actions {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 8px;
}

.pwa-actions .primary-button,
.pwa-actions .secondary-button,
.pwa-actions .small-action {
  min-height: 36px;
  border-radius: 9px;
  padding: 0 12px;
  white-space: nowrap;
}

.pwa-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

body.is-dashboard .projects-board {
  margin-top: 12px;
}

body.is-dashboard .board-card {
  padding: 14px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.05);
}

body.is-dashboard .panel-head h2 {
  font-size: 21px;
}

body.is-dashboard .panel-head p {
  margin-top: 3px;
  font-size: 13px;
}

body.is-dashboard .panel-head .secondary-button {
  min-height: 38px;
  border-radius: 9px;
  padding: 0 14px;
}

body.is-dashboard .projects-grid {
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 12px;
}

body.is-dashboard .project-workspace-card {
  gap: 0;
  padding: 12px;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

body.is-dashboard .project-workspace-card.is-active {
  border-color: rgba(13, 148, 136, 0.34);
  box-shadow: 0 12px 28px rgba(13, 148, 136, 0.08);
}

body.is-dashboard .project-workspace-card.is-disabled {
  opacity: 0.72;
}

body.is-dashboard .project-card-head {
  gap: 10px;
}

body.is-dashboard .project-card-head h3 {
  font-size: 19px;
}

body.is-dashboard .project-card-head a {
  margin-top: 4px;
  font-size: 13px;
}

body.is-dashboard .project-status,
body.is-dashboard .widget-badge {
  min-height: 24px;
  padding: 0 8px;
  font-size: 11px;
}

body.is-dashboard .project-status.is-off,
body.is-dashboard .widget-badge.is-off {
  color: #64748b;
  background: #eef2f7;
}

body.is-dashboard .project-mini-stats {
  gap: 6px;
}

body.is-dashboard .project-mini-stats div {
  padding: 8px;
  border-radius: 9px;
  background: #f6f8fb;
}

body.is-dashboard .project-mini-stats strong {
  font-size: 18px;
}

body.is-dashboard .project-mini-stats span {
  margin-top: 4px;
  font-size: 11px;
}

body.is-dashboard .project-widgets-head strong {
  font-size: 14px;
}

body.is-dashboard .project-widgets-head .secondary-button {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
}

body.is-dashboard .project-widgets-list {
  gap: 6px;
}

body.is-dashboard .compact-widget-card,
body.is-dashboard .compact-empty-widget {
  padding: 10px;
  border-radius: 10px;
}

body.is-dashboard .compact-widget-card.is-disabled {
  background: #f8fafc;
  opacity: 0.76;
}

body.is-dashboard .compact-widget-card strong,
body.is-dashboard .compact-empty-widget strong {
  font-size: 14px;
}

body.is-dashboard .compact-widget-card span,
body.is-dashboard .compact-empty-widget span {
  font-size: 12px;
}

body.is-dashboard .project-card-actions .primary-button {
  min-height: 40px;
  border-radius: 9px;
  box-shadow: none;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #566176;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-slider {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.18s ease;
}

.switch-slider::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
  content: "";
  transition: transform 0.18s ease;
}

.switch-control input:checked + .switch-slider {
  background: var(--brand);
}

.switch-control input:checked + .switch-slider::after {
  transform: translateX(16px);
}

.project-card-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.compact-widget-card {
  grid-template-columns: minmax(0, 1fr);
}

.widget-row-top,
.widget-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.widget-actions {
  flex-wrap: wrap;
}

.small-action,
.danger-action {
  min-height: 32px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  padding: 0 10px;
}

.small-action {
  border: 1px solid #dbe3ee;
  color: #263042;
  background: #ffffff;
}

.danger-action {
  border: 1px solid #fecaca;
  color: #b42318;
  background: #fff5f5;
}

.widget-settings-view {
  margin-top: 14px;
}

.settings-card {
  padding: 18px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.05);
}

.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.settings-head h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
}

.settings-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.settings-box {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.settings-box strong,
.settings-box span {
  display: block;
}

.settings-box strong {
  font-size: 16px;
}

.settings-box span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.settings-placeholder {
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: var(--muted);
  background: #ffffff;
}

.consultant-settings-form {
  margin-top: 16px;
}

.consultant-settings-stack {
  display: grid;
  gap: 12px;
}

.consultant-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 14px;
  align-items: start;
}

.consultant-settings-fields {
  display: grid;
  gap: 12px;
}

.settings-accordion {
  width: 100%;
  overflow: hidden;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #ffffff;
}

.settings-accordion-summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 64px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.settings-accordion-summary::-webkit-details-marker {
  display: none;
}

.settings-accordion-summary > span {
  display: grid;
  flex: 0 0 auto;
  min-width: 42px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  background: var(--brand);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 0 8px;
}

.settings-accordion-summary div {
  min-width: 0;
}

.settings-accordion-summary strong,
.settings-accordion-summary p {
  display: block;
}

.settings-accordion-summary strong {
  font-size: 17px;
  line-height: 1.2;
}

.settings-accordion-summary p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.settings-accordion-summary::after {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin: 8px 2px 0 auto;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  content: "";
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.settings-accordion[open] .settings-accordion-summary::after {
  transform: rotate(225deg);
}

.settings-accordion-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.settings-device-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 14px;
  align-items: start;
}

.settings-device-fields {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.settings-section-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #f8fafc;
}

.settings-section-actions .form-message {
  margin: 0;
}

.settings-section-actions .primary-button {
  min-height: 46px;
  padding-inline: 18px;
}

.settings-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #ffffff;
}

.settings-section-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.settings-section-head > span {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  background: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.settings-section-head strong,
.settings-section-head p {
  display: block;
}

.settings-section-head strong {
  font-size: 16px;
}

.settings-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

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

.settings-field,
.settings-check {
  display: grid;
  gap: 6px;
}

.settings-field.is-wide {
  grid-column: 1 / -1;
}

.settings-field span,
.settings-check span {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.settings-field input,
.settings-field select,
.settings-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
  font-size: 14px;
  padding: 10px 11px;
}

.settings-field input[type="color"] {
  height: 42px;
  padding: 4px;
}

.settings-field textarea {
  resize: vertical;
}

.settings-check {
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #f8fafc;
}

.settings-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.avatar-upload-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.avatar-upload-preview {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  overflow: hidden;
  border: 2px solid #dbe3ee;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, #111827, var(--brand));
  font-size: 16px;
  font-weight: 900;
}

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

.avatar-upload-controls {
  display: grid;
  gap: 8px;
}

.avatar-upload-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.consultant-settings-preview {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 12px;
}

.settings-preview-panel {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.9)),
    repeating-linear-gradient(90deg, rgba(203, 213, 225, 0.2) 0 1px, transparent 1px 44px);
}

.preview-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.preview-panel-head strong,
.preview-panel-head span {
  display: block;
}

.preview-panel-head strong {
  font-size: 14px;
}

.preview-panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.desktop-preview-shell {
  position: relative;
  display: grid;
  min-height: 118px;
  justify-items: end;
  align-items: end;
  overflow: hidden;
  padding: 12px 12px 0;
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.88), rgba(255, 255, 255, 0.96)),
    repeating-linear-gradient(90deg, rgba(203, 213, 225, 0.24) 0 1px, transparent 1px 42px);
}

.desktop-launcher-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #ffffff;
  background: linear-gradient(135deg, #111827, var(--preview-brand, var(--brand)));
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
  font: inherit;
}

.desktop-launcher-preview.is-circle {
  width: 68px;
  min-width: 68px;
  height: 68px;
  min-height: 68px;
  border-radius: 50%;
}

.desktop-launcher-preview.is-standard {
  width: min(100%, 320px);
  height: 56px;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px 0 18px;
  border-radius: 14px 14px 0 0;
}

.desktop-launcher-text {
  display: none;
  min-width: 0;
  overflow: hidden;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-launcher-preview.is-standard .desktop-launcher-text {
  display: block;
}

.desktop-launcher-mark {
  display: grid;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 16px;
  font-weight: 900;
}

.desktop-launcher-preview.is-standard .desktop-launcher-mark {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 13px;
}

.desktop-launcher-mark.is-icon {
  overflow: visible;
  border-radius: 0;
  background: transparent;
}

.desktop-launcher-preview.is-standard .desktop-launcher-mark.is-icon {
  overflow: hidden;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.desktop-launcher-mark img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.mobile-preview-shell {
  position: relative;
  display: grid;
  min-height: 118px;
  justify-items: end;
  align-items: end;
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.86), rgba(255, 255, 255, 0.96)),
    repeating-linear-gradient(90deg, rgba(203, 213, 225, 0.28) 0 1px, transparent 1px 42px);
}

.consultant-preview-bubble {
  position: absolute;
  right: 14px;
  bottom: 78px;
  display: -webkit-box;
  width: 174px;
  max-width: calc(100% - 28px);
  max-height: 52px;
  overflow: hidden;
  border: 1px solid #dbe3ee;
  border-radius: 14px 14px 4px 14px;
  color: #172033;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
  padding: 8px 11px;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.consultant-preview-bubble.is-hidden {
  opacity: 0.28;
}

.mobile-launcher-preview {
  display: flex;
  width: 68px;
  min-width: 68px;
  height: 68px;
  min-height: 68px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, #111827, var(--preview-brand, var(--brand)));
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
  font: inherit;
  padding: 0;
}

.mobile-launcher-preview.is-animated {
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.28);
}

.mobile-launcher-preview span {
  display: grid;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
  font-size: 16px;
  font-weight: 900;
}

.mobile-launcher-preview.is-avatar span {
  width: 64px;
  height: 64px;
  border: 0;
  background: transparent;
}

.mobile-launcher-preview span.is-icon {
  width: 54px;
  height: 54px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.mobile-launcher-preview span img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.mobile-launcher-preview strong {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.settings-actions-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 12px;
  margin-top: 14px;
  align-items: stretch;
}

.settings-save-panel {
  display: grid;
  gap: 10px;
  align-content: end;
  padding: 10px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #ffffff;
}

.back-button {
  margin-bottom: 14px;
}

.settings-install-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 14px;
  margin-top: 16px;
  align-items: start;
}

.consultant-preview {
  overflow: hidden;
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.1);
}

.consultant-preview.is-mobile {
  width: min(100%, 320px);
  justify-self: end;
}

.consultant-preview-head {
  position: relative;
  padding: 16px;
  color: #ffffff;
  background:
    radial-gradient(circle at 88% 16%, rgba(255, 255, 255, 0.2), transparent 24%),
    linear-gradient(135deg, #0f172a, var(--preview-brand, var(--brand)));
}

.consultant-preview-head button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  font-size: 18px;
}

.consultant-preview-head strong,
.consultant-preview-head span {
  display: block;
}

.consultant-preview-head strong {
  max-width: 240px;
  font-size: 17px;
}

.consultant-preview-head span {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.consultant-preview-body {
  display: grid;
  gap: 8px;
  min-height: 210px;
  align-content: end;
  padding: 14px;
  background: #f8fafc;
}

.consultant-preview-body p {
  max-width: 82%;
  margin: 0;
  border-radius: 13px;
  background: #ffffff;
  color: #263042;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  font-size: 13px;
  padding: 10px;
}

.consultant-preview-body button {
  justify-self: end;
  border: 1px solid rgba(13, 148, 136, 0.34);
  border-radius: 999px;
  color: var(--preview-brand, var(--brand));
  background: #ffffff;
  font-size: 13px;
  padding: 8px 12px;
}

.consultant-preview-input {
  display: grid;
  grid-template-columns: 1fr 34px;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-top: 1px solid #e2e8f0;
}

.consultant-preview-input span {
  color: #9aa3b2;
  font-size: 13px;
}

.consultant-preview-input b {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  background: var(--preview-brand, var(--brand));
}

.install-code-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #f8fafc;
}

.install-code-box strong,
.install-code-box span,
.install-code-box code {
  display: block;
}

.install-code-box strong {
  font-size: 14px;
}

.install-code-box span {
  color: var(--muted);
  font-size: 12px;
}

.install-code-box code {
  overflow-x: auto;
  border-radius: 8px;
  color: #0f172a;
  background: #ffffff;
  font-size: 12px;
  line-height: 1.45;
  padding: 9px;
  white-space: nowrap;
}

.install-code-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.install-guide-panel {
  width: min(100%, 760px);
}

.install-guide-content {
  display: grid;
  gap: 14px;
}

.install-guide-content .eyebrow {
  width: fit-content;
  margin: 0;
}

.install-guide-content h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.08;
}

.install-guide-content p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.install-guide-content code {
  border-radius: 6px;
  background: #f1f5f9;
  color: #0f172a;
  padding: 2px 5px;
}

.install-guide-code {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #f8fafc;
}

.install-guide-code-value {
  display: block;
  overflow-x: auto;
  border-radius: 8px;
  background: #ffffff;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px;
  white-space: nowrap;
}

.install-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.install-steps article,
.install-checklist {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
}

.install-steps strong,
.install-steps span,
.install-checklist strong,
.install-checklist span {
  display: block;
}

.install-steps strong,
.install-checklist strong {
  font-size: 15px;
}

.install-steps span,
.install-checklist span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.inbox-view {
  margin-top: 12px;
}

.inbox-shell {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr) minmax(220px, 300px);
  gap: 12px;
  min-height: 610px;
}

.inbox-list,
.inbox-chat,
.inbox-client {
  min-width: 0;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.05);
}

.inbox-list {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding: 10px;
}

.conversation-card {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 11px;
  background: #f8fafc;
  color: #111827;
  cursor: pointer;
  padding: 10px;
  text-align: left;
}

.conversation-card.is-active,
.conversation-card:hover {
  border-color: rgba(13, 148, 136, 0.28);
  background: #f4faf9;
}

.conversation-card strong,
.conversation-card small,
.conversation-card p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-card strong {
  font-size: 14px;
}

.conversation-card small,
.conversation-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.conversation-status {
  width: fit-content;
  border-radius: 999px;
  color: #0f766e;
  background: #e6f5f2;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
}

.conversation-status.is-new {
  color: #b45309;
  background: #fff7ed;
}

.conversation-status.is-waiting {
  color: #3156a3;
  background: #eff6ff;
}

.conversation-status.is-closed {
  color: #64748b;
  background: #eef2f7;
}

.chat-workspace {
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto auto;
  height: 100%;
}

.chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px;
}

.chat-head h2 {
  margin: 8px 0 0;
  font-size: 22px;
  line-height: 1.1;
}

.chat-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.conversation-status-select {
  min-height: 36px;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  background: #ffffff;
  color: #263042;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 0 9px;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  padding: 14px;
  background: #f8fafc;
}

.chat-message {
  max-width: min(78%, 520px);
}

.chat-message.is-manager {
  align-self: flex-end;
}

.chat-message span {
  display: block;
  margin-bottom: 4px;
  color: #8a94a6;
  font-size: 11px;
  font-weight: 700;
}

.chat-message p {
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 13px;
  background: #ffffff;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.45;
  padding: 10px 12px;
}

.chat-message.is-manager p {
  border-color: rgba(13, 148, 136, 0.18);
  color: #ffffff;
  background: var(--brand);
}

.quick-replies {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-top: 1px solid #e2e8f0;
  padding: 10px 12px;
}

.quick-reply {
  flex: 0 0 auto;
  border: 1px solid rgba(13, 148, 136, 0.26);
  border-radius: 999px;
  color: var(--brand-dark);
  background: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
}

.manager-reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  border-top: 1px solid #e2e8f0;
  padding: 12px;
}

.manager-reply-form textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  padding: 10px;
}

.client-card {
  padding: 14px;
}

.client-card h3 {
  margin: 10px 0 12px;
  font-size: 21px;
}

.client-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.client-card div {
  display: grid;
  gap: 4px;
}

.client-card dt {
  color: #8a94a6;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #263042;
  font-size: 13px;
}

.inbox-empty,
.inbox-welcome {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.inbox-empty strong,
.inbox-welcome h2 {
  color: #111827;
}

.inbox-empty span,
.inbox-welcome p {
  max-width: 360px;
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.45;
}

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

  .consultant-settings-layout,
  .settings-device-grid,
  .settings-actions-row {
    grid-template-columns: 1fr;
  }

  .consultant-settings-preview,
  .settings-preview-panel {
    position: static;
  }

  .consultant-settings-preview {
    grid-template-columns: minmax(0, 260px) minmax(280px, 1fr);
    align-items: start;
  }

  body.is-dashboard .app-sidebar {
    position: static;
    height: auto;
    padding: 10px 12px;
  }

  body.is-dashboard .sidebar-nav {
    gap: 8px;
  }

  body.is-dashboard .sidebar-projects {
    min-width: min(100%, 260px);
    margin: 0;
    padding: 0;
    border-left: 0;
  }

  body.is-dashboard .sidebar-project-link {
    width: 180px;
  }

  body.is-dashboard .sidebar-account {
    margin-top: 10px;
    padding-top: 10px;
    border-top-color: #e2e8f0;
  }
}

@media (max-width: 720px) {
  body.is-dashboard .app-content {
    padding: 14px 10px 28px;
  }

  body.is-dashboard .dashboard-top {
    align-items: stretch;
  }

  body.is-dashboard .dashboard-metrics,
  body.is-dashboard .projects-grid,
  .pwa-card,
  .settings-install-preview,
  .settings-fields-grid,
  .settings-section-actions,
  .consultant-settings-preview,
  .install-code-actions,
  .install-steps {
    grid-template-columns: 1fr;
  }

  .settings-section {
    padding: 12px;
  }

  .pwa-card {
    align-items: stretch;
  }

  .pwa-card-main {
    align-items: flex-start;
  }

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

  .pwa-actions .primary-button,
  .pwa-actions .secondary-button,
  .pwa-actions .small-action {
    width: 100%;
  }

  .settings-actions-row {
    gap: 10px;
  }

  .settings-section-actions .primary-button,
  .consultant-preview.is-mobile {
    width: 100%;
  }

  .mobile-preview-shell {
    min-height: 112px;
  }

  body.is-dashboard .project-mini-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  body.is-dashboard .panel-head,
  body.is-dashboard .project-card-head,
  .settings-head,
  .settings-install-preview,
  body.is-dashboard .project-card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .project-card-head-actions,
  .widget-row-top,
  .widget-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .small-action,
  .danger-action,
  .widget-actions .switch-control,
  .settings-save-panel .primary-button,
  .manager-reply-form .primary-button {
    width: 100%;
  }

  .manager-reply-form {
    grid-template-columns: 1fr;
  }

  .chat-head {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Final responsive layer */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-width: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

input,
select,
textarea,
button {
  min-width: 0;
}

.header-inner,
.hero-inner,
.footer-inner,
.footer-bottom {
  width: min(1180px, calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
}

.hero-copy,
.hero-product,
.app-content,
.settings-card,
.board-card,
.project-workspace-card,
.inbox-chat,
.inbox-list,
.inbox-client {
  min-width: 0;
}

.hero-copy > *,
.dashboard-top > div,
.settings-head > div,
.project-card-head > div,
.compact-widget-card > div,
.chat-head > div {
  min-width: 0;
}

.install-code-box code,
.install-guide-code-value {
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1180px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.92fr);
    gap: 34px;
  }

  .dashboard-preview {
    min-height: 390px;
  }

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

  body.is-dashboard .projects-grid {
    grid-template-columns: 1fr;
  }

  .inbox-shell {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  }

  .inbox-client {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .site-header {
    top: 0;
  }

  .header-inner {
    min-height: 66px;
    gap: 10px;
    padding: 8px 0;
  }

  .brand-mark {
    width: 38px;
    height: 36px;
    border-radius: 9px;
  }

  .main-nav {
    border-top: 1px solid #e2e8f0;
  }

  .main-nav > ul {
    padding-top: 10px;
  }

  .header-actions {
    gap: 8px;
  }

  .header-actions .primary-button,
  .header-actions .ghost-link {
    min-height: 40px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: auto;
    padding: 42px 0 36px;
  }

  h1 {
    font-size: clamp(38px, 7.2vw, 58px);
  }

  .hero-text {
    margin-top: 16px;
  }

  .browser-window {
    width: min(100%, 760px);
    margin: 0 auto;
  }

  body.is-dashboard .app-shell {
    display: block;
    min-height: 100vh;
  }

  body.is-dashboard .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 35;
    display: grid;
    height: auto;
    max-height: none;
    gap: 9px;
    overflow: visible;
    padding: 10px max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px));
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
  }

  body.is-dashboard .sidebar-title {
    display: none;
  }

  body.is-dashboard .sidebar-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 1px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body.is-dashboard .sidebar-nav::-webkit-scrollbar,
  body.is-dashboard .sidebar-projects::-webkit-scrollbar,
  .quick-replies::-webkit-scrollbar {
    display: none;
  }

  body.is-dashboard .sidebar-link {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    padding: 0 10px;
    white-space: nowrap;
  }

  body.is-dashboard .sidebar-link.is-active {
    border-color: rgba(13, 148, 136, 0.28);
    background: #eaf7f5;
    color: var(--brand-dark);
  }

  body.is-dashboard .sidebar-icon {
    width: 24px;
    height: 24px;
    color: #ffffff;
    background: var(--brand);
  }

  body.is-dashboard .sidebar-projects {
    display: flex;
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
    gap: 7px;
    margin: 0;
    padding: 0;
    border-left: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body.is-dashboard .sidebar-project-link {
    flex: 0 0 auto;
    width: auto;
    max-width: 220px;
    min-height: 34px;
    grid-template-columns: minmax(0, 1fr) auto;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    padding: 5px 9px;
  }

  body.is-dashboard .sidebar-project-link.is-active {
    border-color: rgba(13, 148, 136, 0.24);
    background: #f4faf9;
    color: var(--brand-dark);
  }

  body.is-dashboard .sidebar-account {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin: 0;
    padding: 0;
    border-top: 0;
  }

  body.is-dashboard .sidebar-account > span {
    display: none;
  }

  body.is-dashboard .sidebar-user {
    min-height: 34px;
    background: #f8fafc;
  }

  body.is-dashboard .sidebar-logout {
    width: auto;
    min-height: 34px;
    padding: 0 13px;
  }

  body.is-dashboard .app-content {
    padding: 18px max(14px, env(safe-area-inset-right, 0px)) 34px max(14px, env(safe-area-inset-left, 0px));
  }

  .dashboard-top {
    align-items: stretch;
  }

  body.is-dashboard .dashboard-top h1 {
    font-size: clamp(32px, 7vw, 44px);
  }

  .pwa-card,
  .settings-device-grid,
  .settings-install-preview,
  .settings-actions-row,
  .consultant-settings-layout,
  .inbox-shell {
    grid-template-columns: 1fr;
  }

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

  .pwa-actions .primary-button,
  .pwa-actions .secondary-button,
  .pwa-actions .small-action {
    width: 100%;
  }

  .settings-preview-panel,
  .consultant-settings-preview {
    position: static;
  }

  .settings-preview-panel {
    order: 2;
  }

  .settings-device-fields {
    order: 1;
  }

  .inbox-list {
    max-height: 300px;
  }

  .chat-workspace {
    min-height: min(680px, 74vh);
  }
}

@media (max-width: 760px) {
  .header-inner,
  .hero-inner,
  .footer-inner,
  .footer-bottom {
    width: min(1180px, calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  }

  .header-actions {
    order: 4;
    width: 100%;
  }

  .header-actions .primary-button,
  .header-actions .ghost-link {
    flex: 1 1 0;
  }

  .hero-inner {
    padding: 34px 0 28px;
  }

  .eyebrow {
    margin-bottom: 12px;
    padding: 6px 10px;
    font-size: 12px;
  }

  h1 {
    font-size: clamp(34px, 10vw, 46px);
    line-height: 1.06;
  }

  .hero-text {
    font-size: 17px;
  }

  .hero-actions {
    gap: 10px;
    margin-top: 24px;
  }

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

  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 24px;
  }

  .hero-stats div {
    padding: 11px 9px;
    border-radius: 10px;
  }

  .hero-stats dt {
    font-size: 18px;
  }

  .hero-stats dd {
    font-size: 12px;
    line-height: 1.25;
  }

  .browser-top {
    height: 34px;
    padding: 0 12px;
  }

  .dashboard-preview {
    grid-template-columns: 48px 1fr;
    min-height: 320px;
  }

  .dashboard-preview aside {
    gap: 10px;
    padding: 12px 8px;
  }

  .dashboard-preview aside .preview-logo {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .dashboard-preview aside span {
    width: 26px;
    height: 8px;
  }

  .dashboard-preview section {
    padding: 14px;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .widget-card {
    align-items: stretch;
    flex-direction: column;
    margin-top: 18px;
    padding: 14px;
  }

  .widget-card button {
    width: 100%;
  }

  .footer-inner,
  .footer-nav {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  body.is-dashboard .app-content {
    padding-top: 14px;
  }

  body.is-dashboard .dashboard-top {
    display: grid;
    gap: 12px;
  }

  body.is-dashboard .dashboard-top p:not(.eyebrow) {
    font-size: 14px;
  }

  body.is-dashboard .dashboard-top .primary-button {
    width: 100%;
  }

  body.is-dashboard .dashboard-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 12px;
  }

  body.is-dashboard .dashboard-metrics div {
    padding: 9px 8px;
    border-radius: 10px;
  }

  body.is-dashboard .dashboard-metrics span {
    font-size: 10px;
    line-height: 1.2;
  }

  body.is-dashboard .dashboard-metrics strong {
    margin-top: 4px;
    font-size: 20px;
  }

  .pwa-card {
    align-items: stretch;
    gap: 12px;
    padding: 12px;
  }

  .pwa-card-main {
    align-items: flex-start;
  }

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

  .board-card,
  .settings-card {
    padding: 12px;
    border-radius: 14px;
  }

  body.is-dashboard .projects-grid {
    grid-template-columns: 1fr;
  }

  body.is-dashboard .project-workspace-card {
    padding: 12px;
  }

  .project-card-head,
  .project-widgets-head,
  .project-card-actions,
  .widget-row-top,
  .widget-actions,
  .settings-head,
  .settings-section-actions,
  .panel-head,
  .project-detail-head {
    align-items: stretch;
    flex-direction: column;
  }

  .project-card-head-actions,
  .widget-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .small-action,
  .danger-action,
  .widget-actions .switch-control,
  .settings-section-actions .primary-button,
  .settings-save-panel .primary-button,
  .project-card-actions .primary-button,
  .project-card-actions .secondary-button {
    width: 100%;
  }

  body.is-dashboard .project-mini-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.is-dashboard .project-mini-stats div {
    padding: 8px;
  }

  body.is-dashboard .project-mini-stats span {
    font-size: 10px;
  }

  .settings-head h2 {
    font-size: clamp(26px, 9vw, 34px);
  }

  .settings-accordion-summary {
    min-height: auto;
    padding: 12px;
  }

  .settings-accordion-summary > span {
    min-width: 36px;
    height: 28px;
    border-radius: 9px;
  }

  .settings-accordion-summary strong {
    font-size: 16px;
  }

  .settings-accordion-summary p {
    font-size: 12px;
  }

  .settings-accordion-body,
  .settings-section {
    padding: 0 12px 12px;
  }

  .settings-section {
    padding: 12px;
  }

  .settings-fields-grid,
  .install-code-actions,
  .install-steps {
    grid-template-columns: 1fr;
  }

  .settings-field input,
  .settings-field select,
  .settings-field textarea,
  .auth-form input,
  .project-form input {
    font-size: 16px;
  }

  .avatar-upload-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .avatar-upload-preview {
    width: 52px;
    height: 52px;
  }

  .desktop-preview-shell,
  .mobile-preview-shell {
    min-height: 104px;
  }

  .consultant-preview.is-mobile,
  .consultant-preview.is-desktop {
    width: 100%;
  }

  .consultant-preview-head {
    padding: 14px;
  }

  .consultant-preview-head strong {
    max-width: calc(100% - 38px);
    font-size: 16px;
  }

  .consultant-preview-body {
    min-height: 180px;
    padding: 12px;
  }

  .consultant-preview-body p {
    max-width: 92%;
  }

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

  .auth-modal,
  .app-modal {
    align-items: start;
    padding: max(12px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
    overflow-y: auto;
  }

  .auth-panel {
    width: min(100%, 460px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 20px;
    border-radius: 16px;
  }

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

  .inbox-shell {
    gap: 10px;
  }

  .inbox-list,
  .inbox-chat,
  .inbox-client {
    border-radius: 12px;
  }

  .chat-head {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .chat-head h2 {
    font-size: clamp(20px, 7vw, 26px);
  }

  .conversation-status-select {
    width: 100%;
  }

  .chat-messages {
    gap: 8px;
    padding: 12px;
  }

  .chat-message {
    max-width: 88%;
  }

  .chat-message p {
    font-size: 14px;
    overflow-wrap: anywhere;
  }

  .manager-reply-form {
    position: sticky;
    bottom: 0;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #ffffff;
  }

  .manager-reply-form textarea {
    min-height: 44px;
    max-height: 120px;
    resize: vertical;
    font-size: 16px;
  }

  .manager-reply-form .primary-button {
    width: auto;
    min-width: 92px;
    min-height: 44px;
  }
}

@media (max-width: 520px) {
  .header-inner,
  .hero-inner,
  .footer-inner,
  .footer-bottom {
    width: min(1180px, calc(100% - 20px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  }

  .brand {
    gap: 8px;
    font-size: 15px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .menu-toggle {
    width: 40px;
    height: 40px;
  }

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

  .hero {
    background: linear-gradient(180deg, rgba(232, 248, 245, 0.96) 0%, #ffffff 56%, rgba(234, 242, 255, 0.96) 100%);
  }

  h1 {
    font-size: clamp(30px, 10.6vw, 40px);
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-preview {
    grid-template-columns: 40px 1fr;
  }

  .preview-grid article {
    min-height: 82px;
    padding: 12px;
  }

  body.is-dashboard .app-sidebar {
    padding: 8px max(10px, env(safe-area-inset-right, 0px)) 8px max(10px, env(safe-area-inset-left, 0px));
  }

  body.is-dashboard .sidebar-link {
    min-height: 36px;
    font-size: 13px;
  }

  body.is-dashboard .sidebar-user {
    font-size: 12px;
  }

  body.is-dashboard .sidebar-logout {
    font-size: 13px;
    padding: 0 10px;
  }

  body.is-dashboard .app-content {
    padding: 12px max(10px, env(safe-area-inset-right, 0px)) 28px max(10px, env(safe-area-inset-left, 0px));
  }

  body.is-dashboard .dashboard-top h1 {
    font-size: clamp(30px, 10vw, 38px);
  }

  body.is-dashboard .dashboard-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.is-dashboard .dashboard-metrics div {
    padding: 8px 6px;
  }

  body.is-dashboard .dashboard-metrics strong {
    font-size: 18px;
  }

  .pwa-title-row h2,
  body.is-dashboard .panel-head h2 {
    font-size: 18px;
  }

  .project-card-head h3 {
    font-size: 19px;
  }

  .install-code-box {
    padding: 9px;
  }

  .settings-accordion-summary {
    gap: 8px;
  }

  .settings-accordion-summary::after {
    margin-right: 0;
  }

  .settings-section-head {
    gap: 8px;
  }

  .settings-section-head > span {
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }

  .mobile-launcher-preview,
  .desktop-launcher-preview.is-circle {
    width: 62px;
    min-width: 62px;
    height: 62px;
    min-height: 62px;
  }

  .mobile-launcher-preview.is-avatar span {
    width: 58px;
    height: 58px;
  }

  .consultant-preview-bubble {
    right: 10px;
    bottom: 72px;
    width: min(174px, calc(100% - 20px));
  }

  .consultant-preview-input {
    grid-template-columns: minmax(0, 1fr) 34px;
    padding: 10px;
  }

  .manager-reply-form {
    grid-template-columns: 1fr;
  }

  .manager-reply-form .primary-button {
    width: 100%;
  }

  .chat-message {
    max-width: 94%;
  }
}

@media (max-width: 380px) {
  body.is-dashboard .dashboard-metrics,
  body.is-dashboard .project-mini-stats {
    grid-template-columns: 1fr;
  }

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

  .settings-accordion-summary > span {
    display: none;
  }
}

/* Dashboard messenger refinement */
.sidebar-mobile-head {
  display: none;
}

.dashboard-view:not(.is-section-projects) .dashboard-top .add-project-button,
.dashboard-view:not(.is-section-projects) .dashboard-metrics {
  display: none;
}

.dashboard-view.is-section-inbox .dashboard-top {
  margin-bottom: 12px;
}

.dashboard-view.is-section-inbox .dashboard-top .eyebrow {
  display: none;
}

.settings-view {
  margin-top: 14px;
}

.settings-page-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.06);
}

.settings-page-head h2 {
  margin: 0;
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.04;
}

.settings-page-head p:not(.eyebrow) {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.settings-page-card .pwa-notifications-panel {
  margin-top: 0;
}

.inbox-shell {
  grid-template-columns: minmax(270px, 360px) minmax(0, 1fr) minmax(240px, 310px);
  gap: 14px;
  min-height: calc(100vh - 210px);
}

.inbox-list,
.inbox-chat,
.inbox-client {
  overflow: hidden;
  border-color: #dbe3ee;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.055);
}

.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 210px);
  padding: 12px;
}

.inbox-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inbox-list-head strong,
.inbox-list-head span {
  display: block;
}

.inbox-list-head strong {
  font-size: 20px;
  line-height: 1.1;
}

.inbox-list-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inbox-refresh {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #dbe3ee;
  border-radius: 50%;
  color: var(--brand-dark);
  background: #ffffff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

.inbox-search {
  display: grid;
  gap: 5px;
}

.inbox-search span {
  color: #8a94a6;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.inbox-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #f8fafc;
  color: #111827;
  font: inherit;
  font-size: 14px;
  padding: 0 12px;
}

.conversation-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}

.conversation-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  color: #111827;
  cursor: pointer;
  padding: 9px;
  text-align: left;
}

.conversation-card.is-active,
.conversation-card:hover {
  border-color: rgba(13, 148, 136, 0.24);
  background: #eaf7f5;
}

.conversation-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  box-shadow: inset 0 -12px 24px rgba(15, 23, 42, 0.18);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0;
}

.conversation-avatar.is-large {
  width: 48px;
  height: 48px;
  font-size: 14px;
}

.conversation-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.conversation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.conversation-row strong,
.conversation-main small,
.conversation-main p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-row strong {
  min-width: 0;
  font-size: 15px;
  line-height: 1.2;
}

.conversation-row time {
  flex: 0 0 auto;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
}

.conversation-main small {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.conversation-main p {
  margin: 0;
  color: #475569;
  font-size: 13px;
}

.chat-workspace {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  height: min(720px, calc(100vh - 210px));
  min-height: 620px;
  background:
    radial-gradient(circle at 20% 0%, rgba(20, 184, 166, 0.12), transparent 34%),
    linear-gradient(180deg, #f7fbfd 0%, #eef7f5 100%);
}

.chat-head {
  align-items: center;
  border-bottom-color: #dbe3ee;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px 14px;
}

.chat-back-button {
  display: none;
}

.chat-title-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-title-block h2 {
  margin: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 19px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-title-block p {
  overflow: hidden;
  margin: 4px 0 0;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.conversation-status {
  min-height: 28px;
  padding: 0 10px;
}

.conversation-status-select {
  min-height: 38px;
  border-radius: 12px;
}

.chat-messages {
  gap: 8px;
  padding: 18px;
  background: transparent;
}

.chat-message {
  display: grid;
  gap: 4px;
  max-width: min(76%, 540px);
}

.chat-message p {
  border: 0;
  border-radius: 18px 18px 18px 6px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  color: #1f2937;
  font-size: 15px;
  line-height: 1.42;
  overflow-wrap: anywhere;
  padding: 10px 13px;
}

.chat-message.is-manager p {
  border-radius: 18px 18px 6px 18px;
  background: var(--brand);
  color: #ffffff;
}

.chat-message time {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
}

.chat-message.is-manager time {
  text-align: right;
}

.quick-replies {
  border-top-color: rgba(203, 213, 225, 0.8);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 12px;
}

.quick-reply {
  min-height: 34px;
  border-color: rgba(13, 148, 136, 0.26);
  color: var(--brand-dark);
  background: #ffffff;
  font-size: 13px;
}

.manager-reply-form {
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  border-top-color: rgba(203, 213, 225, 0.8);
  background: #ffffff;
  padding: 12px;
}

.manager-reply-form textarea {
  min-height: 48px;
  max-height: 120px;
  resize: none;
  border-radius: 999px;
  background: #f8fafc;
  font-size: 15px;
  line-height: 1.35;
  padding: 13px 16px;
}

.manager-reply-form .primary-button {
  display: grid;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  place-items: center;
  border-radius: 50%;
  box-shadow: none;
  font-size: 25px;
  line-height: 1;
  padding: 0 0 3px;
}

.client-card {
  height: 100%;
  padding: 16px;
}

.client-card h3 {
  margin: 10px 0 14px;
  font-size: 20px;
  line-height: 1.1;
}

.client-card dl {
  gap: 12px;
}

.client-card dd {
  font-size: 13px;
}

.inbox-welcome,
.inbox-empty {
  height: 100%;
  min-height: 320px;
  border-radius: inherit;
}

@media (max-width: 1180px) {
  .inbox-shell {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  }

  .inbox-client {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  body.is-dashboard .app-sidebar {
    display: block;
    z-index: 80;
    padding: 10px max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px));
  }

  .sidebar-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .sidebar-mobile-head > div {
    display: grid;
    gap: 2px;
    min-width: 0;
    margin-right: auto;
  }

  .sidebar-mobile-head strong {
    color: #0f172a;
    font-size: 14px;
    line-height: 1;
  }

  .sidebar-mobile-head small {
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 900;
  }

  .dashboard-menu-toggle {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    padding: 10px;
  }

  .dashboard-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #0f172a;
  }

  body.is-dashboard .sidebar-title,
  body.is-dashboard .app-sidebar:not(.is-open) .sidebar-nav,
  body.is-dashboard .app-sidebar:not(.is-open) .sidebar-account {
    display: none !important;
  }

  body.is-dashboard .app-sidebar.is-open .sidebar-nav {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    overflow: visible;
    border-top: 1px solid #e2e8f0;
    padding: 10px 0 0;
  }

  body.is-dashboard .app-sidebar.is-open .sidebar-link {
    display: flex;
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
  }

  body.is-dashboard .app-sidebar.is-open .sidebar-projects {
    display: grid;
    gap: 6px;
    margin: 2px 0 0 14px;
    overflow: visible;
    border-left: 1px solid #d8eeeb;
    padding: 0 0 0 14px;
  }

  body.is-dashboard .app-sidebar.is-open .sidebar-project-link {
    width: 100%;
    max-width: none;
  }

  body.is-dashboard .app-sidebar.is-open .sidebar-account {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 10px;
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
  }

  .dashboard-view.is-section-inbox .dashboard-top {
    display: none;
  }

  .inbox-view {
    margin-top: 0;
  }

  .inbox-shell {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: 0;
  }

  .inbox-list {
    max-height: 360px;
  }

  .chat-workspace {
    height: min(760px, calc(100dvh - 112px));
    min-height: 560px;
  }
}

@media (max-width: 760px) {
  body.is-dashboard .dashboard-view.is-section-inbox .app-content {
    padding: 10px max(10px, env(safe-area-inset-right, 0px)) 18px max(10px, env(safe-area-inset-left, 0px));
  }

  .inbox-client {
    display: none;
  }

  .inbox-list:not(:empty) {
    max-height: 310px;
  }

  .inbox-view.has-active-chat .inbox-list {
    display: none;
  }

  .inbox-view:not(.has-active-chat) .inbox-chat {
    display: none;
  }

  .inbox-list,
  .inbox-chat {
    border-radius: 16px;
  }

  .chat-workspace {
    height: calc(100dvh - 86px);
    min-height: 520px;
    border-radius: 16px;
  }

  .chat-head {
    align-items: center;
    flex-direction: row;
    padding: 10px;
  }

  .chat-back-button {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid #dbe3ee;
    border-radius: 50%;
    color: #0f172a;
    background: #ffffff;
    cursor: pointer;
    font-size: 21px;
    font-weight: 900;
  }

  .chat-title-block {
    gap: 9px;
  }

  .conversation-avatar.is-large {
    width: 42px;
    height: 42px;
  }

  .chat-title-block h2 {
    font-size: 17px;
  }

  .chat-title-block p,
  .conversation-status {
    display: none;
  }

  .chat-head-actions {
    margin-left: auto;
  }

  .conversation-status-select {
    width: auto;
    max-width: 148px;
    min-height: 36px;
    font-size: 12px;
  }

  .chat-messages {
    padding: 14px 10px;
  }

  .chat-message {
    max-width: 88%;
  }

  .chat-message p {
    font-size: 15px;
  }

  .quick-replies {
    padding: 8px 10px;
  }

  .manager-reply-form,
  .manager-reply-form .primary-button {
    width: auto;
  }

  .manager-reply-form {
    position: sticky;
    bottom: 0;
    grid-template-columns: minmax(0, 1fr) 48px !important;
    gap: 8px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .manager-reply-form textarea {
    min-height: 46px;
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  body.is-dashboard .dashboard-view.is-section-inbox .app-content {
    padding: 8px max(8px, env(safe-area-inset-right, 0px)) 14px max(8px, env(safe-area-inset-left, 0px));
  }

  .settings-page-card {
    padding: 14px;
    border-radius: 14px;
  }

  .settings-page-head h2 {
    font-size: clamp(24px, 9vw, 34px);
  }

  .inbox-list {
    padding: 10px;
  }

  .conversation-card {
    grid-template-columns: 40px minmax(0, 1fr);
    min-height: 68px;
    padding: 8px;
  }

  .conversation-avatar {
    width: 40px;
    height: 40px;
  }

  .conversation-row strong {
    font-size: 14px;
  }

  .conversation-main p {
    font-size: 12px;
  }

  .chat-workspace {
    height: calc(100dvh - 78px);
    min-height: 500px;
  }

  .manager-reply-form .primary-button {
    width: 48px;
    min-width: 48px;
  }
}

/* Inbox mobile stability */
body.is-dashboard .dashboard-view.is-section-inbox .app-content,
.inbox-view,
.inbox-shell,
.inbox-list,
.inbox-chat,
.inbox-client,
.chat-workspace,
.chat-head,
.chat-title-block,
.chat-title-block > div,
.chat-head-actions,
.chat-messages,
.quick-replies,
.manager-reply-form {
  min-width: 0;
}

.inbox-view {
  width: 100%;
}

.inbox-shell {
  width: 100%;
  height: clamp(560px, calc(100dvh - 210px), 760px);
  min-height: 560px;
  overflow: hidden;
}

.inbox-list,
.inbox-chat,
.inbox-client {
  width: 100%;
  height: 100%;
  max-height: none;
}

.inbox-list {
  overflow: hidden;
}

.conversation-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.chat-workspace {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.chat-head {
  width: 100%;
  max-width: 100%;
}

.chat-title-block {
  flex: 1 1 auto;
  overflow: hidden;
}

.chat-head-actions {
  max-width: 260px;
}

.chat-messages {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.chat-message {
  min-width: 0;
}

.chat-message.is-manager {
  align-self: flex-end;
  justify-self: end;
}

.quick-replies {
  max-width: 100%;
}

.quick-reply {
  max-width: min(520px, 80vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manager-reply-form {
  width: 100%;
  max-width: 100%;
}

.manager-reply-form textarea {
  min-width: 0;
}

@media (max-width: 980px) {
  body.is-dashboard .dashboard-view.is-section-inbox .app-content {
    min-height: calc(100dvh - 64px);
  }

  .inbox-shell {
    height: calc(100dvh - 84px);
    min-height: 0;
  }

  .inbox-list {
    max-height: none !important;
  }

  .chat-workspace {
    height: 100%;
    min-height: 0;
  }
}

@media (max-width: 760px) {
  body.is-dashboard .dashboard-view.is-section-inbox .app-content {
    overflow: hidden;
  }

  .inbox-view {
    height: 100%;
    min-height: 0;
  }

  .inbox-shell {
    height: calc(100dvh - 76px);
    min-height: 0;
    max-width: 100%;
  }

  .inbox-view:not(.has-active-chat) .inbox-list {
    display: flex;
    height: 100%;
    max-height: none !important;
  }

  .inbox-view.has-active-chat .inbox-chat {
    display: block;
    height: 100%;
    max-width: 100%;
  }

  .chat-head {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px;
    overflow: hidden;
  }

  .chat-title-block {
    gap: 8px;
  }

  .chat-head-actions {
    max-width: 112px;
  }

  .conversation-status-select {
    max-width: 108px;
    padding: 0 7px;
  }

  .chat-messages {
    padding: 12px 10px;
  }

  .chat-message {
    max-width: 84%;
  }

  .quick-replies {
    overflow-x: auto;
  }

  .quick-reply {
    max-width: min(300px, 78vw);
  }
}

@media (max-width: 520px) {
  .inbox-shell {
    height: calc(100dvh - 70px);
  }

  .conversation-list {
    padding-bottom: 8px;
  }

  .chat-title-block h2 {
    font-size: 16px;
  }
}

/* Messenger polish and mobile dashboard stability */
.conversation-meta {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.conversation-unread {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(13, 148, 136, 0.22);
  color: #ffffff;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  padding: 0 6px;
}

.conversation-card.has-unread {
  border-color: rgba(13, 148, 136, 0.34);
  background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
}

.conversation-card.has-unread .conversation-row strong {
  color: #0f766e;
}

.chat-message time {
  display: block;
  margin-top: 5px;
  line-height: 1;
  text-align: left;
}

.chat-message.is-manager time {
  color: rgba(255, 255, 255, 0.78);
  text-align: right;
}

.employee-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 12px;
  align-items: start;
}

.employee-profile-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.employee-avatar-preview {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #cfe8e5;
  border-radius: 18px;
  background: linear-gradient(135deg, #0f172a, var(--brand));
  color: #ffffff;
  font-size: 18px;
  font-weight: 950;
}

.employee-avatar-preview.is-small {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 13px;
}

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

.employee-preview-card {
  display: grid;
  gap: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fffd 0%, #ffffff 100%);
  padding: 14px;
}

.employee-preview-card > span {
  color: #0f766e;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.employee-preview-person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.employee-preview-person strong,
.employee-preview-person small {
  display: block;
}

.employee-preview-person strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-preview-person small {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.employee-preview-card p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.schedule-days {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.schedule-days label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  gap: 5px;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  padding: 0 10px;
}

.schedule-days input {
  width: 14px;
  height: 14px;
  accent-color: var(--brand);
}

.schedule-preview-input {
  background: #f8fafc !important;
  color: #64748b;
}

.dashboard-menu-toggle {
  gap: 3px;
  align-content: center;
}

.dashboard-menu-toggle span {
  transition: transform 0.18s ease, opacity 0.18s ease;
}

@media (max-width: 980px) {
  body.is-dashboard.dashboard-menu-open {
    overflow: hidden;
  }

  body.is-dashboard.dashboard-menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(4px);
  }

  body.is-dashboard .app-shell {
    grid-template-columns: 1fr;
  }

  body.is-dashboard .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 90;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  }

  body.is-dashboard .app-sidebar.is-open {
    position: fixed;
    inset: max(12px, env(safe-area-inset-top, 0px)) 12px auto 12px;
    width: auto;
    max-height: calc(100dvh - 24px);
    overflow: auto;
    border: 1px solid #dbe3ee;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.22);
    padding: 14px;
  }

  body.is-dashboard .app-sidebar.is-open .sidebar-mobile-head {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
  }

  body.is-dashboard .app-sidebar.is-open .dashboard-menu-toggle span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
  }

  body.is-dashboard .app-sidebar.is-open .dashboard-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.is-dashboard .app-sidebar.is-open .dashboard-menu-toggle span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
  }
}

@media (max-width: 760px) {
  body.is-dashboard .dashboard-view.is-section-inbox .app-content {
    min-height: calc(100dvh - 64px);
    overflow: hidden;
    padding: 0;
  }

  .inbox-view {
    height: calc(100dvh - 64px);
    min-height: 0;
    margin: 0;
  }

  .inbox-shell {
    height: 100%;
    min-height: 0;
    max-width: 100vw;
    overflow: hidden;
    border-radius: 0;
  }

  .inbox-view:not(.has-active-chat) .inbox-list {
    display: flex;
    height: 100%;
    max-height: none !important;
    border: 0;
    border-top: 1px solid #e2e8f0;
    border-radius: 0;
    box-shadow: none;
  }

  .conversation-list {
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .inbox-view.has-active-chat .inbox-chat {
    display: block;
    height: 100%;
    max-width: 100vw;
    overflow: hidden;
    border: 0;
    border-top: 1px solid #e2e8f0;
    border-radius: 0;
    box-shadow: none;
  }

  .inbox-view.has-active-chat .inbox-list,
  .inbox-view.has-active-chat .inbox-client {
    display: none;
  }

  .chat-workspace {
    width: 100%;
    max-width: 100vw;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border-radius: 0;
  }

  .chat-head {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) minmax(96px, auto);
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
  }

  .chat-title-block {
    min-width: 0;
    gap: 8px;
  }

  .chat-title-block .conversation-avatar,
  .conversation-avatar.is-large {
    width: 38px;
    height: 38px;
    font-size: 12px;
  }

  .chat-title-block h2 {
    max-width: 100%;
    font-size: 15px;
  }

  .chat-title-block p {
    display: block;
    max-width: 100%;
    font-size: 10px;
  }

  .conversation-status {
    display: none;
  }

  .chat-head-actions,
  .conversation-status-select {
    min-width: 0;
    max-width: 108px;
  }

  .chat-messages {
    padding: 10px 10px 12px;
  }

  .chat-message {
    max-width: 86%;
  }

  .manager-reply-form {
    grid-template-columns: minmax(0, 1fr) 48px !important;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .manager-reply-form textarea {
    min-height: 46px;
  }

  .employee-settings-grid,
  .employee-profile-row {
    grid-template-columns: 1fr;
  }
}

/* Final mobile messenger pass */
body.is-dashboard .conversation-card {
  position: relative;
  grid-template-columns: 44px minmax(0, 1fr);
}

body.is-dashboard .conversation-main,
body.is-dashboard .conversation-row {
  min-width: 0;
}

body.is-dashboard .conversation-meta {
  align-items: flex-end;
  justify-content: flex-end;
}

body.is-dashboard .chat-message p {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 980px) {
  body.is-dashboard .app-shell {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 100dvh;
    overflow-x: hidden;
  }

  body.is-dashboard .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 80;
    min-height: 64px;
    padding: 10px max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px));
  }

  body.is-dashboard .sidebar-mobile-head {
    min-height: 44px;
  }

  body.is-dashboard .dashboard-menu-toggle {
    display: grid;
    grid-template-rows: repeat(3, 2px);
    width: 42px;
    height: 42px;
    place-content: center;
    place-items: stretch;
    gap: 5px;
    padding: 0 11px;
  }

  body.is-dashboard .dashboard-menu-toggle span {
    width: 20px;
    height: 2px;
  }

  body.is-dashboard.dashboard-menu-open::before {
    z-index: 88;
    background: rgba(15, 23, 42, 0.42);
  }

  body.is-dashboard .app-sidebar.is-open {
    position: fixed;
    top: max(12px, env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    left: max(12px, env(safe-area-inset-left, 0px));
    z-index: 100;
    display: grid;
    width: auto;
    max-width: 430px;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px));
    margin: 0 auto;
    overflow-y: auto;
    border: 1px solid rgba(203, 213, 225, 0.95);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.26);
  }

  body.is-dashboard .app-sidebar.is-open .sidebar-nav,
  body.is-dashboard .app-sidebar.is-open .sidebar-account {
    width: 100%;
  }

  body.is-dashboard .app-sidebar.is-open .dashboard-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body.is-dashboard .app-sidebar.is-open .dashboard-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

@media (max-width: 760px) {
  html,
  body.is-dashboard,
  body.is-dashboard .dashboard-view,
  body.is-dashboard .app-shell {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .app-content {
    width: 100%;
    height: calc(100dvh - 64px);
    min-height: 0 !important;
    overflow: hidden;
    padding: 0 !important;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .dashboard-top {
    display: none !important;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .inbox-view {
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    overflow: hidden;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .inbox-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .inbox-list,
  body.is-dashboard .dashboard-view.is-section-inbox .inbox-chat {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: none !important;
    min-height: 0;
    border: 0;
    border-top: 1px solid #e2e8f0;
    border-radius: 0;
    box-shadow: none;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .inbox-view:not(.has-active-chat) .inbox-list {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 10px;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .conversation-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 2px 2px calc(18px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .conversation-card {
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 70px;
    gap: 9px;
    padding: 8px;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .conversation-meta {
    flex-direction: column;
    gap: 4px;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .conversation-unread {
    min-width: 19px;
    height: 19px;
    font-size: 10px;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .inbox-view.has-active-chat .inbox-chat {
    display: block;
    overflow: hidden;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .chat-workspace {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: none !important;
    min-height: 0;
    overflow: hidden;
    border-radius: 0;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .chat-head {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 92px;
    width: 100%;
    min-width: 0;
    gap: 8px;
    padding: 8px 10px;
    overflow: hidden;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .chat-head > *,
  body.is-dashboard .dashboard-view.is-section-inbox .chat-workspace > *,
  body.is-dashboard .dashboard-view.is-section-inbox .manager-reply-form > * {
    min-width: 0;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .chat-title-block {
    min-width: 0;
    overflow: hidden;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .chat-title-block > div {
    min-width: 0;
    overflow: hidden;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .chat-title-block h2 {
    max-width: 100%;
    font-size: 16px;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .chat-title-block p {
    display: none;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .chat-head-actions {
    display: block;
    width: 92px;
    min-width: 0;
    max-width: 92px;
    overflow: hidden;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .conversation-status-select {
    width: 92px;
    max-width: 92px;
    min-height: 34px;
    border-radius: 999px;
    font-size: 11px;
    padding: 0 6px;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .chat-messages {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .chat-message {
    max-width: 86%;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .quick-replies {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding: 8px 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .quick-replies::-webkit-scrollbar {
    display: none;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .quick-reply {
    flex: 0 0 auto;
    max-width: 78vw;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .manager-reply-form {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px !important;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    gap: 8px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  body.is-dashboard .dashboard-view.is-section-inbox .manager-reply-form textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 46px;
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  body.is-dashboard .dashboard-view.is-section-inbox .conversation-row {
    gap: 6px;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .conversation-row strong {
    font-size: 14px;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .chat-head {
    grid-template-columns: 36px minmax(0, 1fr) 86px;
    gap: 7px;
    padding: 7px 8px;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .chat-back-button,
  body.is-dashboard .dashboard-view.is-section-inbox .chat-title-block .conversation-avatar {
    width: 36px;
    height: 36px;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .chat-title-block h2 {
    font-size: 15px;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .chat-head-actions,
  body.is-dashboard .dashboard-view.is-section-inbox .conversation-status-select {
    width: 86px;
    max-width: 86px;
  }

  body.is-dashboard .dashboard-view.is-section-inbox .chat-message {
    max-width: 88%;
  }
}

/* Project list: full-width horizontal cards */
body.is-dashboard .projects-list.projects-grid {
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
}

body.is-dashboard .project-workspace-card {
  width: 100%;
}

body.is-dashboard .project-card-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 0.78fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
}

body.is-dashboard .project-card-title,
body.is-dashboard .project-card-head > div {
  min-width: 0;
}

body.is-dashboard .project-card-title h3 {
  overflow-wrap: anywhere;
}

body.is-dashboard .project-mini-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
}

body.is-dashboard .project-card-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: max-content;
}

body.is-dashboard .project-expand-button {
  min-width: 104px;
}

body.is-dashboard .project-card-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

body.is-dashboard .project-card-details[hidden] {
  display: none;
}

body.is-dashboard .project-card-details > *,
body.is-dashboard .project-card-details .install-code-box,
body.is-dashboard .project-widgets-section,
body.is-dashboard .project-widgets-list,
body.is-dashboard .compact-widget-card,
body.is-dashboard .compact-empty-widget {
  width: 100%;
  min-width: 0;
}

body.is-dashboard .project-widgets-section {
  padding-top: 2px;
}

@media (max-width: 1180px) {
  body.is-dashboard .project-card-head {
    grid-template-columns: minmax(200px, 1fr) minmax(250px, 0.8fr);
  }

  body.is-dashboard .project-card-head-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
  }
}

@media (max-width: 720px) {
  body.is-dashboard .project-card-head,
  body.is-dashboard .project-card-details {
    grid-template-columns: 1fr;
  }

  body.is-dashboard .project-card-head-actions {
    display: grid;
    grid-template-columns: 1fr;
    min-width: 0;
  }

  body.is-dashboard .project-expand-button {
    min-width: 0;
    width: 100%;
  }

  body.is-dashboard .project-mini-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
