:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --line: #d9e0e8;
  --line-strong: #b8c2cc;
  --text: #17212b;
  --muted: #687583;
  --blue: #1a73e8;
  --blue-weak: #e8f0fe;
  --red: #d93025;
  --red-weak: #fce8e6;
  --green: #188038;
  --green-weak: #e6f4ea;
  --amber: #f9ab00;
  --amber-weak: #fff4d8;
  --teal: #0f766e;
  --teal-weak: #def7f3;
  --shadow: 0 14px 40px rgba(24, 32, 43, 0.12);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  height: 100vh;
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  letter-spacing: 0;
}

.startup-splash {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: #17212b;
  background: #eef3f8;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

.startup-splash-logo {
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #1769ff, #14b8c9);
  border-radius: 22px;
  box-shadow: 0 18px 38px rgba(23, 105, 255, 0.22);
  font-size: 34px;
  font-weight: 900;
}

.startup-splash strong {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 850;
}

button,
input,
select,
textarea,
[contenteditable] {
  font: inherit;
}

button {
  border: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.auth-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(rgba(246, 248, 251, 0.9), rgba(246, 248, 251, 0.9)),
    radial-gradient(circle at 20% 20%, rgba(26, 115, 232, 0.15), transparent 26%),
    radial-gradient(circle at 80% 70%, rgba(15, 118, 110, 0.12), transparent 28%);
}

.auth-card {
  width: min(420px, 100%);
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-language {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.auth-language .toolbar-select {
  min-width: 112px;
}

.auth-brand {
  padding: 0;
  margin-bottom: 24px;
}

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

.auth-title {
  margin: 0 0 6px;
  font-size: 24px;
}

.auth-subtitle {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.auth-submit {
  width: 100%;
  min-height: 42px;
}

.auth-error {
  padding: 10px 12px;
  color: var(--red);
  background: var(--red-weak);
  border-radius: 8px;
  font-size: 13px;
}

.mfa-card {
  width: min(480px, 100%);
}

.mfa-form {
  gap: 12px;
}

.mfa-secret-box,
.mfa-recovery-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #f6f8fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mfa-secret-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mfa-secret-box strong {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 18px;
  letter-spacing: 1px;
}

.mfa-recovery-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.mfa-recovery-list code {
  padding: 8px;
  color: #17212b;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 800;
}

.login-hints {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  background: #edf2f7;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  min-height: 42px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: white;
  background: var(--red);
  border-radius: 8px;
}

.brand-mark svg,
.lucide {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.brand-name {
  font-weight: 800;
  font-size: 18px;
}

.brand-domain {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.compose-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 18px;
  color: #fff;
  background: var(--blue);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(26, 115, 232, 0.22);
  cursor: pointer;
}

.compose-button:hover {
  background: #0b57d0;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-title {
  padding: 8px 12px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.nav-title-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.icon-button.small {
  width: 28px;
  min-height: 28px;
}

.nav-button,
.folder-button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  color: var(--text);
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.nav-button:hover,
.folder-button:hover {
  background: #dfe8f2;
}

.nav-button.active,
.folder-button.active {
  color: #0b57d0;
  background: var(--blue-weak);
  font-weight: 700;
}

.folder-button.custom-folder {
  padding-left: 18px;
}

.count-pill {
  min-width: 24px;
  padding: 2px 7px;
  color: var(--muted);
  background: var(--surface);
  border-radius: 999px;
  font-size: 12px;
  text-align: center;
}

.nav-button.active .count-pill,
.folder-button.active .count-pill {
  color: #0b57d0;
}

.mailbox-switcher {
  margin-top: auto;
  padding: 12px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mailbox-switcher label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.mailbox-switcher select {
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  color: var(--text);
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.auth-account-switcher {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.auth-account-switcher .ghost-button,
.mobile-drawer-auth-account .ghost-button {
  width: 100%;
  justify-content: center;
}

.account-login-dialog .auth-form {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

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

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 66px;
  padding: 10px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 720px;
  min-height: 42px;
  padding: 0 13px;
  background: #eef3f8;
  border: 1px solid transparent;
  border-radius: 8px;
}

.search-box:focus-within {
  border-color: #9ab9f4;
  background: #fff;
}

.search-box input {
  width: 100%;
  min-width: 80px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

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

.identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  color: #fff;
  background: var(--teal);
  border-radius: 50%;
  font-weight: 800;
  overflow: hidden;
}

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

.avatar-large {
  width: 64px;
  height: 64px;
  font-size: 22px;
}

.identity-text {
  min-width: 0;
}

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

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

.identity-name {
  font-weight: 800;
  white-space: nowrap;
}

.identity-mail {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.mail-layout {
  display: grid;
  grid-template-columns: minmax(330px, 38%) minmax(0, 1fr);
  height: calc(100vh - 66px);
  min-height: 0;
}

.mail-list-pane,
.mail-detail-pane,
.workspace-pane {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.mail-list-pane {
  background: #fbfcfe;
  border-right: 1px solid var(--line);
}

.mail-toolbar,
.workspace-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 16px;
  background: rgba(251, 252, 254, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.toolbar-title {
  min-width: 0;
}

.toolbar-title h1,
.workspace-toolbar h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.toolbar-title p,
.workspace-toolbar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.icon-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-button,
.text-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}

.icon-button {
  width: 34px;
  padding: 0;
  color: var(--muted);
  background: transparent;
}

.icon-button:hover {
  color: var(--text);
  background: var(--surface-2);
}

.text-button {
  color: #fff;
  background: var(--blue);
}

.text-button:hover {
  background: #0b57d0;
}

.text-button:disabled,
.ghost-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.compose-modal.sending [data-compose-drag-handle] {
  cursor: wait;
}

.compose-modal.sending [data-lucide="loader-circle"] {
  animation: spin 0.9s linear infinite;
}

.danger-icon {
  color: var(--red);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.ghost-button {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.ghost-button:hover {
  border-color: var(--line-strong);
}

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

.mail-list {
  display: grid;
}

.mail-bulk-toolbar {
  position: sticky;
  top: 58px;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 46px;
  padding: 8px 12px;
  background: rgba(251, 252, 254, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  overflow: visible;
}

.mail-select-all,
.bulk-move {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.bulk-selected {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.bulk-move select {
  min-width: 118px;
  height: 34px;
  padding: 0 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.mail-bulk-toolbar .ghost-button,
.mail-bulk-toolbar .danger-button {
  flex: 0 0 auto;
}

@media (max-width: 1180px) {
  .mail-bulk-toolbar {
    gap: 8px;
    padding: 8px 10px;
  }

  .mail-bulk-toolbar .ghost-button,
  .mail-bulk-toolbar .danger-button {
    min-height: 32px;
    padding: 0 9px;
    font-size: 12px;
  }

  .bulk-move {
    gap: 5px;
  }

  .bulk-move select {
    min-width: 104px;
  }
}

.mail-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 8px 12px;
  color: var(--muted);
  background: #fbfcfe;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.top-pagination {
  justify-content: flex-end;
  min-height: 40px;
  padding-top: 6px;
  padding-bottom: 6px;
  background: #fff;
  border-top: 0;
}

.mail-pagination label,
.mail-page-size-group,
.pagination-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.mail-pagination select {
  height: 32px;
  padding: 0 8px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.mail-pagination a {
  color: inherit;
  text-decoration: none;
}

.page-size-links {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.page-size-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 26px;
  padding: 0 8px;
  color: var(--muted);
  border-radius: 6px;
}

.page-size-link.active {
  color: var(--brand);
  background: #eef4ff;
}

.icon-button.small {
  width: 30px;
  height: 30px;
}

.icon-button.disabled {
  cursor: default;
  opacity: 0.42;
  pointer-events: none;
}

.mail-row {
  display: grid;
  grid-template-columns: 22px 30px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 94px;
  padding: 14px 16px;
  background: transparent;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.mobile-mail-avatar,
.mobile-attachment-chip {
  display: none;
}

.mail-row:hover {
  background: #f2f6fb;
}

.mail-row.active {
  background: #eaf2ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.mail-row.selected {
  background: #f3f8ff;
}

.mail-row.unread .sender,
.mail-row.unread .subject {
  font-weight: 800;
}

.mail-row-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 28px;
  cursor: pointer;
}

.mail-row-check input,
.mail-select-all input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.star-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--muted);
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
}

.star-button.active {
  color: var(--amber);
}

.star-button.active svg,
.star-button-inline.active svg,
.mobile-row-star svg {
  fill: currentColor;
  stroke: currentColor;
}

.star-button-inline.active {
  color: var(--amber);
}

.mobile-row-star {
  color: var(--amber);
}

.mail-summary {
  min-width: 0;
}

.mail-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sender,
.subject,
.snippet {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sender {
  min-width: 0;
}

.subject {
  margin-top: 6px;
}

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

.label {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  color: #0b57d0;
  background: var(--blue-weak);
  font-size: 12px;
  font-weight: 700;
}

.priority {
  color: var(--red);
  background: var(--red-weak);
}

.mail-time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.thread-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  margin-left: 6px;
  padding: 0 8px;
  color: #64748b;
  background: #eef3f8;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.thread-count.has-unread {
  color: #1d4ed8;
  background: #dbeafe;
}

.conversation-detail-meta,
.mobile-detail-thread-meta {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.conversation-thread {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.conversation-thread-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.conversation-thread-head strong {
  color: var(--text);
  font-size: 15px;
}

.conversation-message {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.conversation-message.current {
  background: #f7fbff;
  border-color: #bfdbfe;
}

.conversation-message-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.conversation-message-head .avatar {
  width: 36px;
  height: 36px;
}

.conversation-message-head strong,
.conversation-message-head span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-message-head span,
.conversation-message-head time {
  color: var(--muted);
  font-size: 12px;
}

.conversation-message-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px 46px;
}

.conversation-message-body {
  min-width: 0;
}

.mail-detail-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  color: var(--muted);
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.mail-detail-pane {
  background: var(--surface);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.mail-detail {
  padding: 24px;
  width: min(100%, 980px);
  max-width: 980px;
}

.mail-detail h2 {
  margin: 0 0 14px;
  font-size: 26px;
  line-height: 1.28;
}

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

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

.sender-info {
  min-width: 0;
}

.sender-info strong,
.sender-info span {
  display: block;
  overflow-wrap: anywhere;
}

.sender-info span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.body-copy {
  margin-top: 24px;
  color: #283544;
  line-height: 1.76;
}

.mail-detail-error,
.mobile-mail-error {
  display: grid;
  gap: 10px;
  padding: 14px;
  color: var(--red);
  background: var(--red-weak);
  border: 1px solid rgba(217, 48, 37, 0.22);
  border-radius: 8px;
}

.mail-detail-error span,
.mobile-mail-error span {
  color: #7b2d27;
  font-size: 13px;
  line-height: 1.5;
}

.mail-detail-error button,
.mobile-mail-error button {
  justify-self: start;
}

.rich-content p {
  margin: 0 0 14px;
}

.rich-content ul,
.rich-content ol {
  margin: 0 0 14px 22px;
  padding: 0;
}

.rich-content a {
  color: var(--blue);
}

.rich-content img,
.editor-surface img {
  display: block;
  max-width: 100%;
  max-height: 360px;
  height: auto;
  object-fit: contain;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mail-detail .rich-content img {
  max-width: min(100%, 640px) !important;
  height: auto !important;
}

.rich-content table,
.editor-surface table {
  width: 100%;
  margin: 12px 0;
  border-collapse: collapse;
}

.rich-content th,
.rich-content td,
.editor-surface th,
.editor-surface td {
  padding: 8px 10px;
  border: 1px solid var(--line);
}

.rich-content th,
.editor-surface th {
  background: #f6f8fb;
  font-weight: 800;
}

.rich-content blockquote,
.editor-surface blockquote {
  margin: 12px 0;
  padding: 8px 12px;
  color: var(--muted);
  background: #f6f8fb;
  border-left: 4px solid var(--line-strong);
}

.rich-content pre,
.editor-surface pre {
  overflow: auto;
  padding: 12px;
  color: #15202b;
  background: #eef3f8;
  border-radius: 8px;
}

.mail-html-content {
  color: #1f2937;
  display: block;
  isolation: isolate;
  line-height: normal;
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  contain: inline-size;
}

.mail-html-content * {
  box-sizing: border-box !important;
  max-width: 100% !important;
}

.mail-html-content table {
  max-width: 100% !important;
}

.mail-html-content td,
.mail-html-content th {
  vertical-align: top;
}

.mail-html-content img {
  display: inline-block;
  max-width: min(100%, 640px) !important;
  max-height: 420px;
  height: auto !important;
  object-fit: contain;
}

.mail-html-content .mail-signature-block {
  margin-top: 10px;
}

.mail-html-content img.mail-signature-image {
  width: auto !important;
  max-width: min(180px, 60vw) !important;
  max-height: 96px !important;
  object-fit: contain !important;
}

.mail-html-content p {
  margin: revert;
}

.attachment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.attachment {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  background: #f5f7fa;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
}

.attachment.drive {
  color: var(--teal);
  background: var(--teal-weak);
  border-color: rgba(15, 118, 110, 0.22);
}

.attachment small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.attachment-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 28px;
}

.attachment-preview-modal .modal-backdrop {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.42);
}

.attachment-preview-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(980px, calc(100vw - 40px));
  height: min(760px, calc(100vh - 52px));
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.attachment-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid var(--line);
}

.attachment-preview-head strong,
.attachment-preview-head span {
  display: block;
  max-width: min(620px, 58vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.attachment-preview-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.attachment-preview-body {
  display: grid;
  min-height: 0;
  background: #f8fafc;
}

.attachment-preview-frame,
.attachment-preview-image,
.attachment-preview-media {
  width: 100%;
  height: 100%;
  border: 0;
}

.attachment-preview-image,
.attachment-preview-media {
  object-fit: contain;
  padding: 14px;
}

.attachment-preview-audio {
  align-self: center;
  justify-self: center;
  width: min(520px, calc(100% - 32px));
}

.attachment-preview-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.attachment-preview-empty svg {
  width: 40px;
  height: 40px;
  color: var(--muted);
}

.attachment-preview-empty small {
  max-width: 360px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.quick-reply {
  margin-top: 30px;
  display: grid;
  gap: 10px;
}

.workspace-pane {
  height: calc(100vh - 66px);
  background: var(--surface);
}

.workspace-body {
  padding: 22px;
  display: grid;
  gap: 18px;
}

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

.metric {
  min-height: 92px;
  padding: 15px;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
}

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

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(128px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.calendar-month {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calendar-weekdays,
.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  min-height: 38px;
  background: #f6f8fb;
  border-bottom: 1px solid var(--line);
}

.calendar-weekdays span {
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.month-day {
  min-height: 132px;
  padding: 8px;
  background: #fff;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.month-day:nth-child(7n) {
  border-right: 0;
}

.month-day.muted {
  background: #f9fafb;
  color: var(--muted);
}

.month-day.selected {
  box-shadow: inset 0 0 0 2px var(--blue);
}

.month-day.today .month-day-head strong {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #fff;
  background: var(--blue);
  border-radius: 999px;
}

.month-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
  margin-bottom: 6px;
}

.month-day-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.month-event-list {
  display: grid;
  gap: 4px;
}

.month-event {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  min-height: 24px;
  padding: 0 6px;
  color: #17212b;
  background: #eef4ff;
  border: 0;
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.month-event span {
  color: var(--muted);
  font-size: 11px;
}

.month-event.interview {
  background: #edfdf6;
  border-left-color: var(--green);
}

.month-event.deadline {
  background: #fff1f2;
  border-left-color: var(--red);
}

.month-event.shift {
  background: #fff7ed;
  border-left-color: var(--amber);
}

.month-event.event-tone-good {
  background: #eef4ff;
  border-left-color: var(--blue);
}

.month-event.event-tone-warn {
  background: #fff7ed;
  border-left-color: var(--amber);
}

.month-event.event-tone-bad {
  background: #fff1f2;
  border-left-color: var(--red);
}

.month-event.event-span-start {
  border-radius: 6px 2px 2px 6px;
}

.month-event.event-span-middle {
  border-radius: 2px;
  border-left-color: transparent;
}

.month-event.event-span-end {
  border-radius: 2px 6px 6px 2px;
}

.month-event.more {
  grid-template-columns: 1fr;
  color: var(--blue);
  background: #f6f8fb;
  border-left-color: var(--line-strong);
}

.day-column {
  min-height: 420px;
  border-right: 1px solid var(--line);
  background: #fbfcfe;
}

.day-column:last-child {
  border-right: 0;
}

.day-head {
  min-height: 54px;
  padding: 10px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.day-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-top: 3px;
}

.event-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.event-card {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 7px;
  cursor: pointer;
}

.event-card.interview {
  border-left-color: var(--green);
}

.event-card.deadline {
  border-left-color: var(--red);
}

.event-card.shift {
  border-left-color: var(--amber);
}

.event-card.event-tone-good {
  border-left-color: var(--blue);
}

.event-card.event-tone-warn {
  border-left-color: var(--amber);
}

.event-card.event-tone-bad {
  border-left-color: var(--red);
}

.event-time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.event-title {
  margin-top: 5px;
  font-weight: 800;
  line-height: 1.25;
}

.event-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.panel {
  padding: 16px;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 17px;
}

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

.form-grid .full {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.event-type-manager {
  display: grid;
  gap: 8px;
}

.event-type-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.event-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.event-type-chip.event-tone-good {
  color: var(--blue);
  background: #eef4ff;
  border-color: #cfe0ff;
}

.event-type-chip.event-tone-warn {
  color: #9a5a00;
  background: #fff7ed;
  border-color: #fed7aa;
}

.event-type-chip.event-tone-bad {
  color: var(--red);
  background: #fff1f2;
  border-color: #fecdd3;
}

.event-type-chip button {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.event-type-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px auto;
  gap: 8px;
}

.event-type-add input,
.event-type-add select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
}

.calendar-import-tools {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  background: #f8fbff;
  border: 1px solid #dbe5f0;
  border-radius: 12px;
}

.calendar-import-tools strong,
.calendar-import-tools span {
  display: block;
}

.calendar-import-tools strong {
  color: #172033;
  font-size: 14px;
  font-weight: 850;
}

.calendar-import-tools span {
  margin-top: 3px;
  color: #65748a;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 650;
}

.calendar-import-url-dialog .field {
  gap: 8px;
}

.calendar-import-url-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #8ab4f8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.number-setting {
  display: inline-grid;
  grid-template-columns: 112px auto;
  align-items: center;
  gap: 6px;
  justify-self: end;
}

.number-setting input {
  width: 112px;
  min-height: 34px;
  padding: 6px 8px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.number-setting span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.readonly-field {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--muted);
  background: #f6f8fb;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--text);
  font-weight: 700;
}

.checkbox-line input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.field-checkbox {
  margin-top: 6px;
  min-height: 0;
  font-size: 12px;
  font-weight: 700;
}

.toolbar-select {
  min-height: 36px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-weight: 700;
}

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

.delegate-picker {
  display: grid;
  gap: 8px;
}

.delegate-search {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.delegate-grid-scroll {
  max-height: 280px;
  overflow: auto;
  padding-right: 2px;
}

.delegate-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.delegate-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.delegate-option strong,
.delegate-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delegate-option small {
  color: var(--muted);
  font-size: 12px;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.domain-dns-box {
  display: grid;
  gap: 10px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dns-record-table {
  table-layout: fixed;
}

.dns-record-table th:nth-child(1),
.dns-record-table td:nth-child(1) {
  width: 56px;
}

.dns-record-table th:nth-child(2),
.dns-record-table td:nth-child(2) {
  width: 92px;
}

.dns-record-table th:nth-child(3),
.dns-record-table td:nth-child(3) {
  width: auto;
}

.dns-record-table th:nth-child(4),
.dns-record-table td:nth-child(4) {
  width: 64px;
  text-align: center;
}

.dns-record-table th:nth-child(5),
.dns-record-table td:nth-child(5) {
  width: 64px;
}

.dns-record-table th:nth-child(6),
.dns-record-table td:nth-child(6) {
  width: 78px;
}

.dns-value {
  max-width: 0;
}

.dns-host,
.dns-value code {
  display: block;
  padding: 2px 0;
  color: var(--text);
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.dns-host {
  overflow-wrap: anywhere;
}

.dns-value code {
  max-height: 92px;
  overflow: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  scrollbar-width: thin;
}

.rich-editor {
  display: grid;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.editor-label {
  padding: 10px 12px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 40px;
  padding: 6px 8px;
  background: #f6f8fb;
  border-bottom: 1px solid var(--line);
}

.toolbar-separator {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: var(--line);
}

.editor-select {
  min-height: 30px;
  padding: 0 8px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.editor-color {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  border-radius: 7px;
  cursor: pointer;
}

.editor-color:hover {
  color: var(--text);
  background: var(--surface-2);
}

.editor-color input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.editor-surface {
  width: 100%;
  padding: 13px 14px;
  color: var(--text);
  background: #fff;
  outline: 0;
  overflow: auto;
  line-height: 1.7;
}

.editor-surface:focus {
  box-shadow: inset 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.editor-surface:empty::before {
  content: attr(data-placeholder);
  color: #8a96a3;
}

.editor-surface p {
  margin: 0 0 12px;
}

.editor-surface ul,
.editor-surface ol {
  margin: 0 0 12px 22px;
  padding: 0;
}

.rich-editor.compact .editor-toolbar {
  min-height: 34px;
  padding: 4px 6px;
}

.rich-editor.compact .editor-surface {
  padding: 10px 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

.table th {
  color: var(--muted);
  background: #f6f8fb;
  font-size: 12px;
  font-weight: 800;
}

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

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

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

.status.good {
  color: var(--green);
  background: var(--green-weak);
}

.status.warn {
  color: #946200;
  background: var(--amber-weak);
}

.status.bad {
  color: var(--red);
  background: var(--red-weak);
}

.ghost-button.danger {
  color: var(--red);
  border-color: rgba(210, 55, 55, 0.28);
}

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

.user-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.user-item strong,
.user-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-item span {
  color: var(--muted);
  font-size: 12px;
}

.health-grid {
  display: grid;
  gap: 10px;
}

.health-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.health-item strong,
.health-item span {
  display: block;
}

.health-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

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

.settings-help-list {
  margin-top: 14px;
}

.signature-manager {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.signature-list,
.signature-editor {
  min-width: 0;
}

.signature-list {
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.signature-list p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.signature-list-body {
  display: grid;
  gap: 8px;
}

.signature-item {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--text);
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.signature-item.active {
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.signature-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.signature-item small {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.signature-actions {
  align-content: end;
}

.signature-save-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.signature-editor .editor-surface {
  line-height: 1.45;
}

.signature-editor .editor-surface p {
  margin: 0 0 6px;
}

.signature-editor .editor-surface img {
  width: auto;
  max-width: min(180px, 100%);
  max-height: 86px;
  object-fit: contain;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  background: #f6f8fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.filter-bar.compact-filter {
  grid-template-columns: 1fr;
}

.filter-bar.user-domain-filter {
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  align-items: end;
}

.filter-summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filter-bar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filter-bar input,
.filter-bar select {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
}

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

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row strong {
  display: block;
}

.setting-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 26px;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c7d0db;
  cursor: pointer;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition:
    transform 0.16s ease,
    background 0.16s ease;
}

.switch input:checked + span {
  background: var(--blue);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.compose-modal {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.compose-modal.dragging {
  user-select: none;
}

.compose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 14px;
  color: #fff;
  background: #26323f;
  cursor: grab;
  touch-action: none;
}

.compose-modal.dragging .compose-head {
  cursor: grabbing;
}

.compose-head .icon-button {
  cursor: pointer;
}

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

.compose-modal form {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.compose-body {
  display: grid;
  min-height: 0;
  overflow-y: auto;
  gap: 0;
}

.compose-body input,
.compose-body textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  outline: 0;
  padding: 12px 14px;
}

.compose-body textarea {
  min-height: 220px;
  resize: vertical;
  border-bottom: 0;
}

.compose-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 33, 43, 0.36);
}

.dialog-panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 12px 16px;
  color: #fff;
  background: #26323f;
}

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

.dialog-head span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.dialog-body {
  padding: 16px;
}

.dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.recipient-hints {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 12px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
}

.recipient-hint-tools,
.recipient-chip-row,
.recipient-chip-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.recipient-hint-tools strong {
  font-size: 12px;
}

.ghost-button.compact {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.recipient-chip-row {
  min-width: 0;
  overflow-x: auto;
}

.recipient-chip-wrap {
  flex: 0 0 auto;
}

.recipient-chip {
  display: grid;
  gap: 2px;
  min-width: 126px;
  max-width: 180px;
  padding: 7px 9px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.recipient-chip:hover {
  border-color: #8ab4f8;
  background: var(--blue-weak);
}

.recipient-chip span,
.recipient-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipient-chip span {
  font-weight: 800;
}

.recipient-chip small {
  color: var(--muted);
}

.recipient-empty {
  color: var(--muted);
  font-size: 12px;
}

.recipient-autocomplete {
  position: relative;
  min-width: 0;
}

.recipient-suggestions {
  position: absolute;
  z-index: 24;
  top: calc(100% - 1px);
  right: 10px;
  left: 10px;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 14px 32px rgba(29, 41, 57, 0.16);
}

.recipient-suggestions[hidden] {
  display: none;
}

.recipient-suggestions button {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 9px 12px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  cursor: pointer;
  text-align: left;
}

.recipient-suggestions button:hover {
  background: var(--blue-weak);
}

.recipient-suggestions span,
.recipient-suggestions small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipient-suggestions span {
  font-weight: 800;
}

.recipient-suggestions small {
  color: var(--muted);
}

.compose-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 38px;
  padding: 0 14px;
  color: var(--muted);
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.compose-options label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.mail-category-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.category-chip span {
  width: 8px;
  height: 8px;
  background: var(--label-color, var(--blue));
  border-radius: 999px;
}

.category-chip.active {
  color: var(--text);
  border-color: var(--label-color, var(--blue));
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.08);
}

.category-chip.add {
  color: var(--blue);
  border-style: dashed;
}

.mail-label-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
}

.label {
  border-color: color-mix(in srgb, var(--label-color, var(--line-strong)) 42%, white);
  color: var(--label-color, var(--muted));
  background: color-mix(in srgb, var(--label-color, var(--line-strong)) 10%, white);
}

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

.label-check {
  display: grid;
  grid-template-columns: 16px 10px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.label-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--label-color, var(--blue));
}

.label-check span {
  width: 10px;
  height: 10px;
  background: var(--label-color, var(--blue));
  border-radius: 999px;
}

.label-check strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-dialog {
  width: min(560px, calc(100vw - 28px));
}

.category-manager-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.category-manager-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 32px 32px;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.category-manager-row > span {
  width: 10px;
  height: 10px;
  background: var(--label-color, var(--blue));
  border-radius: 999px;
}

.category-manager-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.security-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 12px;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.security-card strong,
.security-card span {
  min-width: 0;
}

.security-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.inline-checks {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.inline-checks label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
}

.inline-checks input {
  accent-color: var(--blue);
}

.compose-body .rich-editor {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.drive-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f7fbfb;
  border-bottom: 1px solid var(--line);
}

.drive-tools strong,
.drive-tools span {
  display: block;
}

.drive-tools span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.upload-zone {
  padding: 12px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
}

.upload-zone.loading .upload-box {
  border-color: #8ab4f8;
  background: var(--blue-weak);
}

.upload-box {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 96px;
  padding: 14px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
}

.upload-box span {
  color: var(--text);
  font-weight: 800;
}

.upload-box small {
  font-size: 12px;
}

.upload-list,
.upload-history {
  display: grid;
  gap: 8px;
}

.upload-list {
  margin-top: 10px;
}

.upload-empty {
  color: var(--muted);
  font-size: 12px;
}

.upload-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.upload-item strong,
.upload-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-item strong {
  font-size: 13px;
}

.upload-item span {
  color: var(--muted);
  font-size: 12px;
}

.upload-item a {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.upload-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.upload-actions.full {
  grid-column: 1 / -1;
  width: 100%;
}

.upload-actions .text-button,
.upload-actions .ghost-button {
  width: auto;
  min-width: max-content;
  height: 34px;
  padding-inline: 11px;
}

.collab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.collab-panel-wide {
  grid-row: span 2;
}

.collab-action-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.collab-action-strip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.collab-action-strip button:hover {
  color: var(--blue);
  border-color: #b8d3ff;
  background: #f7fbff;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
}

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

.kanban-column {
  min-height: 360px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.kanban-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
}

.kanban-head span {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.kanban-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.task-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
}

.task-card.high {
  border-left-color: var(--red);
}

.task-card strong,
.task-card span {
  min-width: 0;
}

.task-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
}

.ghost-button.mini {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.setting-row.as-button {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.wide-dialog {
  width: min(1120px, calc(100vw - 40px));
  max-height: calc(100vh - 36px);
}

.wide-dialog.office-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: calc(100vw - 24px);
  height: calc(100vh - 24px);
  max-height: calc(100vh - 24px);
  overflow: hidden;
}

.wide-dialog.office-editor-fullscreen {
  grid-template-rows: minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border: 0;
  border-radius: 0;
}

.office-editor-fullscreen .dialog-head,
.office-editor-fullscreen .doc-meta-grid,
.office-editor-fullscreen .doc-collaborators,
.office-editor-fullscreen .dialog-foot {
  display: none;
}

.office-service-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.office-service-panel strong,
.office-service-panel span {
  display: block;
}

.office-service-panel span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.office-service-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.collab-doc-body {
  display: grid;
  gap: 14px;
  overflow: auto;
}

.office-dialog .collab-doc-body {
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  padding: 12px;
}

.office-editor-fullscreen .collab-doc-body {
  grid-template-rows: minmax(0, 1fr);
  padding: 0;
}

.office-dialog .doc-meta-grid {
  grid-template-columns: minmax(260px, 1.5fr) minmax(140px, 0.7fr) minmax(140px, 0.7fr);
  gap: 10px;
}

.doc-collaborators {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compact-collaborators {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  padding: 8px 10px;
}

.compact-collaborators .label-check-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.compact-collaborators label {
  white-space: nowrap;
}

.onlyoffice-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 560px;
}

.office-dialog .onlyoffice-shell {
  height: 100%;
  min-height: 0;
}

.office-editor-fullscreen .onlyoffice-shell {
  position: relative;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

.onlyoffice-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.office-editor-fullscreen .onlyoffice-toolbar {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 5;
  padding: 0;
  background: transparent;
  border: 0;
}

.office-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.office-fullscreen-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.office-editor-fullscreen .onlyoffice-toolbar > div:first-child,
.office-editor-fullscreen .office-toolbar-actions .status-pill,
.office-editor-fullscreen .office-fullscreen-hint {
  display: none;
}

.office-editor-fullscreen .office-toolbar-actions .icon-button {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.onlyoffice-toolbar span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.onlyoffice-editor {
  min-height: 520px;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.office-editor-fullscreen .onlyoffice-editor {
  min-height: 0;
  border: 0;
  border-radius: 0;
}

.onlyoffice-editor iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
}

.role-guide {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.role-guide h3 {
  margin: 0;
  font-size: 15px;
}

.sheet-editor {
  display: grid;
  gap: 10px;
  min-height: 360px;
}

.sheet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sheet-scroll {
  overflow: auto;
  max-height: 430px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sheet-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.sheet-table th,
.sheet-table td {
  min-width: 132px;
  height: 38px;
  border: 1px solid var(--line);
}

.sheet-table th {
  min-width: 42px;
  padding: 0 8px;
  color: var(--muted);
  background: #f2f5f8;
  font-size: 12px;
  font-weight: 900;
}

.sheet-table td {
  padding: 0;
  background: #fff;
}

.sheet-table input {
  width: 100%;
  height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.sheet-table input:focus {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.empty-state.small {
  min-height: 42px;
  padding: 10px;
  font-size: 12px;
}

.upload-item .upload-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
}

.upload-item .upload-actions a,
.upload-item .upload-actions button {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
}

progress {
  width: 120px;
  height: 8px;
  accent-color: var(--blue);
}

.nav-link {
  text-decoration: none;
}

.admin-shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background: #eef1f4;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background: #20282f;
  color: #d9e1e8;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px 18px;
  background: #151b20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: #1db5c9;
  border-radius: 7px;
  font-weight: 900;
  letter-spacing: 0;
}

.admin-brand-mark.image {
  overflow: hidden;
  background: #fff;
}

.admin-brand-mark.image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.admin-brand strong {
  color: #fff;
  font-size: 15px;
}

.admin-brand span {
  margin-top: 2px;
  color: #90a0ad;
  font-size: 12px;
}

.admin-nav-groups {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 12px 0;
}

.admin-nav-group {
  display: grid;
  gap: 2px;
}

.admin-nav-title {
  padding: 10px 18px 4px;
  color: #93a0aa;
  font-size: 12px;
  font-weight: 800;
}

.admin-nav-button {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  color: #d9e1e8;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.admin-nav-button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.admin-nav-button.active {
  color: #fff;
  background: #1db5c9;
  box-shadow: inset 3px 0 0 #fff;
}

.admin-nav-button .lucide:last-child {
  width: 14px;
  height: 14px;
  color: #798894;
}

.admin-nav-button.active .lucide:last-child {
  color: rgba(255, 255, 255, 0.85);
}

.admin-nav-foot {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 14px 16px;
  background: #12171c;
}

.admin-nav-foot span {
  color: #ff7a45;
  font-size: 12px;
  font-weight: 800;
}

.admin-mail-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d9e1e8;
  text-decoration: none;
  font-size: 13px;
}

.admin-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.admin-topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 68px;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.admin-topbar-title h1 {
  margin: 0;
  font-size: 20px;
}

.admin-topbar-title span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.admin-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 280px;
  min-height: 36px;
  padding: 0 10px;
  background: #f3f5f8;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.admin-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.identity.compact .avatar {
  width: 32px;
  height: 32px;
}

.identity.compact .identity-name {
  font-size: 13px;
}

.admin-content {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.admin-section {
  display: grid;
  gap: 16px;
  padding: 18px 18px 48px;
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 24px;
  align-items: center;
  min-height: 150px;
  padding: 24px;
  color: #fff;
  background: #2388e8;
  border-radius: 8px;
}

.admin-hero h2 {
  margin: 0 0 8px;
  font-size: 25px;
}

.admin-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

.admin-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.admin-hero .text-button {
  color: #1b425f;
  background: #fff;
}

.admin-hero .ghost-button {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

.admin-hero-status {
  display: grid;
  gap: 9px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
}

.admin-hero-status strong {
  font-size: 20px;
}

.admin-hero-status span {
  color: rgba(255, 255, 255, 0.86);
}

.admin-hero-status progress {
  width: 100%;
  accent-color: #fff;
}

.admin-metrics .metric {
  background: #fff;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.46fr);
  gap: 16px;
}

.admin-panel-wide {
  min-width: 0;
}

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

.admin-action {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 86px;
  color: #3b4650;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.admin-action:hover {
  color: #0b57d0;
  border-color: #9ab9f4;
}

.license-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  padding: 14px;
  background: #eef6ff;
  border: 1px solid #c8ddfb;
  border-radius: 8px;
}

.license-summary strong,
.license-summary span {
  display: block;
}

.license-summary strong {
  font-size: 24px;
}

.license-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.license-summary progress {
  width: 100%;
}

.org-tree {
  display: grid;
  gap: 8px;
}

.org-node {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 10px;
  padding-left: calc(10px + var(--depth, 0) * 18px);
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.org-node.active,
.org-node:hover {
  border-color: #8ab4f8;
  background: #eef6ff;
}

.org-node strong,
.org-node small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-node small,
.muted-text {
  color: var(--muted);
  font-size: 12px;
}

.admin-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.42fr);
  gap: 16px;
  align-items: start;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 20;
  transform: translate(-50%, 12px);
  min-height: 38px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 9px 14px;
  color: #fff;
  background: rgba(23, 33, 43, 0.92);
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

#desktop-notifications {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.desktop-notification {
  display: grid;
  gap: 8px;
  padding: 14px 14px 13px;
  color: #17212b;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
  cursor: pointer;
  transform: translateX(30px);
  opacity: 0;
  animation: desktop-notify-in 0.22s ease-out forwards;
}

.desktop-notification.closing {
  animation: desktop-notify-out 0.18s ease-in forwards;
}

.desktop-notification-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.desktop-notification-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #14b8a6);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 900;
}

.desktop-notification-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.desktop-notification-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.desktop-notification-title time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.desktop-notification p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.desktop-notification-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.desktop-notification-actions button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--blue);
  background: #edf4ff;
  border: 0;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}

@keyframes desktop-notify-in {
  from {
    opacity: 0;
    transform: translateX(36px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes desktop-notify-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(26px);
  }
}

@media (max-width: 1120px) {
  #desktop-notifications {
    right: 10px;
    left: 10px;
    width: auto;
  }

  .app-shell {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .brand-name,
  .brand-domain,
  .nav-title,
  .nav-button span:not(.count-pill),
  .folder-button span:not(.count-pill),
  .mailbox-switcher {
    display: none;
  }

  .side-nav {
    align-items: center;
    padding: 16px 10px;
  }

  .brand {
    padding: 0;
  }

  .compose-button {
    width: 54px;
    padding: 0;
  }

  .compose-button span {
    display: none;
  }

  .nav-button,
  .folder-button {
    grid-template-columns: 1fr;
    place-items: center;
    width: 48px;
    padding: 0;
  }

  .count-pill {
    display: none;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

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

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .collab-grid,
  .kanban-grid,
  .collab-action-strip,
  .security-grid,
  .signature-manager {
    grid-template-columns: 1fr;
  }

  .calendar-month {
    overflow-x: auto;
  }

  .calendar-weekdays,
  .calendar-month-grid {
    min-width: 760px;
  }

  .admin-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .admin-brand div:not(.admin-brand-mark),
  .admin-nav-title,
  .admin-nav-button span,
  .admin-nav-button .lucide:last-child,
  .admin-nav-foot span,
  .admin-mail-link span {
    display: none;
  }

  .admin-brand {
    justify-content: center;
    padding: 12px;
  }

  .admin-nav-button {
    grid-template-columns: 1fr;
    place-items: center;
    padding: 0;
  }

  .admin-dashboard-grid,
  .admin-two-column,
  .admin-hero {
    grid-template-columns: 1fr;
  }

  .day-column {
    min-height: 300px;
    border-bottom: 1px solid var(--line);
  }
}

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

  .side-nav {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    min-height: 38px;
  }

  .compose-button {
    width: auto;
    min-height: 38px;
    padding: 0 12px;
  }

  .compose-button span {
    display: inline;
  }

  .nav-group {
    grid-column: 1 / -1;
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-button,
  .folder-button {
    width: 42px;
    flex: 0 0 42px;
  }

  .topbar {
    grid-template-columns: 1fr;
    padding: 10px 12px;
  }

  .topbar-actions {
    justify-content: space-between;
  }

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

  .mail-list-pane,
  .mail-detail-pane,
  .workspace-pane {
    height: auto;
    max-height: none;
  }

  .mail-detail {
    padding: 18px;
  }

  .metric-grid,
  .calendar-grid,
  .form-grid,
  .delegate-grid,
  .label-check-grid,
  .collab-grid,
  .kanban-grid,
  .collab-action-strip,
  .security-grid {
    grid-template-columns: 1fr;
  }

  .wide-dialog {
    width: calc(100vw - 20px);
  }

  .sheet-table th,
  .sheet-table td {
    min-width: 110px;
  }

  .category-manager-row {
    grid-template-columns: 12px minmax(0, 1fr) 36px 36px;
  }

  .mail-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .mail-pagination label,
  .mail-page-size-group,
  .pagination-actions {
    justify-content: space-between;
  }

  .event-type-add {
    grid-template-columns: 1fr;
  }

  .calendar-month {
    overflow-x: auto;
  }

  .calendar-weekdays,
  .calendar-month-grid {
    min-width: 700px;
  }

  .workspace-body {
    padding: 14px;
  }

  .table {
    display: block;
    overflow-x: auto;
  }

  .compose-modal {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }

  .dialog-overlay {
    align-items: start;
    padding: 8px;
  }

  .dialog-panel {
    max-height: calc(100vh - 16px);
  }

  .dialog-foot {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-foot .icon-row,
  .dialog-foot button {
    width: 100%;
  }

  .office-service-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .office-service-actions,
  .office-service-actions button {
    width: 100%;
  }

  .drive-tools {
    grid-template-columns: 1fr;
  }

  .drive-tools .icon-row,
  .drive-tools button {
    width: 100%;
  }

  .admin-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
    overflow-x: hidden;
  }

  .admin-nav {
    height: auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    overflow: hidden;
  }

  .admin-nav-groups {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100vw;
    overflow-x: auto;
    padding: 8px;
  }

  .admin-nav-group {
    display: flex;
    flex: 0 0 auto;
  }

  .admin-main,
  .admin-topbar,
  .admin-content,
  .admin-section {
    min-width: 0;
    width: 100%;
    max-width: 100vw;
  }

  .admin-nav-button {
    width: 42px;
    flex: 0 0 42px;
    border-radius: 8px;
  }

  .admin-nav-foot {
    display: none;
  }

  .admin-topbar {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .admin-topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .admin-search {
    width: 100%;
    min-width: 0;
  }

  .admin-section {
    padding: 12px;
  }

  .admin-action-grid,
  .admin-metrics {
    grid-template-columns: 1fr;
  }
}

.mobile-back-button,
.mobile-folder-tabs {
  display: none;
}

body.mobile-app {
  min-width: 0;
  height: 100dvh;
  overflow: hidden;
  background: #eef3f8;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.mobile-app #app {
  height: 100dvh;
  overflow: hidden;
}

body.mobile-app .auth-shell {
  align-content: start;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top, 0px) + 64px) 22px calc(env(safe-area-inset-bottom, 0px) + 24px);
  background: #eef3f8;
}

body.mobile-app .auth-card {
  width: 100%;
  max-width: 430px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.mobile-app .auth-language {
  margin: 0 0 16px;
  padding: 4px;
  background: #dde8f5;
  border-radius: 8px;
}

body.mobile-app .auth-language .toolbar-select {
  width: 100%;
  min-height: 42px;
  color: #1769ff;
  background: #fff;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  text-align: center;
}

body.mobile-app .auth-brand {
  margin: 0 0 22px;
}

body.mobile-app .auth-brand .brand-name,
body.mobile-app .auth-brand .brand-domain {
  display: block;
}

body.mobile-app .brand-mark {
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #0f6bff, #13b8c9);
  border-radius: 8px;
}

body.mobile-app .brand-name {
  font-size: 28px;
  line-height: 1.05;
}

body.mobile-app .brand-domain,
body.mobile-app .auth-subtitle {
  color: #66758a;
}

body.mobile-app .auth-title {
  margin-bottom: 8px;
  font-size: 22px;
}

body.mobile-app .auth-form {
  gap: 12px;
  padding: 18px;
  background: #fff;
  border: 1px solid #dce5f0;
  border-radius: 8px;
}

body.mobile-app .field input,
body.mobile-app .field select,
body.mobile-app .field textarea {
  min-height: 44px;
  background: #f8fbff;
  border-radius: 8px;
}

body.mobile-app .auth-submit {
  min-height: 46px;
  border-radius: 8px;
  font-weight: 900;
}

body.mobile-app .app-shell {
  display: block;
  height: 100dvh;
  overflow: hidden;
  background: #eef3f8;
}

body.mobile-app .main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100dvh;
  padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}

body.mobile-app .content {
  min-height: 0;
  overflow: hidden;
}

body.mobile-app .side-nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(86vw, 330px);
  height: 100dvh;
  padding: calc(env(safe-area-inset-top, 0px) + 22px) 18px calc(env(safe-area-inset-bottom, 0px) + 22px);
  overflow-y: auto;
  background: rgba(249, 251, 255, 0.99);
  border-top: 0;
  border-right: 1px solid #dce5f0;
  box-shadow: 18px 0 40px rgba(20, 31, 48, 0.18);
  backdrop-filter: blur(18px);
  transform: translateX(-104%);
  transition: transform 0.22s ease;
  -webkit-overflow-scrolling: touch;
}

body.mobile-app .mobile-edge-swipe-zone {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 55;
  width: 18px;
  background: transparent;
  pointer-events: none;
}

body.mobile-app.native-mobile-drawer-open .side-nav,
body.mobile-app .native-mobile-drawer-open .side-nav {
  transform: translateX(0);
}

body.mobile-app .side-nav .brand,
body.mobile-app .side-nav .compose-button,
body.mobile-app .side-nav .mailbox-switcher,
body.mobile-app .side-nav .nav-title,
body.mobile-app .side-nav .nav-link {
  display: flex;
}

body.mobile-app .side-nav .nav-group {
  display: grid;
  gap: 6px;
  width: 100%;
}

body.mobile-app .side-nav .nav-group[aria-label="主导航"] {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  width: 100%;
}

body.mobile-app .side-nav .nav-button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  justify-items: start;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  color: #172033;
  background: transparent;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 850;
  text-align: left;
}

body.mobile-app .side-nav .nav-button span:not(.count-pill) {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-app .side-nav .nav-button.active {
  color: #1769ff;
  background: #eaf2ff;
}

body.mobile-app .side-nav .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 4px;
}

body.mobile-app .side-nav .brand-mark {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 50%;
  font-size: 22px;
}

body.mobile-app .side-nav .brand-name {
  font-size: 20px;
  line-height: 1.12;
}

body.mobile-app .side-nav .compose-button {
  display: inline-flex;
  min-height: 52px;
  margin: 0 0 4px;
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(23, 105, 255, 0.18);
}

body.mobile-app .side-nav .nav-group[aria-label="邮箱文件夹"] {
  display: grid;
  gap: 6px;
}

body.mobile-app .side-nav .folder-button {
  min-height: 50px;
  background: transparent;
  border-radius: 14px;
  font-size: 15px;
}

body.mobile-app .side-nav .mailbox-switcher {
  display: block;
  margin-top: auto;
  padding: 12px;
  background: #fff;
  border: 1px solid #dce5f0;
  border-radius: 16px;
}

body.mobile-app .mobile-drawer-panel {
  gap: 18px;
  color: #172033;
}

body.mobile-app .mobile-drawer-profile {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
}

body.mobile-app .mobile-drawer-profile .avatar {
  width: 56px;
  height: 56px;
  font-size: 22px;
}

body.mobile-app .mobile-drawer-profile strong,
body.mobile-app .mobile-drawer-profile span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-app .mobile-drawer-profile strong {
  font-size: 18px;
  line-height: 1.2;
}

body.mobile-app .mobile-drawer-profile span {
  margin-top: 3px;
  color: #66758a;
  font-size: 13px;
  font-weight: 700;
}

body.mobile-app .mobile-drawer-close {
  color: #1769ff;
  background: #edf4ff;
  border-radius: 50%;
}

body.mobile-app .mobile-drawer-mailbox {
  display: grid;
  gap: 7px;
  padding: 12px;
  background: #fff;
  border: 1px solid #dce5f0;
  border-radius: 16px;
}

body.mobile-app .mobile-drawer-mailbox label,
body.mobile-app .mobile-drawer-section-title {
  color: #7a8494;
  font-size: 13px;
  font-weight: 900;
}

body.mobile-app .mobile-drawer-mailbox select {
  width: 100%;
  min-height: 42px;
  color: #172033;
  background: #f7faff;
  border: 1px solid #dce5f0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
}

body.mobile-app .mobile-drawer-section {
  display: grid;
  gap: 6px;
}

body.mobile-app .mobile-drawer-section-title {
  padding: 0 4px 4px;
}

body.mobile-app .mobile-drawer-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  color: #172033;
  background: transparent;
  border-radius: 15px;
  text-align: left;
}

body.mobile-app .mobile-drawer-row svg {
  width: 24px;
  height: 24px;
  color: #7a8494;
}

body.mobile-app .mobile-drawer-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 850;
}

body.mobile-app .mobile-drawer-row.active {
  color: #1769ff;
  background: #eaf2ff;
}

body.mobile-app .mobile-drawer-row.active svg {
  color: #1769ff;
}

body.mobile-app .mobile-label-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--label-color, #1769ff);
}

body.mobile-app .mobile-drawer-empty {
  margin: 0;
  padding: 8px 14px;
  color: #8a94a6;
  font-size: 14px;
}

body.mobile-app .mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  background: rgba(12, 18, 28, 0.42);
}

body.mobile-app.native-mobile-drawer-open .mobile-drawer-backdrop,
body.mobile-app .native-mobile-drawer-open .mobile-drawer-backdrop {
  display: block;
}

body.mobile-app .topbar {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-height: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 8px;
  background: #eef3f8;
  border-bottom: 0;
}

body.mobile-app .topbar-actions {
  display: none;
}

body.mobile-app .native-mail-detail-open .topbar,
body.mobile-app .native-mail-detail-open .side-nav {
  display: none;
}

body.mobile-app .native-mail-view:not(.native-mail-detail-open) .topbar {
  display: none;
}

body.mobile-app .native-mail-view:not(.native-mail-detail-open) .main {
  grid-template-rows: minmax(0, 1fr);
}

body.mobile-app .native-mail-detail-open .main {
  display: block;
  padding-bottom: 0;
}

body.mobile-app .mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  min-height: calc(72px + env(safe-area-inset-bottom, 0px));
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #dce5f0;
  box-shadow: 0 -8px 24px rgba(20, 31, 48, 0.08);
  backdrop-filter: blur(18px);
}

body.mobile-app .mobile-bottom-nav button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 56px;
  color: #66758a;
  background: transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

body.mobile-app .mobile-bottom-nav button svg {
  width: 23px;
  height: 23px;
}

body.mobile-app .mobile-bottom-nav button.active {
  color: #1769ff;
  background: #edf4ff;
}

body.mobile-app .native-mail-detail-open .mobile-bottom-nav {
  display: none;
}

body.mobile-app .native-mail-detail-open .content {
  height: 100dvh;
}

body.mobile-app .search-box {
  max-width: none;
  min-height: 44px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #dce5f0;
  border-radius: 8px;
}

body.mobile-app .mobile-search-trigger {
  width: 100%;
  color: #9aa7b8;
  font-size: 16px;
  font-weight: 800;
  text-align: left;
}

body.mobile-app .mobile-search-trigger span {
  flex: 1;
}

body.mobile-app .mobile-search-page {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 100dvh;
  padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
  background: #f3f5f9;
  overflow: hidden;
}

body.mobile-app .mobile-search-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 16px 12px;
}

body.mobile-app .mobile-search-input {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  color: #8d99aa;
  background: #eaedf3;
  border-radius: 999px;
}

body.mobile-app .mobile-search-input input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: #172033;
  background: transparent;
  font-size: 16px;
}

body.mobile-app .mobile-search-head button {
  min-height: 42px;
  color: #172033;
  background: transparent;
  font-size: 16px;
  font-weight: 800;
}

body.mobile-app .mobile-search-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid #dce5f0;
}

body.mobile-app .mobile-search-tabs button {
  position: relative;
  min-height: 48px;
  color: #7a8494;
  background: transparent;
  font-size: 16px;
  font-weight: 900;
}

body.mobile-app .mobile-search-tabs button.active {
  color: #172033;
}

body.mobile-app .mobile-search-tabs button.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 30px;
  height: 3px;
  background: #172033;
  border-radius: 999px;
  transform: translateX(-50%);
}

body.mobile-app .mobile-search-body {
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.mobile-app .mobile-search-card {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
}

body.mobile-app .mobile-search-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body.mobile-app .mobile-search-card h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

body.mobile-app .mobile-history-row,
body.mobile-app .mobile-search-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  color: #172033;
  background: transparent;
  text-align: left;
}

body.mobile-app .mobile-history-row {
  grid-template-columns: auto minmax(0, 1fr);
  color: #7a8494;
  font-size: 16px;
}

body.mobile-app .mobile-search-result span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

body.mobile-app .mobile-search-result strong,
body.mobile-app .mobile-search-result b,
body.mobile-app .mobile-search-result small,
body.mobile-app .mobile-history-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-app .mobile-search-result strong {
  font-size: 15px;
}

body.mobile-app .mobile-search-result b {
  font-size: 14px;
}

body.mobile-app .mobile-search-result small,
body.mobile-app .mobile-search-result time,
body.mobile-app .mobile-search-empty {
  color: #7a8494;
  font-size: 12px;
}

body.mobile-app .mobile-search-file {
  display: grid !important;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #1769ff;
  background: #edf4ff;
  border-radius: 8px;
}

body.mobile-app .mail-layout {
  display: block;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #eef3f8;
}

body.mobile-app .mail-list-pane,
body.mobile-app .mail-detail-pane,
body.mobile-app .workspace-pane {
  height: 100%;
  max-height: none;
  overflow-y: auto;
  border-right: 0;
  background: #eef3f8;
  -webkit-overflow-scrolling: touch;
}

body.mobile-app .mail-layout:not(.mobile-detail-open) .mail-detail-pane {
  display: none;
}

body.mobile-app .mail-layout.mobile-detail-open .mail-list-pane {
  display: none;
}

body.mobile-app .mobile-mail-screen {
  height: 100%;
  min-height: 0;
  background: #eef3f8;
}

body.mobile-app .mobile-list-screen {
  position: relative;
  overflow-y: auto;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}

body.mobile-app .mobile-mail-list-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) 22px 12px;
}

body.mobile-app .mobile-mail-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

body.mobile-app .mobile-mail-title-row .avatar {
  width: 46px;
  height: 46px;
  font-size: 20px;
}

body.mobile-app .mobile-mail-title-row h1 {
  margin: 0;
  color: #172033;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

body.mobile-app .mobile-mail-title-row p {
  margin: 4px 0 0;
  color: #66758a;
  font-size: 13px;
  font-weight: 800;
}

body.mobile-app .mobile-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  color: #1769ff;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid #dce5f0;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(20, 31, 48, 0.06);
}

body.mobile-app .mobile-menu-button svg {
  width: 23px;
  height: 23px;
}

body.mobile-app .mobile-mail-current-folder {
  display: none;
}

body.mobile-app .mobile-mail-search-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 44px);
  min-height: 48px;
  margin: 0 22px 14px;
  padding: 0 16px;
  color: #9aa7b8;
  background: #fff;
  border: 1px solid #dce5f0;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
  text-align: left;
}

body.mobile-app .mobile-mail-search-card svg {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  color: #172033;
}

body.mobile-app .mobile-compose-fab {
  position: fixed;
  right: 22px;
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  z-index: 25;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: #fff;
  background: #1769ff;
  border-radius: 50%;
  box-shadow: 0 14px 28px rgba(23, 105, 255, 0.28);
}

body.mobile-app .mobile-compose-fab svg {
  width: 25px;
  height: 25px;
}

body.mobile-app .mobile-compose-fab.small {
  position: static;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  box-shadow: 0 10px 20px rgba(23, 105, 255, 0.16);
}

body.mobile-app .mail-toolbar,
body.mobile-app .workspace-toolbar {
  position: static;
  align-items: center;
  min-height: auto;
  padding: 10px 20px 8px;
  background: #eef3f8;
  border-bottom: 0;
  backdrop-filter: none;
}

body.mobile-app .toolbar-title h1,
body.mobile-app .workspace-toolbar h1 {
  font-size: 28px;
  letter-spacing: 0;
}

body.mobile-app .toolbar-title p,
body.mobile-app .workspace-toolbar p {
  color: #66758a;
  font-weight: 700;
}

body.mobile-app .mail-toolbar .icon-row .icon-button:not([data-open-compose]) {
  display: none;
}

body.mobile-app .mobile-folder-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 14px 8px;
  scrollbar-width: none;
}

body.mobile-app .mobile-folder-tabs::-webkit-scrollbar {
  display: none;
}

body.mobile-app .mobile-folder-tabs button,
body.mobile-app .category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  color: #66758a;
  background: #fff;
  border: 1px solid #dce5f0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

body.mobile-app .mobile-folder-tabs button.active,
body.mobile-app .category-chip.active {
  color: #1769ff;
  border-color: #1769ff;
  box-shadow: 0 0 0 3px rgba(23, 105, 255, 0.08);
}

body.mobile-app .mobile-folder-tabs b {
  min-width: 18px;
  padding: 1px 5px;
  color: #fff;
  background: #1769ff;
  border-radius: 999px;
  font-size: 10px;
}

body.mobile-app .mail-category-bar {
  padding: 4px 14px 10px;
  background: #eef3f8;
  border-bottom: 0;
}

body.mobile-app .mail-pagination.top-pagination,
body.mobile-app .mail-pagination,
body.mobile-app .mail-bulk-toolbar {
  display: none;
}

body.mobile-app .mail-list {
  display: grid;
  gap: 0;
  padding: 0 22px 18px;
  background: #eef3f8;
}

body.mobile-app .mail-row {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 96px;
  padding: 16px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #dce5f0;
  border-radius: 0;
  box-shadow: none;
}

body.mobile-app .mail-row.active {
  background: transparent;
  box-shadow: none;
}

body.mobile-app .mail-row-check,
body.mobile-app .mail-row .star-button {
  display: none;
}

body.mobile-app .mobile-mail-avatar {
  display: block;
}

body.mobile-app .mobile-mail-avatar .avatar {
  width: 42px;
  height: 42px;
  font-size: 18px;
  font-weight: 800;
}

body.mobile-app .mail-summary {
  min-width: 0;
}

body.mobile-app .mail-meta-line {
  align-items: center;
  gap: 6px;
  min-width: 0;
}

body.mobile-app .mail-meta-line .label {
  display: none;
}

body.mobile-app .sender,
body.mobile-app .subject {
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: 0;
}

body.mobile-app .sender {
  max-width: 100%;
  font-weight: 800;
}

body.mobile-app .subject {
  margin-top: 4px;
  color: #172033;
  font-weight: 600;
}

body.mobile-app .snippet {
  margin-top: 4px;
  color: #8a94a6;
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
}

body.mobile-app .mail-time {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: #8a94a6;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

body.mobile-app .mail-time svg {
  width: 16px;
  height: 16px;
  color: #8a94a6;
}

body.mobile-app .mail-time b {
  min-width: 18px;
  padding: 2px 5px;
  color: #8a94a6;
  background: #e5e9f0;
  border-radius: 4px;
  font-size: 12px;
}

body.mobile-app .mobile-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(220px, 100%);
  min-height: 32px;
  margin-top: 8px;
  padding: 0 10px;
  color: #7a8494;
  background: #fff;
  border: 1px solid #dce5f0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-app .mobile-attachment-chip svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: #1769ff;
}

body.mobile-app .mail-detail {
  width: 100%;
  max-width: none;
  padding: 12px 14px 28px;
}

body.mobile-app .mobile-back-button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 34px;
  margin: 0 0 8px;
  padding: 0;
  color: #1769ff;
  background: transparent;
  font-weight: 800;
}

body.mobile-app .detail-head,
body.mobile-app .body-copy,
body.mobile-app .quick-reply {
  padding: 16px;
  background: #fff;
  border: 1px solid #dce5f0;
  border-radius: 8px;
}

body.mobile-app .detail-head {
  display: grid;
  gap: 12px;
}

body.mobile-app .mail-detail h2 {
  font-size: 24px;
}

body.mobile-app .detail-head > .icon-row {
  justify-content: space-between;
  padding-top: 4px;
  border-top: 1px solid #eef3f8;
}

body.mobile-app .body-copy,
body.mobile-app .quick-reply {
  margin-top: 12px;
}

body.mobile-app .rich-content img,
body.mobile-app .mail-html-content img {
  max-width: 100% !important;
  max-height: 260px !important;
}

body.mobile-app .attachment-row {
  margin: 12px 0 0;
}

body.mobile-app .mobile-detail-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  color: #172033;
  background: #fff;
}

body.mobile-app .mobile-detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: calc(56px + env(safe-area-inset-top, 0px));
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 20px 8px;
  background: #fff;
  border-bottom: 1px solid #eef1f5;
}

body.mobile-app .mobile-detail-back,
body.mobile-app .mobile-detail-actions,
body.mobile-app .mobile-detail-actions .icon-button {
  display: inline-flex;
  align-items: center;
}

body.mobile-app .mobile-detail-back {
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #172033;
  background: transparent;
}

body.mobile-app .mobile-detail-back svg {
  width: 28px;
  height: 28px;
}

body.mobile-app .mobile-detail-actions {
  gap: 10px;
}

body.mobile-app .mobile-detail-actions .icon-button {
  justify-content: center;
  width: 38px;
  height: 38px;
  color: #172033;
  background: transparent;
}

body.mobile-app .mobile-detail-content {
  position: relative;
  z-index: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 22px calc(88px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}

body.mobile-app .mobile-detail-title {
  margin: 0 0 20px;
  color: #172033;
  font-size: 26px;
  line-height: 1.24;
  letter-spacing: 0;
}

body.mobile-app .mobile-detail-sender {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid #e7edf5;
}

body.mobile-app .mobile-detail-sender .avatar {
  width: 54px;
  height: 54px;
  font-size: 22px;
}

body.mobile-app .mobile-detail-sender strong,
body.mobile-app .mobile-detail-sender span,
body.mobile-app .mobile-recipient-line {
  display: block;
  min-width: 0;
}

body.mobile-app .mobile-detail-sender strong {
  margin-top: 2px;
  color: #172033;
  font-size: 18px;
  line-height: 1.2;
}

body.mobile-app .mobile-detail-sender span,
body.mobile-app .mobile-recipient-line {
  margin-top: 5px;
  color: #7a8494;
  font-size: 14px;
  line-height: 1.35;
}

body.mobile-app .mobile-recipient-line {
  width: 100%;
  padding: 0;
  background: transparent;
  text-align: left;
}

body.mobile-app .mobile-detail-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
}

body.mobile-app .mobile-detail-attachments {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
}

body.mobile-app .mobile-detail-attachments .attachment {
  justify-content: flex-start;
  min-height: 42px;
  width: 100%;
  border-radius: 10px;
}

body.mobile-app .attachment-preview-modal {
  padding: 0;
  align-items: stretch;
}

body.mobile-app .attachment-preview-panel {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border: 0;
  border-radius: 0;
}

body.mobile-app .attachment-preview-head {
  min-height: 64px;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
}

body.mobile-app .attachment-preview-head strong,
body.mobile-app .attachment-preview-head span {
  max-width: 58vw;
}

body.mobile-app .attachment-preview-download {
  min-height: 38px;
  padding: 0 12px;
}

body.mobile-app .mobile-detail-body {
  margin-top: 22px;
  max-width: 100%;
  overflow: hidden;
}

body.mobile-app .mobile-detail-body .body-copy {
  max-width: 100%;
  margin: 0;
  padding: 0;
  color: #172033;
  background: #fff;
  border: 0;
  border-radius: 0;
  font-size: 17px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

body.mobile-app .mobile-detail-body .mail-html-content {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  word-break: normal;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.mobile-app .mobile-detail-body .mail-html-content * {
  box-sizing: border-box !important;
  max-width: 100% !important;
}

body.mobile-app .mobile-detail-body .mail-html-content table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: auto !important;
  border-collapse: collapse;
}

body.mobile-app .mobile-detail-body .mail-html-content td,
body.mobile-app .mobile-detail-body .mail-html-content th {
  max-width: 100% !important;
  overflow-wrap: anywhere;
  word-break: normal;
}

body.mobile-app .mobile-detail-body .rich-content img,
body.mobile-app .mobile-detail-body .mail-html-content img {
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
}

body.mobile-app .mobile-loading-mail,
body.mobile-app .mobile-loading-preview {
  color: #7a8494;
  font-size: 15px;
}

body.mobile-app .mobile-loading-mail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

body.mobile-app .mobile-loading-mail svg {
  animation: spin 1s linear infinite;
}

body.mobile-app .mobile-loading-preview {
  margin: 8px 0 0;
  line-height: 1.6;
}

body.mobile-app .mobile-detail-actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 140;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #e7edf5;
  box-shadow: 0 -12px 26px rgba(20, 31, 48, 0.08);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

body.mobile-app .mobile-detail-actionbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  color: #1769ff;
  background: #edf4ff;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 900;
}

body.mobile-app .mobile-empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 220px;
  color: #8a94a6;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

body.mobile-app .mobile-empty-state svg {
  width: 32px;
  height: 32px;
}

body.mobile-app .compose-modal {
  inset: 0 !important;
  z-index: 180;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.mobile-app .compose-head {
  min-height: calc(50px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0;
  color: #132033;
  background: #eef3f8;
  cursor: default;
}

body.mobile-app .compose-head strong {
  font-size: 17px;
}

body.mobile-app .compose-head .icon-button {
  color: #1769ff;
}

body.mobile-app .compose-body {
  background: #eef3f8;
}

body.mobile-app .compose-body > input,
body.mobile-app .recipient-hints,
body.mobile-app .compose-options,
body.mobile-app .editor-shell,
body.mobile-app .upload-zone,
body.mobile-app .drive-tools {
  margin: 0 12px;
  background: #fff;
}

body.mobile-app .compose-body > .recipient-autocomplete {
  margin: 0 12px;
}

body.mobile-app .compose-body > .recipient-autocomplete input {
  margin: 0;
  background: #fff;
}

body.mobile-app .compose-body > input:first-of-type {
  border-radius: 8px 8px 0 0;
}

body.mobile-app .compose-options {
  padding: 10px 12px;
  border-bottom: 1px solid #dce5f0;
}

body.mobile-app .editor-shell {
  border: 1px solid #dce5f0;
  border-radius: 8px;
}

body.mobile-app .editor-surface {
  min-height: 260px !important;
}

body.mobile-app .upload-zone,
body.mobile-app .drive-tools {
  border-left: 1px solid #dce5f0;
  border-right: 1px solid #dce5f0;
}

body.mobile-app .compose-foot {
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: #fff;
}

body.mobile-app .workspace-pane {
  padding-bottom: 12px;
}

body.mobile-app .workspace-body {
  padding: 10px 14px 18px;
}

body.mobile-app .metric-grid,
body.mobile-app .collab-grid,
body.mobile-app .kanban-grid,
body.mobile-app .split-grid {
  grid-template-columns: 1fr;
}

body.mobile-app .metric,
body.mobile-app .panel,
body.mobile-app .calendar-month,
body.mobile-app .calendar-grid {
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(20, 31, 48, 0.04);
}

body.mobile-app .calendar-month {
  overflow-x: auto;
}

body.mobile-app .calendar-weekdays,
body.mobile-app .calendar-month-grid {
  min-width: 640px;
}

body.mobile-app .dialog-overlay {
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 10px calc(env(safe-area-inset-bottom, 0px) + 10px);
}

body.mobile-app .dialog-panel {
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 20px);
}

/* Native mobile app hardening: keep the WebView from falling back to desktop layout. */
html.mobile-app,
body.mobile-app {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #eef3f8;
  overscroll-behavior: none;
}

body.mobile-app #app {
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
}

body.mobile-app .app-shell.native-app-shell {
  position: fixed;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: #eef3f8;
}

body.mobile-app .app-shell.native-app-shell .main {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 0 calc(78px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  background: #eef3f8;
}

body.mobile-app .app-shell.native-app-shell.native-mail-detail-open .main {
  padding-bottom: 0;
}

body.mobile-app .app-shell.native-app-shell .topbar {
  display: none !important;
}

body.mobile-app .app-shell.native-app-shell .content {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #eef3f8;
}

body.mobile-app .app-shell.native-app-shell > .side-nav.mobile-drawer-panel {
  position: fixed !important;
  inset: 0 auto 0 0 !important;
  z-index: 320 !important;
  display: flex !important;
  width: min(84vw, 330px) !important;
  height: 100dvh !important;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 18px calc(env(safe-area-inset-bottom, 0px) + 22px) !important;
  overflow-y: auto !important;
  background: #f8fbff !important;
  border-right: 1px solid #dde6f2 !important;
  box-shadow: 20px 0 42px rgba(12, 22, 36, 0.22) !important;
  transform: translate3d(-105%, 0, 0) !important;
  transition: transform 0.22s ease !important;
  will-change: transform;
  contain: layout paint style;
  -webkit-overflow-scrolling: touch;
}

body.mobile-app.native-mobile-drawer-open .app-shell.native-app-shell > .side-nav.mobile-drawer-panel,
body.mobile-app .app-shell.native-app-shell.native-mobile-drawer-open > .side-nav.mobile-drawer-panel {
  transform: translate3d(0, 0, 0) !important;
}

body.mobile-app .mobile-drawer-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 300 !important;
  display: block !important;
  width: 100vw;
  height: 100dvh;
  background: rgba(10, 18, 30, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  will-change: opacity;
}

body.mobile-app.native-mobile-drawer-open .mobile-drawer-backdrop,
body.mobile-app .app-shell.native-app-shell.native-mobile-drawer-open .mobile-drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.mobile-app .mobile-edge-swipe-zone {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 260;
  width: 24px;
  background: transparent;
  pointer-events: none;
}

body.mobile-app .mobile-menu-button,
body.mobile-app [data-open-mobile-drawer] {
  display: none !important;
}

body.mobile-app .mobile-bottom-nav {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 240 !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: calc(74px + env(safe-area-inset-bottom, 0px));
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
}

body.mobile-app .native-mail-detail-open .mobile-bottom-nav,
body.mobile-app .app-shell.native-mail-detail-open .mobile-bottom-nav {
  display: none !important;
}

body.mobile-app .mail-layout,
body.mobile-app .mail-list-pane,
body.mobile-app .workspace-pane {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body.mobile-app .mobile-mail-screen.mobile-list-screen {
  position: absolute;
  inset: 0;
  height: auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(94px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scroll-behavior: auto !important;
  touch-action: pan-y;
}

body.mobile-app .mobile-mail-list-header {
  padding: calc(env(safe-area-inset-top, 0px) + 22px) 20px 12px;
}

body.mobile-app .mobile-mail-title-row {
  width: 100%;
}

body.mobile-app .mobile-mail-title-row h1 {
  font-size: 30px;
  text-align: left;
}

body.mobile-app .mobile-mail-title-row p {
  text-align: left;
}

body.mobile-app .mobile-folder-tabs,
body.mobile-app .mail-list.mobile-native-list {
  width: 100%;
  max-width: 100%;
}

body.mobile-app .mail-list.mobile-native-list {
  padding: 0 20px 20px;
}

body.mobile-app .mail-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

body.mobile-app .mobile-detail-screen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 420 !important;
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden !important;
  background: #fff;
  contain: layout paint;
}

body.mobile-app .mobile-detail-top {
  z-index: 2;
}

body.mobile-app .mobile-detail-content {
  width: 100%;
  min-width: 0;
  max-width: 100vw;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 22px 20px calc(92px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}

body.mobile-app .mobile-detail-title,
body.mobile-app .mobile-detail-sender,
body.mobile-app .mobile-detail-labels,
body.mobile-app .mobile-detail-attachments,
body.mobile-app .mobile-detail-body,
body.mobile-app .mobile-detail-body .body-copy,
body.mobile-app .mobile-detail-body .mail-html-content {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

body.mobile-app .mobile-detail-body .mail-html-content,
body.mobile-app .mobile-detail-body .mail-html-content body,
body.mobile-app .mobile-detail-body .mail-html-content div,
body.mobile-app .mobile-detail-body .mail-html-content p,
body.mobile-app .mobile-detail-body .mail-html-content td,
body.mobile-app .mobile-detail-body .mail-html-content th {
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

body.mobile-app .mobile-detail-body .mail-html-content table,
body.mobile-app .mobile-detail-body .mail-html-content tbody,
body.mobile-app .mobile-detail-body .mail-html-content tr {
  width: 100% !important;
  max-width: 100% !important;
}

body.mobile-app .mobile-detail-body .mail-html-content img,
body.mobile-app .mobile-detail-body .mail-html-content video,
body.mobile-app .mobile-detail-body .mail-html-content iframe {
  max-width: 100% !important;
  height: auto !important;
}

body.mobile-app .mobile-detail-actionbar {
  z-index: 460 !important;
  pointer-events: auto !important;
}

body.mobile-app .compose-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 620 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
}

body.mobile-app .dialog-overlay,
body.mobile-app .mail-label-modal,
body.mobile-app .category-manager-modal {
  z-index: 640 !important;
}

body.mobile-app .mobile-page-screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(96px + env(safe-area-inset-bottom, 0px));
  background: #eef3f8;
  -webkit-overflow-scrolling: touch;
}

body.mobile-app .mobile-page-search,
body.mobile-app .mobile-mail-search-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  margin: 0 0 22px;
  padding: 0 18px;
  color: #8a97a8;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  background: #fff;
  border: 1px solid #dbe5f0;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(24, 39, 58, 0.05);
}

body.mobile-app .mobile-page-head,
body.mobile-app .mobile-mail-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0 0 16px;
}

body.mobile-app .mobile-page-head > div:first-child,
body.mobile-app .mobile-mail-title-row > div {
  min-width: 0;
}

body.mobile-app .mobile-page-head h1,
body.mobile-app .mobile-mail-title-row h1 {
  margin: 0;
  max-width: 100%;
  font-size: clamp(28px, 8vw, 36px);
  line-height: 1.1;
  letter-spacing: 0;
  word-break: keep-all;
  overflow-wrap: normal;
}

body.mobile-app .mobile-page-head p,
body.mobile-app .mobile-mail-title-row p {
  margin: 6px 0 0;
  color: #687789;
  font-size: 14px;
  font-weight: 700;
}

body.mobile-app .mobile-page-actions,
body.mobile-app .mobile-detail-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

body.mobile-app .mobile-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: #182536;
  background: #fff;
  border: 1px solid #dbe5f0;
  border-radius: 14px;
}

body.mobile-app .mobile-action-pills,
body.mobile-app .mobile-calendar-mode {
  display: flex;
  gap: 10px;
  width: calc(100% + 32px);
  margin: 0 -16px 18px;
  padding: 0 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

body.mobile-app .mobile-action-pills::-webkit-scrollbar,
body.mobile-app .mobile-calendar-mode::-webkit-scrollbar {
  display: none;
}

body.mobile-app .mobile-action-pills button,
body.mobile-app .mobile-calendar-mode button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  color: #172233;
  font-size: 15px;
  font-weight: 800;
  background: #fff;
  border: 1px solid #dbe5f0;
  border-radius: 16px;
  white-space: nowrap;
}

body.mobile-app .mobile-calendar-mode button.active {
  color: #1267ff;
  border-color: #1267ff;
  background: #eaf2ff;
}

body.mobile-app .mobile-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

body.mobile-app .mobile-metric {
  display: grid;
  gap: 8px;
  min-height: 94px;
  padding: 18px;
  background: #fff;
  border: 1px solid #dbe5f0;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(24, 39, 58, 0.06);
}

body.mobile-app .mobile-metric strong {
  font-size: 30px;
  line-height: 1;
}

body.mobile-app .mobile-metric span,
body.mobile-app .mobile-list-card span,
body.mobile-app .mobile-list-card small {
  color: #687789;
  font-size: 13px;
  font-weight: 700;
}

body.mobile-app .mobile-card-list {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

body.mobile-app .mobile-section-title {
  color: #6d7b8d;
  font-size: 14px;
  font-weight: 900;
}

body.mobile-app .mobile-list-card,
body.mobile-app .mobile-empty-card {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  text-align: left;
  background: #fff;
  border: 1px solid #dbe5f0;
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(24, 39, 58, 0.05);
}

body.mobile-app .mobile-list-card > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

body.mobile-app .mobile-list-card strong {
  color: #172233;
  font-size: 16px;
  line-height: 1.25;
}

body.mobile-app .mobile-empty-card {
  color: #748195;
  justify-content: center;
  min-height: 76px;
  font-weight: 800;
}

body.mobile-app .mobile-mail-screen.mobile-list-screen {
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(100px + env(safe-area-inset-bottom, 0px));
}

body.mobile-app .mobile-mail-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

body.mobile-app .mail-list.mobile-native-list {
  display: grid;
  gap: 2px;
  padding: 0 0 96px;
}

body.mobile-app .mobile-mail-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  min-height: 86px;
  padding: 14px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(196, 207, 220, 0.78);
}

body.mobile-app .mobile-mail-row .avatar {
  width: 46px;
  height: 46px;
}

body.mobile-app .mobile-mail-row-main {
  min-width: 0;
}

body.mobile-app .mobile-mail-row-top,
body.mobile-app .mobile-mail-row-subject,
body.mobile-app .mobile-mail-row-preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-app .mobile-mail-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

body.mobile-app .mobile-mail-row-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

body.mobile-app .mobile-mail-row-top time,
body.mobile-app .mobile-mail-row-side {
  flex: 0 0 auto;
  color: #8390a1;
  font-size: 13px;
  font-weight: 800;
}

body.mobile-app .mobile-mail-row-subject {
  margin-top: 4px;
  color: #172233;
  font-size: 16px;
  font-weight: 700;
}

body.mobile-app .mobile-mail-row-preview {
  margin-top: 3px;
  color: #7a8798;
  font-size: 14px;
}

body.mobile-app .mobile-mail-row-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 210px;
  margin-top: 8px;
  padding: 7px 10px;
  color: #69788a;
  background: #fff;
  border: 1px solid #dfe7f0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-app .mobile-mail-row-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

body.mobile-app .mobile-mail-row-side b {
  min-width: 22px;
  padding: 2px 6px;
  text-align: center;
  color: #7a8493;
  background: #edf2f8;
  border-radius: 8px;
}

body.mobile-app .mobile-mail-row-side .thread-count {
  min-width: 34px !important;
  height: 24px !important;
  margin-left: 0 !important;
  padding: 0 7px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
}

body.mobile-app .mobile-mail-row-side .thread-count.has-unread {
  color: #2563eb !important;
  background: #dbeafe !important;
}

body.mobile-app .mobile-compose-fab {
  position: fixed;
  right: 20px;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  z-index: 245;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  color: #fff;
  background: #1267ff;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 16px 34px rgba(18, 103, 255, 0.32);
}

body.mobile-app .mobile-calendar-card {
  padding: 14px;
  margin: 0 0 18px;
  background: #fff;
  border: 1px solid #dbe5f0;
  border-radius: 18px;
}

body.mobile-app .mobile-calendar-weekdays,
body.mobile-app .mobile-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

body.mobile-app .mobile-calendar-weekdays {
  margin-bottom: 8px;
  color: #7a8798;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

body.mobile-app .mobile-calendar-day {
  position: relative;
  min-height: 42px;
  color: #1b2838;
  background: #f7f9fc;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
}

body.mobile-app .mobile-calendar-day.active {
  color: #fff;
  background: #1267ff;
}

body.mobile-app .mobile-calendar-day.muted {
  color: #a6afbb;
}

body.mobile-app .mobile-calendar-day i {
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 5px;
  height: 5px;
  transform: translateX(-50%);
  background: currentColor;
  border-radius: 999px;
  font-size: 0;
}

body.mobile-app .mobile-calendar-screen {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: calc(100dvh - 76px - env(safe-area-inset-bottom, 0px));
  min-height: calc(100dvh - 76px - env(safe-area-inset-bottom, 0px));
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 0 calc(86px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  background: #fff;
}

body.mobile-app .mobile-calendar-native-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 18px 12px;
  background: #fff;
}

body.mobile-app .mobile-calendar-native-head h1 {
  margin: 0;
  color: #172233;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.mobile-app .mobile-calendar-native-head p {
  margin: 6px 0 0;
  color: #778395;
  font-size: 13px;
  font-weight: 800;
}

body.mobile-app .mobile-calendar-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body.mobile-app .mobile-calendar-head-actions .mobile-icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 0;
  border-radius: 999px;
}

body.mobile-app .mobile-calendar-import-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 0 14px 10px;
  background: #fff;
}

body.mobile-app .mobile-calendar-import-strip span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #4f5d72;
  font-size: 13px;
  font-weight: 850;
}

body.mobile-app .mobile-calendar-import-strip span svg {
  width: 17px;
  height: 17px;
  color: #1267ff;
}

body.mobile-app .mobile-calendar-import-strip button {
  min-height: 32px;
  padding: 0 10px;
  color: #1267ff;
  background: #eef5ff;
  border: 1px solid #d5e6ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

body.mobile-app .mobile-calendar-month-shell {
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr);
  width: 100%;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  border-top: 1px solid #edf1f5;
  border-bottom: 1px solid #edf1f5;
  touch-action: pan-y;
}

@keyframes mobileCalendarMonthNext {
  from {
    opacity: 0.3;
    transform: translate3d(26px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes mobileCalendarMonthPrev {
  from {
    opacity: 0.3;
    transform: translate3d(-26px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

body.mobile-app .mobile-calendar-month-shell.calendar-month-transition-next .mobile-calendar-month-grid {
  animation: mobileCalendarMonthNext 0.22s ease both;
  will-change: transform, opacity;
}

body.mobile-app .mobile-calendar-month-shell.calendar-month-transition-prev .mobile-calendar-month-grid {
  animation: mobileCalendarMonthPrev 0.22s ease both;
  will-change: transform, opacity;
}

body.mobile-app .mobile-calendar-week-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  height: 40px;
  align-items: center;
  color: #3f4650;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  border-bottom: 1px solid #edf1f5;
}

body.mobile-app .mobile-calendar-month-grid {
  display: grid;
  grid-template-rows: repeat(6, minmax(0, 1fr));
  width: 100%;
  height: 100%;
  min-height: 0;
}

body.mobile-app .mobile-calendar-month-week {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid #edf1f5;
}

body.mobile-app .mobile-calendar-week-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
  height: 100%;
  min-height: 0;
}

body.mobile-app .mobile-calendar-month-day {
  position: relative;
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 6px 2px 3px;
  background: transparent;
  border-right: 1px solid #edf1f5;
}

body.mobile-app .mobile-calendar-month-day:last-child {
  border-right: 0;
}

body.mobile-app .mobile-calendar-month-day.is-muted {
  color: #a6afbb;
  background: #fbfcfe;
}

body.mobile-app .mobile-calendar-month-day.is-selected {
  background: #f8fbff;
  box-shadow: inset 0 0 0 2px rgba(18, 103, 255, 0.25);
}

body.mobile-app .mobile-calendar-day-head {
  display: flex;
  justify-content: center;
  min-width: 0;
}

body.mobile-app .mobile-calendar-day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #1f2937;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
  font-weight: 850;
}

body.mobile-app .mobile-calendar-month-day.is-muted .mobile-calendar-day-number {
  color: #a8b0bc;
}

body.mobile-app .mobile-calendar-month-day.is-today .mobile-calendar-day-number {
  color: #fff;
  background: #ef4444;
}

body.mobile-app .mobile-calendar-day-events {
  display: grid;
  gap: 2px;
  min-width: 0;
}

body.mobile-app .mobile-calendar-week-event-layer {
  position: absolute;
  left: 0;
  right: 0;
  top: 32px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: 18px;
  gap: 2px 0;
  padding: 0 2px;
  pointer-events: none;
}

body.mobile-app .mobile-calendar-event-segment {
  min-width: 0;
  height: 17px;
  margin: 0 1px;
  padding: 0 6px;
  overflow: hidden;
  color: #fff;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--event-color, #2563eb);
  border: 0;
  border-radius: 4px;
  font-size: 10px;
  line-height: 17px;
  font-weight: 850;
  pointer-events: auto;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

body.mobile-app .mobile-calendar-event-segment.is-span-continued-start {
  margin-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

body.mobile-app .mobile-calendar-event-segment.is-span-continued-end {
  margin-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

body.mobile-app .mobile-calendar-event-chip {
  display: block;
  width: 100%;
  min-width: 0;
  height: 16px;
  padding: 0 4px;
  overflow: hidden;
  color: #fff;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--event-color, #2563eb);
  border: 0;
  border-radius: 3px;
  font-size: 9px;
  line-height: 16px;
  font-weight: 800;
}

body.mobile-app .mobile-calendar-event-chip.more {
  color: #5f6978;
  background: #e7edf5;
  text-align: center;
}

body.mobile-app .mobile-calendar-event-chip.event-span-start {
  border-radius: 3px 1px 1px 3px;
}

body.mobile-app .mobile-calendar-event-chip.event-span-middle {
  border-radius: 1px;
}

body.mobile-app .mobile-calendar-event-chip.event-span-end {
  border-radius: 1px 3px 3px 1px;
}

body.mobile-app .mobile-calendar-agenda {
  display: none;
  gap: 10px;
  padding: 16px;
  background: #eef3f8;
}

body.mobile-app .mobile-calendar-agenda > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

body.mobile-app .mobile-calendar-agenda > header div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

body.mobile-app .mobile-calendar-agenda > header strong {
  color: #172233;
  font-size: 17px;
  line-height: 1.2;
}

body.mobile-app .mobile-calendar-agenda > header span {
  color: #7a8798;
  font-size: 13px;
  font-weight: 800;
}

body.mobile-app .mobile-mini-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  color: #1267ff;
  background: #fff;
  border: 1px solid #d8e2ef;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 850;
}

body.mobile-app .mobile-settings-screen {
  display: grid;
  align-content: start;
  gap: 14px;
}

body.mobile-app .mobile-settings-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

body.mobile-app .mobile-settings-profile .avatar {
  width: 62px;
  height: 62px;
  font-size: 24px;
}

body.mobile-app .mobile-settings-profile h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

body.mobile-app .mobile-settings-profile p {
  margin: 5px 0 0;
  color: #718092;
  font-weight: 700;
}

body.mobile-app .mobile-settings-card {
  width: 100%;
  min-width: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid #dbe5f0;
  border-radius: 16px;
}

body.mobile-app .mobile-settings-card select,
body.mobile-app .mobile-settings-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #d6e0ec;
  border-radius: 12px;
}

body.mobile-app .mobile-settings-label {
  display: block;
  margin-bottom: 8px;
  color: #6f7d8e;
  font-size: 13px;
  font-weight: 900;
}

body.mobile-app .mobile-settings-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  text-align: left;
  background: transparent;
  border: 0;
  color: #172233;
  font-size: 16px;
  text-decoration: none;
}

body.mobile-app details.mobile-settings-details {
  display: block !important;
  padding: 0 !important;
  overflow: visible !important;
}

body.mobile-app details.mobile-settings-details:not([open]) {
  height: 64px !important;
  max-height: 64px !important;
}

body.mobile-app .mobile-settings-details summary {
  display: grid !important;
  grid-template-columns: 36px minmax(0, 1fr) 20px !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  height: 64px !important;
  min-height: 64px !important;
  padding: 0 14px !important;
  color: #172233;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
  list-style: none;
  cursor: pointer;
  overflow: visible !important;
  -webkit-tap-highlight-color: transparent;
}

body.mobile-app .mobile-settings-details summary::after {
  content: "›";
  justify-self: end;
  color: #8794a6;
  font-size: 24px;
  line-height: 1;
  transition: transform 0.16s ease;
}

body.mobile-app .mobile-settings-details[open] summary::after {
  transform: rotate(90deg);
}

body.mobile-app .mobile-settings-details summary svg {
  width: 22px;
  height: 22px;
}

body.mobile-app .mobile-settings-details summary::-webkit-details-marker {
  display: none;
}

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

body.mobile-app .mobile-settings-form label {
  display: grid;
  gap: 6px;
  color: #6f7d8e;
  font-size: 13px;
  font-weight: 900;
}

body.mobile-app .mobile-file-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: #1267ff !important;
  background: #eef5ff;
  border-radius: 12px;
}

body.mobile-app .mobile-logout-button {
  min-height: 50px;
  color: #d33030;
  font-size: 16px;
  font-weight: 900;
  background: #fff;
  border: 1px solid #f0d6d6;
  border-radius: 16px;
}

body.mobile-app .mobile-sheet-modal,
body.mobile-app .mobile-compose-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 720 !important;
  width: 100vw !important;
  height: 100dvh !important;
  overflow: hidden !important;
  background: #fff !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.mobile-app .mobile-compose-form,
body.mobile-app .mobile-sheet-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 100%;
}

body.mobile-app .mobile-compose-head {
  display: grid;
  grid-template-columns: minmax(64px, 1fr) auto minmax(64px, 1fr);
  align-items: center;
  gap: 10px;
  min-height: calc(58px + env(safe-area-inset-top, 0px));
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 18px 8px;
  background: #fff;
  border-bottom: 1px solid #e4ebf3;
}

body.mobile-app .mobile-compose-head strong {
  color: #172233;
  font-size: 18px;
  text-align: center;
}

body.mobile-app .mobile-compose-head button {
  min-height: 38px;
  color: #1267ff;
  font-size: 16px;
  font-weight: 800;
  background: transparent;
  border: 0;
}

body.mobile-app .mobile-compose-head button:first-child {
  justify-self: start;
  color: #172233;
}

body.mobile-app .mobile-compose-head .mobile-compose-send {
  justify-self: end;
}

body.mobile-app .mobile-compose-scroll,
body.mobile-app .mobile-sheet-scroll {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

body.mobile-app .mobile-compose-line,
body.mobile-app .mobile-compose-input {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  color: #172233;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #e4ebf3;
  border-radius: 0;
  font-size: 16px;
}

body.mobile-app .mobile-compose-line span {
  color: #7a8798;
  font-weight: 800;
}

body.mobile-app .mobile-compose-line strong {
  min-width: 0;
  color: #4f5d6d;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-app .mobile-compose-input {
  display: block;
  min-height: 56px;
  color: #172233;
  font-size: 18px;
}

body.mobile-app .mobile-compose-input::placeholder {
  color: #a7b0bd;
}

body.mobile-app .mobile-compose-subject {
  font-weight: 900;
}

body.mobile-app .mobile-compose-details {
  border-bottom: 1px solid #e4ebf3;
}

body.mobile-app .mobile-compose-details summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  color: #6f7d8e;
  font-size: 14px;
  font-weight: 900;
  list-style: none;
}

body.mobile-app .mobile-compose-details summary::-webkit-details-marker {
  display: none;
}

body.mobile-app .mobile-compose-modal .compose-options,
body.mobile-app .mobile-compose-modal .recipient-hints,
body.mobile-app .mobile-compose-modal .upload-zone,
body.mobile-app .mobile-compose-modal .drive-tools {
  margin: 0;
  padding: 12px 18px;
  border: 0;
  border-top: 1px solid #eef2f7;
  border-radius: 0;
}

body.mobile-app .mobile-compose-modal .recipient-chip-row {
  overflow-x: auto;
  flex-wrap: nowrap;
}

body.mobile-app .mobile-compose-editor {
  min-height: 360px;
  background: #fff;
}

body.mobile-app .mobile-compose-editor .rich-editor {
  border: 0;
  border-bottom: 1px solid #e4ebf3;
  border-radius: 0;
}

body.mobile-app .mobile-compose-editor .editor-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 8px 12px;
  background: #f8fbff;
  border-bottom: 1px solid #e4ebf3;
  scrollbar-width: none;
}

body.mobile-app .mobile-compose-editor .editor-toolbar::-webkit-scrollbar {
  display: none;
}

body.mobile-app .mobile-compose-editor .editor-toolbar button,
body.mobile-app .mobile-compose-editor .editor-toolbar select {
  flex: 0 0 auto;
}

body.mobile-app .mobile-compose-editor [data-editor="compose-body"] {
  min-height: 320px !important;
  padding: 18px !important;
  font-size: 17px;
  line-height: 1.65;
}

body.mobile-app .mobile-compose-foot {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  min-height: calc(58px + env(safe-area-inset-bottom, 0px));
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid #e4ebf3;
}

body.mobile-app .mobile-compose-foot label,
body.mobile-app .mobile-compose-foot button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #5e6c7d;
  background: transparent;
  border: 0;
}

body.mobile-app .mobile-event-composer.google-calendar-create {
  display: flex !important;
  align-items: flex-end !important;
  justify-content: stretch !important;
  background: rgba(15, 23, 42, 0.42) !important;
}

body.mobile-app .mobile-event-composer .mobile-event-form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  max-height: 94dvh;
  min-height: min(760px, 88dvh);
  overflow: hidden;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -18px 42px rgba(15, 23, 42, 0.18);
}

body.mobile-app .mobile-google-event-head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(64px, 1fr) auto minmax(64px, 1fr);
  align-items: center;
  gap: 8px;
  min-height: calc(58px + env(safe-area-inset-top, 0px));
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 18px 8px;
  background: #fff;
  border-bottom: 1px solid #edf1f5;
}

body.mobile-app .mobile-google-event-head button {
  min-height: 40px;
  color: #1267ff;
  font-size: 16px;
  font-weight: 800;
  background: transparent;
  border: 0;
}

body.mobile-app .mobile-google-event-head button:first-child {
  justify-self: start;
}

body.mobile-app .mobile-google-event-head .mobile-google-save {
  justify-self: end;
}

body.mobile-app .mobile-sheet-grabber {
  width: 46px;
  height: 6px;
  background: #d8dde6;
  border-radius: 999px;
}

body.mobile-app .mobile-google-event-scroll {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

body.mobile-app .mobile-event-title-field {
  display: block;
  padding: 20px 20px 12px 64px;
  background: #fff;
}

body.mobile-app .mobile-event-title-field input {
  width: 100%;
  min-height: 48px;
  color: #172233;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 820;
}

body.mobile-app .mobile-event-title-field input::placeholder {
  color: #b4bac4;
}

body.mobile-app .mobile-event-type-strip {
  display: flex;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  padding: 0 20px 18px 64px;
  background: #fff;
  border-bottom: 1px solid #edf1f5;
  scrollbar-width: none;
}

body.mobile-app .mobile-event-type-strip::-webkit-scrollbar {
  display: none;
}

body.mobile-app .mobile-event-type-strip button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 18px;
  color: #172233;
  background: #fff;
  border: 1px solid #dfe5ed;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 850;
}

body.mobile-app .mobile-event-type-strip button.active {
  color: #075985;
  background: #d8efff;
  border-color: #b8e0fb;
}

body.mobile-app .mobile-event-section {
  background: #fff;
  border-bottom: 10px solid #f4f6f9;
}

body.mobile-app .mobile-event-section:last-child {
  border-bottom: 0;
}

body.mobile-app .mobile-event-row {
  display: grid;
  grid-template-columns: 34px minmax(76px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 0 20px;
  color: #1f2937;
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  border-radius: 0;
  font-size: 16px;
  font-weight: 700;
}

body.mobile-app .mobile-event-row:last-child {
  border-bottom: 0;
}

body.mobile-app .mobile-event-row > svg,
body.mobile-app .mobile-event-description > svg {
  width: 24px;
  height: 24px;
  color: #68778a;
}

body.mobile-app .mobile-event-row .avatar {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

body.mobile-app .mobile-event-row span {
  color: #6b7280;
  font-weight: 780;
}

body.mobile-app .mobile-event-row input,
body.mobile-app .mobile-event-row select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  color: #1f2937;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 16px;
  font-weight: 700;
}

body.mobile-app .mobile-event-row input::placeholder {
  color: #b4bac4;
}

body.mobile-app .mobile-event-row input[type="date"],
body.mobile-app .mobile-event-row input[type="time"],
body.mobile-app .mobile-event-row select {
  text-align: right;
}

body.mobile-app .mobile-event-row input:disabled {
  color: #8a95a5;
  opacity: 1;
}

body.mobile-app .mobile-event-switch-row {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

body.mobile-app .mobile-event-switch-row input[type="checkbox"] {
  width: 50px;
  height: 30px;
  accent-color: #1a73e8;
}

body.mobile-app .mobile-event-row-spacer {
  width: 24px;
  height: 24px;
}

body.mobile-app .mobile-event-row[data-mobile-event-disabled] {
  color: #6b7280;
}

body.mobile-app .mobile-event-row[data-mobile-event-disabled] span {
  color: #9aa4b2;
}

body.mobile-app .mobile-event-color-dot {
  width: 18px;
  height: 18px;
  justify-self: center;
  background: var(--event-color, #1a73e8);
  border-radius: 6px;
}

body.mobile-app .mobile-event-description {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 14px 20px;
  background: #fff;
}

body.mobile-app .mobile-event-description textarea {
  width: 100%;
  min-height: 98px;
  padding: 0;
  color: #1f2937;
  background: transparent;
  border: 0;
  outline: 0;
  resize: vertical;
  font-size: 16px;
  line-height: 1.55;
  font-weight: 650;
}

body.mobile-app .mobile-event-description textarea::placeholder {
  color: #b4bac4;
}

body.mobile-app .mobile-sheet-scroll {
  padding: 16px;
}

body.mobile-app .mobile-sheet-scroll .form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

body.mobile-app .mobile-sheet-scroll .field,
body.mobile-app .mobile-sheet-scroll .field.full,
body.mobile-app .mobile-sheet-scroll .full {
  grid-column: 1;
}

body.mobile-app .mobile-sheet-scroll input,
body.mobile-app .mobile-sheet-scroll select {
  min-height: 48px;
}

body.mobile-app .signature-manager {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0 14px 14px;
}

body.mobile-app .signature-editor .form-grid {
  grid-template-columns: 1fr;
}

body.mobile-app .signature-editor .rich-editor [contenteditable="true"] {
  min-height: 120px !important;
}

/* Native mobile hardening: keep app pages inside the phone viewport. */
body.mobile-app,
body.mobile-app #app,
body.mobile-app .app-shell.native-app-shell,
body.mobile-app .app-shell.native-app-shell .main,
body.mobile-app .app-shell.native-app-shell .content {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

body.mobile-app * {
  box-sizing: border-box;
}

body.mobile-app .mobile-page-screen,
body.mobile-app .mobile-mail-screen.mobile-list-screen,
body.mobile-app .mobile-detail-screen,
body.mobile-app .mobile-search-screen {
  width: 100vw !important;
  max-width: 100vw !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
}

body.mobile-app .mobile-page-head,
body.mobile-app .mobile-mail-list-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end !important;
  gap: 12px !important;
}

body.mobile-app .mobile-page-head > div:first-child,
body.mobile-app .mobile-mail-title-row > div,
body.mobile-app .mobile-page-head h1,
body.mobile-app .mobile-mail-title-row h1,
body.mobile-app .mobile-page-head p,
body.mobile-app .mobile-mail-title-row p {
  min-width: 0 !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

body.mobile-app .mobile-page-head h1,
body.mobile-app .mobile-mail-title-row h1 {
  display: block !important;
  max-width: 100% !important;
  font-size: clamp(26px, 7.2vw, 34px) !important;
  line-height: 1.12 !important;
}

body.mobile-app .mobile-collaboration-screen .mobile-page-head h1,
body.mobile-app .mobile-calendar-screen .mobile-page-head h1 {
  font-size: 30px !important;
}

body.mobile-app .mobile-action-pills,
body.mobile-app .mobile-calendar-mode,
body.mobile-app .mobile-folder-tabs {
  max-width: 100vw !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  white-space: nowrap !important;
}

body.mobile-app .mobile-metric-grid {
  grid-template-columns: 1fr !important;
}

body.mobile-app .mobile-detail-content {
  touch-action: pan-y !important;
  overscroll-behavior-x: contain !important;
}

body.mobile-app .mobile-detail-body,
body.mobile-app .mobile-detail-body .body-copy,
body.mobile-app .mobile-detail-body .mail-html-content,
body.mobile-app .mobile-detail-body .mail-html-content * {
  max-width: 100% !important;
  min-width: 0 !important;
}

body.mobile-app .mobile-detail-body .mail-html-content {
  overflow-x: hidden !important;
  transform-origin: top left;
}

body.mobile-app .mobile-detail-body .mail-html-content table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: auto !important;
}

body.mobile-app .mobile-detail-body .mail-html-content img,
body.mobile-app .mobile-detail-body .mail-html-content video,
body.mobile-app .mobile-detail-body .mail-html-content iframe {
  max-width: 100% !important;
  height: auto !important;
}

body.mobile-app .mobile-detail-actionbar {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 760 !important;
  pointer-events: auto !important;
}

body.mobile-app .mobile-compose-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 900 !important;
  display: block !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  background: #fff !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

body.mobile-app .mobile-compose-form {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  background: #fff !important;
}

body.mobile-app .mobile-compose-scroll {
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
}

body.mobile-app .mobile-compose-line,
body.mobile-app .mobile-compose-input {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.mobile-app .mobile-compose-editor {
  min-height: 34dvh !important;
}

body.mobile-app .mobile-compose-editor .editor-toolbar {
  display: none !important;
}

body.mobile-app .mobile-compose-editor [data-editor="compose-body"] {
  min-height: 34dvh !important;
  padding: 20px 18px !important;
  font-size: 17px !important;
  line-height: 1.65 !important;
}

body.mobile-app .mobile-compose-foot {
  z-index: 2 !important;
}

body.mobile-app .app-shell.native-app-shell:has(.mobile-compose-modal) .mobile-bottom-nav,
body.mobile-app .mobile-compose-modal ~ .mobile-bottom-nav {
  display: none !important;
}

/* Mobile mail density pass: closer to native mailbox apps. */
body.mobile-app .mobile-mail-list-header {
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 18px 8px !important;
}

body.mobile-app .mobile-mail-title-row h1,
body.mobile-app .mobile-page-head h1 {
  font-size: clamp(22px, 6vw, 28px) !important;
  line-height: 1.16 !important;
  font-weight: 800 !important;
}

body.mobile-app .mobile-mail-title-row p,
body.mobile-app .mobile-page-head p {
  margin-top: 2px !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
  font-weight: 650 !important;
}

body.mobile-app .mobile-mail-head-action {
  min-width: 64px !important;
  min-height: 34px !important;
  border: 1px solid #d9e3ef !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  color: #1f6fff !important;
  background: #f7fbff !important;
  font-size: 12px !important;
  font-weight: 780 !important;
  white-space: nowrap !important;
}

body.mobile-app .mobile-mail-head-action svg {
  width: 15px !important;
  height: 15px !important;
}

body.mobile-app .mobile-mail-search-card {
  min-height: 44px !important;
  margin-bottom: 10px !important;
  font-size: 15px !important;
  font-weight: 650 !important;
}

body.mobile-app .mobile-folder-tabs {
  gap: 7px !important;
  padding-bottom: 6px !important;
}

body.mobile-app .mobile-folder-tabs button,
body.mobile-app .category-chip {
  min-height: 31px !important;
  padding: 0 10px !important;
  font-size: 11px !important;
  font-weight: 760 !important;
}

body.mobile-app .mail-list.mobile-native-list {
  padding-bottom: 88px !important;
}

body.mobile-app .mobile-mail-load-more {
  width: calc(100% - 32px) !important;
  min-height: 36px !important;
  margin: -72px 16px 86px !important;
  border: 0 !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  color: #5f6f83 !important;
  background: #eef3f8 !important;
  font-size: 12px !important;
  font-weight: 760 !important;
}

body.mobile-app .mobile-mail-load-more svg {
  width: 15px !important;
  height: 15px !important;
}

body.mobile-app .mobile-mail-load-more small {
  color: #8794a6 !important;
  font: inherit !important;
}

body.mobile-app .mobile-mail-row {
  grid-template-columns: 40px minmax(0, 1fr) auto !important;
  gap: 10px !important;
  min-height: 74px !important;
  padding: 11px 0 !important;
}

body.mobile-app .mobile-mail-row .avatar {
  width: 38px !important;
  height: 38px !important;
  font-size: 16px !important;
}

body.mobile-app .mobile-mail-row-leading {
  display: grid !important;
  place-items: center !important;
  width: 40px !important;
  min-width: 0 !important;
}

body.mobile-app .mobile-mail-row-leading > .mobile-mail-select-circle,
body.mobile-app .mobile-mail-row-leading > .mobile-mail-row-avatar {
  grid-area: 1 / 1 !important;
}

body.mobile-app .mobile-mail-row-avatar {
  display: grid !important;
  place-items: center !important;
}

body.mobile-app .mobile-mail-row-top strong {
  color: #172033 !important;
  font-size: 15px !important;
  line-height: 1.18 !important;
  font-weight: 500 !important;
}

body.mobile-app .mobile-mail-row.unread .mobile-mail-row-top strong {
  font-weight: 820 !important;
}

body.mobile-app .mobile-mail-row-top time,
body.mobile-app .mobile-mail-row-side {
  font-size: 12px !important;
  font-weight: 600 !important;
}

body.mobile-app .mobile-mail-row-subject {
  margin-top: 3px !important;
  font-size: 14px !important;
  line-height: 1.22 !important;
  font-weight: 450 !important;
}

body.mobile-app .mobile-mail-row.unread .mobile-mail-row-subject {
  font-weight: 760 !important;
}

body.mobile-app .mobile-mail-row-preview {
  margin-top: 3px !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
}

body.mobile-app .mobile-mail-row-attachment {
  margin-top: 6px !important;
  padding: 5px 8px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

body.mobile-app .mobile-detail-content {
  padding: 14px 18px calc(86px + env(safe-area-inset-bottom, 0px)) !important;
  background: #fff !important;
}

body.mobile-app .mobile-detail-title {
  margin: 0 0 16px !important;
  color: #111827 !important;
  font-size: 24px !important;
  line-height: 1.28 !important;
  font-weight: 800 !important;
}

body.mobile-app .mobile-detail-sender {
  grid-template-columns: 44px minmax(0, 1fr) !important;
  gap: 12px !important;
  padding-bottom: 14px !important;
}

body.mobile-app .mobile-detail-sender .avatar {
  width: 44px !important;
  height: 44px !important;
  font-size: 18px !important;
}

body.mobile-app .mobile-detail-sender strong {
  margin-top: 0 !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
  font-weight: 780 !important;
}

body.mobile-app .mobile-detail-sender span,
body.mobile-app .mobile-recipient-line {
  margin-top: 3px !important;
  font-size: 13px !important;
  line-height: 1.32 !important;
}

body.mobile-app .mobile-detail-labels {
  gap: 7px !important;
  margin-top: 14px !important;
}

body.mobile-app .mobile-detail-body {
  margin-top: 18px !important;
}

body.mobile-app .mobile-detail-body .body-copy,
body.mobile-app .mobile-detail-body .mail-html-content {
  font-size: 15px !important;
  line-height: 1.58 !important;
}

body.mobile-app .mobile-detail-body .mail-html-content * {
  font-size: inherit;
}

body.mobile-app .mobile-detail-body .mail-html-content table {
  font-size: 13px !important;
}

body.mobile-app .mobile-detail-body .mail-html-content td,
body.mobile-app .mobile-detail-body .mail-html-content th {
  padding: 4px !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

body.mobile-app .mobile-detail-actionbar {
  padding: 9px 18px calc(9px + env(safe-area-inset-bottom, 0px)) !important;
  gap: 10px !important;
}

body.mobile-app .mobile-detail-actionbar button {
  min-height: 44px !important;
  font-size: 14px !important;
  font-weight: 760 !important;
}

/* Mobile mailbox gestures and bulk actions. */
body.mobile-app .mobile-mail-category-tabs {
  display: flex !important;
  gap: 8px !important;
  overflow-x: auto !important;
  padding: 0 18px 8px !important;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

body.mobile-app .mobile-mail-category-tabs::-webkit-scrollbar {
  display: none;
}

body.mobile-app .mobile-category-chip {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  min-height: 31px !important;
  border: 1px solid #dbe5f1 !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #1d2b3a !important;
  padding: 0 11px !important;
  font-size: 11px !important;
  line-height: 1 !important;
  font-weight: 760 !important;
  white-space: nowrap !important;
}

body.mobile-app .mobile-category-chip.active {
  border-color: #1677ff !important;
  background: #eef6ff !important;
  color: #0b63d8 !important;
}

body.mobile-app .mobile-category-dot {
  width: 8px !important;
  height: 8px !important;
  border-radius: 999px !important;
  background: var(--label-color, #1677ff) !important;
}

body.mobile-app .mobile-mail-selection-topbar {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  align-items: center !important;
  gap: 8px !important;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px 10px !important;
  background: #f3f8fd !important;
}

body.mobile-app .mobile-mail-selection-topbar button {
  border: 0 !important;
  background: transparent !important;
  color: #1677ff !important;
  padding: 0 !important;
  font-size: 15px !important;
  font-weight: 760 !important;
}

body.mobile-app .mobile-mail-selection-topbar button:first-child {
  text-align: left !important;
}

body.mobile-app .mobile-mail-selection-topbar button:last-child {
  text-align: right !important;
}

body.mobile-app .mobile-mail-selection-topbar strong {
  color: #172033 !important;
  font-size: 16px !important;
  font-weight: 820 !important;
  white-space: nowrap !important;
}

body.mobile-app .mobile-mail-swipe {
  --mobile-mail-action-width: 88px;
  position: relative !important;
  overflow: hidden !important;
  background: #fff !important;
  border-bottom: 1px solid #edf2f7 !important;
  touch-action: pan-y !important;
  contain: layout paint style !important;
  transform: none !important;
}

body.mobile-app .mobile-mail-swipe .mobile-mail-row {
  position: relative !important;
  z-index: 2 !important;
  margin: 0 !important;
  border-bottom: 0 !important;
  background: #fff !important;
  transition: transform 90ms cubic-bezier(0.2, 0, 0, 1), background-color 0.12s ease !important;
  transform: translate3d(0, 0, 0) !important;
  backface-visibility: hidden !important;
  will-change: auto !important;
  -webkit-touch-callout: none;
  user-select: none;
}

body.mobile-app .mobile-mail-swipe.dragging .mobile-mail-row {
  transition: none !important;
  transform: translate3d(var(--mobile-mail-swipe-x, 0px), 0, 0) !important;
  will-change: transform !important;
}

body.mobile-app .mobile-mail-swipe.swipe-right .mobile-mail-row {
  transform: translate3d(var(--mobile-mail-action-width), 0, 0) !important;
  will-change: transform !important;
}

body.mobile-app .mobile-mail-swipe.swipe-left .mobile-mail-row {
  transform: translate3d(calc(-1 * var(--mobile-mail-action-width)), 0, 0) !important;
  will-change: transform !important;
}

body.mobile-app .mobile-swipe-action {
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  width: var(--mobile-mail-action-width) !important;
  border: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  font-size: 11px !important;
  font-weight: 820 !important;
  transform: translateZ(0) !important;
  backface-visibility: hidden !important;
}

body.mobile-app .mobile-swipe-action svg {
  width: 18px !important;
  height: 18px !important;
}

body.mobile-app .mobile-swipe-read {
  left: 0 !important;
  background: #dff0ff !important;
  color: #0b74de !important;
}

body.mobile-app .mobile-swipe-trash {
  right: 0 !important;
  background: #ffe0dd !important;
  color: #d93025 !important;
}

body.mobile-app .mobile-mail-select-circle {
  flex: 0 0 28px !important;
  width: 28px !important;
  height: 28px !important;
  border: 2px solid #b7c3d0 !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #fff !important;
  display: grid !important;
  place-items: center !important;
  margin-top: 2px !important;
}

body.mobile-app .mobile-mail-select-circle.selected {
  border-color: #1677ff !important;
  background: #1677ff !important;
}

body.mobile-app .mobile-mail-select-circle svg {
  width: 16px !important;
  height: 16px !important;
}

body.mobile-app .mobile-mail-screen:not(.mobile-selecting) .mobile-mail-select-circle {
  display: none !important;
}

body.mobile-app .mobile-mail-screen.mobile-selecting .mobile-mail-row-avatar {
  display: none !important;
}

body.mobile-app .mobile-mail-row.selected {
  background: #eef6ff !important;
}

body.mobile-app .mobile-mail-row-labels {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  margin-top: 5px !important;
}

body.mobile-app .mobile-mail-row-labels .label {
  padding: 3px 6px !important;
  font-size: 10.5px !important;
  line-height: 1.2 !important;
}

body.mobile-app .mobile-mail-bulkbar {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 140 !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)) !important;
  gap: 0 !important;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  border-top: 1px solid #dce5ef !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 -8px 22px rgba(15, 23, 42, 0.08) !important;
}

body.mobile-app .mobile-mail-bulkbar button,
body.mobile-app .mobile-bulk-select {
  position: relative !important;
  min-width: 0 !important;
  min-height: 46px !important;
  border: 0 !important;
  background: transparent !important;
  color: #6b7788 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  font-size: 12px !important;
  font-weight: 760 !important;
}

body.mobile-app .mobile-mail-bulkbar svg {
  width: 21px !important;
  height: 21px !important;
}

body.mobile-app .mobile-mail-bulkbar .danger {
  color: #ef4444 !important;
}

body.mobile-app .mobile-bulk-select.disabled,
body.mobile-app .mobile-mail-bulkbar button:disabled {
  opacity: 0.42 !important;
}

body.mobile-app .mobile-bulk-select select {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
}

body.mobile-app .mobile-mail-screen:not(.mobile-selecting) .mobile-mail-selection-topbar,
body.mobile-app .mobile-mail-screen:not(.mobile-selecting) .mobile-mail-bulkbar {
  display: none !important;
}

body.mobile-app .mobile-mail-screen.mobile-selecting .mobile-mail-list-normal-head,
body.mobile-app .mobile-mail-screen.mobile-selecting .mobile-compose-fab {
  display: none !important;
}

body.mobile-app .mobile-list-screen.mobile-selecting .mobile-native-list {
  padding-bottom: 82px !important;
}

/* Mobile drawer compact pass: align the menu with lightweight native mailbox drawers. */
body.mobile-app .app-shell.native-app-shell > .side-nav.mobile-drawer-panel {
  width: min(86vw, 390px) !important;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 16px calc(env(safe-area-inset-bottom, 0px) + 22px) !important;
  gap: 15px !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  background: #f8f9fc !important;
  border-right: 0 !important;
  box-shadow: 18px 0 34px rgba(9, 14, 24, 0.18) !important;
}

body.mobile-app .mobile-drawer-profile {
  grid-template-columns: 48px minmax(0, 1fr) 34px !important;
  gap: 12px !important;
  width: 100% !important;
  padding: 0 2px 4px !important;
}

body.mobile-app .mobile-drawer-profile .avatar {
  width: 48px !important;
  height: 48px !important;
  font-size: 19px !important;
}

body.mobile-app .mobile-drawer-profile strong {
  color: #20242d !important;
  font-size: 17px !important;
  line-height: 1.15 !important;
  font-weight: 500 !important;
}

body.mobile-app .mobile-drawer-profile span {
  margin-top: 2px !important;
  color: #747983 !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  font-weight: 430 !important;
}

body.mobile-app .mobile-drawer-close {
  width: 34px !important;
  height: 34px !important;
  color: #717783 !important;
  background: transparent !important;
}

body.mobile-app .mobile-drawer-close svg {
  width: 21px !important;
  height: 21px !important;
}

body.mobile-app .mobile-drawer-mailbox {
  width: 100% !important;
  gap: 6px !important;
  padding: 10px !important;
  border-radius: 10px !important;
  background: #fff !important;
}

body.mobile-app .mobile-drawer-mailbox select {
  min-height: 36px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 560 !important;
}

body.mobile-app .mobile-drawer-section {
  width: 100% !important;
  gap: 6px !important;
}

body.mobile-app .mobile-drawer-section-title {
  padding: 0 10px 2px !important;
  color: #7e838c !important;
  font-size: 15px !important;
  line-height: 1.1 !important;
  font-weight: 420 !important;
}

body.mobile-app .mobile-drawer-row {
  grid-template-columns: 28px minmax(0, 1fr) auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 44px !important;
  padding: 0 10px !important;
  gap: 11px !important;
  border-radius: 8px !important;
  color: #1f232b !important;
}

body.mobile-app .mobile-drawer-row svg {
  width: 21px !important;
  height: 21px !important;
  color: #727780 !important;
  stroke-width: 2 !important;
}

body.mobile-app .mobile-drawer-row strong {
  color: #1f232b !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
  font-weight: 460 !important;
}

body.mobile-app .mobile-drawer-row.active {
  color: #1f232b !important;
  background: #eef0f5 !important;
}

body.mobile-app .mobile-drawer-row.active svg,
body.mobile-app .mobile-drawer-row.active strong {
  color: #1f232b !important;
}

body.mobile-app .mobile-drawer-empty {
  padding: 0 10px !important;
  color: #9aa0ab !important;
  font-size: 15px !important;
  font-weight: 420 !important;
}

body.mobile-app .mobile-drawer-footer {
  width: 100% !important;
  margin-top: auto !important;
  padding: 14px 0 0 8px !important;
}

body.mobile-app .mobile-drawer-settings {
  width: 44px !important;
  height: 44px !important;
  border: 0 !important;
  border-radius: 50% !important;
  display: inline-grid !important;
  place-items: center !important;
  color: #717780 !important;
  background: rgba(255, 255, 255, 0.8) !important;
}

body.mobile-app .mobile-drawer-settings svg {
  width: 24px !important;
  height: 24px !important;
}

body.mobile-app .mobile-label-dot {
  width: 22px !important;
  height: 22px !important;
  border: 2px solid #858b95 !important;
  background: transparent !important;
  border-radius: 7px !important;
}

body.mobile-app .mobile-drawer-backdrop {
  background: rgba(0, 0, 0, 0.48) !important;
}

body.mobile-app .mobile-mail-screen.mobile-list-screen {
  background: #f6f8fb !important;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 10px calc(88px + env(safe-area-inset-bottom, 0px)) !important;
}

body.mobile-app .mobile-mail-search-card {
  min-height: 34px !important;
  margin: 0 0 10px !important;
  border-radius: 7px !important;
  background: #eef1f5 !important;
  font-size: 13px !important;
  font-weight: 430 !important;
}

body.mobile-app .mobile-mail-search-card svg {
  width: 15px !important;
  height: 15px !important;
}

body.mobile-app .mobile-mail-list-header {
  padding: 0 0 8px !important;
}

body.mobile-app .mobile-mail-title-row {
  gap: 8px !important;
}

body.mobile-app .mobile-mail-title-row .avatar {
  width: 38px !important;
  height: 38px !important;
  font-size: 16px !important;
}

body.mobile-app .mobile-mail-title-row h1 {
  font-size: 19px !important;
  line-height: 1.15 !important;
  font-weight: 560 !important;
}

body.mobile-app .mobile-mail-title-row p {
  margin-top: 1px !important;
  color: #707884 !important;
  font-size: 11px !important;
  font-weight: 420 !important;
}

body.mobile-app .mobile-folder-tabs,
body.mobile-app .mobile-mail-category-tabs {
  gap: 6px !important;
  padding: 0 0 8px !important;
}

body.mobile-app .mobile-folder-tabs button,
body.mobile-app .mobile-category-chip {
  min-height: 28px !important;
  border-radius: 7px !important;
  font-size: 11px !important;
  font-weight: 520 !important;
  background: #fff !important;
}

body.mobile-app .mobile-folder-tabs button.active,
body.mobile-app .mobile-category-chip.active {
  color: #1f63d6 !important;
  background: #eaf1ff !important;
}

body.mobile-app .mail-list.mobile-native-list {
  gap: 0 !important;
  padding-bottom: 80px !important;
  background: #fff !important;
}

body.mobile-app .mobile-mail-stage {
  position: relative !important;
  min-height: 100dvh !important;
  background: #fff !important;
  overflow-x: hidden !important;
}

body.mobile-app .mobile-mail-stage.has-detail .mobile-list-screen {
  pointer-events: none !important;
}

body.mobile-app .mobile-detail-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 80 !important;
  width: 100vw !important;
  height: 100dvh !important;
  background: #fff !important;
  transform: translate3d(0, 0, 0) !important;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1) !important;
  will-change: transform !important;
  contain: layout paint style !important;
  backface-visibility: hidden !important;
}

body.mobile-app .mobile-detail-overlay.mobile-detail-returning {
  transform: translate3d(100%, 0, 0) !important;
}

body.mobile-app .mobile-mail-swipe {
  background: #fff !important;
  border-bottom: 1px solid #edf0f4 !important;
}

body.mobile-app .mail-list.mobile-native-list > .mobile-mail-swipe {
  content-visibility: auto !important;
  contain-intrinsic-size: 74px !important;
  contain: layout paint style !important;
}

body.mobile-app .mobile-mail-row {
  min-height: 70px !important;
  padding: 9px 8px !important;
}

body.mobile-app .mobile-mail-row-top strong {
  font-size: 14px !important;
  font-weight: 560 !important;
}

body.mobile-app .mobile-mail-row-subject {
  margin-top: 2px !important;
  font-size: 13px !important;
  font-weight: 470 !important;
}

body.mobile-app .mobile-mail-row-preview {
  margin-top: 2px !important;
  font-size: 12px !important;
}

body.mobile-app .mobile-detail-thread-meta {
  margin: -4px 0 16px !important;
  color: #7b889a !important;
  font-size: 13px !important;
}

body.mobile-app .mobile-conversation-thread {
  gap: 12px !important;
  margin: 0 !important;
}

body.mobile-app .conversation-thread-head {
  padding: 0 2px !important;
  font-size: 12px !important;
}

body.mobile-app .conversation-message {
  padding: 14px !important;
  border-radius: 18px !important;
  background: #fff !important;
  border-color: #e2eaf3 !important;
}

body.mobile-app .conversation-message.current {
  background: #f1f7ff !important;
  border-color: #bfdbfe !important;
}

body.mobile-app .conversation-message-head {
  grid-template-columns: 38px minmax(0, 1fr) auto !important;
  gap: 10px !important;
}

body.mobile-app .conversation-message-head .avatar {
  width: 38px !important;
  height: 38px !important;
}

body.mobile-app .conversation-message-head strong {
  font-size: 15px !important;
}

body.mobile-app .conversation-message-head span,
body.mobile-app .conversation-message-head time {
  font-size: 11px !important;
}

body.mobile-app .conversation-message-labels {
  margin-left: 48px !important;
}

/* Final mobile mail detail guard: external HTML mail often carries desktop table widths. */
body.mobile-app .mobile-detail-content {
  width: 100vw !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

body.mobile-app .mobile-detail-body,
body.mobile-app .mobile-detail-body .mobile-fit-mail {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
}

body.mobile-app .mobile-detail-body .mobile-fit-mail,
body.mobile-app .mobile-detail-body .mobile-fit-mail * {
  box-sizing: border-box !important;
  max-width: 100% !important;
  min-width: 0 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

body.mobile-app .mobile-detail-body .mobile-fit-mail table {
  display: table !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

body.mobile-app .mobile-detail-body .mobile-fit-mail colgroup,
body.mobile-app .mobile-detail-body .mobile-fit-mail col {
  display: none !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

body.mobile-app .mobile-detail-body .mobile-fit-mail tbody,
body.mobile-app .mobile-detail-body .mobile-fit-mail thead,
body.mobile-app .mobile-detail-body .mobile-fit-mail tfoot,
body.mobile-app .mobile-detail-body .mobile-fit-mail tr {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.mobile-app .mobile-detail-body .mobile-fit-mail td,
body.mobile-app .mobile-detail-body .mobile-fit-mail th {
  width: auto !important;
  max-width: 1px !important;
  min-width: 0 !important;
  padding: 3px 4px !important;
  font-size: 12px !important;
  line-height: 1.32 !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  vertical-align: top !important;
}

body.mobile-app .mobile-detail-body .mobile-fit-mail img,
body.mobile-app .mobile-detail-body .mobile-fit-mail svg,
body.mobile-app .mobile-detail-body .mobile-fit-mail video,
body.mobile-app .mobile-detail-body .mobile-fit-mail iframe {
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
}

body.mobile-app .mobile-detail-body .mobile-fit-mail img.mail-signature-image {
  width: auto !important;
  max-width: min(120px, 46vw) !important;
  max-height: 72px !important;
  object-fit: contain !important;
}
