@font-face {
  font-family: Portal;
  src: local("Inter"), local("Segoe UI");
}
* {
  box-sizing: border-box;
}
:root {
  font-family:
    Portal,
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  --bg: #f5f7fa;
  --surface: #fff;
  --soft: #f8fafc;
  --text: #202c3c;
  --muted: #7b8798;
  --line: #e8edf3;
  --blue: #0f6cbd;
  --blue-hover: #115ea3;
  --blue-soft: #eaf3fc;
  --shadow: 0 12px 45px #1e35500e;
  --danger: #c43f4b;
  --drawer-shadow: -12px 0 70px #172c4920;
  color-scheme: light;
}
html[data-size="s"] {
  font-size: 12.5px;
}
html[data-size="l"] {
  font-size: 16px;
}
html[data-theme="dark"] {
  --bg: #101827;
  --surface: #172233;
  --soft: #1b283b;
  --text: #e5edf7;
  --muted: #93a3b9;
  --line: #29374a;
  --blue: #54aaf2;
  --blue-hover: #78bcf5;
  --blue-soft: #193650;
  --shadow: 0 12px 45px #0002;
  --danger: #f3848e;
  --drawer-shadow: -12px 0 70px #0005;
  color-scheme: dark;
}
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-size: 1rem;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.4;
}
button,
a {
  touch-action: manipulation;
}
button {
  color: inherit;
}
a {
  color: var(--blue);
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
button {
  border: 0;
  background: none;
}
svg {
  width: 1.3em;
  height: 1.3em;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  flex-shrink: 0;
}
button svg {
  pointer-events: none;
}
[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button[data-icon] {
  display: inline-flex;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
p {
  color: var(--muted);
  line-height: 1.7;
}
small {
  font-size: 0.78em;
}
kbd {
  font: 0.72rem inherit;
  font-family: inherit;
  border: 1px solid var(--line);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  color: var(--muted);
}
.spacer {
  flex: 1;
}
.accent {
  color: var(--blue);
}
.small-text {
  font-size: 0.85rem;
}
.muted {
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 100;
  background: var(--surface);
  padding: 1rem;
}
.skip-link:focus {
  top: 1rem;
}
.app-shell {
  display: flex;
  min-height: 100dvh;
}
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 2.4rem 1.3rem 1rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.75rem;
  font-weight: 750;
  letter-spacing: -0.07rem;
  color: var(--text);
  padding: 0 0.5rem;
}
.brand-light {
  font-weight: 350;
  color: var(--muted);
}
.brand-mark {
  width: 2.6rem;
  height: 2.6rem;
  flex-shrink: 0;
  color: white;
  background: #0f6cbd;
  border-radius: 0.85rem;
  box-shadow: 0 5px 12px #0f6cbd22;
}
.brand-mark svg {
  width: 1.5rem;
  height: 1.5rem;
}
.brand small {
  display: block;
  font-size: 0.5rem;
  letter-spacing: 0.13rem;
  margin-top: 0.3rem;
  color: var(--muted);
  font-weight: 600;
}
.button,
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 550;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.button {
  border: 1px solid var(--line);
  background: var(--surface);
}
.button:hover {
  background: var(--soft);
  border-color: var(--muted);
}
.primary {
  background: #0f6cbd;
  color: #fff;
  border: 1px solid #0f6cbd;
  box-shadow: 0 3px 6px #0f6cbd15;
}
.primary:hover {
  background: #115ea3;
}
.compose-button {
  margin-top: 2.6rem;
  justify-content: flex-start;
  padding: 0.9rem 1rem;
}
.compose-button kbd {
  margin-left: auto;
  color: #fff9;
  border-color: #fff3;
}
.nav-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.12rem;
  font-weight: 600;
  padding: 1.5rem 0.8rem 0.6rem;
}
.nav-caption .icon-button {
  width: 1.8rem;
  height: 1.8rem;
}
nav {
  overflow: auto;
}
nav .folder {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  width: 100%;
  padding: 0.88rem 1rem;
  border-radius: 8px;
  color: var(--muted);
  text-align: left;
  margin-bottom: 0.25rem;
  font-weight: 500;
  min-height: 3rem;
}
nav .folder:hover {
  background: var(--soft);
  color: var(--text);
}
nav .folder.active {
  background: var(--blue-soft);
  color: var(--blue);
}
nav .folder .folder-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
nav .folder .badge {
  font-size: 0.72rem;
  background: var(--surface);
  min-width: 1.6rem;
  padding: 0.2rem 0.35rem;
  text-align: center;
  border-radius: 5px;
}
nav .folder:not(.active) .badge {
  background: var(--soft);
  color: var(--muted);
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 1.5rem;
}
.connection {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.7rem;
  font-size: 0.72rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.connection [data-icon] {
  margin-left: auto;
  font-size: 0.8rem;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #35a57d;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #35a57d12;
  flex-shrink: 0;
}
.account-button {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 1.2rem 0.3rem 0.4rem;
  text-align: left;
}
.account-button > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.account-button strong {
  font-size: 0.82rem;
  display: block;
}
.account-button small {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 0.3rem;
}
.account-button > span:last-child {
  color: var(--muted);
}
.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 650;
  flex-shrink: 0;
}
.avatar.small {
  width: 2rem;
  height: 2rem;
  font-size: 0.65rem;
  margin-left: 0.5rem;
}
main {
  margin-left: 248px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.topbar {
  height: 76px;
  border-bottom: 1px solid var(--line);
  padding: 0 2.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
}
.breadcrumb {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  gap: 1rem;
}
.breadcrumb span {
  color: var(--line);
}
.breadcrumb strong {
  color: var(--text);
  font-weight: 500;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.icon-button {
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding: 0.4rem;
  flex-shrink: 0;
}
.icon-button:hover {
  background: var(--soft);
  color: var(--blue);
}
.icon-button.active,
.icon-button.starred {
  color: #d6a23a;
}
.icon-button.starred svg {
  fill: #d6a232;
}
.toolbar-divider {
  height: 1.4rem;
  width: 1px;
  background: var(--line);
  display: inline-block;
  margin: 0 0.3rem;
}
.text-sizes {
  display: flex;
  gap: 0.15rem;
  background: var(--soft);
  padding: 0.22rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.text-sizes button {
  width: 1.9rem;
  height: 1.6rem;
  font-size: 0.72rem;
  color: var(--muted);
  border-radius: 4px;
}
.text-sizes button.active {
  background: var(--surface);
  color: var(--blue);
  box-shadow: 0 1px 4px #0001;
  font-weight: 650;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 2.7rem 2.7rem 2rem;
  gap: 1rem;
}
.eyebrow {
  color: var(--muted);
  letter-spacing: 0.14rem;
  font-size: 0.6rem;
  font-weight: 600;
}
.page-heading h1 {
  font-size: 2.65rem;
  letter-spacing: -0.12rem;
  margin: 0.7rem 0 0.65rem;
  font-weight: 650;
  line-height: 1.1;
}
.page-heading p {
  font-size: 0.9rem;
  margin-bottom: 0;
}
.heading-end {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.sync-text {
  font-size: 0.7rem;
  color: var(--muted);
}
.mail-panel {
  margin: 0 2.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 430px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.mail-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1.6rem 0;
  border-bottom: 1px solid var(--line);
}
.tabs {
  display: flex;
  gap: 1.6rem;
  align-self: stretch;
  white-space: nowrap;
}
.tabs button {
  position: relative;
  font-size: 0.84rem;
  padding: 1.2rem 0 1.3rem;
  color: var(--muted);
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.tabs button.active {
  color: var(--blue);
  font-weight: 600;
}
.tabs button.active:after {
  position: absolute;
  content: "";
  bottom: -1px;
  height: 2px;
  background: var(--blue);
  left: 0;
  right: 0;
  border-radius: 2px;
}
.tabs button span {
  background: var(--blue-soft);
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  font-size: 0.65rem;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 0.7rem;
  margin-bottom: 0.5rem;
  min-width: 160px;
  width: 29%;
  color: var(--muted);
}
.search-box input {
  background: none;
  border: 0;
  width: 100%;
  padding: 0.65rem 0;
  color: var(--text);
  outline-offset: 0;
  font-size: 0.8rem;
}
.search-box svg {
  width: 1rem;
}
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1.6rem;
  border-bottom: 1px solid var(--line);
  min-height: 3.4rem;
  background: var(--soft);
}
.check-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.8rem;
}
.check-label input {
  accent-color: #0f6cbd;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  flex-shrink: 0;
}
.check-label small {
  display: block;
  font-size: 0.75rem;
  line-height: 1.6;
  margin-top: 0.25rem;
  color: var(--muted);
}
.pagination {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.pagination > span {
  margin-right: 0.5rem;
}
.pagination .icon-button {
  width: 1.9rem;
  height: 1.9rem;
}
#bulk-actions {
  display: flex;
  margin: -0.4rem 0;
}
.message-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1.35rem 1.6rem;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: background 0.12s;
  min-height: 5.7rem;
}
.message-row:hover {
  background: var(--soft);
}
.message-row.selected {
  background: var(--blue-soft);
}
.message-row.selected:before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--blue);
}
.row-check {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #0f6cbd;
  flex-shrink: 0;
}
.message-row .avatar {
  border-radius: 12px;
  width: 2.65rem;
  height: 2.65rem;
  font-weight: 600;
}
.avatar.color-1 {
  background: #f1edfc;
  color: #8a6ab7;
}
.avatar.color-2 {
  background: #eaf5ef;
  color: #548d6c;
}
.avatar.color-3 {
  background: #fcf1e8;
  color: #b88655;
}
.avatar.color-4 {
  background: #f9eaf0;
  color: #b46d8a;
}
html[data-theme="dark"] .avatar.color-1 {
  background: #362e4a;
  color: #c0a3ea;
}
html[data-theme="dark"] .avatar.color-2 {
  background: #243d36;
  color: #8ec6a6;
}
html[data-theme="dark"] .avatar.color-3 {
  background: #43352b;
  color: #dab289;
}
html[data-theme="dark"] .avatar.color-4 {
  background: #432d3c;
  color: #d99cb8;
}
.message-open {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 0;
}
.message-sender {
  width: 11rem;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 450;
}
.message-detail {
  min-width: 0;
  flex: 1;
}
.message-subject {
  font-size: 0.87rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 450;
  line-height: 1.7;
}
.message-preview {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 0.73rem;
  margin-top: 0.15rem;
  line-height: 1.5;
}
.message-row.unread .message-sender,
.message-row.unread .message-subject {
  font-weight: 650;
}
.message-row.unread .message-sender:before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  display: inline-block;
  margin: 0 0.5rem 0.1rem 0;
}
.message-time {
  font-size: 0.72rem;
  color: var(--muted);
  min-width: 4rem;
  text-align: right;
  white-space: nowrap;
}
.message-row.unread .message-time {
  color: var(--blue);
  font-weight: 550;
}
.row-paperclip {
  font-size: 0.75rem;
  color: var(--muted);
  width: 1rem;
}
.message-row .star-button {
  width: 1.6rem;
  height: 1.8rem;
  font-size: 0.85rem;
}
.list-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding: 1rem 1.6rem;
  color: var(--muted);
  font-size: 0.65rem;
  gap: 1rem;
}
.list-footer > span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.list-footer svg {
  width: 1em;
}
.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2.7rem;
  color: var(--muted);
  font-size: 0.6rem;
  letter-spacing: 0.04rem;
}
.page-footer > button {
  color: var(--muted);
  font-size: 0.65rem;
}
.page-footer kbd {
  margin-left: 0.5rem;
}
.footer-dot {
  padding: 0 0.4rem;
}
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 0.7rem;
}
.empty-state > .empty-icon {
  width: 4.3rem;
  height: 4.3rem;
  border-radius: 20px;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}
.empty-state h2 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.03rem;
  margin-bottom: 0;
}
.empty-state p {
  font-size: 0.85rem;
  max-width: 330px;
}
.loading-row {
  height: 5.7rem;
  margin: 0 1.6rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  align-items: center;
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--soft) 25%,
    var(--line) 50%,
    var(--soft) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  height: 0.7rem;
  width: 70%;
}
.loading-row > .skeleton {
  width: 2.7rem;
  height: 2.7rem;
}
.loading-row > div {
  width: 80%;
  display: grid;
  gap: 0.8rem;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
dialog {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
}
dialog::backdrop {
  background: #101b2b55;
  backdrop-filter: blur(3px);
}
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  height: 100dvh;
  max-height: 100dvh;
  width: min(740px, calc(100vw - 60px));
  max-width: 100vw;
  border: 0;
  border-left: 1px solid var(--line);
  box-shadow: var(--drawer-shadow);
  padding: 0;
  z-index: 20;
  overflow: hidden;
}
.drawer[open] {
  display: flex;
  flex-direction: column;
  animation: slide-in 0.2s ease-out;
}
@keyframes slide-in {
  from {
    transform: translateX(35px);
    opacity: 0.4;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
.reader-drawer {
  width: min(780px, calc(100vw - 100px));
  z-index: 15;
}
.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.6rem;
  border-bottom: 1px solid var(--line);
  min-height: 5rem;
  background: var(--surface);
}
.drawer-context {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.12rem;
  font-weight: 550;
}
.drawer-top-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.reader-toolbar {
  padding: 1rem 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.reader-toolbar .button {
  font-size: 0.8rem;
  padding: 0.55rem 0.75rem;
  min-height: 2.4rem;
}
.drawer-scroll {
  padding: 2rem;
  overflow: auto;
  flex: 1;
}
.drawer-scroll h2 {
  font-size: 1.7rem;
  letter-spacing: -0.04rem;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.reader-sender {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin: 1.5rem 0 2rem;
}
.reader-sender .sender-details {
  flex: 1;
  min-width: 0;
}
.reader-sender strong {
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}
.reader-sender p {
  font-size: 0.75rem;
  margin: 0.45rem 0 0;
  overflow-wrap: anywhere;
}
.reader-sender time {
  font-size: 0.65rem;
  color: var(--muted);
  white-space: nowrap;
  margin-top: 0.2rem;
}
.reader-text {
  white-space: pre-wrap;
  line-height: 1.9;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}
.html-notice {
  font-size: 0.7rem;
  padding: 0.7rem 0.9rem;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
}
.html-email {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 460px;
  background: white;
  color-scheme: light;
}
.attachment-heading {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 2rem 0 0.8rem;
  letter-spacing: 0.05rem;
}
.attachment-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
}
.attachment-card > span {
  flex: 1;
  overflow-wrap: anywhere;
}
.attachment-card svg {
  color: var(--blue);
}
.attachment-card small {
  display: block;
  color: var(--muted);
  margin-top: 0.3rem;
}
.reader-bottom {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.reader-bottom label {
  font-size: 0.75rem;
  color: var(--muted);
}
.reader-bottom select {
  max-width: 150px;
}
.text-button {
  color: var(--blue);
  font-size: 0.78rem;
  padding: 0.4rem;
  cursor: pointer;
}
.danger {
  color: var(--danger);
}
.compose-drawer #send-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.compose-fields {
  padding: 0 1.6rem;
}
.compose-fields label {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
.compose-fields label > span {
  width: 3.3rem;
  color: var(--muted);
  flex-shrink: 0;
}
.compose-fields input {
  border: 0;
  padding: 1.2rem 0;
  flex: 1;
  min-width: 0;
  background: transparent;
  color: var(--text);
}
.compose-drawer textarea {
  resize: none;
  border: 0;
  flex: 1;
  background: transparent;
  color: var(--text);
  padding: 1.8rem;
  min-height: 180px;
  line-height: 1.8;
}
.compose-drawer textarea:focus {
  outline-offset: -4px;
}
.compose-footer {
  border-top: 1px solid var(--line);
  padding: 1rem 1.6rem 1.4rem;
}
.compose-actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 0.9rem;
  align-items: center;
}
.compose-footer #draft-status {
  font-size: 0.65rem;
  color: var(--muted);
}
#attachment-list {
  max-height: 150px;
  overflow: auto;
  padding: 0 1.6rem;
}
#attachment-list .attachment-card {
  padding: 0.5rem 0.8rem;
}
.attach-button {
  cursor: pointer;
}
.settings-drawer {
  width: min(490px, 100vw);
}
.settings-drawer h2 {
  font-size: 1.5rem;
}
.settings-drawer p {
  font-size: 0.85rem;
}
.setting-section {
  border-top: 1px solid var(--line);
  padding: 1.7rem 0;
}
.setting-section h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.setting-section .check-label {
  align-items: flex-start;
  margin: 1.5rem 0;
  color: var(--text);
}
.setting-section .check-label input {
  margin-top: 0.1rem;
}
.theme-options,
.size-options {
  display: flex;
  gap: 0.7rem;
}
.theme-options button,
.size-options button {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem;
  font-size: 0.75rem;
  text-align: left;
}
.theme-options button.active,
.size-options button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}
.theme-preview {
  display: block;
  height: 55px;
  border: 1px solid #dce4ef;
  border-radius: 5px;
  margin-bottom: 0.8rem;
  position: relative;
  overflow: hidden;
}
.theme-preview:before {
  content: "";
  position: absolute;
  inset: 8px 8px 8px 24px;
  border-radius: 3px;
  background: #fff;
  border: 1px solid #dce4ef;
}
.theme-preview:after {
  content: "";
  position: absolute;
  height: 3px;
  top: 17px;
  left: 32px;
  right: 16px;
  background: #0f6cbd;
  box-shadow:
    0 9px 0 #dce4ef,
    0 18px 0 #dce4ef;
}
.light-preview {
  background: #f1f4f8;
}
.dark-preview {
  background: #101827;
  border-color: #344055;
}
.dark-preview:before {
  background: #1b283b;
  border-color: #344055;
}
.dark-preview:after {
  box-shadow:
    0 9px 0 #344055,
    0 18px 0 #344055;
}
.system-preview {
  background: linear-gradient(90deg, #f1f4f8 50%, #101827 50%);
}
.size-options button {
  font-size: 1.3rem;
  text-align: center;
}
.size-options button span {
  display: block;
  font-size: 0.7rem;
  margin-top: 0.4rem;
}
.size-options button:first-child {
  font-size: 1.1rem;
}
.size-options button:last-child {
  font-size: 1.5rem;
}
.login-dialog {
  width: min(1050px, 94vw);
  max-width: 1050px;
  max-height: 94dvh;
  padding: 0;
  border-radius: 18px;
  box-shadow: 0 30px 130px #0003;
  overflow: auto;
}
.login-dialog[open] {
  display: grid;
  grid-template-columns: 43% 57%;
}
.login-dialog::backdrop {
  background: var(--bg);
  backdrop-filter: none;
}
.login-story {
  background: #101e33;
  color: white;
  padding: 2.5rem 2.3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  min-height: 680px;
}
.login-story .brand {
  color: white;
  padding: 0;
  font-size: 1.65rem;
}
.login-story .brand-light {
  color: #b8c7db;
}
.login-story .brand-mark {
  background: #1b3554;
  color: #78b8ed;
}
.story-tag {
  font-size: 0.55rem;
  letter-spacing: 0.13rem;
  color: #afc4df;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.8rem;
}
.login-story h2 {
  font-size: 2.6rem;
  font-weight: 550;
  line-height: 1.2;
  letter-spacing: -0.1rem;
  margin-bottom: 1.4rem;
}
.login-story p {
  font-size: 0.8rem;
  color: #9caec6;
  line-height: 1.9;
}
.story-bottom {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6rem;
  color: #8ca3c0;
  margin-top: 3rem;
}
.story-visual {
  margin-top: 2.4rem;
  background: #192b43;
  border: 1px solid #ffffff0d;
  border-radius: 10px;
  padding: 1rem;
  position: relative;
  box-shadow: 0 15px 40px #0002;
  transform: rotate(-2deg);
}
.visual-top {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid #ffffff09;
  padding: 0 0 0.8rem;
}
.visual-top i {
  width: 4px;
  height: 4px;
  background: #47617f;
  border-radius: 50%;
}
.visual-top span {
  font-size: 0.55rem;
  color: #9aafc8;
  margin-left: auto;
}
.visual-row {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #ffffff07;
  font-size: 0.6rem;
}
.visual-row > div {
  flex: 1;
}
.visual-row b {
  font-weight: 450;
  color: #c6d4e5;
}
.visual-row i {
  display: block;
  height: 3px;
  width: 80%;
  background: #31455f;
  margin-top: 0.6rem;
  border-radius: 3px;
}
.visual-avatar {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 7px;
  color: #9bc2ed;
  background: #2b4868;
  font-size: 0.6rem;
}
.visual-avatar.purple {
  color: #b9ade5;
  background: #3b3558;
}
.visual-avatar.green {
  color: #93c9b5;
  background: #2c4b48;
}
.visual-row > span:last-child {
  color: #7da7d4;
}
.visual-dot {
  width: 4px;
  height: 4px;
  background: #66a3df;
  border-radius: 50%;
}
.visual-pill {
  position: absolute;
  right: -15px;
  bottom: -18px;
  background: #f5f9ff;
  color: #345472;
  font-size: 0.6rem;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  box-shadow: 0 6px 20px #0002;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  transform: rotate(2deg);
}
.visual-pill svg {
  color: #389271;
}
.login-form-wrap {
  padding: 1.5rem 3rem 2rem;
}
.login-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.55rem;
  letter-spacing: 0.12rem;
  margin-bottom: 1.5rem;
}
#login-theme {
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--blue);
  background: var(--blue-soft);
}
#login-theme:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
#login-form {
  display: grid;
  gap: 1rem;
}
#login-form h1 {
  font-size: 1.9rem;
  letter-spacing: -0.07rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
}
#login-form p {
  font-size: 0.78rem;
  margin-bottom: 0.2rem;
}
#login-form label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  display: block;
}
#login-form input:not([type="checkbox"]),
#login-form select,
.prompt-dialog input {
  display: block;
  width: 100%;
  padding: 0.75rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 7px;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 2.75rem;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.75;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 0.8rem;
}
.form-grid.equal {
  grid-template-columns: 1fr 1fr;
  margin-top: 0.8rem;
}
#login-form select {
  font-size: 0.65rem;
  padding: 0.7rem 0.4rem;
}
.password-wrap {
  position: relative;
}
.password-wrap input {
  padding-right: 3rem !important;
}
.password-wrap button {
  position: absolute;
  right: 0.25rem;
  top: 0.2rem;
}
details summary {
  font-size: 0.73rem;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0;
  list-style: none;
}
details[open] summary {
  margin-bottom: 0.8rem;
}
#login-form .cache-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 0.75rem;
  line-height: 1.4;
  margin-top: 0.2rem;
}
#login-form .cache-opt input {
  margin-top: 0.12rem;
}
.cache-opt small {
  font-size: 0.63rem;
  font-weight: 400;
}
.login-submit {
  width: 100%;
  justify-content: space-between;
  min-height: 3rem;
  font-size: 0.85rem;
}
.form-error {
  color: var(--danger) !important;
  font-size: 0.78rem;
  line-height: 1.6;
  margin: 0;
}
.form-error:empty {
  display: none;
}
.login-divider {
  position: relative;
  text-align: center;
  border-top: 1px solid var(--line);
  margin: 0.8rem 0 0.1rem;
  height: 0.4rem;
}
.login-divider span {
  position: relative;
  top: -0.65rem;
  background: var(--surface);
  padding: 0 1rem;
  color: var(--muted);
  font-size: 0.63rem;
}
.demo-button {
  width: 100%;
  justify-content: space-between;
  font-size: 0.75rem;
}
.login-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.6rem !important;
  color: var(--muted);
}
.login-note svg {
  width: 0.8rem;
}
.prompt-dialog {
  border-radius: 12px;
  width: 420px;
  max-width: 92vw;
  padding: 1.7rem;
  box-shadow: var(--shadow);
}
.prompt-dialog h2 {
  font-size: 1.2rem;
}
.prompt-dialog p {
  font-size: 0.85rem;
  white-space: pre-line;
}
.prompt-dialog label {
  font-size: 0.8rem;
}
.prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  margin-top: 1.5rem;
}
#toast {
  position: fixed;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--text);
  color: var(--surface);
  box-shadow: 0 8px 40px #0002;
  border-radius: 10px;
  padding: 0.7rem 0.8rem 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: min(620px, 92vw);
  font-size: 0.8rem;
}
#toast .icon-button {
  color: inherit;
  width: 1.8rem;
  height: 1.8rem;
}
#toast .icon-button:hover {
  background: #8883;
}
#toast.error > svg {
  color: #f39a9a;
}
.mobile-menu {
  display: none;
}
@media (min-width: 1600px) {
  .sidebar {
    width: 270px;
  }
  main {
    margin-left: 270px;
  }
  .topbar {
    padding: 0 3.5rem;
  }
  .page-heading {
    padding: 3.3rem 3.5rem 2.5rem;
  }
  .mail-panel {
    margin: 0 3.5rem;
  }
  .page-footer {
    padding: 1.8rem 3.5rem;
  }
  .message-row {
    padding: 1.6rem 2rem;
  }
  .message-sender {
    width: 13rem;
  }
}
@media (max-width: 1150px) {
  .sidebar {
    width: 210px;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  main {
    margin-left: 210px;
  }
  .topbar {
    padding: 0 1.7rem;
  }
  .page-heading {
    padding: 2rem 1.7rem 1.6rem;
  }
  .mail-panel {
    margin: 0 1.7rem;
  }
  .page-footer {
    padding: 1.4rem 1.7rem;
  }
  .message-sender {
    width: 8rem;
  }
  .message-open {
    gap: 1rem;
  }
  .message-row {
    gap: 0.7rem;
    padding: 1.2rem;
  }
  .sync-text {
    display: none;
  }
  .mail-controls {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }
  .tabs {
    gap: 1.1rem;
  }
  .message-preview {
    font-size: 0.68rem;
  }
  .message-time {
    font-size: 0.65rem;
  }
  .login-form-wrap {
    padding: 1.5rem 2rem 2rem;
  }
}
@media (max-width: 900px) {
  .message-open {
    display: block;
  }
  .message-sender {
    display: block;
    width: auto;
    margin-bottom: 0.3rem;
  }
  .message-preview {
    display: none;
  }
  .message-subject {
    font-size: 0.78rem;
  }
  .mail-controls {
    flex-wrap: wrap;
    padding-top: 1rem;
    gap: 0.5rem;
  }
  .search-box {
    width: 100%;
    order: -1;
  }
  .tabs {
    gap: 2rem;
  }
  .tabs button {
    padding: 0.8rem 0 1rem;
  }
  .message-time {
    min-width: 3.2rem;
  }
  .login-dialog[open] {
    grid-template-columns: 38% 62%;
  }
  .login-story {
    padding: 2rem 1.5rem;
  }
  .login-story h2 {
    font-size: 2.1rem;
  }
  .story-visual {
    padding: 0.7rem;
  }
  .login-story p {
    font-size: 0.73rem;
  }
  .visual-row {
    font-size: 0.5rem;
  }
}
@media (max-width: 700px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
    width: 240px;
    box-shadow: var(--shadow);
    z-index: 25;
  }
  .sidebar.visible {
    transform: translateX(0);
  }
  main {
    margin-left: 0;
  }
  .mobile-menu {
    display: inline-flex;
  }
  .topbar {
    height: 62px;
    padding: 0 1rem;
    gap: 0.7rem;
  }
  .breadcrumb {
    margin-right: auto;
    font-size: 0.75rem;
    gap: 0.6rem;
  }
  .topbar-actions {
    gap: 0.2rem;
  }
  .topbar-actions > .toolbar-divider,
  .topbar-actions > .small {
    display: none;
  }
  .topbar-actions .icon-button {
    width: 2rem;
  }
  .page-heading {
    padding: 1.8rem 1rem 1.4rem;
  }
  .page-heading h1 {
    font-size: 2.2rem;
  }
  .eyebrow {
    font-size: 0.5rem;
  }
  .page-heading p {
    font-size: 0.8rem;
  }
  .heading-end .button {
    font-size: 0.75rem;
    padding: 0.5rem 0.7rem;
    min-height: 2.5rem;
  }
  .mail-panel {
    margin: 0 0.8rem;
    border-radius: 10px;
  }
  .message-row {
    padding: 1rem 0.9rem;
  }
  .message-row .avatar {
    width: 2.4rem;
    height: 2.4rem;
    font-size: 0.72rem;
  }
  .row-paperclip {
    display: none;
  }
  .message-time {
    min-width: 2.9rem;
  }
  .message-row .star-button {
    width: 1.4rem;
  }
  .list-toolbar {
    padding: 0.6rem 0.9rem;
  }
  .list-toolbar .check-label {
    font-size: 0.7rem;
  }
  .pagination {
    gap: 0.1rem;
    font-size: 0.65rem;
  }
  .pagination > span {
    margin-right: 0.1rem;
  }
  .list-footer {
    padding: 0.9rem;
    font-size: 0.55rem;
  }
  .list-footer > span:last-child {
    display: none;
  }
  .page-footer {
    padding: 1.2rem 1rem;
    font-size: 0.5rem;
  }
  .page-footer > button {
    font-size: 0.6rem;
  }
  .drawer,
  .reader-drawer {
    width: 100vw;
    max-width: 100vw;
  }
  .drawer-top {
    padding: 0.8rem 1rem;
    min-height: 4.5rem;
  }
  .reader-toolbar {
    padding: 0.7rem 0.8rem;
    gap: 0.2rem;
  }
  .reader-toolbar .button {
    font-size: 0.72rem;
    padding: 0.5rem;
  }
  .reader-toolbar .icon-button {
    width: 2rem;
  }
  .reader-toolbar .button svg {
    display: none;
  }
  .drawer-scroll {
    padding: 1.5rem;
  }
  .reader-sender time {
    font-size: 0.6rem;
  }
  .compose-fields {
    padding: 0 1.2rem;
  }
  .compose-drawer textarea {
    padding: 1.3rem;
  }
  .compose-footer {
    padding: 1rem;
  }
  .compose-actions {
    gap: 0.4rem;
  }
  .compose-actions > .button {
    font-size: 0.75rem;
    padding: 0.65rem;
  }
  .compose-actions > .primary {
    font-size: 0.8rem;
  }
  .login-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    border: 0;
    margin: 0;
  }
  .login-dialog[open] {
    display: block;
  }
  .login-story {
    display: none;
  }
  .login-form-wrap {
    max-width: 470px;
    margin: auto;
    padding: 1.3rem 1.5rem 2rem;
  }
  .login-top {
    margin-bottom: 1rem;
  }
  .login-top:before {
    content: "portalmail";
    font-weight: 650;
    font-size: 1.2rem;
    letter-spacing: -0.05rem;
    color: var(--blue);
  }
  .login-top > span {
    display: none;
  }
  #login-form {
    gap: 0.9rem;
  }
  #login-form h1 {
    font-size: 1.8rem;
  }
  .prompt-dialog {
    padding: 1.5rem;
  }
  .theme-options button {
    padding: 0.6rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
