
/*
 * Nexwebmail "Iris Ink" design system.
 * Warm porcelain canvas, iris accent, Fraunces display serif,
 * card-based mail rows, always-night rail, luminous dark mode.
 */
:root {
  color-scheme: light;
  --nx-accent: #5352c9;
  --nx-accent-strong: #403fae;
  --nx-accent-soft: #ecebfa;
  --nx-accent-glow: rgba(83, 82, 201, 0.28);
  --nx-accent-ink: #ffffff;
  --nx-canvas: #f4f2ed;
  --nx-surface: #ffffff;
  --nx-surface-soft: #faf9f6;
  --nx-ink: #171922;
  --nx-muted: #5c6270;
  --nx-faint: #8b909d;
  --nx-line: #e7e3da;
  --nx-line-soft: #efece5;
  --nx-rail: linear-gradient(180deg, #1b1830 0%, #131120 55%, #100e1a 100%);
  --nx-rail-ink: #b5b2cc;
  --nx-star: #d99a2b;
  --nx-ok: #2f9e6e;
  --nx-danger: #c2452d;
  --nx-shadow-1: 0 1px 2px rgba(23, 20, 40, 0.05), 0 8px 24px rgba(23, 20, 40, 0.06);
  --nx-shadow-2: 0 2px 6px rgba(23, 20, 40, 0.07), 0 24px 60px rgba(23, 20, 40, 0.12);
  --nx-font-ui: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --nx-font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --jv-font-family: var(--nx-font-ui);
  font-family: var(--nx-font-ui);
  color: var(--nx-ink);
  background: var(--nx-canvas);
}

[data-theme="dark"] {
  color-scheme: dark;
  --nx-accent: #8c8af2;
  --nx-accent-strong: #a7a5f7;
  --nx-accent-soft: #262649;
  --nx-accent-glow: rgba(140, 138, 242, 0.3);
  --nx-accent-ink: #10102b;
  --nx-canvas: #0e0f17;
  --nx-surface: #171923;
  --nx-surface-soft: #1c1e2b;
  --nx-ink: #eceef6;
  --nx-muted: #a4a9ba;
  --nx-faint: #767c8f;
  --nx-line: #272a3a;
  --nx-line-soft: #20232f;
  --nx-rail: linear-gradient(180deg, #14121f 0%, #0e0c18 60%, #0b0a13 100%);
  --nx-rail-ink: #8f8cab;
  --nx-star: #e6b357;
  --nx-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 28px rgba(0, 0, 0, 0.35);
  --nx-shadow-2: 0 2px 8px rgba(0, 0, 0, 0.45), 0 30px 70px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow: hidden;
  background: var(--nx-canvas);
}

body {
  color: var(--nx-ink);
  font-size: 14px;
  transition: background 350ms ease, color 350ms ease;
}

a {
  color: inherit;
}

j-app,
j-layout,
j-header,
j-toolbar,
j-drawer,
j-page-container,
j-page,
j-list,
j-item,
j-item-section,
j-item-label,
j-scroll-area,
j-card,
j-card-section,
j-card-actions,
j-form,
j-input,
j-textarea,
j-file,
j-linear-progress,
j-separator {
  display: block;
}

j-button,
j-icon-button,
j-avatar,
j-badge,
j-chip,
j-icon,
j-space,
j-toggle {
  display: inline-flex;
}

j-space {
  flex: 1 1 auto;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--nx-accent);
  outline-offset: 2px;
}

/*
 * Form controls: the CLI puts the component class (e.g. .j-input) on the
 * wrapper element too, so reset wrappers and style only inner controls.
 */
j-input.j-field:not(.global-search),
j-textarea.j-field,
j-select.j-field,
j-file.j-field {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: grid;
  gap: 7px;
}

.j-field__label {
  color: var(--nx-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.j-field__required {
  color: var(--nx-danger);
}

.j-field__hint {
  color: var(--nx-faint);
  font-size: 10.5px;
}

input.j-input,
textarea.j-textarea,
.j-select__native,
select.j-select {
  min-height: 46px;
  padding: 0 15px;
  border: 1.5px solid var(--nx-line);
  border-radius: 14px;
  color: var(--nx-ink);
  background: var(--nx-surface-soft);
  font: inherit;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

textarea.j-textarea {
  padding: 12px 15px;
  resize: vertical;
}

input.j-input:focus,
textarea.j-textarea:focus,
.j-select__native:focus,
select.j-select:focus {
  outline: none;
  border-color: var(--nx-accent);
  background: var(--nx-surface);
  box-shadow: 0 0 0 4px var(--nx-accent-soft);
}

input.j-input::placeholder,
textarea.j-textarea::placeholder {
  color: var(--nx-faint);
}

label.j-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  color: var(--nx-muted);
}

.j-checkbox__input {
  appearance: none;
  width: 19px;
  height: 19px;
  margin: 0;
  flex: 0 0 19px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--nx-line);
  border-radius: 6px;
  background: var(--nx-surface);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.j-checkbox__input:checked {
  border-color: var(--nx-accent);
  background: var(--nx-accent);
}

.j-checkbox__input:checked::after {
  width: 9px;
  height: 5px;
  margin-top: -2px;
  border: 2.5px solid var(--nx-accent-ink);
  border-top: 0;
  border-right: 0;
  border-radius: 1px;
  transform: rotate(-45deg);
  content: "";
}

.j-checkbox__input:focus-visible {
  outline: 2px solid var(--nx-accent);
  outline-offset: 2px;
}

.j-checkbox__label {
  font-size: 12px;
}

j-file.j-file {
  min-height: 54px;
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--nx-line);
  border-radius: 14px;
  color: var(--nx-faint);
  background: var(--nx-surface-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: border-color 150ms ease, color 150ms ease;
}

j-file.j-file:hover {
  border-color: var(--nx-accent);
  color: var(--nx-accent-strong);
}

j-file.j-file:empty::before {
  content: attr(label);
}

input.j-input[type="file"] {
  min-height: 52px;
  padding: 9px 10px;
  border-style: dashed;
  cursor: pointer;
  color: var(--nx-muted);
  font-size: 12.5px;
}

input.j-input[type="file"]::file-selector-button {
  margin-right: 12px;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  color: var(--nx-accent-strong);
  background: var(--nx-accent-soft);
  font: 650 12px/1 var(--nx-font-ui);
  cursor: pointer;
}

input.j-input[type="file"]:hover {
  border-color: var(--nx-accent);
}

.mail-app,
.mail-shell {
  width: 100%;
  min-height: 100vh;
}

.mail-shell {
  display: grid;
  grid-template-columns: 78px 248px minmax(0, 1fr);
  background: var(--nx-canvas);
}

.app-rail {
  position: relative;
  z-index: 4;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  padding: 18px 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #edecf6;
  background: var(--nx-rail);
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 15px;
  text-decoration: none;
  color: var(--nx-accent-ink);
  background: linear-gradient(140deg, var(--nx-accent), var(--nx-accent-strong));
  box-shadow: 0 10px 24px var(--nx-accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.brand-envelope,
.brand-envelope j-icon {
  display: grid;
  place-items: center;
}

.brand-envelope j-icon {
  font-size: 24px;
}

.rail-nav {
  width: 100%;
  display: grid;
  gap: 8px;
}

.rail-link {
  position: relative;
  min-height: 58px;
  padding: 9px 2px 8px;
  display: grid;
  place-items: center;
  gap: 3px;
  border-radius: 14px;
  color: var(--nx-rail-ink);
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.rail-link j-icon {
  font-size: 22px;
}

.rail-link span {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.rail-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.rail-link--active {
  color: #ffffff;
  background: linear-gradient(
    140deg,
    color-mix(in srgb, var(--nx-accent) 55%, transparent),
    color-mix(in srgb, var(--nx-accent) 28%, transparent)
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 6px 18px var(--nx-accent-glow);
}

.rail-link--active j-icon {
  --jv-icon-fill: 1;
}

.rail-theme,
.mini-action,
.topbar-action,
.icon-action,
.pager-action,
.star-action,
.editor-action {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  color: var(--nx-muted);
  background: transparent;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, transform 100ms ease;
}

.rail-theme {
  color: var(--nx-rail-ink);
}

.rail-theme:hover,
.rail-theme:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.rail-avatar {
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--nx-accent-ink);
  background: linear-gradient(140deg, var(--nx-accent), var(--nx-accent-strong));
  outline: 2px solid rgba(255, 255, 255, 0.2);
  outline-offset: 2px;
  font-size: 11px;
  font-weight: 800;
}

.folder-drawer {
  position: relative;
  z-index: 3;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  padding: 22px 16px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--nx-line);
  background: transparent;
}

.folder-head {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 6px 18px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--nx-accent);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.folder-head h1,
.panel-head h2,
.subject-row h2,
.compose-head h2,
.contact-hero h2,
.settings-head h2 {
  margin: 0;
  color: var(--nx-ink);
  font-family: var(--nx-font-display);
  font-weight: 480;
  letter-spacing: -0.01em;
}

.folder-head h1 {
  font-size: 21px;
  line-height: 26px;
}

.mini-action {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 10px;
}

.mini-action:hover,
.topbar-action:hover,
.icon-action:hover,
.pager-action:hover,
.editor-action:hover {
  color: var(--nx-accent-strong);
  background: var(--nx-accent-soft);
}

.compose-button,
.send-button,
.save-settings {
  min-height: 46px;
  padding: 0 20px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 15px;
  color: var(--nx-accent-ink);
  background: linear-gradient(140deg, var(--nx-accent), var(--nx-accent-strong));
  box-shadow: 0 12px 26px var(--nx-accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.compose-button:hover,
.send-button:hover,
.save-settings:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px var(--nx-accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.compose-button {
  width: 100%;
  margin-bottom: 18px;
}

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

.folder-link {
  display: block;
  border-radius: 12px;
  color: var(--nx-muted);
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.folder-link j-item {
  min-height: 38px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: inherit;
}

.folder-link j-item-label {
  font-size: 13px;
  font-weight: 500;
}

.folder-link:hover {
  color: var(--nx-ink);
  background: color-mix(in srgb, var(--nx-surface) 70%, transparent);
}

.folder-link:hover .folder-icon j-icon {
  color: var(--nx-accent);
}

.folder-link--active {
  color: var(--nx-ink);
  background: var(--nx-surface);
  box-shadow: var(--nx-shadow-1);
}

.folder-link--active j-item-label {
  font-weight: 650;
}

.folder-link--active .folder-icon j-icon {
  --jv-icon-fill: 1;
  color: var(--nx-accent);
}

.folder-icon {
  width: 20px;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
}

.folder-icon j-icon {
  font-size: 19px;
  color: var(--nx-faint);
  transition: color 150ms ease;
}

.folder-link j-item-section:not(.folder-icon):not(.folder-count) {
  min-width: 0;
  flex: 1 1 auto;
}

.folder-count {
  flex: 0 0 auto;
  color: var(--nx-faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.folder-count j-badge {
  min-width: 21px;
  height: 19px;
  padding: 0 6px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--nx-accent-ink);
  background: var(--nx-accent);
  font-size: 10px;
  font-weight: 700;
}

.folder-label-row {
  margin: 20px 12px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--nx-faint);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.folder-list--compact .folder-link j-item {
  min-height: 34px;
}

.folder-icon--dot::before {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  transform: rotate(45deg);
  background: var(--dot-color);
  content: "";
}

.folder-icon--blue { --dot-color: #6a8ff0; }
.folder-icon--green { --dot-color: #43b489; }
.folder-icon--amber { --dot-color: #e0a54b; }

.storage-card {
  margin-top: auto;
  padding: 14px 14px 15px;
  border: 1px solid var(--nx-line-soft);
  border-radius: 14px;
  background: var(--nx-surface);
  box-shadow: var(--nx-shadow-1);
}

.storage-copy {
  margin-bottom: 9px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--nx-faint);
  font-size: 10.5px;
}

.storage-copy strong {
  color: var(--nx-muted);
  font-weight: 600;
}

.storage-card j-linear-progress {
  position: relative;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--nx-line);
}

.storage-card j-linear-progress::after {
  width: 28%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--nx-accent), var(--nx-accent-strong));
  content: "";
}

.workspace {
  min-width: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: 66px minmax(0, 1fr);
}

.topbar {
  position: relative;
  z-index: 2;
  min-width: 0;
  border-bottom: 1px solid var(--nx-line);
  background: color-mix(in srgb, var(--nx-canvas) 70%, var(--nx-surface) 30%);
}

.topbar j-toolbar {
  min-height: 66px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.global-search {
  width: min(480px, 46vw);
  min-height: 40px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  border: 1px solid var(--nx-line);
  border-radius: 999px;
  color: var(--nx-faint);
  background: var(--nx-surface);
  box-shadow: var(--nx-shadow-1);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.global-search:hover {
  border-color: var(--nx-accent);
}

.global-search > j-icon {
  flex: 0 0 auto;
  font-size: 19px;
}

.search-placeholder {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search .j-field__label,
.global-search label {
  display: none;
}

.global-search .j-input,
.global-search input,
j-input.global-search {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--nx-ink);
  background: var(--nx-surface);
}

.global-search:focus-within {
  border-color: var(--nx-accent);
  box-shadow: 0 0 0 4px var(--nx-accent-soft);
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 8px;
}

.mobile-brand .brand-envelope {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: var(--nx-accent-ink);
  background: linear-gradient(140deg, var(--nx-accent), var(--nx-accent-strong));
}

.mail-pages {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.inbox-page,
.directory-page {
  height: calc(100vh - 66px);
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(340px, 40%) minmax(0, 1fr);
}

.message-column,
.contacts-list {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border-right: 1px solid var(--nx-line);
  background: transparent;
}

.panel-head,
.compose-head {
  min-height: 76px;
  padding: 20px 20px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2,
.compose-head h2,
.settings-head h2 {
  font-size: 24px;
  line-height: 30px;
}

.panel-head h2 span {
  color: var(--nx-faint);
  font-family: var(--nx-font-ui);
  font-size: 12px;
  font-weight: 500;
}

.panel-actions,
.reader-primary-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.filter-row {
  padding: 6px 20px 14px;
  display: flex;
  gap: 7px;
}

.filter-chip {
  min-height: 28px;
  padding: 0 13px;
  border: 1px solid var(--nx-line);
  border-radius: 999px;
  color: var(--nx-muted);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.filter-chip:hover {
  border-color: var(--nx-accent);
  color: var(--nx-accent-strong);
}

.filter-chip--active,
.filter-chip--active:hover {
  border-color: var(--nx-ink);
  color: var(--nx-canvas);
  background: var(--nx-ink);
}

.message-scroll,
.reader-scroll {
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--nx-line) transparent;
}

.message-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  align-content: start;
  padding: 2px 12px 12px;
}

.message-link {
  position: relative;
  display: block;
  min-width: 0;
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.message-link:hover {
  background: var(--nx-surface);
  box-shadow: var(--nx-shadow-1);
}

.message-link--selected,
.message-link--selected:hover {
  background: var(--nx-surface);
  box-shadow: var(--nx-shadow-1),
    inset 0 0 0 1px color-mix(in srgb, var(--nx-accent) 35%, transparent);
}

.message-link--selected::before {
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background: var(--nx-accent);
  content: "";
}

.message-row {
  min-height: 104px;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.message-avatar {
  position: relative;
  flex: 0 0 auto;
}

.avatar,
.sender-avatar,
.quick-avatar,
.contact-hero-avatar {
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #4d5b6b;
  background: #e4e8ed;
  font-weight: 750;
}

.message-avatar .avatar {
  width: 40px;
  height: 40px;
  font-size: 11.5px;
}

.avatar--violet { color: #5b4694; background: #ece5fa; }
.avatar--blue { color: #23649a; background: #dcebf9; }
.avatar--green { color: #2e6f52; background: #ddf0e6; }
.avatar--amber { color: #8c6023; background: #f7ead4; }
.avatar--rose { color: #97485c; background: #f8e1e7; }
.avatar--slate { color: #4d5b6b; background: #e4e8ed; }

[data-theme="dark"] .avatar--violet { color: #cabcf4; background: #322a52; }
[data-theme="dark"] .avatar--blue { color: #9cc8ef; background: #1e3550; }
[data-theme="dark"] .avatar--green { color: #93d9b9; background: #1c3d2e; }
[data-theme="dark"] .avatar--amber { color: #ebc78a; background: #45351a; }
[data-theme="dark"] .avatar--rose { color: #f0aec0; background: #472633; }
[data-theme="dark"] .avatar--slate,
[data-theme="dark"] .avatar,
[data-theme="dark"] .sender-avatar,
[data-theme="dark"] .quick-avatar,
[data-theme="dark"] .contact-hero-avatar { color: #b6c2cf; background: #2c3542; }

.online-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 11px;
  height: 11px;
  border: 2.5px solid var(--nx-canvas);
  border-radius: 50%;
  background: var(--nx-ok);
}

.message-link:hover .online-dot,
.message-link--selected .online-dot {
  border-color: var(--nx-surface);
}

.message-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.message-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
}

.message-meta strong {
  min-width: 0;
  overflow: hidden;
  color: var(--nx-ink);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-row--unread .message-meta strong,
.message-row--unread .message-subject {
  font-weight: 750;
}

.message-row--unread .message-meta time {
  color: var(--nx-accent);
  font-weight: 700;
}

.message-meta time,
.sender-card time {
  flex: 0 0 auto;
  color: var(--nx-faint);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.message-subject,
.message-preview {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-subject {
  color: var(--nx-ink);
  font-size: 12.5px;
  font-weight: 500;
}

.message-preview {
  margin-top: 3px;
  color: var(--nx-muted);
  font-size: 11.5px;
}

.message-tags {
  min-height: 20px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tag,
.tiny-chip {
  min-height: 18px;
  padding: 0 8px;
  align-items: center;
  border-radius: 6px;
  color: var(--nx-accent-strong);
  background: var(--nx-accent-soft);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tag--green { color: #2e6f52; background: #ddf0e6; }
.tag--amber { color: #8c6023; background: #f7ead4; }
.tag--rose { color: #97485c; background: #f8e1e7; }

[data-theme="dark"] .tag--green { color: #93d9b9; background: #1c3d2e; }
[data-theme="dark"] .tag--amber { color: #ebc78a; background: #45351a; }
[data-theme="dark"] .tag--rose { color: #f0aec0; background: #472633; }

.attachment {
  color: var(--nx-faint);
  font-size: 15px;
}

.list-footer {
  min-height: 47px;
  padding: 0 15px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--nx-line);
  color: var(--nx-faint);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.list-footer div {
  display: flex;
}

.pager-action[disabled] {
  opacity: 0.35;
  pointer-events: none;
}

.reader-column {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: transparent;
}

.reader-toolbar {
  min-height: 58px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--nx-line);
  background: transparent;
}

.reader-action,
.attachment-button,
.outline-button {
  min-height: 36px;
  padding: 0 15px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--nx-line);
  border-radius: 12px;
  color: var(--nx-muted);
  background: var(--nx-surface);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.reader-action:hover,
.attachment-button:hover,
.outline-button:hover {
  border-color: var(--nx-accent);
  color: var(--nx-accent-strong);
}

.reader-action--primary,
.reader-action--primary:hover {
  border-color: transparent;
  color: var(--nx-accent-ink);
  background: linear-gradient(140deg, var(--nx-accent), var(--nx-accent-strong));
  box-shadow: 0 8px 18px var(--nx-accent-glow);
}

.reader-action--primary:hover {
  transform: translateY(-1px);
}

.reader-scroll {
  padding: 26px clamp(20px, 3vw, 44px) 44px;
}

.reader-content {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 40px clamp(28px, 4vw, 56px) 44px;
  border: 1px solid var(--nx-line-soft);
  border-radius: 20px;
  background: var(--nx-surface);
  box-shadow: var(--nx-shadow-1);
}

.reader-content--wide {
  width: min(900px, 100%);
}

.subject-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.subject-row h2 {
  margin-top: 4px;
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 440;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.star-action,
.message-star {
  color: var(--nx-star);
}

.star-action:hover {
  color: var(--nx-star);
  background: var(--nx-accent-soft);
}

.sender-card {
  margin-top: 26px;
  padding-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid var(--nx-line-soft);
}

.sender-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  font-size: 12px;
}

.sender-details {
  min-width: 0;
  flex: 1 1 auto;
}

.sender-details > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.sender-details strong {
  font-size: 13px;
}

.sender-details span,
.sender-details p {
  color: var(--nx-faint);
  font-size: 11px;
}

.sender-details p {
  margin: 3px 0 0;
}

.tiny-chip {
  margin-left: 3px;
  border-radius: 999px;
  font-style: normal;
}

.message-body {
  max-width: 66ch;
  padding: 26px 0 8px;
  color: var(--nx-ink);
  font-size: 14px;
  line-height: 1.75;
}

.message-body p {
  margin: 0 0 16px;
}

.message-body blockquote {
  margin: 26px 0;
  padding: 18px 24px;
  border-left: 3px solid var(--nx-accent);
  border-radius: 4px 16px 16px 4px;
  color: var(--nx-ink);
  background: var(--nx-accent-soft);
  font-family: var(--nx-font-display);
  font-size: 17px;
  font-style: italic;
  line-height: 1.5;
}

.attachment-card {
  max-width: 500px;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  border: 1px solid var(--nx-line);
  border-radius: 16px;
  background: var(--nx-surface-soft);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.attachment-card:hover {
  border-color: var(--nx-accent);
  box-shadow: var(--nx-shadow-1);
}

.attachment-icon {
  width: 46px;
  height: 46px;
  margin-left: 11px;
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  border-radius: 13px;
  color: #c2452d;
  background: #fae7e3;
}

[data-theme="dark"] .attachment-icon {
  color: #f3a08e;
  background: #46231c;
}

.attachment-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 3px;
}

.attachment-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-copy span {
  color: var(--nx-faint);
  font-size: 10.5px;
}

.attachment-card j-card-actions {
  padding: 0 9px;
  display: flex;
  gap: 2px;
}

.quick-reply {
  max-width: 620px;
  margin-top: 30px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--nx-line);
  border-radius: 999px;
  background: var(--nx-surface);
  box-shadow: var(--nx-shadow-1);
}

.quick-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  font-size: 9.5px;
}

.quick-reply-button {
  min-height: 32px;
  flex: 1 1 auto;
  justify-content: flex-start;
  border: 0;
  color: var(--nx-faint);
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: text;
  text-decoration: none;
}

.single-page,
.compose-page,
.settings-page {
  height: calc(100vh - 66px);
  min-width: 0;
  overflow: auto;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: var(--nx-line) transparent;
}

.reader-column--single {
  min-height: 100%;
}

.compose-page {
  padding: 26px;
}

.compose-panel {
  width: min(940px, 100%);
  min-height: calc(100vh - 118px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--nx-line-soft);
  border-radius: 20px;
  background: var(--nx-surface);
  box-shadow: var(--nx-shadow-1);
}

.compose-head {
  border-bottom: 1px solid var(--nx-line-soft);
}

.compose-form {
  position: relative;
  padding: 20px 26px 24px;
  display: grid;
  gap: 12px;
}

.compose-field,
.compose-body,
.compose-attachment {
  width: 100%;
}

.compose-field,
.compose-body,
.compose-attachment,
.compose-field input,
.compose-body textarea {
  width: 100%;
}

.recipient-links {
  position: absolute;
  top: 16px;
  right: 28px;
  display: flex;
  gap: 2px;
}

.text-action {
  min-height: 28px;
  padding: 0 7px;
  border: 0;
  color: var(--nx-accent-strong);
  background: transparent;
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}

.editor-toolbar {
  min-height: 44px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 1px;
  border: 1.5px solid var(--nx-line);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: var(--nx-surface-soft);
}

.editor-action {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 9px;
}

.editor-toolbar j-separator {
  width: 1px;
  height: 22px;
  margin: 0 6px;
  background: var(--nx-line);
}

.compose-body {
  margin-top: -12px;
}

.compose-body .j-field__label {
  display: none;
}

.compose-body textarea {
  min-height: 300px;
  resize: vertical;
  border-radius: 0 0 14px 14px;
}

.compose-footer {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.draft-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--nx-faint);
  font-size: 10.5px;
}

.draft-status j-icon {
  color: var(--nx-ok);
  font-size: 17px;
}

.directory-page {
  grid-template-columns: minmax(300px, 35%) minmax(0, 1fr);
}

.contacts-list {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.contact-search {
  padding: 0 18px 14px;
}

.contact-search input,
j-input.contact-search {
  border: 1px solid var(--nx-line);
  border-radius: 999px;
  background: var(--nx-surface);
}

.contact-items {
  overflow: auto;
  padding: 2px 12px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: var(--nx-line) transparent;
}

.contact-row {
  min-height: 64px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.contact-row:hover {
  background: var(--nx-surface);
  box-shadow: var(--nx-shadow-1);
}

.contact-row--active,
.contact-row--active:hover {
  background: var(--nx-surface);
  box-shadow: var(--nx-shadow-1),
    inset 0 0 0 1px color-mix(in srgb, var(--nx-accent) 35%, transparent);
}

.contact-avatar {
  flex: 0 0 auto;
}

.contact-avatar .avatar {
  width: 40px;
  height: 40px;
  font-size: 11px;
}

.contact-row > j-item-section:nth-child(2) {
  min-width: 0;
  flex: 1 1 auto;
}

.contact-name,
.contact-email {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-name {
  font-size: 12.5px;
  font-weight: 650;
}

.contact-email {
  margin-top: 3px;
  color: var(--nx-faint);
  font-size: 10.5px;
}

.contact-favorite {
  color: var(--nx-star);
}

.contact-detail {
  padding: clamp(26px, 5vw, 64px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--nx-line) transparent;
}

.contact-hero {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-bottom: 28px;
}

.contact-hero-avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 20px;
  font-size: 18px;
}

.contact-hero h2 {
  font-size: 27px;
}

.contact-hero p,
.settings-head p,
.settings-card-head p {
  margin: 5px 0 0;
  color: var(--nx-muted);
  font-size: 11.5px;
}

.detail-card,
.settings-card {
  border: 1px solid var(--nx-line-soft);
  border-radius: 18px;
  background: var(--nx-surface);
  box-shadow: var(--nx-shadow-1);
}

.detail-card + .detail-card {
  margin-top: 15px;
}

.detail-card > j-card-section {
  padding: 20px;
}

.detail-line {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 0;
}

.detail-line j-icon {
  color: var(--nx-accent);
}

.detail-line div {
  display: grid;
  gap: 2px;
}

.detail-line span,
.conversation-link span {
  color: var(--nx-faint);
  font-size: 9.5px;
}

.detail-line strong,
.conversation-link strong {
  font-size: 11.5px;
}

.conversation-link {
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.conversation-link + .conversation-link {
  border-top: 1px solid var(--nx-line-soft);
}

.conversation-link div {
  display: grid;
  gap: 3px;
}

.settings-page {
  padding: 30px clamp(24px, 4vw, 52px) 60px;
}

.settings-head {
  max-width: 1040px;
  margin: 0 auto 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.settings-grid {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-card {
  overflow: hidden;
}

.settings-card-head {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid var(--nx-line-soft);
}

.settings-card-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}

.settings-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: 12px;
  color: var(--nx-accent-strong);
  background: var(--nx-accent-soft);
}

.settings-icon--green { color: #2e6f52; background: #ddf0e6; }
.settings-icon--amber { color: #8c6023; background: #f7ead4; }
.settings-icon--violet { color: #5b4694; background: #ece5fa; }

[data-theme="dark"] .settings-icon--green { color: #93d9b9; background: #1c3d2e; }
[data-theme="dark"] .settings-icon--amber { color: #ebc78a; background: #45351a; }
[data-theme="dark"] .settings-icon--violet { color: #cabcf4; background: #322a52; }

.settings-options {
  padding: 6px 20px 14px;
}

.setting-row,
.account-status {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.setting-row + .setting-row {
  border-top: 1px solid var(--nx-line-soft);
}

.setting-row div,
.account-status div {
  display: grid;
  gap: 4px;
}

.setting-row strong,
.account-status strong {
  font-size: 11.5px;
}

.setting-row span,
.account-status span {
  color: var(--nx-faint);
  font-size: 9.5px;
}

/* Theme the framework j-toggle (track = ::before, thumb = ::after). */
.setting-row j-toggle {
  position: relative;
  flex: 0 0 auto;
  min-height: 24px;
  align-items: center;
  cursor: pointer;
}

j-toggle.j-toggle::before,
.setting-row j-toggle::before {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--nx-line);
  background: var(--nx-line);
  content: "";
  transition: background 200ms ease, border-color 200ms ease;
}

j-toggle.j-toggle::after,
.setting-row j-toggle::after {
  position: absolute;
  left: 4px;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  content: "";
  transform: translateY(-50%);
  transition: transform 200ms ease, background 200ms ease;
}

j-toggle.j-toggle[aria-checked="true"]::before,
j-toggle.j-toggle.j-toggle--checked::before,
.setting-row j-toggle[checked]::before {
  background: var(--nx-accent);
  border-color: var(--nx-accent);
}

j-toggle.j-toggle[aria-checked="true"]::after,
j-toggle.j-toggle.j-toggle--checked::after,
.setting-row j-toggle[checked]::after {
  transform: translate(17px, -50%);
  background: #ffffff;
}

j-toggle.j-toggle[aria-checked="false"]::before {
  background: var(--nx-line);
  border-color: var(--nx-line);
}

j-toggle.j-toggle[aria-checked="false"]::after {
  transform: translateY(-50%);
}

j-toggle.j-toggle:focus-visible {
  outline: 2px solid var(--nx-accent);
  outline-offset: 2px;
  border-radius: 999px;
}

label.j-toggle .j-toggle__track {
  width: 42px;
  height: 24px;
  border: 1px solid var(--nx-line);
  background: var(--nx-line);
}

label.j-toggle .j-toggle__thumb {
  width: 18px;
  height: 18px;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

label.j-toggle .j-toggle__input:checked + .j-toggle__track {
  background: var(--nx-accent);
  border-color: var(--nx-accent);
}

label.j-toggle .j-toggle__input:checked + .j-toggle__track .j-toggle__thumb {
  transform: translateX(18px);
  background: #ffffff;
}

.theme-choices {
  padding: 13px 0 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.theme-choice {
  min-height: 68px;
  padding: 8px;
  display: grid;
  place-items: center;
  gap: 5px;
  border: 1px solid var(--nx-line);
  border-radius: 12px;
  color: var(--nx-muted);
  background: transparent;
  font: inherit;
  font-size: 9.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.theme-choice:hover {
  border-color: var(--nx-accent);
  color: var(--nx-accent-strong);
}

.theme-choice--active {
  border-color: var(--nx-accent);
  color: var(--nx-accent-strong);
  box-shadow: 0 0 0 4px var(--nx-accent-soft);
}

.theme-swatch {
  width: 43px;
  height: 28px;
  display: block;
  border: 1px solid var(--nx-line);
  border-radius: 7px;
  background: linear-gradient(90deg, #eceaf5 30%, #ffffff 30%);
}

.theme-swatch--dark {
  border-color: #33364a;
  background: linear-gradient(90deg, #0e0f17 30%, #1c1e2b 30%);
}

.theme-swatch--auto {
  background: linear-gradient(135deg, #ffffff 50%, #1c1e2b 50%);
}

.account-status {
  justify-content: flex-start;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--nx-ok);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--nx-ok) 14%, transparent);
}

.outline-button {
  margin: 5px 0;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(400px, 47%) minmax(480px, 53%);
  background:
    radial-gradient(900px 500px at 88% -10%, var(--nx-accent-soft), transparent 60%),
    var(--nx-canvas);
}

.login-story {
  position: relative;
  min-height: 100vh;
  padding: 40px clamp(36px, 5vw, 78px) 38px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #eceaf6;
  background: var(--nx-rail);
}

.login-story::before,
.login-story::after {
  position: absolute;
  content: "";
}

.login-story::before {
  width: 640px;
  height: 640px;
  right: -220px;
  top: -260px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--nx-accent-glow), transparent 65%);
  filter: blur(10px);
}

.login-story::after {
  width: 320px;
  height: 320px;
  left: -180px;
  bottom: -80px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.login-brand,
.login-mobile-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #ffffff;
  text-decoration: none;
}

.login-brand strong,
.login-mobile-brand strong {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.login-brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--nx-accent-ink);
  background: linear-gradient(140deg, var(--nx-accent), var(--nx-accent-strong));
  box-shadow: 0 10px 24px var(--nx-accent-glow);
}

.login-brand-mark j-icon {
  font-size: 22px;
}

.login-story-copy {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  margin: auto 0;
  padding: 50px 0 38px;
}

.login-kicker {
  min-height: 30px;
  padding: 0 13px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #cfcde6;
  background: rgba(255, 255, 255, 0.05);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nx-ok);
  box-shadow: 0 0 0 4px rgba(47, 158, 110, 0.15);
}

.login-story h1 {
  margin: 22px 0 16px;
  color: #ffffff;
  font-family: var(--nx-font-display);
  font-size: clamp(44px, 4.6vw, 64px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.login-story h1 em {
  color: color-mix(in srgb, #ffffff 40%, var(--nx-accent));
  font-style: italic;
}

.login-story-copy > p {
  max-width: 42ch;
  margin: 0;
  color: #b7b3cf;
  font-size: 14.5px;
  line-height: 1.7;
}

.login-benefits {
  margin-top: 30px;
  display: grid;
  gap: 14px;
}

.login-benefits > div {
  display: flex;
  align-items: center;
  gap: 13px;
}

.login-benefits > div > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: color-mix(in srgb, #ffffff 45%, var(--nx-accent));
  background: rgba(255, 255, 255, 0.07);
}

.login-benefits j-icon {
  font-size: 19px;
}

.login-benefits p {
  margin: 0;
  display: grid;
  gap: 3px;
}

.login-benefits strong {
  color: #eceaf6;
  font-size: 12.5px;
}

.login-benefits small {
  color: #a09cbb;
  font-size: 11px;
}

.login-quote {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 22px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.login-quote > p {
  margin: 0 0 14px;
  color: #d9d6ea;
  font-family: var(--nx-font-display);
  font-size: 16px;
  font-style: italic;
  line-height: 1.5;
}

.login-quote footer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quote-avatar {
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #5b4694;
  background: #ece5fa;
  font-size: 10px;
  font-weight: 750;
}

.login-quote footer span {
  display: grid;
  gap: 2px;
}

.login-quote footer strong {
  color: #eceaf6;
  font-size: 12px;
}

.login-quote footer small {
  color: #a09cbb;
  font-size: 10.5px;
}

.login-form-panel {
  min-height: 100vh;
  padding: 38px clamp(36px, 7vw, 110px) 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: transparent;
}

.login-mobile-brand {
  display: none;
  margin-bottom: 26px;
  color: var(--nx-ink);
}

.login-card {
  width: min(470px, 100%);
  margin: auto;
  overflow: hidden;
  border: 1px solid var(--nx-line-soft);
  border-radius: 24px;
  background: var(--nx-surface);
  box-shadow: var(--nx-shadow-2);
}

.login-card > j-card-section {
  padding: 0 34px 30px;
}

.login-card > .login-card-head {
  padding: 32px 34px 20px;
}

.login-card-head h2 {
  margin: 4px 0 0;
  color: var(--nx-ink);
  font-family: var(--nx-font-display);
  font-size: 27px;
  font-weight: 460;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.login-card-head > p:last-child {
  margin: 8px 0 0;
  color: var(--nx-muted);
  font-size: 12.5px;
}

.login-alert {
  min-height: 42px;
  margin-bottom: 13px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid color-mix(in srgb, var(--nx-danger) 28%, transparent);
  border-radius: 12px;
  color: var(--nx-danger);
  background: color-mix(in srgb, var(--nx-danger) 10%, transparent);
  font-size: 11px;
  font-weight: 600;
}

.login-alert j-icon {
  font-size: 18px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-field {
  width: 100%;
}

.login-options {
  margin-top: -2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-options j-checkbox {
  color: var(--nx-muted);
  font-size: 11.5px;
}

.forgot-link {
  min-height: 28px;
  padding: 0;
  border: 0;
  color: var(--nx-accent-strong);
  background: transparent;
  font: inherit;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}

.login-submit {
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 15px;
  color: var(--nx-accent-ink);
  background: linear-gradient(140deg, var(--nx-accent), var(--nx-accent-strong));
  box-shadow: 0 14px 30px var(--nx-accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease;
}

.login-submit:hover {
  transform: translateY(-1px);
}

.login-submit j-icon {
  font-size: 17px;
}

.login-divider {
  margin: 20px 0 14px;
  display: grid;
  grid-template-columns: minmax(20px, 1fr) auto minmax(20px, 1fr);
  align-items: center;
  gap: 12px;
  color: var(--nx-faint);
  font-size: 10.5px;
}

.login-divider j-separator {
  height: 1px;
  background: var(--nx-line);
}

.login-alternatives {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 10px;
}

.login-alt-button {
  min-height: 42px;
  padding: 0 13px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--nx-line);
  border-radius: 13px;
  color: var(--nx-muted);
  background: var(--nx-surface);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}

.login-alt-button:hover {
  border-color: var(--nx-accent);
  color: var(--nx-accent-strong);
}

.login-alt-button--icon {
  width: 52px;
  padding: 0;
}

.provider-mark {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  color: var(--nx-accent-ink);
  background: var(--nx-accent);
  font-size: 9px;
  font-weight: 700;
}

.login-card > .login-demo-note {
  padding: 15px 34px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border-top: 1px solid var(--nx-line-soft);
  background: var(--nx-surface-soft);
}

.login-demo-note > j-icon {
  color: var(--nx-accent);
  font-size: 18px;
}

.login-demo-note p {
  margin: 0;
  display: grid;
  gap: 3px;
}

.login-demo-note strong {
  color: var(--nx-ink);
  font-size: 10.5px;
}

.login-demo-note span {
  color: var(--nx-muted);
  font-size: 10px;
  line-height: 1.55;
}

.login-demo-note code {
  padding: 1px 6px;
  border-radius: 6px;
  color: var(--nx-accent-strong);
  background: var(--nx-accent-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
}

.login-legal {
  width: min(470px, 100%);
  margin: 20px auto 0;
  display: flex;
  justify-content: center;
  gap: 16px;
  color: var(--nx-faint);
  font-size: 9.5px;
}

.login-legal a {
  color: inherit;
  text-decoration: none;
}

/* Runtime toast notifications — !important beats the runtime-injected sheet. */
.jv-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1400;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 46px;
  max-width: min(380px, calc(100vw - 40px));
  padding: 11px 13px !important;
  border: 1px solid var(--nx-line) !important;
  border-radius: 15px !important;
  background: var(--nx-surface) !important;
  color: var(--nx-ink) !important;
  font: 600 12.5px/1.45 var(--nx-font-ui) !important;
  box-shadow: var(--nx-shadow-2) !important;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 250ms ease, transform 250ms ease;
}

.jv-toast--in {
  opacity: 1;
  transform: none;
}

.jv-toast--out {
  opacity: 0;
  transform: translateY(10px);
}

.jv-toast__icon {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: grid;
  place-items: center;
  border-radius: 50% !important;
  color: var(--nx-accent-strong) !important;
  background: var(--nx-accent-soft) !important;
  font-size: 14px;
}

.jv-toast--success .jv-toast__icon {
  color: var(--nx-ok) !important;
  background: color-mix(in srgb, var(--nx-ok) 14%, transparent) !important;
}

.jv-toast--error .jv-toast__icon,
.jv-toast--warning .jv-toast__icon {
  color: var(--nx-danger) !important;
  background: color-mix(in srgb, var(--nx-danger) 12%, transparent) !important;
}

.jv-toast__msg {
  flex: 1 1 auto;
  min-width: 0;
}

.jv-toast__close {
  flex: 0 0 auto;
  border: 0;
  padding: 4px 8px;
  border-radius: 9px;
  color: var(--nx-faint);
  background: transparent;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.jv-toast__close:hover {
  color: var(--nx-accent-strong);
  background: var(--nx-accent-soft);
}

.starter-not-found {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--nx-canvas);
}

.starter-not-found__content {
  text-align: center;
}

.starter-not-found__content h1 {
  margin: 0;
  color: var(--nx-accent);
  font-family: var(--nx-font-display);
  font-size: 88px;
  font-weight: 420;
}

.starter-not-found__content .j-button {
  min-height: 42px;
  padding: 0 20px;
  align-items: center;
  border-radius: 13px;
  color: var(--nx-accent-ink);
  background: linear-gradient(140deg, var(--nx-accent), var(--nx-accent-strong));
  box-shadow: 0 10px 22px var(--nx-accent-glow);
  text-decoration: none;
}

@media (max-width: 1100px) {
  .mail-shell {
    grid-template-columns: 68px 216px minmax(0, 1fr);
  }

  .app-rail {
    padding-inline: 6px;
  }

  .folder-drawer {
    padding-inline: 12px;
  }

  .inbox-page {
    grid-template-columns: minmax(320px, 48%) minmax(0, 1fr);
  }

  .reader-scroll {
    padding-inline: 18px;
  }

  .reader-content {
    padding-inline: 30px;
  }

  .sender-details > div {
    display: grid;
    gap: 2px;
  }
}

@media (max-width: 860px) {
  .mail-shell {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .folder-drawer {
    display: none;
  }

  .inbox-page {
    grid-template-columns: minmax(300px, 44%) minmax(0, 1fr);
  }

  .reader-toolbar {
    padding-inline: 14px;
  }

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

  .login-page {
    grid-template-columns: minmax(330px, 42%) minmax(430px, 58%);
  }

  .login-story {
    padding-inline: 34px;
  }

  .login-story h1 {
    font-size: 44px;
  }

  .login-form-panel {
    padding-inline: 38px;
  }
}

@media (max-width: 680px) {
  html,
  body {
    overflow: auto;
  }

  .mail-shell {
    display: block;
  }

  .app-rail {
    position: fixed;
    inset: auto 0 0;
    z-index: 20;
    width: 100%;
    max-width: 100vw;
    height: 62px;
    padding: 5px 14px;
    flex-direction: row;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .brand-mark,
  .rail-theme,
  .rail-avatar,
  .app-rail > j-space {
    display: none;
  }

  .rail-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .rail-link {
    min-height: 50px;
    padding: 4px;
    border-radius: 12px;
  }

  .workspace {
    height: auto;
    min-height: 100vh;
    padding-bottom: 62px;
  }

  .topbar j-toolbar {
    padding-inline: 13px;
  }

  .mobile-brand {
    display: flex;
  }

  .global-search {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
  }

  .topbar-action:last-child {
    display: none;
  }

  .inbox-page,
  .directory-page {
    height: calc(100vh - 128px);
    display: block;
    overflow: auto;
  }

  .message-column,
  .contacts-list {
    min-height: 100%;
    border-right: 0;
  }

  .inbox-page .reader-column,
  .directory-page .contact-detail {
    display: none;
  }

  .single-page,
  .compose-page,
  .settings-page {
    height: auto;
    min-height: calc(100vh - 128px);
  }

  .reader-scroll {
    padding: 14px 12px 32px;
  }

  .reader-content--wide {
    width: 100%;
  }

  .reader-content {
    padding: 24px 19px 40px;
    border-radius: 16px;
  }

  .reader-action:not(.reader-action--primary) {
    padding: 0 9px;
  }

  .subject-row h2 {
    font-size: 24px;
  }

  .sender-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .sender-card time {
    width: 100%;
    padding-left: 57px;
  }

  .compose-page,
  .settings-page {
    padding: 13px;
  }

  .compose-panel {
    min-height: auto;
    border-radius: 16px;
  }

  .compose-form {
    padding-inline: 15px;
  }

  .compose-body textarea {
    min-height: 230px;
  }

  .draft-status {
    display: none;
  }

  .settings-head {
    align-items: flex-start;
  }

  .save-settings {
    min-height: 40px;
    padding: 0 13px;
    font-size: 11.5px;
  }

  .theme-choices {
    grid-template-columns: repeat(3, minmax(72px, 1fr));
  }

  .login-page {
    min-height: 100vh;
    display: block;
  }

  .login-story {
    display: none;
  }

  .login-form-panel {
    min-height: 100vh;
    padding: 28px 18px 22px;
  }

  .login-mobile-brand {
    display: flex;
  }

  .login-card {
    margin: 0 auto;
    border-radius: 18px;
  }

  .login-card > j-card-section {
    padding-inline: 23px;
  }

  .login-card > .login-card-head {
    padding: 27px 23px 18px;
  }

  .login-card > .login-demo-note {
    padding: 13px 23px;
  }
}

@media (max-width: 420px) {
  .mobile-brand strong,
  .topbar-action {
    display: none;
  }

  .panel-head {
    padding-inline: 14px;
  }

  .filter-row {
    padding-inline: 14px;
    overflow-x: auto;
  }

  .message-list {
    padding-inline: 8px;
  }

  .message-row {
    padding-inline: 12px;
  }

  .reader-toolbar .reader-primary-actions .icon-action {
    display: none;
  }

  .attachment-card {
    gap: 6px;
  }
}
