* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 72% 22%, var(--glow), transparent 34%),
    linear-gradient(135deg, var(--page-start), var(--page-end));
}

body.theme-sky {
  --page-start: #e5f6ff;
  --page-end: #b8e7ff;
  --panel: #ffffff;
  --panel-soft: #eff9ff;
  --text: #13263a;
  --muted: #5b7083;
  --border: #b8dcec;
  --brand: #36a9e1;
  --brand-strong: #1179ad;
  --accent: #8a5a35;
  --danger: #d32f2f;
  --success: #1f8f51;
  --shadow: rgba(32, 91, 122, 0.18);
  --glow: rgba(54, 169, 225, 0.24);
}

body.theme-white {
  --page-start: #ffffff;
  --page-end: #eef2f6;
  --panel: #ffffff;
  --panel-soft: #f7f9fb;
  --text: #1a2433;
  --muted: #657386;
  --border: #d8e0e8;
  --brand: #ffffff;
  --brand-strong: #31465c;
  --accent: #8a5a35;
  --danger: #cf2f2f;
  --success: #23824d;
  --shadow: rgba(31, 42, 55, 0.12);
  --glow: rgba(138, 90, 53, 0.12);
}

body.theme-brown {
  --page-start: #f3e4d4;
  --page-end: #c09a77;
  --panel: #fffaf5;
  --panel-soft: #f8eadb;
  --text: #2d1c12;
  --muted: #715a49;
  --border: #cba98a;
  --brand: #8a5a35;
  --brand-strong: #5b351f;
  --accent: #36a9e1;
  --danger: #b72727;
  --success: #237345;
  --shadow: rgba(80, 45, 24, 0.19);
  --glow: rgba(138, 90, 53, 0.22);
}

body.theme-dark {
  color-scheme: dark;
  --page-start: #111820;
  --page-end: #071018;
  --panel: #17212c;
  --panel-soft: #202c38;
  --text: #f4f8fb;
  --muted: #aab8c7;
  --border: #334252;
  --brand: #36a9e1;
  --brand-strong: #78d0ff;
  --accent: #b7835d;
  --danger: #ff7777;
  --success: #6bd394;
  --shadow: rgba(0, 0, 0, 0.28);
  --glow: rgba(54, 169, 225, 0.14);
}

a {
  color: inherit;
}

.view-panel[hidden] {
  display: none;
}

button,
input,
select,
textarea,
a {
  font: inherit;
}

.google-translate-host {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.skiptranslate,
.goog-te-banner-frame {
  display: none;
}

.page-controls {
  position: fixed;
  top: 22px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-controls-left {
  left: 24px;
}

.page-controls-right {
  right: 24px;
  justify-content: flex-end;
}

.client-single-page[data-view="login"] .page-controls {
  left: 24px;
  right: auto;
  justify-content: flex-start;
}

.client-single-page[data-view="forgot-client-number"] .page-controls,
.client-single-page[data-view="forgot-password"] .page-controls {
  left: 24px;
  right: auto;
  justify-content: flex-start;
}

.client-single-page[data-view="register"] .page-controls,
.client-single-page[data-view="dashboard"] .page-controls {
  left: auto;
  right: 24px;
  justify-content: flex-end;
}

.select-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px var(--shadow);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.select-control select,
.form-field input,
.form-field select,
.reply-box textarea {
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel);
}

.select-control select {
  min-height: 30px;
  max-width: 180px;
  padding: 0 28px 0 8px;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 26px;
  min-height: 100vh;
  padding: 92px 48px 48px;
}

.registration-shell {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 920px);
  gap: 24px;
  align-items: start;
  min-height: 100vh;
  padding: 92px 48px 48px;
}

.auth-panel,
.registration-card,
.next-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px var(--shadow);
}

.auth-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
}

.compact-panel {
  position: sticky;
  top: 92px;
  min-height: 360px;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.auth-switch-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel-soft);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.auth-switch-button.active {
  border-color: transparent;
  color: #ffffff;
  background: var(--brand-strong);
}

.login-form,
.registration-form,
.form-section,
.next-card {
  display: grid;
}

.login-form {
  gap: 18px;
}

.form-heading {
  display: grid;
  gap: 8px;
}

.form-heading h1,
.next-card h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
}

.form-heading p,
.form-note,
.next-card p,
.mini-logo p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.form-field {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.form-field input,
.form-field select {
  width: 100%;
  min-height: 44px;
  padding: 0 42px 0 12px;
}

.field-help {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.field-error {
  color: var(--danger);
}

.input-status-wrap {
  position: relative;
  display: block;
}

.otp-field[hidden] {
  display: none;
}

.otp-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.small-button {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--brand-strong);
  font-weight: 800;
  cursor: pointer;
}

.small-button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.text-action {
  justify-self: start;
  min-height: 30px;
  padding: 0;
  border: 0;
  color: var(--brand-strong);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.text-action[hidden] {
  display: none;
}

.field-status {
  position: absolute;
  top: 50%;
  right: 12px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  transform: translateY(-50%);
}

.field-valid .field-status {
  color: var(--success);
}

.field-invalid .field-status {
  color: var(--danger);
}

.field-valid input,
.field-valid select {
  border-color: var(--success);
}

.field-invalid input,
.field-invalid select {
  border-color: var(--danger);
}

.optional-status {
  width: auto;
  min-width: 62px;
  border-radius: 999px;
  font-size: 11px;
}

.check-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

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

.login-recovery-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0;
  border: 0;
  color: var(--brand-strong);
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.back-link {
  justify-self: start;
  margin-top: 2px;
}

.primary-button,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--brand-strong);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.secondary-link {
  justify-self: start;
  padding: 0 18px;
  color: var(--text);
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

.logo-stage {
  display: grid;
  place-items: center;
  min-height: 520px;
}

.logo-lockup {
  display: grid;
  justify-items: center;
  gap: 20px;
  text-align: center;
}

.logo-mark-large {
  display: grid;
  place-items: center;
  width: 180px;
  height: 180px;
  border: 12px solid var(--panel);
  border-radius: 36px;
  color: #ffffff;
  background:
    linear-gradient(145deg, var(--brand-strong), var(--brand)),
    var(--brand);
  box-shadow: 0 28px 80px var(--shadow);
}

.logo-mark-large span {
  font-size: 58px;
  font-weight: 900;
}

.logo-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.logo-copy h2 {
  margin: 0;
  font-size: 48px;
  line-height: 1;
}

.logo-copy p {
  max-width: 460px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.mini-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 14px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.logo-mark-small {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand-strong);
  font-weight: 900;
}

.registration-card {
  padding: 24px;
}

.registration-form {
  gap: 20px;
  margin-top: 24px;
}

.form-section {
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.form-section h2 {
  margin: 0;
  font-size: 20px;
}

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

.address-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(120px, 0.7fr);
}

.address-grid .form-field:nth-child(5) {
  grid-column: 1 / -1;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.save-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.save-status.error {
  color: var(--danger);
}

.save-status.success {
  color: var(--success);
}

.next-page-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 96px 24px 48px;
}

.next-card {
  justify-items: center;
  gap: 14px;
  max-width: 620px;
  padding: 38px;
  text-align: center;
}

.next-card .logo-mark-large {
  width: 118px;
  height: 118px;
  border-radius: 26px;
}

.next-card .logo-mark-large span {
  font-size: 38px;
}

.recovery-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 96px 24px 48px;
}

.recovery-card {
  display: grid;
  gap: 22px;
  width: min(100%, 560px);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px var(--shadow);
}

.recovery-form {
  display: grid;
  gap: 16px;
}

.recovery-otp-area {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.recovery-otp-area[hidden] {
  display: none;
}

.recovery-result {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.recovery-result[hidden] {
  display: none;
}

.recovery-result span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.recovery-result strong {
  color: var(--brand-strong);
  font-size: 30px;
  letter-spacing: 2px;
}

.copy-button {
  justify-self: start;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--brand-strong);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.client-dashboard-page {
  min-height: 100vh;
}

.client-dashboard-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  min-height: 100vh;
  padding: 24px;
}

.client-single-page[data-view="dashboard"] .client-dashboard-shell {
  padding-top: 88px;
}

.dashboard-sidebar,
.dashboard-topbar,
.dashboard-panel,
.dashboard-stat,
.customer-message-card,
.client-number-card,
.installer-panel,
.installer-package {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 48px var(--shadow);
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 28px 18px;
}

.dashboard-nav {
  display: grid;
  gap: 14px;
}

.dashboard-nav-item,
.panel-button,
.message-actions button {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel-soft);
  font-weight: 800;
  cursor: pointer;
}

.dashboard-nav-item {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 0 12px;
  font-size: 18px;
  text-align: left;
  text-decoration: none;
}

.dashboard-nav-item.active,
.panel-button,
.message-actions button:last-child {
  border-color: transparent;
  color: #ffffff;
  background: var(--brand-strong);
}

.dashboard-main {
  display: grid;
  gap: 18px;
  align-content: start;
}

.dashboard-section[hidden] {
  display: none;
}

.dashboard-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.dashboard-title h1 {
  margin: 6px 0 8px;
  font-size: 34px;
  line-height: 1.08;
}

.dashboard-title p:last-child {
  margin: 0;
  color: var(--muted);
}

.dashboard-top-right {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.client-number-card {
  display: grid;
  gap: 4px;
  min-width: 176px;
  padding: 10px 14px;
  text-align: right;
}

.client-number-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-number-card strong {
  color: var(--brand-strong);
  font-size: 24px;
  letter-spacing: 2px;
}

.dashboard-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.dashboard-controls .select-control {
  box-shadow: none;
}

.dashboard-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-stat {
  min-height: 104px;
  padding: 14px;
}

.dashboard-stat span,
.dashboard-stat p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.dashboard-stat strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 30px;
}

.dashboard-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 18px;
}

.dashboard-panel {
  padding: 18px;
}

.dashboard-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-panel-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.dashboard-panel-head p {
  margin: 0;
  color: var(--muted);
}

.settings-panel {
  display: grid;
  gap: 16px;
  max-width: 680px;
}

.settings-account-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.settings-account-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-account-card strong {
  color: var(--text);
  font-size: 22px;
}

.settings-account-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.logout-button {
  justify-self: start;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--danger);
  font-weight: 900;
  cursor: pointer;
}

.panel-button {
  padding: 0 12px;
  white-space: nowrap;
}

.folder-stack {
  display: grid;
  gap: 10px;
}

.dashboard-folder {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.dashboard-folder strong {
  display: block;
  margin-bottom: 4px;
}

.dashboard-folder p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-folder > span {
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 32px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 900;
}

.customer-message-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  box-shadow: none;
}

.customer-message-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.customer-message-card header p,
.customer-message-card > p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.customer-message-card header span {
  padding: 6px 10px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--success);
  font-size: 12px;
  font-weight: 900;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-actions button {
  padding: 0 12px;
}

.installer-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.installer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.installer-header h2 {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 1.12;
}

.installer-add-button {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--brand-strong);
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
}

.installer-list {
  display: grid;
  gap: 14px;
}

.installer-package {
  display: grid;
  gap: 12px;
  padding: 14px;
  box-shadow: none;
}

.installer-package-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.installer-package-title {
  display: grid;
  gap: 5px;
}

.installer-package-title strong {
  font-size: 18px;
}

.widget-key {
  color: var(--brand-strong);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1px;
}

.installer-package-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.installer-status-pill {
  align-self: start;
  padding: 7px 10px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.installer-status-pill.installed {
  background: var(--success);
}

.installer-code {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: var(--panel-soft);
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.installer-instruction-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(138, 90, 53, 0.24);
  border-radius: 8px;
  color: var(--accent);
  background: rgba(138, 90, 53, 0.08);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.45;
}

.installer-website-field {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 800;
}

.installer-website-field span {
  color: var(--muted);
  font-size: 13px;
}

.installer-website-field input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel-soft);
  font-weight: 700;
}

.installer-website-field input:focus-visible {
  border-color: var(--brand-strong);
  outline: 3px solid var(--glow);
}

.installer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.installer-actions button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel-soft);
  font-weight: 800;
  cursor: pointer;
}

.installer-actions button:disabled {
  opacity: 0.62;
  cursor: wait;
}

.installer-actions .installer-action-primary,
.installer-empty-state .installer-action-primary {
  border-color: transparent;
  color: #ffffff;
  background: var(--brand-strong);
}

.installer-actions .installer-action-danger {
  border-color: transparent;
  color: #ffffff;
  background: var(--danger);
}

.installer-delete-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.installer-delete-confirm[hidden] {
  display: none;
}

.installer-delete-confirm p {
  flex: 1 1 220px;
  margin: 0;
  color: var(--text);
  font-weight: 800;
}

.installer-delete-confirm button,
.installer-empty-state button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.installer-confirm-yes {
  background: var(--danger);
}

.installer-confirm-no {
  background: var(--brand-strong);
}

.installer-empty-state {
  align-items: start;
}

.installer-empty-state > strong {
  font-size: 20px;
}

.widget-folders-panel,
.edit-widget-panel {
  display: grid;
  gap: 16px;
  min-height: 260px;
}

.edit-widget-toolbar {
  display: flex;
  justify-content: flex-start;
}

.widget-option-form {
  display: grid;
  gap: 14px;
  max-width: 620px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.widget-option-form[hidden] {
  display: none;
}

.widget-option-list,
.widget-folder-list {
  display: grid;
  gap: 10px;
}

.widget-option-item,
.widget-folder-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.widget-option-title,
.widget-folder-title {
  min-width: 0;
}

.widget-option-title strong,
.widget-folder-title strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.widget-option-title span,
.widget-folder-title span,
.empty-dashboard-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.empty-dashboard-note {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.empty-dashboard-note[hidden] {
  display: none;
}

.widget-option-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.widget-option-actions button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel);
  font-weight: 800;
  cursor: pointer;
}

.widget-option-actions button:last-child {
  color: #ffffff;
  background: var(--danger);
  border-color: transparent;
}

.widget-folder-count {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 36px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 900;
}

.widget-folder-card {
  width: 100%;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.widget-folder-card.has-unread {
  border-color: var(--brand-strong);
  background: var(--panel);
}

.widget-folder-card.has-unread .widget-folder-count {
  background: var(--danger);
}

.folder-detail-panel {
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.folder-detail-panel[hidden] {
  display: none;
}

.folder-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.folder-detail-head h3 {
  margin: 0 0 4px;
  font-size: 22px;
}

.folder-detail-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.folder-close-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel-soft);
  font-weight: 800;
  cursor: pointer;
}

.folder-message-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.42fr) minmax(0, 0.58fr);
  gap: 14px;
  align-items: start;
}

.folder-message-list {
  display: grid;
  gap: 8px;
}

.folder-message-button {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-soft);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.folder-message-button.unread {
  border-color: var(--brand-strong);
  background: var(--panel);
}

.folder-message-button.active {
  outline: 3px solid var(--glow);
}

.folder-message-button strong,
.folder-message-button span {
  overflow-wrap: anywhere;
}

.folder-message-button span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.folder-message-detail {
  display: grid;
  gap: 16px;
  min-height: 250px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.folder-message-detail[hidden] {
  display: none;
}

.mail-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.mail-detail-header h3 {
  margin: 0 0 5px;
  font-size: 22px;
}

.mail-detail-header p {
  margin: 0;
  color: var(--muted);
}

.mail-status-pill {
  padding: 7px 10px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.mail-status-pill.sent {
  background: var(--success);
}

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

.customer-detail-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.customer-detail-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-detail-item strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.mail-message-body {
  display: grid;
  gap: 8px;
}

.mail-message-body h4,
.reply-history h4 {
  margin: 0;
  font-size: 16px;
}

.mail-message-body p,
.reply-history p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.reply-area {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.reply-toggle-button,
.reply-send-button {
  justify-self: start;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--brand-strong);
  font-weight: 800;
  cursor: pointer;
}

.reply-form {
  display: grid;
  gap: 8px;
}

.reply-form[hidden] {
  display: none;
}

.reply-form textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-soft);
  font: inherit;
  line-height: 1.5;
}

.reply-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.reply-status.error {
  color: var(--danger);
}

.reply-status.success {
  color: var(--success);
}

@media (max-width: 900px) {
  .auth-shell,
  .registration-shell,
  .client-dashboard-shell,
  .dashboard-work-grid {
    grid-template-columns: 1fr;
    padding: 104px 24px 36px;
  }

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

  .compact-panel {
    position: static;
    min-height: auto;
  }

  .logo-stage {
    min-height: 360px;
  }

  .dashboard-sidebar {
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .page-controls {
    position: static;
    padding: 16px;
  }

  .client-single-page[data-view="login"] .page-controls,
  .client-single-page[data-view="forgot-client-number"] .page-controls,
  .client-single-page[data-view="forgot-password"] .page-controls,
  .client-single-page[data-view="register"] .page-controls,
  .client-single-page[data-view="dashboard"] .page-controls {
    justify-content: flex-start;
  }

  .page-controls-right {
    justify-content: flex-start;
  }

  .select-control {
    flex: 1 1 210px;
  }

  .auth-shell,
  .registration-shell {
    padding: 8px 16px 30px;
  }

  .recovery-shell {
    padding: 8px 16px 30px;
  }

  .form-grid,
  .address-grid,
  .otp-row {
    grid-template-columns: 1fr;
  }

  .address-grid .form-field:nth-child(5) {
    grid-column: auto;
  }

  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
  }

  .logo-copy h2 {
    font-size: 38px;
  }

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

  .dashboard-top-right {
    justify-items: stretch;
    width: 100%;
  }

  .client-number-card {
    text-align: left;
  }

  .dashboard-controls {
    justify-content: flex-start;
  }

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

  .customer-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .auth-panel,
  .registration-card,
  .next-card,
  .recovery-card {
    padding: 18px;
  }

  .logo-mark-large {
    width: 136px;
    height: 136px;
    border-radius: 28px;
  }

  .logo-mark-large span {
    font-size: 44px;
  }

  .client-dashboard-shell {
    padding: 16px;
  }

  .dashboard-stat-grid,
  .dashboard-folder {
    grid-template-columns: 1fr;
  }

  .dashboard-panel-head,
  .customer-message-card header,
  .installer-header,
  .installer-package-header,
  .widget-option-item,
  .widget-folder-card {
    flex-direction: column;
  }

  .widget-option-item,
  .widget-folder-card {
    grid-template-columns: 1fr;
  }

  .widget-option-actions {
    justify-content: flex-start;
  }
}
