:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #121821;
  --panel-strong: #17202b;
  --panel-soft: #101722;
  --line: #263243;
  --line-soft: rgba(148, 163, 184, 0.18);
  --text: #eef3f8;
  --muted: #95a3b8;
  --cyan: #43c6e8;
  --green: #48d597;
  --amber: #f3bd47;
  --red: #f46d75;
  --violet: #b690ff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(67, 198, 232, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(246, 184, 83, 0.05) 1px, transparent 1px),
    var(--bg);
  background-size: 46px 46px;
  color: var(--text);
}

body.public-page,
body.login-page {
  background:
    radial-gradient(circle at 28% 18%, rgba(67, 198, 232, 0.08), transparent 30%),
    linear-gradient(135deg, #111827, #050608 70%);
}

body.public-page[data-theme="light"] {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-strong: #eef2f7;
  --panel-soft: #f7f9fc;
  --line: #d8e0ea;
  --line-soft: rgba(30, 41, 59, 0.13);
  --text: #101827;
  --muted: #64748b;
  background: #eef2f7;
  color: var(--text);
}

body.private-mail-page {
  overflow: hidden;
  background: #111019;
  color: #f7f4ff;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: rgba(13, 17, 23, 0.93);
  backdrop-filter: blur(14px);
}

.brand,
.topbar,
.section-head,
.domain-pill,
.admin-auth,
.toolbar,
.ticket-filters,
.ticket-form,
.delivery-column-head,
.delivery-ticket-meta,
.delivery-ticket-labels,
.ticket-card-actions,
.password-cell {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  margin-bottom: 30px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(67, 198, 232, 0.42);
  border-radius: 8px;
  background: #122330;
  color: var(--cyan);
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.eyebrow,
.domain-pill span,
.metric span,
.delivery-ticket-files {
  color: var(--muted);
  font-size: 0.78rem;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0 12px;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--text);
}

.workspace {
  width: min(1540px, 100%);
  padding: 24px;
}

.topbar {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.15rem;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.domain-pill {
  gap: 10px;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-auth {
  gap: 8px;
  min-height: 46px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-auth input {
  width: 150px;
  min-height: 34px;
}

.admin-auth button {
  min-height: 34px;
}

.admin-auth span {
  min-width: 70px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-auth span[data-tone="success"] {
  color: var(--green);
}

.admin-auth span[data-tone="error"] {
  color: var(--red);
}

.admin-auth.is-session {
  padding: 0 12px;
}

.page {
  display: none;
}

.page.is-active {
  display: block;
}

.stats-grid,
.ticket-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stats-grid {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.metric,
.tool-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 33, 0.92);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 94px;
  padding: 16px;
}

.metric strong {
  display: block;
  max-width: 100%;
  margin-top: 10px;
  overflow: hidden;
  color: var(--text);
  font-size: 1.5rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(280px, 1fr);
  gap: 16px;
  align-items: start;
}

.tool-panel {
  padding: 18px;
}

.section-head {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1119;
  color: var(--text);
  outline: none;
  padding: 0 12px;
}

textarea {
  min-height: 86px;
  resize: vertical;
  padding: 10px 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(67, 198, 232, 0.75);
  box-shadow: 0 0 0 3px rgba(67, 198, 232, 0.12);
}

.address-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1119;
}

.address-field:has(input:only-child) {
  grid-template-columns: minmax(0, 1fr);
}

.address-field:focus-within {
  border-color: rgba(67, 198, 232, 0.75);
  box-shadow: 0 0 0 3px rgba(67, 198, 232, 0.12);
}

.address-field input {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.address-field span {
  padding-right: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.primary-button,
.secondary-button,
.danger-button,
.mini-button,
.delivery-new-item {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 700;
}

.primary-button {
  background: var(--cyan);
  color: #041016;
}

.secondary-button,
.mini-button,
.delivery-new-item {
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--text);
}

.danger-button {
  background: var(--red);
  color: #160406;
}

.mini-button {
  min-height: 34px;
  margin-right: 4px;
}

.form-status {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--muted);
}

.form-status[data-tone="success"] {
  color: var(--green);
}

.form-status[data-tone="error"] {
  color: var(--red);
}

.category-list {
  display: grid;
  gap: 10px;
}

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

.alias-examples span {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  color: #cfe9f4;
  padding: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.diagnostic-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 33, 0.92);
  box-shadow: var(--shadow);
  padding: 16px;
}

.diagnostic-list,
.diagnostic-events {
  display: grid;
  gap: 8px;
}

.diagnostic-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0e151f;
  padding: 8px 10px;
}

.diagnostic-row span,
.diagnostic-event span,
.diagnostic-event p {
  color: var(--muted);
  font-size: 0.84rem;
}

.diagnostic-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnostic-row[data-tone="success"] strong {
  color: var(--green);
}

.diagnostic-row[data-tone="error"] strong {
  color: var(--red);
}

.diagnostic-event {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--cyan);
  border-radius: 8px;
  background: #0e151f;
  padding: 10px 12px;
}

.diagnostic-event[data-status="blocked"],
.diagnostic-event[data-status="rate_limited"],
.diagnostic-event[data-status="rejected"] {
  border-left-color: var(--red);
}

.diagnostic-event[data-status="stored"] {
  border-left-color: var(--green);
}

.diagnostic-event p {
  margin: 0;
}

.private-mail-settings {
  margin-bottom: 16px;
}

.private-mail-settings-form {
  display: grid;
  gap: 12px;
}

.secondary-link {
  display: inline-grid;
  min-height: 38px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 0 14px;
  font-weight: 800;
  text-decoration: none;
}

.private-mail-mailbox-list {
  display: grid;
  max-height: 360px;
  overflow: auto;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b1119;
  padding: 10px;
}

.private-mail-mailbox-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0e151f;
  color: var(--text);
  padding: 8px 10px;
}

.private-mail-mailbox-row input {
  width: 18px;
  min-height: 18px;
}

.private-mail-mailbox-row span {
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.private-mail-mailbox-row small {
  color: var(--muted);
  white-space: nowrap;
}

.category-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
}

.category-row span {
  display: grid;
  min-width: 34px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: rgba(72, 213, 151, 0.14);
  color: var(--green);
  font-weight: 800;
}

.toolbar,
.ticket-filters,
.ticket-form {
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar input,
.toolbar select,
.ticket-filters input,
.ticket-filters select {
  width: min(240px, 100%);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 33, 0.92);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

td {
  color: #dce5ef;
}

tr:last-child td {
  border-bottom: 0;
}

code {
  color: var(--amber);
}

.password-cell {
  gap: 8px;
}

.status-badge,
.provider-badge,
.delivery-chip,
.label-chip {
  display: inline-grid;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.76rem;
  font-weight: 800;
}

.status-badge {
  background: rgba(72, 213, 151, 0.13);
  color: var(--green);
}

.status-badge.is-disabled {
  background: rgba(244, 109, 117, 0.13);
  color: var(--red);
}

.provider-badge {
  background: rgba(149, 163, 184, 0.13);
  color: var(--muted);
}

.provider-badge.is-provisioned {
  background: rgba(72, 213, 151, 0.13);
  color: var(--green);
}

.provider-badge.is-provider_error,
.provider-badge.is-provider_missing {
  background: rgba(244, 109, 117, 0.13);
  color: var(--red);
}

.action-cell {
  width: 98px;
  text-align: right;
  white-space: nowrap;
}

td.action-cell .icon-button + .icon-button {
  margin-left: 8px;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1119;
  color: var(--text);
}

.icon-button:hover {
  border-color: rgba(67, 198, 232, 0.68);
}

.icon-button.info:hover {
  color: var(--cyan);
}

.icon-button.danger:hover {
  border-color: rgba(244, 109, 117, 0.72);
  color: var(--red);
}

.trash-icon,
.copy-icon,
.dice-icon,
.detail-icon {
  position: relative;
  display: block;
  width: 17px;
  height: 17px;
}

.trash-icon::before {
  content: "";
  position: absolute;
  inset: 6px 3px 1px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 3px 3px;
}

.trash-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 3px;
  width: 13px;
  height: 2px;
  border-radius: 3px;
  background: currentColor;
  box-shadow: 4px -3px 0 -1px currentColor;
}

.copy-icon::before,
.copy-icon::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.copy-icon::before {
  left: 2px;
  top: 4px;
  opacity: 0.55;
}

.copy-icon::after {
  right: 1px;
  top: 1px;
  background: #0b1119;
}

.dice-icon {
  border: 2px solid currentColor;
  border-radius: 4px;
}

.dice-icon::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 7px 0 0 currentColor, 3.5px 7px 0 currentColor;
}

.detail-icon {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.detail-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}


.ticket-summary {
  margin-top: 4px;
}

.ticket-board-page {
  --ticket-compact-font: 0.82rem;
}

.tickets-titlebar {
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(67, 198, 232, 0.12), transparent 42%),
    rgba(18, 24, 33, 0.92);
  box-shadow: var(--shadow);
}

.ticket-overview {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) minmax(250px, 0.75fr);
  gap: 12px;
  margin-bottom: 10px;
}

.ticket-spotlight,
.ticket-progress-panel {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 33, 0.92);
  box-shadow: var(--shadow);
}

.ticket-spotlight {
  padding: 12px;
}

.ticket-spotlight > strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1rem, 1.4vw, 1.28rem);
  line-height: 1.15;
}

.ticket-spotlight p {
  max-width: 720px;
  margin: 8px 0 10px;
  color: #c3cfdd;
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ticket-spotlight-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ticket-progress-panel {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.ticket-progress-ring {
  --ticket-progress: 0;
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(67, 198, 232, 0.34);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #121821 0 56%, transparent 57%),
    conic-gradient(var(--cyan) calc(var(--ticket-progress) * 1%), rgba(67, 198, 232, 0.08) 0);
}

.ticket-progress-ring strong {
  font-size: 1.35rem;
}

.ticket-progress-ring span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ticket-breakdown {
  display: grid;
  gap: 6px;
}

.ticket-breakdown-row {
  display: grid;
  grid-template-columns: 78px minmax(42px, 1fr) 24px;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.74rem;
}

.ticket-breakdown-row i {
  display: block;
  min-width: 4px;
  height: 7px;
  border-radius: 999px;
  background: var(--cyan);
}

.ticket-breakdown-row strong {
  color: var(--text);
  text-align: right;
}

.ticket-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 130px minmax(120px, 180px) auto;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 33, 0.74);
}

.delivery-board-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(126px, 1fr));
  gap: 8px;
  overflow: visible;
}

.delivery-column {
  min-width: 0;
  min-height: 360px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(18, 24, 33, 0.74);
  padding: 6px;
}

.delivery-column[data-ticket-status="In Progress"] {
  border-color: rgba(243, 189, 71, 0.34);
}

.delivery-column[data-ticket-status="Review"] {
  border-color: rgba(67, 198, 232, 0.34);
}

.delivery-column[data-ticket-status="Blocked"] {
  border-color: rgba(244, 109, 117, 0.42);
}

.delivery-column[data-ticket-status="Done"] {
  border-color: rgba(72, 213, 151, 0.34);
}

.delivery-column-head {
  justify-content: space-between;
  min-height: 28px;
  padding: 0 3px 6px;
  font-size: 0.84rem;
}

.delivery-column-head span {
  display: grid;
  min-width: 24px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #0b1119;
  color: var(--muted);
}

.delivery-column-list {
  display: grid;
  gap: 6px;
}

.delivery-ticket-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0e151f;
  padding: 9px 9px 9px 11px;
}

.delivery-ticket-card::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 2px;
  border-radius: 999px;
  background: var(--muted);
}

.delivery-ticket-card[data-ticket-priority="High"]::before {
  background: var(--red);
}

.delivery-ticket-card[data-ticket-priority="Medium"]::before {
  background: var(--amber);
}

.delivery-ticket-card[data-ticket-priority="Low"]::before {
  background: var(--cyan);
}

.delivery-ticket-title {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  align-items: start;
}

.delivery-ticket-title span {
  display: inline-grid;
  min-height: 24px;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  background: rgba(182, 144, 255, 0.13);
  color: var(--violet);
  padding: 0 8px;
  font-size: 0.74rem;
  font-weight: 900;
}

.delivery-ticket-title strong {
  display: block;
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.28;
  font-size: 0.86rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.delivery-ticket-card p {
  display: -webkit-box;
  min-height: 0;
  margin: 7px 0;
  overflow: hidden;
  color: #bdc8d7;
  font-size: var(--ticket-compact-font);
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.delivery-ticket-meta,
.delivery-ticket-labels,
.ticket-card-actions {
  gap: 4px;
  flex-wrap: wrap;
}

.delivery-ticket-meta {
  max-height: 24px;
  overflow: hidden;
}

.delivery-ticket-labels {
  max-height: 23px;
  overflow: hidden;
}

.delivery-chip {
  background: rgba(67, 198, 232, 0.12);
  color: var(--cyan);
}

.priority-high {
  background: rgba(244, 109, 117, 0.12);
  color: var(--red);
}

.priority-medium {
  background: rgba(243, 189, 71, 0.13);
  color: var(--amber);
}

.priority-low {
  background: rgba(72, 213, 151, 0.12);
  color: var(--green);
}

.label-chip {
  border: 1px solid var(--line-soft);
  color: var(--muted);
}

.delivery-ticket-files {
  display: block;
  min-height: 18px;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
}

.ticket-card-actions {
  justify-content: space-between;
  margin-top: 8px;
}

.compact-select {
  min-height: 32px;
  max-width: calc(100% - 42px);
  padding: 0 7px;
}

.delivery-new-item {
  width: 100%;
  min-height: 34px;
  margin-top: 6px;
  color: var(--muted);
}

.empty-note,
.empty-table {
  color: var(--muted);
}

.signin-shell,
.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.signin-panel,
.login-panel {
  display: grid;
  width: min(448px, 100%);
  gap: 22px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(13, 13, 16, 0.92);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
  padding: 32px;
}

.signin-panel.is-hidden,
.public-inbox.is-hidden,
.mail-client.is-hidden {
  display: none;
}

.signin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.signin-brand strong,
.signin-brand span {
  display: block;
}

.signin-brand span,
.signin-panel p {
  color: #b8c2d4;
}

.signin-panel h1,
.login-panel h1 {
  margin: 0 0 4px;
  font-size: 1.9rem;
  line-height: 1;
}

.signin-panel p {
  margin: 0;
  font-size: 0.9rem;
}

.signin-panel label,
.login-panel label {
  margin: 0;
  color: #f3f7fb;
}

.signin-panel input,
.login-panel input {
  min-height: 50px;
  margin-top: 6px;
  border-color: rgba(255, 255, 255, 0.1);
  background: #191a1f;
  font-size: 1rem;
}

.signin-button {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, #5138ff, #af11f5);
  color: #fff;
  font-weight: 800;
}

.signin-button:hover {
  filter: brightness(1.08);
}

.public-inbox {
  width: min(920px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 33, 0.94);
  box-shadow: var(--shadow);
  padding: 18px;
}

.public-inbox-list {
  min-height: 220px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(11, 17, 25, 0.72);
}

.inbox-email-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0e151f;
  padding: 14px;
}

.inbox-email-card + .inbox-email-card {
  margin-top: 10px;
}

.inbox-email-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.inbox-email-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.inbox-email-head span,
.inbox-email-card p {
  color: var(--muted);
  font-size: 0.82rem;
}

.inbox-email-card p {
  margin: 0;
}

.inbox-email-card pre {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #dce5ef;
  font: inherit;
  line-height: 1.45;
}

.mail-client {
  display: grid;
  grid-template-columns: 256px minmax(320px, 448px) minmax(480px, 1fr);
  gap: 16px;
  width: min(1880px, 100%);
  height: calc(100vh - 64px);
}

.mail-sidebar,
.mail-list-panel,
.mail-reader {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(13, 13, 16, 0.88);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

body.public-page[data-theme="light"] .mail-sidebar,
body.public-page[data-theme="light"] .mail-list-panel,
body.public-page[data-theme="light"] .mail-reader,
body.public-page[data-theme="light"] .signin-panel,
body.public-page[data-theme="light"] .settings-dialog {
  background: rgba(255, 255, 255, 0.94);
}

.mail-sidebar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 16px;
}

.mail-panel-title,
.mail-list-head,
.mail-actions,
.mail-account {
  display: flex;
  align-items: center;
}

.mail-panel-title {
  gap: 10px;
  margin-bottom: 18px;
  font-size: 1.05rem;
}

.mail-icon,
.mail-list-icon {
  width: 17px;
  height: 12px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
}

.mail-folders {
  display: grid;
  align-content: start;
  gap: 4px;
}

.mail-folders button {
  cursor: pointer;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 0 12px;
  text-align: left;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.mail-folders button:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.mail-folders button.is-active {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.13);
}

.mail-session {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
}

.session-timer {
  min-height: 34px;
  border: 1px solid rgba(0, 210, 106, 0.52);
  border-radius: 7px;
  background: rgba(0, 157, 82, 0.15);
  color: #20f28a;
  display: grid;
  align-items: center;
  padding: 0 12px;
  font-size: 0.84rem;
  font-weight: 800;
}

.mail-account {
  gap: 10px;
  min-height: 60px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
}

.account-avatar,
.mail-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #6338ff, #bc34ff);
  color: #fff;
  font-weight: 900;
}

.mail-avatar.large {
  width: 48px;
  height: 48px;
}

.mail-account strong,
.mail-account span {
  display: block;
  max-width: 154px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-account span {
  color: var(--muted);
  font-size: 0.78rem;
}

.signout-button,
.settings-button {
  cursor: pointer;
  min-height: 38px;
  border-radius: 7px;
  font-weight: 800;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.signout-button {
  border: 1px solid rgba(244, 109, 117, 0.55);
  background: rgba(244, 109, 117, 0.13);
  color: #ff6b75;
}

.settings-button {
  border: 1px solid rgba(31, 131, 255, 0.52);
  background: rgba(31, 131, 255, 0.12);
  color: #2f8cff;
}

.signout-button:hover,
.settings-button:hover,
.mail-actions button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.mail-list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 16px;
}

.mail-list-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mail-list-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mail-actions {
  gap: 8px;
}

.mail-actions button {
  cursor: pointer;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  transition:
    background-color 160ms ease,
    transform 160ms ease;
}

.mail-actions span {
  color: var(--muted);
  font-size: 0.74rem;
}

.mail-list {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.mail-list-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 11px;
  text-align: left;
}

.mail-list-item:hover,
.mail-list-item.is-active {
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.06);
}

.mail-list-item span:last-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mail-list-item strong,
.mail-list-item b,
.mail-list-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-list-item b {
  font-size: 0.93rem;
}

.mail-list-item small {
  color: #bcd0ef;
}

.mail-list-foot {
  justify-self: center;
  min-height: 28px;
  margin-top: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  padding: 5px 14px;
  font-size: 0.78rem;
}

.mail-reader {
  overflow-y: auto;
  padding: 24px;
}

.mail-reader-empty {
  display: grid;
  min-height: 100%;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
}

.mail-reader-empty strong {
  color: var(--text);
  font-size: 1.2rem;
}

.mail-reader-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.mail-reader-head h2 {
  margin: 2px 0 6px;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.mail-reader-head strong,
.mail-reader-head time {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.mail-reader hr {
  margin: 18px 0 24px;
  border: 0;
  border-top: 1px solid var(--line-soft);
}

.mail-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: -6px 0 16px;
  border: 1px solid rgba(47, 140, 255, 0.32);
  border-radius: 10px;
  background: rgba(47, 140, 255, 0.1);
  padding: 10px;
}

.mail-link-actions span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mail-link-actions a,
.mail-code-chip,
.folder-action-button {
  display: inline-grid;
  min-height: 34px;
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: #5865f2;
  color: #fff;
  padding: 0 12px;
  font-size: 0.86rem;
  font-weight: 900;
  text-decoration: none;
}

.mail-code-chip {
  background: #12b981;
  color: #04130d;
}

.folder-action-button {
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

.folder-action-button.danger {
  border-color: rgba(244, 109, 117, 0.42);
  background: rgba(244, 109, 117, 0.13);
  color: #ff7f87;
}

.mail-link-actions a:hover,
.mail-code-chip:hover,
.folder-action-button:hover {
  filter: brightness(1.08);
}

.mail-reader-actions {
  margin-top: -8px;
}

.mail-attachments {
  display: grid;
  gap: 8px;
  margin: -6px 0 16px;
  border: 1px solid rgba(243, 189, 71, 0.32);
  border-radius: 10px;
  background: rgba(243, 189, 71, 0.1);
  padding: 10px;
}

.mail-attachments > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mail-attachments strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-reader-body {
  min-height: 420px;
  border-radius: 0;
  background: #f7f7f7;
  color: #101010;
  padding: 26px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}

.mail-html-frame {
  display: block;
  width: 100%;
  min-height: 620px;
  border: 0;
  background: #fff;
}

.proton-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  height: 100vh;
  background: #111019;
}

.proton-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: #15121d;
  padding: 14px 10px;
}

.compose-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #7547f6;
  color: #fff;
  font-weight: 900;
}

.proton-folders {
  display: grid;
  align-content: start;
  gap: 4px;
}

.proton-folders button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 42px;
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #f7f4ff;
  padding: 0 12px;
  text-align: left;
}

.proton-folders button:hover,
.proton-folders button.is-active {
  background: rgba(255, 255, 255, 0.08);
}

.proton-folders strong {
  display: grid;
  min-width: 34px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #7547f6;
  color: #fff;
  font-size: 0.78rem;
}

.proton-account {
  display: grid;
  gap: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #bfb7d5;
  padding: 14px 8px 4px;
  font-size: 0.82rem;
}

.proton-account strong {
  color: #fff;
}

.proton-main {
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  min-width: 0;
}

.proton-topbar,
.proton-actions,
.proton-list-head,
.proton-list-head > div {
  display: flex;
  align-items: center;
}

.proton-topbar {
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #1d1926;
  padding: 10px 22px;
}

.proton-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: min(560px, 100%);
  min-height: 36px;
  border-radius: 8px;
  background: #2a2634;
  color: #bab3ca;
  padding: 0 12px;
}

.proton-search input {
  min-height: 36px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.proton-actions {
  gap: 8px;
}

.proton-actions button,
.proton-reader-toolbar button {
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #1a1721;
  color: #fff;
  padding: 0 9px;
  font-size: 0.82rem;
  font-weight: 800;
}

.proton-actions button.is-active {
  border-color: #7547f6;
  background: rgba(117, 71, 246, 0.24);
}

.proton-content {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(520px, 1.3fr);
  min-height: 0;
}

.proton-content:not(.has-open-email) {
  grid-template-columns: minmax(0, 1fr);
}

.proton-content:not(.has-open-email) .proton-reader {
  display: none;
}

.proton-content:not(.has-open-email) .proton-list-panel {
  border-right: 0;
}

.proton-content.has-open-email {
  grid-template-columns: minmax(0, 1fr);
}

.proton-content.has-open-email .proton-list-panel {
  display: none;
}

.proton-list-panel,
.proton-reader {
  min-width: 0;
  min-height: 0;
}

.proton-list-panel {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.proton-list-head {
  justify-content: space-between;
  min-height: 46px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 16px;
}

.proton-list-head input,
.proton-message-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: #7547f6;
  cursor: pointer;
}

.proton-list-head > div {
  gap: 10px;
}

.proton-list-head h1 {
  font-size: 1rem;
}

.proton-list-head span {
  color: #bfb7d5;
  font-size: 0.84rem;
}

.selection-toolbar {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #17131f;
  padding: 6px 14px;
}

.selection-toolbar[hidden] {
  display: none;
}

.selection-toolbar > span {
  margin-right: 6px;
  color: #bfb7d5;
  font-size: 0.82rem;
  font-weight: 800;
}

.mail-icon-button {
  position: relative;
  display: grid;
  width: 34px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #211d2a;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

.mail-icon-button::after,
.proton-star::after {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 50;
  display: none;
  width: max-content;
  max-width: 220px;
  transform: translateX(-50%);
  border-radius: 6px;
  background: #f8f6ff;
  color: #231b2f;
  padding: 7px 9px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
  content: attr(title);
}

.mail-icon-button::before,
.proton-star::before {
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  z-index: 51;
  display: none;
  width: 10px;
  height: 10px;
  transform: translateX(-50%) rotate(45deg);
  background: #f8f6ff;
  content: "";
}

.mail-icon-button:hover::after,
.mail-icon-button:hover::before,
.proton-star:hover::after,
.proton-star:hover::before {
  display: block;
}

.mail-icon-button:hover {
  border-color: rgba(117, 71, 246, 0.8);
  background: #312a41;
}

.mail-icon-button.danger:hover {
  border-color: rgba(255, 91, 110, 0.8);
  color: #ff94a2;
}

.move-menu {
  position: absolute;
  top: 42px;
  left: 210px;
  z-index: 20;
  display: grid;
  width: min(300px, calc(100vw - 40px));
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #17131f;
  padding: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.move-menu[hidden] {
  display: none;
}

.move-menu strong {
  padding: 2px 4px 8px;
  color: #fff;
}

.move-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #fff;
  padding: 0 8px;
  text-align: left;
  cursor: pointer;
}

.move-menu button:hover {
  background: #2a2634;
}

.proton-message-list {
  height: calc(100vh - 104px);
  overflow-y: auto;
}

.proton-message-row {
  display: grid;
  grid-template-columns: 22px 32px 28px minmax(120px, 0.7fr) minmax(130px, 0.7fr) minmax(220px, 1.4fr) auto;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #1d1926;
  color: #fff;
  padding: 0 16px;
  text-align: left;
  cursor: pointer;
}

.proton-message-row:hover,
.proton-message-row.is-active,
.proton-message-row.is-selected {
  background: #282431;
}

.proton-message-row.is-unread strong,
.proton-message-row.is-unread b,
.proton-message-row.is-unread time {
  color: #fff;
  font-weight: 900;
}

.proton-message-row.is-read strong,
.proton-message-row.is-read b,
.proton-message-row.is-read time {
  color: #c9c2d8;
  font-weight: 500;
}

.proton-message-row.is-read small,
.proton-message-row.is-read .proton-star {
  color: #8f879f;
}

.proton-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: #5f5870;
  color: #fff;
  font-weight: 900;
}

.proton-star {
  position: relative;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 0;
  background: transparent;
  color: #bfb7d5;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.proton-star:hover,
.proton-star.is-favorite {
  color: #f4b63f;
}

.proton-message-row strong,
.proton-message-row small,
.proton-message-row b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proton-message-row small {
  color: #bfb7d5;
}

.proton-message-row time {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
}

.proton-reader {
  overflow-y: auto;
  background: #14111a;
}

.proton-reader-head {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px 22px 12px;
}

.proton-reader-topline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
}

.proton-reader-meta {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.proton-reader-side {
  display: grid;
  justify-items: end;
  color: #bfb7d5;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.proton-reader-head h2 {
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.25;
}

.proton-reader-addresses {
  display: grid;
  gap: 4px;
  color: #d8d1e8;
  font-size: 0.86rem;
  line-height: 1.35;
}

.proton-reader-addresses p {
  margin: 0;
}

.proton-reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.proton-reader-body {
  min-height: 560px;
  background: #f5f6f8;
  color: #111;
  padding: 20px;
  white-space: pre-wrap;
}

.compose-dialog {
  position: fixed;
  left: 280px;
  bottom: 0;
  z-index: 60;
  display: grid;
  width: min(640px, calc(100vw - 320px));
  max-height: 78vh;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px 10px 0 0;
  background: #1a1721;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.compose-dialog[hidden] {
  display: none;
}

.compose-dialog header,
.compose-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #474055;
  padding: 10px 16px;
}

.compose-dialog header button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
}

.compose-dialog label {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
}

.compose-dialog input,
.compose-dialog select {
  min-height: 34px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.compose-dialog textarea {
  min-height: 220px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #111;
  resize: vertical;
}

.compose-dialog footer span {
  color: #bfb7d5;
}

.compose-dialog footer button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: #7547f6;
  color: #fff;
  padding: 0 20px;
  font-weight: 900;
  opacity: 0.55;
}

.settings-dialog {
  width: min(512px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #101113;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.5);
}

.settings-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  padding: 24px;
}

.settings-head h2 {
  font-size: 1.45rem;
}

.settings-head .icon-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
}

.appearance-panel {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 30px 24px 24px;
}

.appearance-panel > span {
  color: var(--muted);
}

.theme-options {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.theme-option {
  display: grid;
  width: 62px;
  height: 70px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--muted);
}

.settings-gear,
.theme-moon,
.theme-sun {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
}

.settings-gear {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.settings-gear::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.theme-moon {
  border-radius: 50%;
  box-shadow: -5px 2px 0 currentColor;
  transform: translateX(5px);
}

.theme-sun {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.theme-sun::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.theme-option.is-active {
  border-color: #2f8cff;
  color: #2f8cff;
  box-shadow: 0 0 0 2px rgba(47, 140, 255, 0.14);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none;
}

.confirm-dialog {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  width: min(460px, 100%);
  border: 1px solid rgba(244, 109, 117, 0.32);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(244, 109, 117, 0.1), transparent 48%),
    #111821;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52);
  padding: 18px;
}

.confirm-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
  background: rgba(244, 109, 117, 0.12);
  color: var(--red);
}

.confirm-dialog h2 {
  margin-top: 2px;
  font-size: 1.25rem;
}

.confirm-dialog p {
  margin: 8px 0 0;
  color: #c3cfdd;
  line-height: 1.45;
}

.confirm-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 10px;
}

.mailbox-detail-dialog {
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #111821;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52);
}

.modal-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line-soft);
  padding: 18px;
}

.modal-titlebar h2 {
  overflow-wrap: anywhere;
}

.modal-titlebar .icon-button {
  flex: 0 0 auto;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
}

.mailbox-detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
  padding: 18px;
}

.mailbox-password-panel,
.mailbox-email-panel {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(11, 17, 25, 0.72);
  padding: 16px;
}

.mailbox-detail-emails {
  display: grid;
  max-height: 420px;
  overflow: auto;
  gap: 8px;
  padding-right: 4px;
}

.admin-email-preview {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0e151f;
  padding: 10px;
}

.admin-email-preview strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-email-preview span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .split-layout,
  .ticket-overview,
  .diagnostic-grid,
  .stats-grid,
  .ticket-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .delivery-board-grid {
    grid-template-columns: repeat(4, minmax(132px, 1fr));
  }

  .mail-client {
    grid-template-columns: 190px minmax(260px, 1fr);
    height: auto;
    min-height: calc(100vh - 32px);
  }

  .mail-reader {
    grid-column: 1 / -1;
    min-height: 520px;
  }

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

  body.private-mail-page {
    overflow: auto;
  }

  .proton-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .proton-sidebar {
    position: static;
    grid-template-rows: auto auto auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

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

  .proton-content {
    grid-template-columns: 1fr;
  }

  .proton-message-list {
    height: auto;
    max-height: 420px;
  }

  .proton-reader {
    min-height: 520px;
  }

  .compose-dialog {
    left: 16px;
    width: calc(100vw - 32px);
  }
}

@media (max-width: 620px) {
  .workspace {
    padding: 16px;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .split-layout,
  .ticket-overview,
  .stats-grid,
  .ticket-summary,
  .ticket-form {
    grid-template-columns: 1fr;
  }

  .ticket-progress-panel {
    grid-template-columns: 1fr;
  }

  .side-nav {
    grid-template-columns: 1fr;
  }

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

  .delivery-ticket-files,
  .delivery-ticket-labels {
    display: none;
  }

  .signin-panel {
    padding: 24px;
  }

  .mail-client {
    grid-template-columns: 1fr;
    height: auto;
  }

  .mail-sidebar,
  .mail-list-panel,
  .mail-reader {
    border-radius: 12px;
  }

  .mail-sidebar {
    min-height: auto;
  }

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

  .mail-reader {
    min-height: 420px;
    padding: 16px;
  }

  .mail-reader-body {
    padding: 16px;
  }
}
