:root {
  --xl-brand: #132C52;
  --xl-brand-dark: #0C1E3A;
  --xl-brand-deep: #1A3A6B;
  --xl-brand-light: #EEF3F9;
  --xl-brand-soft: #DBEAFE;
  --xl-brand-border: #93C5FD;
  --bg-canvas: #F4F5F7;
  --bg-surface: #FFFFFF;
  --border-color: #E5E7EB;
  --border-strong: #CBD5E1;
  --text-main: #0F172A;
  --text-body: #242424;
  --text-muted: #605E5C;
  --danger: #C42B1C;
  --danger-bg: #FDE7E9;
  --success: #0F7B0F;
  --success-bg: #DFF6DD;
  --star: #D97706;
  --shadow-sm: 0 1px 3px rgba(12, 30, 58, 0.06);
  --shadow-md: 0 12px 32px rgba(12, 30, 58, 0.18);
  --radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: var(--xl-brand-soft);
  color: var(--xl-brand-dark);
}

html, body {
  height: 100%;
  height: 100dvh;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
  font-size: 14px;
  color: var(--text-body);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

svg {
  display: block;
  flex-shrink: 0;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: transparent;
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration: none;
}

.muted {
  color: var(--text-muted);
}

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--text-muted);
  transition: background 0.14s, color 0.14s;
}

.icon-btn.sm {
  width: 28px;
  height: 28px;
}

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

.icon-btn.starred {
  color: var(--star);
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-canvas);
}

/* Top Header */
.topbar {
  height: 56px;
  background: var(--bg-canvas);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  gap: 14px;
  flex-shrink: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  padding: 0;
  line-height: 0;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  border-radius: 999px;
}

.brand-box {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--xl-brand);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(19, 44, 82, 0.22);
}

.brand-logo.lg {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  margin: 0 auto 12px;
}

/* DC Apps Launcher */
.dc-launcher-wrap {
  position: relative;
}

.dc-waffle-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--text-main);
  transition: background 0.14s;
}

.dc-launcher-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 14px;
  display: none;
  z-index: 80;
}

.dc-launcher-panel.open {
  display: block;
}

.dc-launcher-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding: 0 4px;
}

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

.dc-launcher-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 10px;
  text-align: center;
  transition: background 0.14s;
}

.dc-launcher-item.is-current {
  background: var(--xl-brand-light);
}

.dc-launcher-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dc-launcher-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.25;
}

/* Search Bar */
.search-wrap {
  flex: 1;
  max-width: 540px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: #FFFFFF;
  color: var(--text-main);
  padding: 0 36px 0 40px;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
  border-color: var(--xl-brand);
  box-shadow: 0 0 0 2px rgba(19, 44, 82, 0.12);
}

.search-clear {
  position: absolute;
  right: 10px;
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--text-muted);
}

.search-clear.visible {
  display: inline-flex;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pc-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  transition: border-color 0.14s, background 0.14s;
}

.spin {
  animation: spinAnim 0.85s linear infinite;
}

@keyframes spinAnim {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--xl-brand);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

/* Dropdown */
.dropdown-wrap {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 230px;
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: none;
  z-index: 70;
}

.dropdown-menu.open {
  display: block;
}

.user-menu-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
}

.user-menu-name {
  font-weight: 600;
  color: var(--text-main);
  font-size: 13.5px;
}

.user-menu-email {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 13px;
  text-align: left;
  color: var(--text-body);
}

.dropdown-item.danger {
  color: var(--danger);
}

/* Workspace */
.workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12, 30, 58, 0.42);
  z-index: 28;
}

.sidebar-backdrop.open {
  display: block;
}

/* Sidebar */
.sidebar {
  width: 238px;
  background: var(--bg-canvas);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 12px 14px;
  flex-shrink: 0;
  z-index: 30;
}

.sidebar-scroll {
  overflow-y: auto;
  flex: 1;
  padding-bottom: 10px;
}

.create-cta-wrap {
  margin-bottom: 14px;
}

.btn-create-pill {
  width: 100%;
  height: 40px;
  border-radius: 999px;
  background: var(--xl-brand);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(19, 44, 82, 0.24);
  transition: background 0.14s;
}

.nav-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 6px 6px 12px;
}

.nav-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--text-body);
  font-weight: 500;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}

.nav-item.active {
  background: #E5E7EB;
  color: var(--xl-brand);
  font-weight: 600;
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--xl-brand-soft);
  color: var(--xl-brand);
  font-variant-numeric: tabular-nums;
}

.acc-item-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.acc-item-row .nav-item {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
}

.acc-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.acc-label-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.acc-del-btn {
  opacity: 0.45;
  flex-shrink: 0;
}

.storage-card {
  padding: 12px;
  border-radius: var(--radius);
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.storage-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.storage-bar {
  height: 5px;
  background: #E5E7EB;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.storage-fill {
  height: 100%;
  background: var(--xl-brand);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.storage-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main White Sheet */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-surface);
  border-radius: 14px;
  margin: 0 14px 14px 4px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.command-bar {
  min-height: 50px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.cmd-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.check-all-wrap {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.view-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-right: 6px;
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-chip {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: #FFFFFF;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-body);
}

.filter-chip.active {
  background: var(--xl-brand-light);
  border-color: var(--xl-brand);
  color: var(--xl-brand);
  font-weight: 600;
}

.selected-count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--xl-brand);
}

/* Buttons */
.btn {
  height: 34px;
  padding: 0 13px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.14s, border-color 0.14s;
}

.btn-primary {
  background: var(--xl-brand);
  color: #FFFFFF;
}

.btn-secondary {
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  color: var(--text-main);
}

.btn-ghost {
  color: var(--text-body);
}

.btn-danger {
  color: var(--danger);
  border-color: #FCA5A5;
}

.btn.full {
  width: 100%;
  height: 40px;
  font-weight: 600;
}

/* Split Mail Layout */
.mail-split {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.mail-list-pane {
  width: 390px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex-shrink: 0;
}

.mail-list-body {
  flex: 1;
  overflow-y: auto;
}

.mail-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
  transition: background 0.12s;
}

.mail-row.unread {
  background: #F8FAFC;
}

.mail-row.selected {
  background: var(--xl-brand-light);
  border-left: 3px solid var(--xl-brand);
  padding-left: 11px;
}

.mail-row-check {
  margin-top: 3px;
  flex-shrink: 0;
}

.mail-row-main {
  flex: 1;
  min-width: 0;
}

.mail-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.mail-sender {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13.5px;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.mail-time {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.mail-subject {
  font-size: 13px;
  color: var(--text-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}

.mail-snippet {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-row-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.star-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  border-radius: 999px;
}

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

/* Reader Pane */
.mail-reader-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
}

.reader-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}

.reader-empty-icon {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: var(--xl-brand-light);
  color: var(--xl-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.reader-empty h3 {
  font-size: 16px;
  color: var(--text-main);
  margin-bottom: 6px;
}

.reader-empty p {
  max-width: 380px;
  font-size: 13px;
  line-height: 1.5;
}

.reader-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.reader-toolbar {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.reader-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-color);
}

.reader-subject-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.reader-subject {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.account-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--xl-brand-light);
  color: var(--xl-brand);
  white-space: nowrap;
  flex-shrink: 0;
}

.reader-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reader-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--xl-brand);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.reader-meta-info {
  flex: 1;
  min-width: 0;
}

.reader-sender-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13.5px;
}

.reader-to-line {
  font-size: 12px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-date {
  font-size: 12px;
  white-space: nowrap;
}

.reader-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
}

.att-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: #F8FAFC;
  font-size: 12.5px;
  color: var(--text-main);
}

.reader-body-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
}

.reader-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #FFFFFF;
}

/* Empty State in List */
.list-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
}

.list-empty h4 {
  color: var(--text-main);
  margin-bottom: 6px;
}

.list-empty p {
  font-size: 13px;
  margin-bottom: 14px;
}

/* Modals (Always Centered) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 30, 58, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.auth-overlay {
  background: rgba(12, 30, 58, 0.72);
  backdrop-filter: blur(4px);
}

.modal-card {
  background: #FFFFFF;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-sm { max-width: 400px; }
.modal-md { max-width: 600px; }
.modal-lg { max-width: 740px; }

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

.modal-head h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-foot {
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.auth-header {
  padding: 24px 20px 6px;
  text-align: center;
}

.auth-header h2 {
  font-size: 19px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.auth-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-row label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
}

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

.form-input, .form-textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 11px;
  background: #FFFFFF;
  color: var(--text-main);
  outline: none;
}

.form-input {
  height: 36px;
}

.form-textarea {
  resize: vertical;
  min-height: 180px;
  line-height: 1.5;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--xl-brand);
  box-shadow: 0 0 0 2px rgba(19, 44, 82, 0.12);
}

.preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-pill {
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #FFFFFF;
  font-size: 12px;
  font-weight: 500;
}

.preset-pill.active {
  background: var(--xl-brand);
  border-color: var(--xl-brand);
  color: #FFFFFF;
}

.hint-banner {
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--xl-brand-light);
  color: var(--xl-brand-dark);
  font-size: 12.5px;
  line-height: 1.45;
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid transparent;
}

.color-swatch.active {
  border-color: #0F172A;
  transform: scale(1.12);
}

.form-error {
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 12.5px;
}

/* Toast */
.toast-box {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  padding: 10px 15px;
  border-radius: 9px;
  background: var(--xl-brand-dark);
  color: #FFFFFF;
  font-size: 13px;
  box-shadow: var(--shadow-md);
}

.toast.error {
  background: var(--danger);
}

.mobile-only {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover, .dc-waffle-btn:hover { background: #E5E7EB; color: var(--text-main); }
  .btn-create-pill:hover, .btn-primary:hover { background: var(--xl-brand-deep); }
  .btn-secondary:hover, .pc-status-pill:hover { background: var(--xl-brand-light); border-color: var(--xl-brand-border); }
  .btn-ghost:hover { background: #F1F5F9; }
  .nav-item:hover { background: #E5E7EB; }
  .dropdown-item:hover { background: var(--xl-brand-light); }
  .dc-launcher-item:hover { background: var(--xl-brand-light); }
  .mail-row:hover { background: #F1F5F9; }
  .att-chip:hover { border-color: var(--xl-brand); background: var(--xl-brand-light); }
  .acc-del-btn:hover { opacity: 1; color: var(--danger); }
}

@media (max-width: 960px) {
  .mail-list-pane { width: 320px; }
}

@media (max-width: 820px) {
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-left { min-width: auto; gap: 6px; }
  .brand-box span:last-child { display: none; }
  .pc-status-pill span { display: none; }
  .pc-status-pill { padding: 0 9px; }

  .sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-md);
  }
  .sidebar.open { transform: translateX(0); }

  .main-area {
    margin: 0;
    border-radius: 0;
    border: none;
  }

  .mail-list-pane {
    width: 100%;
    border-right: none;
  }

  .mail-reader-pane {
    display: none;
    width: 100%;
  }

  .mail-split.reading-mobile .mail-list-pane { display: none; }
  .mail-split.reading-mobile .mail-reader-pane { display: flex; }
  .mobile-only { display: inline-flex; }
  .form-row-2 { grid-template-columns: 1fr; }
}

/* Chống tự động zoom input trên iOS Safari */
@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
  html, body {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  select,
  textarea,
  .search-input,
  .form-input,
  .form-textarea {
    font-size: 16px !important;
  }
}
