/*
 * Account, tools, notification, and support workspaces.
 * This layer is intentionally scoped to the named screens and is loaded after
 * the shared rebrand layer. It changes layout hierarchy without changing data,
 * permission checks, element IDs, or event handlers.
 */

/* ── Account workspace ─────────────────────────────────────────────── */
#screen-profile .profile-container {
  min-width: 0;
  min-height: 0;
  scrollbar-color: #cbd9e4 transparent;
  scrollbar-width: thin;
}

/* Compact identity hero — just avatar + name + role. Everything else
   (email, gender, IDs, security, notifications, devices) lives in the
   tabs below, reusing the app's existing detail-tab-bar/panel pattern
   (styled generically in style.css, retuned to the light palette in
   rebrand.css) instead of introducing a new UI pattern here. */
#screen-profile .profile-hero--compact {
  position: relative;
  overflow: hidden;
  border: 0;
  /* `overflow: hidden` (needed to clip the decorative circle below) makes
     some browsers ignore the flex child's height when auto-sizing this
     flex container, collapsing it to just its padding and clipping the
     avatar — confirmed empirically. min-height is a floor that prevents
     that regardless of the auto-height calculation. */
  min-height: 108px;
  padding: 20px;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  box-shadow: 0 16px 34px rgba(53, 83, 111, .17);
}

#screen-profile .profile-hero--compact::before {
  position: absolute;
  inset: auto -58px -104px auto;
  width: 240px;
  height: 240px;
  border: 42px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  content: '';
  pointer-events: none;
}

#screen-profile .profile-hero-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}

#screen-profile .profile-avatar-wrap {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  border-color: rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .14);
  box-shadow: none;
}

#screen-profile .profile-avatar-wrap::before {
  opacity: 1;
  background: linear-gradient(135deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .12));
}

#screen-profile .profile-avatar,
#screen-profile .profile-avatar-fallback {
  width: 68px;
  height: 68px;
}

#screen-profile .profile-avatar-fallback {
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  font-size: 22px;
}

#screen-profile .profile-main-info {
  min-width: 0;
}

#screen-profile .profile-main-info h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(20px, 3vw, 25px);
  letter-spacing: -.03em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

#screen-profile .profile-main-info p {
  margin: 3px 0 0;
  color: #d7e6f1;
  font-size: 13px;
  font-weight: 600;
}

#screen-profile .profile-avatar-edit-btn {
  border-color: var(--navy, #1f2d3d);
}

#screen-profile .profile-meta-select {
  min-height: 34px;
  padding: 5px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

#screen-profile .detail-tab-host {
  min-width: 0;
}

#screen-profile .profile-preference-row--link {
  text-decoration: none;
  cursor: pointer;
}

#screen-profile .profile-preference-row__cta {
  flex: 0 0 auto;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

#screen-profile .profile-preferences-card,
#screen-profile .profile-devices-card,
#screen-profile .profile-admin-card,
#screen-profile .profile-info-card,
#screen-profile .profile-password-card {
  min-width: 0;
}

#screen-profile .profile-info-card,
#screen-profile .profile-password-card,
#screen-profile .profile-preferences-card,
#screen-profile .profile-devices-card,
#screen-profile .profile-admin-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

#screen-profile .detail-section-title {
  min-height: 52px;
  padding: 14px 18px;
  color: var(--navy);
  background: var(--surface-blue);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

#screen-profile .profile-meta-list {
  padding: 4px 18px 10px;
}

#screen-profile .profile-meta-item {
  min-width: 0;
  min-height: 58px;
  padding: 12px 0;
  gap: 14px;
  border-color: var(--line);
}

#screen-profile .profile-meta-label {
  color: var(--ink-muted);
  font-size: 10px;
}

#screen-profile .profile-meta-value {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

#screen-profile .profile-security-ok {
  color: var(--success);
}

#screen-profile .profile-password-form {
  display: grid;
  gap: 15px;
  padding: 18px;
}

#screen-profile .profile-password-form .form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

#screen-profile .profile-preferences-list {
  display: grid !important;
  gap: 9px !important;
  padding: 12px 14px 14px;
}

#screen-profile .profile-preference-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  gap: 14px;
  padding: 12px 13px !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  background: var(--surface-soft) !important;
  color: var(--ink);
}

#screen-profile .profile-preference-row span {
  min-width: 0;
  color: var(--ink) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  overflow-wrap: anywhere;
}

#screen-profile .profile-preference-row input[type='checkbox'],
#screen-profile .profile-devices-card input[type='checkbox'] {
  flex: 0 0 auto;
  accent-color: var(--coral);
}

#screen-profile .profile-devices-card__header {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  background: var(--surface-blue);
  border-bottom: 1px solid var(--line);
}

#screen-profile .profile-devices-card__header .detail-section-title {
  flex: 1;
  min-width: 0;
  border: 0;
}

#screen-profile .profile-devices-card__header .btn {
  flex: 0 1 auto;
  min-height: 38px;
  margin-inline-end: 12px;
  white-space: normal;
}

#screen-profile .profile-devices-list {
  min-width: 0;
  padding: 12px 14px 14px;
}

#screen-profile .profile-devices-list > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

#screen-profile .profile-admin-card {
  padding-bottom: 18px;
  order: 10;
}

#screen-profile .profile-admin-card > p {
  padding: 0 18px;
  color: var(--ink-soft) !important;
  line-height: 1.65;
}

#screen-profile .profile-admin-card > div:last-child {
  display: flex !important;
  flex-wrap: wrap;
  gap: 10px !important;
  padding: 0 18px;
}

#screen-profile .profile-version-row {
  align-self: center;
  padding: 2px 0 0;
  order: 11;
}

#screen-profile .profile-version-row .app-version-label {
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@media (min-width: 1024px) {
  #screen-profile .profile-container {
    display: flex;
    flex-direction: column;
    width: min(100%, 900px);
    max-width: 900px;
    margin-inline: auto;
    padding: 24px clamp(24px, 3vw, 42px) 36px;
    gap: 16px;
  }

  #screen-profile .profile-hero--compact {
    min-height: 120px;
    padding: 26px 30px;
  }
}

/* ── Tools workspace ───────────────────────────────────────────────── */
#screen-tools .tools-menu {
  min-width: 0;
  min-height: 0;
}

#screen-tools .tools-menu > .page-context {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}

#screen-tools .tools-section-label {
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

#screen-tools .tool-card {
  min-width: 0;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: start;
}

#screen-tools a.tool-card {
  color: inherit;
  text-decoration: none;
}

#screen-tools .tool-card--danger {
  border-color: color-mix(in srgb, var(--clr-danger, #dc453f) 35%, var(--line));
  background: color-mix(in srgb, var(--clr-danger, #dc453f) 5%, var(--surface));
}
#screen-tools .tool-card--danger::before {
  background: var(--clr-danger, #dc453f);
}
#screen-tools .tool-card--danger:hover {
  border-color: var(--clr-danger, #dc453f);
}

#screen-tools .tool-card::before {
  inset-block: 16px;
  width: 4px;
  border-radius: 999px;
  background: var(--coral);
}

#screen-tools .tool-card:hover {
  border-color: #d5e2eb;
  background: #fff;
  box-shadow: var(--shadow-raised);
  transform: translateY(-2px);
}

#screen-tools .tool-card:active {
  transform: translateY(0);
}

#screen-tools .tool-card-icon {
  width: 50px;
  height: 50px;
  flex-basis: 50px;
  border: 0;
  border-radius: 15px;
  background: var(--surface-blue);
  box-shadow: none;
}

#screen-tools .tool-card-icon svg {
  color: var(--navy);
}

#screen-tools .tool-card-icon--amber {
  background: #fff2dc;
}

#screen-tools .tool-card-icon--amber svg {
  color: #c2801d;
}

#screen-tools .tool-card-icon--red {
  background: #ffebe9;
}

#screen-tools .tool-card-icon--red svg {
  color: #d74d4d;
}

#screen-tools .tool-card-copy {
  min-width: 0;
}

#screen-tools .tool-card-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

#screen-tools .tool-card-copy small {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

#screen-tools .tool-card-arrow {
  color: var(--blue-gray);
  opacity: .8;
}

/* Single stacked column, full-width cards on every breakpoint — matches
   the Warehouse/Quotations card treatment. Desktop widens the cards'
   internal layout for a more detailed, professional read rather than
   packing multiple cards per row. */
@media (min-width: 980px) {
  #screen-tools .tools-menu {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    width: min(100%, 900px);
    max-width: 900px;
    margin-inline: auto;
    padding: 24px clamp(24px, 3vw, 42px) 36px;
    gap: 14px;
  }

  #screen-tools .tools-section-label {
    grid-column: 1 / -1;
    margin: 16px 0 2px;
    padding: 0 2px;
    font-size: 11px;
  }

  #screen-tools .tools-section-label:first-of-type {
    margin-top: 0;
  }

  #screen-tools .tool-card {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 16px;
    min-height: 96px;
    padding: 18px 22px;
  }

  #screen-tools .tool-card-icon {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    border-radius: 16px;
  }

  #screen-tools .tool-card-copy strong {
    font-size: 15px;
  }

  #screen-tools .tool-card-copy small {
    font-size: 12.5px;
  }

  #screen-tools .tool-card-arrow {
    align-self: center;
  }
}

/* ── Notifications inbox ────────────────────────────────────────────── */
#screen-notifications .pg-filter-bar {
  z-index: 1;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  width: min(100% - 32px, 1280px);
  margin: 16px auto 0;
  padding: 10px !important;
  gap: 10px;
  border: 1px solid var(--line) !important;
  border-radius: 18px;
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: var(--shadow-card);
}

#screen-notifications .pg-filter-bar .search-box {
  min-width: 0;
  box-shadow: none;
}

#screen-notifications #notif-unread-filter {
  min-width: 0;
  height: 50px;
  border-color: var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

#screen-notifications .notification-inbox-workspace {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: min(100%, 1320px);
  margin: 0 auto;
  padding: 16px clamp(16px, 3vw, 32px) 34px !important;
  overflow-y: auto;
}

#screen-notifications #notif-inbox-list {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 12px !important;
  padding: 0 !important;
}

#screen-notifications #notif-inbox-list > .pg-loading,
#screen-notifications #notif-inbox-list > .error-msg {
  grid-column: 1 / -1;
}

#screen-notifications .notif-item {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start !important;
  min-width: 0;
  min-height: 142px;
  margin: 0;
  padding: 17px !important;
  gap: 12px !important;
  overflow: hidden;
  border: 1px solid var(--line) !important;
  border-radius: 18px !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-card) !important;
}

#screen-notifications .notif-item.unread {
  border-inline-start: 4px solid var(--coral) !important;
  background: #fffdfc !important;
}

#screen-notifications .notif-item::before {
  display: none;
}

#screen-notifications .notif-item:hover {
  background: #fff !important;
  box-shadow: var(--shadow-raised) !important;
}

#screen-notifications .notif-item > div:first-child {
  min-width: 0;
  cursor: pointer;
}

#screen-notifications .notif-item > div:first-child > div:first-child {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center !important;
  gap: 7px !important;
}

#screen-notifications .notif-item strong {
  min-width: 0;
  color: var(--ink) !important;
  font-size: 14px !important;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

#screen-notifications .notif-item p {
  display: -webkit-box;
  margin: 8px 0 !important;
  overflow: hidden;
  color: var(--ink-soft) !important;
  font-size: 12px !important;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

#screen-notifications .notif-item small {
  color: var(--ink-muted) !important;
  font-size: 10px !important;
}

#screen-notifications .notif-item > div:last-child {
  display: grid !important;
  grid-auto-flow: column;
  gap: 5px !important;
}

#screen-notifications .notif-item .btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--surface-soft);
  font-size: 15px;
}

#screen-notifications .notif-item .btn-icon--danger {
  color: var(--danger);
  background: #fff0ef;
}

#screen-notifications #notif-inbox-empty {
  max-width: 480px;
  margin: 32px auto;
  border: 1px dashed #cbd9e4;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

/* ── Notification settings ──────────────────────────────────────────── */
#screen-notification-settings #notif-settings-tabs {
  z-index: 1;
  display: flex !important;
  align-items: center;
  width: min(100% - 32px, 1280px);
  margin: 16px auto 0;
  padding: 8px !important;
  gap: 7px !important;
  overflow-x: auto;
  border: 1px solid var(--line) !important;
  border-radius: 18px;
  background: var(--surface) !important;
  box-shadow: var(--shadow-card);
  scrollbar-width: thin;
}

#screen-notification-settings #notif-settings-tabs .pg-tab-btn {
  flex: 0 0 auto;
  min-height: 40px;
  padding-inline: 14px;
  box-shadow: none;
}

#screen-notification-settings .notification-settings-workspace {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: min(100%, 1180px) !important;
  max-width: 1180px !important;
  margin: 16px auto 30px !important;
  padding: 24px !important;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

#screen-notification-settings .notif-setting-panel {
  min-width: 0;
}

#screen-notification-settings .notif-setting-panel > h4,
#screen-notification-settings .notif-setting-panel form > h4 {
  color: var(--ink);
  font-size: 17px !important;
  font-weight: 800;
  letter-spacing: -.015em;
}

#screen-notification-settings .notif-setting-panel > p {
  max-width: 760px;
  color: var(--ink-soft) !important;
  line-height: 1.65;
}

#screen-notification-settings #form-notif-general > div[style*='flex-direction:column'] {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px !important;
}

#screen-notification-settings label[style*='justify-content:space-between'],
#screen-notification-settings div[style*='justify-content:space-between'] {
  min-width: 0;
  border-color: var(--line) !important;
  border-radius: 16px !important;
  background: var(--surface-soft) !important;
}

#screen-notification-settings label[style*='justify-content:space-between'] {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center !important;
  min-height: 82px;
  gap: 16px;
  padding: 15px 16px !important;
}

#screen-notification-settings label[style*='justify-content:space-between'] > div,
#screen-notification-settings div[style*='justify-content:space-between'] > div:first-child {
  min-width: 0;
}

#screen-notification-settings label[style*='justify-content:space-between'] strong,
#screen-notification-settings div[style*='justify-content:space-between'] strong {
  color: var(--ink) !important;
  line-height: 1.4;
}

#screen-notification-settings label[style*='justify-content:space-between'] small,
#screen-notification-settings div[style*='justify-content:space-between'] small {
  color: var(--ink-soft) !important;
  line-height: 1.5;
}

#screen-notification-settings input[type='checkbox'] {
  flex: 0 0 auto;
  accent-color: var(--coral);
}

#screen-notification-settings [style*='grid-template-columns'] {
  min-width: 0;
}

#screen-notification-settings .form-group {
  min-width: 0;
}

#screen-notification-settings .form-actions {
  display: flex !important;
  align-items: center;
  min-height: 66px;
  margin-top: 22px !important;
  padding-top: 16px !important;
  border-top: 1px solid var(--line);
}

#screen-notification-settings .form-actions > div {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px !important;
}

#screen-notification-settings .form-actions .btn {
  white-space: normal;
}

#screen-notification-settings [style*='overflow-x:auto'],
#screen-notification-settings [style*='overflow:auto'] {
  max-width: 100%;
  border-color: var(--line) !important;
  border-radius: 16px !important;
}

#screen-notification-settings table {
  min-width: 650px;
  color: var(--ink);
}

#screen-notification-settings thead,
#screen-notification-settings thead tr {
  background: var(--surface-blue) !important;
}

#screen-notification-settings th,
#screen-notification-settings td {
  border-color: var(--line) !important;
}

#screen-notification-settings #notif-tab-templates [style*='display:flex'][style*='flex-wrap:wrap'] {
  gap: 7px !important;
}

#screen-notification-settings #notif-tab-templates .btn-chip {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 11px;
}

#screen-notification-settings #smtp-test-output {
  color: #e5eff6 !important;
  background: var(--navy-dark) !important;
  border-radius: 16px !important;
}

@media (min-width: 980px) {
  #screen-notifications .pg-filter-bar {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  }
}

@media (min-width: 1100px) {
  #screen-notifications #notif-inbox-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) and (min-width: 769px) {
  #screen-notification-settings #form-notif-general > div[style*='flex-direction:column'],
  #screen-notification-settings [style*='grid-template-columns'] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #screen-notification-settings .form-actions,
  #screen-notification-settings .form-actions > div {
    flex-wrap: wrap;
  }
}

/* ── Support ticket workspace ───────────────────────────────────────── */
#screen-support .support-workspace {
  display: flex;
  flex: 1 1 auto !important;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: auto !important;
  padding: 20px clamp(18px, 3vw, 38px) 30px;
  overflow: hidden !important;
}

#screen-support #support-iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

/* ── Phone and narrow tablet arrangement ────────────────────────────── */
@media (max-width: 768px) {
  #screen-profile .profile-container {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 12px 12px calc(var(--nav-h) + 28px);
    gap: 14px;
  }

  #screen-profile .profile-hero--compact {
    padding: 18px;
    border-radius: 24px;
  }

  #screen-profile .profile-hero-main {
    align-items: center;
  }

  #screen-profile .profile-password-form,
  #screen-profile .profile-meta-list {
    padding-inline: 14px;
  }

  #screen-profile .profile-devices-card__header {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 12px;
  }

  #screen-profile .profile-devices-card__header .btn {
    width: calc(100% - 24px);
    margin: 0 12px;
  }

  #screen-profile .profile-admin-card > div:last-child .btn {
    flex: 1 1 100%;
    width: 100%;
  }

  #screen-tools .tools-menu {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    margin: 0;
    padding: 12px 12px calc(var(--nav-h) + 28px);
    gap: 11px;
  }

  #screen-tools .tools-section-label {
    margin: 10px 2px 0;
  }

  #screen-tools .tools-section-label:first-of-type {
    margin-top: 0;
  }

  #screen-tools .tool-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 18px;
    align-items: start;
    min-height: 88px;
    padding: 14px;
    gap: 11px;
    border-radius: 18px;
  }

  #screen-tools .tool-card-icon {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 13px;
  }

  #screen-tools .tool-card-icon svg {
    width: 21px;
    height: 21px;
  }

  #screen-tools .tool-card-arrow {
    width: 18px;
    height: 18px;
    margin-top: 4px;
  }

  #screen-notifications .pg-filter-bar {
    grid-template-columns: minmax(0, 1fr);
    width: calc(100% - 24px);
    margin-top: 12px;
    padding: 9px !important;
    border-radius: 16px;
  }

  #screen-notifications .notification-inbox-workspace {
    width: 100%;
    padding: 12px 12px calc(var(--nav-h) + 26px) !important;
  }

  #screen-notifications #notif-inbox-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px !important;
  }

  #screen-notifications .notif-item {
    min-height: 122px;
    padding: 14px !important;
    border-radius: 16px !important;
  }

  #screen-notification-settings #notif-settings-tabs {
    width: calc(100% - 24px);
    margin-top: 12px;
    border-radius: 16px;
    scrollbar-width: none;
  }

  #screen-notification-settings #notif-settings-tabs::-webkit-scrollbar {
    display: none;
  }

  #screen-notification-settings .notification-settings-workspace {
    width: 100% !important;
    max-width: none !important;
    margin: 12px 0 0 !important;
    padding: 15px 12px calc(var(--nav-h) + 28px) !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  #screen-notification-settings #form-notif-general > div[style*='flex-direction:column'],
  #screen-notification-settings [style*='grid-template-columns'] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #screen-notification-settings label[style*='justify-content:space-between'] {
    min-height: 74px;
    gap: 12px;
    padding: 13px !important;
  }

  #screen-notification-settings .form-actions,
  #screen-notification-settings .form-actions > div {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  #screen-notification-settings .form-actions .btn {
    width: 100%;
  }

  #screen-notification-settings #notif-tab-logs > div:first-child,
  #screen-notification-settings #notif-tab-browser > div[style*='justify-content:space-between'] {
    align-items: stretch !important;
    flex-direction: column;
  }

  #screen-notification-settings #notif-tab-logs > div:first-child .btn,
  #screen-notification-settings #notif-tab-browser > div[style*='justify-content:space-between'] .btn {
    width: 100%;
  }

  #screen-support .support-workspace {
    padding: 12px 12px calc(var(--nav-h) + 22px);
  }

  #screen-support #support-iframe {
    border-radius: 20px;
  }
}

@media (max-width: 420px) {
  #screen-profile .profile-hero-main {
    align-items: flex-start;
  }

  #screen-profile .profile-avatar-wrap,
  #screen-profile .profile-avatar,
  #screen-profile .profile-avatar-fallback {
    width: 64px;
    height: 64px;
  }

  #screen-profile .profile-avatar-fallback {
    font-size: 22px;
  }

  #screen-tools .tool-card {
    grid-template-columns: 40px minmax(0, 1fr) 17px;
    padding: 12px;
  }

  #screen-tools .tool-card-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  #screen-notifications .notif-item > div:last-child {
    grid-auto-flow: row;
  }
}

@media (prefers-reduced-motion: reduce) {
  #screen-tools .tool-card {
    transition: none;
  }
}
