:root {
  color-scheme: dark;
  --canvas: #090d0b;
  --paper: #111713;
  --ink: #e8eee8;
  --muted: #8c9c90;
  --line: #27332a;
  --teal: #b4fa53;
  --teal-hover: #c9ff7d;
  --teal-soft: #b4fa5310;
  --danger: #ff927f;
  --danger-soft: #ff927f10;
  --mono: "Cascadia Code", "Consolas", "SFMono-Regular", monospace;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 14px; line-height: 1.5; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid #718b65; outline-offset: 4px; }
button { transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease; }
button:active:not(:disabled) { transform: translateY(1px); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.button { border: 1px solid transparent; min-height: 43px; border-radius: 10px; padding: 11px 17px; display: inline-flex; gap: 9px; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; line-height: 1.3; }
.primary { color: white; background: var(--teal); box-shadow: 0 3px 7px #c3d6b514; }
.primary:hover:not(:disabled) { background: var(--teal-hover); }
.quiet { background: transparent; color: #c3d6b5; }
.quiet:hover:not(:disabled) { background: #111713; color: var(--ink); }
.danger { background: var(--danger); color: white; }
.danger:hover:not(:disabled) { background: #c3d6b5; }
.icon-button { width: 38px; height: 38px; border: 1px solid transparent; border-radius: 9px; color: #96b184; background: transparent; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-button:hover:not(:disabled) { color: var(--teal); background: var(--teal-soft); }
.icon-button[title^="Xóa"]:hover:not(:disabled) { color: var(--danger); background: var(--danger-soft); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 25px; letter-spacing: -.9px; font-weight: 700; line-height: 1; }
.brand-mark { width: 35px; height: 35px; border-radius: 11px; background: var(--teal); color: white; display: inline-flex; align-items: center; justify-content: center; font-size: 32px; line-height: 1; font-weight: 650; padding: 0 0 7px; letter-spacing: -2px; flex-shrink: 0; }
.brand-divider { color: #344b2a; margin: 0 9px; font-size: 21px; font-weight: 400; }
.brand-product { font-size: 19px; letter-spacing: -.8px; font-weight: 400; color: #96b184; }
.pill { display: inline-flex; align-items: center; gap: 7px; color: #96b184; border: 1px solid #1c2919; border-radius: 30px; padding: 6px 12px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pill .icon { width: 13px; height: 13px; }
.tiny-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); display: inline-block; flex-shrink: 0; }
.eyebrow { display: flex; align-items: center; gap: 9px; font-size: 10px; font-weight: 700; letter-spacing: 1.35px; color: #96b184; line-height: 1.5; }
.boot-view { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; color: var(--muted); }
.boot-view .brand-mark { animation: boot-pulse 1.2s ease infinite; }
@keyframes boot-pulse { 50% { opacity: .5; } }

.login-view { min-height: 100svh; display: flex; flex-direction: column; background: #111713; }
.login-header { width: min(1200px, 100%); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 35px 44px; }
.login-main { width: min(1080px, 100%); margin: auto; padding: 48px 44px 54px; display: grid; grid-template-columns: 1fr 390px; gap: 110px; align-items: center; }
.login-story h1 { font-size: clamp(38px, 4.5vw, 57px); letter-spacing: -2.7px; font-weight: 650; line-height: 1.16; margin-top: 22px; }
.login-story h1 span { color: var(--teal); }
.login-description { color: #96b184; font-size: 15px; line-height: 1.75; max-width: 400px; margin-top: 23px; }
.login-features { display: flex; flex-wrap: wrap; gap: 17px 23px; margin-top: 25px; }
.login-features > div { display: flex; align-items: center; gap: 7px; color: #c3d6b5; font-size: 11px; }
.feature-icon { color: var(--teal); display: flex; }
.feature-icon .icon { width: 15px; height: 15px; }
.envelope-art { position: relative; width: 210px; height: 162px; margin: 49px 0 0 30px; transform: rotate(-6deg); }
.envelope-art::before { content: ""; position: absolute; background: #1c2919; width: 215px; height: 160px; border-radius: 50%; left: -26px; top: 4px; transform: rotate(6deg); }
.envelope-note { position: absolute; width: 130px; height: 116px; background: white; border: 1px solid #1c2919; border-radius: 10px; left: 28px; top: -8px; padding: 18px; box-shadow: 0 8px 20px #c3d6b50a; }
.art-dot { display: block; width: 23px; height: 23px; background: var(--teal-soft); border-radius: 7px; }
.art-line { display: block; height: 5px; width: 77px; background: #1c2919; border-radius: 4px; margin-top: 11px; }
.art-line.short { width: 55px; margin-top: 7px; }
.art-check { position: absolute; width: 27px; height: 27px; border-radius: 50%; background: var(--teal); color: white; right: -12px; top: 17px; display: flex; align-items: center; justify-content: center; font-size: 15px; box-shadow: 0 0 0 5px #111713; }
.envelope-front { position: absolute; width: 183px; height: 98px; background: #1c2919; border: 1px solid #344b2a; border-radius: 9px; bottom: 19px; left: 0; overflow: hidden; box-shadow: 0 8px 14px #c3d6b506; }
.envelope-front::before, .envelope-front::after { content: ""; position: absolute; width: 145px; height: 145px; border: 1px solid #344b2a; background: #1c2919; border-radius: 7px; transform: rotate(45deg); left: -68px; top: -38px; }
.envelope-front::after { left: 105px; }
.art-chip { position: absolute; right: -134px; bottom: 40px; background: white; padding: 11px 14px; border: 1px solid #1c2919; box-shadow: 0 8px 20px #c3d6b506; border-radius: 10px; display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 500; color: #c3d6b5; transform: rotate(6deg); }
.art-chip .icon { width: 16px; height: 16px; color: var(--teal); }
.login-card { background: var(--paper); border: 1px solid #1c2919; border-radius: 20px; padding: 36px 31px 28px; box-shadow: 0 20px 55px #c3d6b506; }
.login-card-icon { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: var(--teal-soft); color: var(--teal); border-radius: 13px; margin-bottom: 20px; }
.login-card h2 { font-size: 23px; font-weight: 600; letter-spacing: -.7px; }
.login-card > p { color: #96b184; font-size: 12px; margin: 9px 0 27px; line-height: 1.6; }
.login-card label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 9px; color: #c3d6b5; }
.login-card input { min-height: 47px; width: 100%; border: 1px solid #1c2919; border-radius: 9px; padding: 12px 14px; background: #111713; color: var(--ink); }
.login-card input::placeholder { color: #718b65; font-size: 12px; }
.login-card input:focus { border-color: #96b184; }
.login-button { width: 100%; margin-top: 18px; justify-content: space-between; min-height: 46px; }
.login-button .icon { width: 17px; height: 17px; }
.login-card .login-note { display: flex; align-items: center; justify-content: center; gap: 7px; border-top: 1px solid #111713; padding-top: 22px; margin-top: 25px; margin-bottom: 0; color: #96b184; font-size: 10px; }
.login-note .icon { width: 13px; height: 13px; }
.form-error { color: var(--danger); margin-top: 9px; font-size: 12px; line-height: 1.6; }
.login-footer { width: min(1200px, 100%); margin: 0 auto; padding: 25px 44px; color: #718b65; display: flex; justify-content: space-between; font-size: 11px; }

.app-view { display: grid; grid-template-columns: 286px minmax(0,1fr); min-height: 100svh; }
.sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--line); padding: 32px 20px 20px; background: #111713; min-width: 0; height: 100svh; position: sticky; top: 0; }
.sidebar-brand { margin: 0 8px; font-size: 23px; }
.sidebar-brand .brand-mark { width: 33px; height: 33px; font-size: 30px; }
.sidebar-brand .brand-product { font-size: 18px; }
.sidebar-brand .brand-divider { margin: 0 7px; }
.sidebar-intro { margin: 24px 9px 27px; display: flex; align-items: center; gap: 8px; color: #96b184; font-size: 11px; }
.sidebar-intro .domain-label { margin-left: auto; font-size: 9px; color: #718b65; }
.create-button { min-height: 43px; width: 100%; }
.create-button .icon { width: 16px; height: 16px; }
.sidebar-list-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 30px 8px 13px; }
.sidebar-list-label h2 { font-size: 11px; font-weight: 600; color: #96b184; }
.count-pill { font-size: 10px; line-height: 1; padding: 5px 7px; min-width: 22px; border-radius: 6px; background: #1c2919; color: #96b184; text-align: center; font-weight: 600; }
.mailbox-list { display: flex; flex-direction: column; gap: 7px; overflow-y: auto; margin: 0 -5px; padding: 0 5px 12px; scrollbar-width: thin; scrollbar-color: #344b2a transparent; }
.mailbox-item { background: transparent; border: 1px solid transparent; border-radius: 11px; text-align: left; padding: 12px 10px; display: grid; grid-template-columns: 31px minmax(0,1fr) auto; align-items: center; gap: 7px; width: 100%; color: #c3d6b5; }
.mailbox-item:hover { background: #111713; }
.mailbox-item[aria-current="true"] { background: #1c2919; border-color: #1c2919; color: var(--ink); }
.mailbox-item-icon { width: 29px; height: 29px; display: flex; align-items: center; justify-content: center; color: #718b65; background: #111713; border-radius: 8px; }
.mailbox-item[aria-current="true"] .mailbox-item-icon { background: #1c2919; color: var(--teal); }
.mailbox-item-icon .icon { width: 16px; height: 16px; }
.mailbox-item-copy { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.mailbox-item-address { font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mailbox-item-meta { font-size: 10px; color: #96b184; }
.mailbox-item-count { font-size: 10px; color: #96b184; min-width: 17px; text-align: center; }
.sidebar-empty { color: #718b65; font-size: 11px; line-height: 1.8; padding: 6px 8px; }
.sidebar-bottom { margin-top: auto; padding-top: 23px; }
.storage-note { display: flex; gap: 9px; align-items: flex-start; padding: 17px 10px; border-top: 1px solid var(--line); }
.storage-note > .icon { width: 15px; height: 15px; color: #718b65; margin-top: 2px; }
.storage-note p { color: #96b184; font-size: 10px; line-height: 1.75; }
.storage-note strong { font-weight: 500; color: #96b184; }
.logout-button { justify-content: flex-start; width: 100%; font-size: 11px; font-weight: 500; color: #96b184; padding: 10px; }
.logout-button .icon { width: 16px; height: 16px; }
.workspace { min-width: 0; padding: 35px 42px 25px; width: min(1300px, 100%); margin: 0 auto; }
.workspace-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 28px; }
.workspace-header .eyebrow { font-size: 9px; color: #718b65; letter-spacing: 1.55px; margin-bottom: 7px; }
.workspace-header h1 { font-size: 29px; font-weight: 600; letter-spacing: -1px; line-height: 1.3; }
.title-dot { color: var(--teal); }
.private-pill { font-size: 10px; padding: 6px 10px; }
.error-banner { margin-bottom: 16px; padding: 10px 12px 10px 16px; border: 1px solid #344b2a; background: var(--danger-soft); border-radius: 10px; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #c3d6b5; font-size: 12px; }
.error-banner .icon-button { width: 28px; height: 28px; color: #c3d6b5; }
.error-banner .icon-button:hover { background: #1c2919; }
.welcome-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 17px; min-height: 580px; padding: 65px 28px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.welcome-visual { position: relative; width: 126px; height: 126px; border-radius: 50%; background: #111713; margin: 0 0 28px; display: flex; align-items: center; justify-content: center; color: #96b184; }
.welcome-visual > .icon { width: 55px; height: 55px; stroke-width: 1.2; }
.welcome-spark { position: absolute; width: 9px; height: 9px; background: #344b2a; border-radius: 2px; transform: rotate(45deg); }
.spark-one { right: -5px; top: 19px; }
.spark-two { left: -13px; bottom: 23px; width: 6px; height: 6px; background: #718b65; }
.welcome-panel .eyebrow { font-size: 9px; color: #718b65; letter-spacing: 1.5px; }
.welcome-panel h2 { font-size: 25px; letter-spacing: -.65px; margin: 11px 0 12px; font-weight: 600; }
.welcome-panel > p:not(.eyebrow) { font-size: 12px; line-height: 1.9; color: #96b184; }
.welcome-panel > .button { margin-top: 27px; font-size: 12px; min-height: 44px; padding: 12px 20px; }
.welcome-panel > .button .icon { width: 16px; height: 16px; }
.welcome-footnote { display: flex; align-items: center; gap: 6px; color: #718b65; font-size: 10px; margin-top: 24px; }
.welcome-footnote .icon { width: 13px; height: 13px; }
.address-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #111713; border: 1px solid #1c2919; border-radius: 14px; padding: 24px 26px; }
.address-content { min-width: 0; }
.address-card .eyebrow { color: #96b184; font-size: 9px; letter-spacing: 1.55px; }
.active-address { font-size: clamp(18px, 2.3vw, 27px); letter-spacing: -.8px; line-height: 1.4; font-weight: 600; color: #c3d6b5; overflow-wrap: anywhere; margin: 7px 0 6px; }
.address-hint { color: #96b184; font-size: 11px; }
.address-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 15px; flex-shrink: 0; }
.saved-status { display: flex; align-items: center; gap: 7px; color: #96b184; font-size: 11px; font-variant-numeric: tabular-nums; }
.saved-status .icon { width: 13px; height: 13px; }
#countdownText { font-weight: 650; }
.saved-status-label { color: #718b65; font-size: 10px; }
.saved-status.expiring { color: #96b184; }
.address-buttons { display: flex; align-items: center; gap: 8px; }
.copy-button { background: var(--paper); border-color: #1c2919; color: #c3d6b5; font-size: 11px; min-height: 36px; padding: 9px 13px; border-radius: 8px; }
.copy-button:hover:not(:disabled) { background: #111713; border-color: #344b2a; }
.copy-button .icon { width: 14px; height: 14px; }
.delete-mailbox { color: #718b65; height: 35px; width: 35px; }
.delete-mailbox .icon { width: 16px; height: 16px; }
.inbox-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 25px 1px 16px; }
.inbox-title { display: flex; gap: 9px; align-items: center; }
.inbox-title h2 { font-size: 15px; font-weight: 600; letter-spacing: -.2px; }
.inbox-title .count-pill { font-size: 9px; padding: 4px 6px; min-width: 20px; }
.sync-tools { display: flex; align-items: center; gap: 7px; }
.sync-status { display: flex; align-items: center; gap: 6px; color: #718b65; font-size: 9px; }
.sync-status .tiny-dot { width: 4px; height: 4px; background: #718b65; }
.sync-status.paused .tiny-dot { background: #718b65; }
.sync-tools .icon-button { width: 29px; height: 29px; }
.sync-tools .icon { width: 15px; height: 15px; }
.sync-tools .icon-button[aria-busy="true"] .icon { animation: rotate 1.2s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }
.inbox-layout { display: grid; grid-template-columns: 280px minmax(0,1fr); background: var(--paper); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; min-height: 420px; height: min(600px, calc(100svh - 330px)); }
.inbox-layout.is-empty { display: flex; }
.message-list { border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #344b2a transparent; padding: 6px; }
.message-item { width: 100%; display: block; padding: 16px 13px; text-align: left; background: transparent; border: 1px solid transparent; border-bottom-color: #111713; border-radius: 8px; color: var(--ink); }
.message-item:last-child { border-bottom-color: transparent; }
.message-item:hover { background: #111713; }
.message-item[aria-current="true"] { background: #111713; border-color: #1c2919; }
.message-item-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 7px; }
.message-item-sender { font-size: 11px; font-weight: 650; color: #c3d6b5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.message-item-time { font-size: 9px; white-space: nowrap; color: #718b65; font-variant-numeric: tabular-nums; }
.message-item-subject { display: block; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 5px; }
.message-item-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 10px; line-height: 1.7; color: #718b65; overflow: hidden; word-break: break-word; }
.inbox-empty, .reader-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 20px; text-align: center; }
.inbox-empty { width: 100%; }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 18px; color: #718b65; background: #111713; margin-bottom: 18px; }
.empty-icon .icon { width: 28px; height: 28px; stroke-width: 1.4; }
.inbox-empty h3, .reader-placeholder h3 { font-size: 16px; font-weight: 500; letter-spacing: -.3px; color: #96b184; }
.inbox-empty p, .reader-placeholder p { color: #718b65; font-size: 11px; line-height: 1.85; margin-top: 9px; }
.waiting-chip { display: inline-flex; align-items: center; gap: 6px; background: #111713; color: #718b65; font-size: 9px; padding: 6px 10px; border-radius: 30px; margin-top: 23px; }
.waiting-chip .tiny-dot { width: 4px; height: 4px; background: #718b65; }
.message-reader { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.reader-toolbar { padding: 11px 20px 7px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reader-label { color: #718b65; font-size: 8px; letter-spacing: 1.25px; font-weight: 500; }
.reader-toolbar > .icon-button { width: 29px; height: 29px; color: #718b65; }
.reader-toolbar > .icon-button .icon { width: 14px; height: 14px; }
.back-button { display: none; font-size: 11px; padding: 7px 0; min-height: 28px; }
.back-button .icon { width: 15px; height: 15px; }
.reader-heading { padding: 5px 24px 20px; border-bottom: 1px solid #111713; }
.reader-heading h2 { font-size: 20px; font-weight: 600; letter-spacing: -.6px; line-height: 1.5; overflow-wrap: anywhere; margin: 0 0 18px; }
.sender-details { display: flex; align-items: center; gap: 9px; }
.sender-avatar { width: 32px; height: 32px; border-radius: 10px; background: #111713; color: #718b65; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sender-details > div { min-width: 0; }
#messageSender { font-size: 11px; font-weight: 600; color: #96b184; overflow-wrap: anywhere; }
.sender-address { font-size: 9px; color: #718b65; overflow-wrap: anywhere; margin-top: 2px; }
#messageTime { margin-left: auto; color: #718b65; font-size: 9px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; max-width: 85px; }
.message-body { flex: 1; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.85; color: #c3d6b5; padding: 24px; scrollbar-width: thin; scrollbar-color: #344b2a transparent; }
.message-body:empty::before { content: "Thư này không có nội dung văn bản."; color: #718b65; font-style: italic; font-size: 12px; }
.otp-panel { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid #1c2919; background: #111713; border-radius: 10px; padding: 12px 14px; }
.otp-panel > div { display: flex; flex-direction: column; gap: 4px; }
.otp-label { font-size: 9px; color: #718b65; }
#otpCode { font-size: 22px; font-weight: 600; letter-spacing: 3px; color: #c3d6b5; }
.otp-panel .button { min-height: 32px; font-size: 10px; padding: 8px 10px; }
.otp-panel .icon { width: 13px; height: 13px; }
.workspace-note { display: flex; align-items: center; justify-content: center; gap: 6px; color: #718b65; font-size: 9px; padding: 17px 0 0; text-align: center; }
.workspace-note .icon { width: 12px; height: 12px; }
.list-loading { min-height: 180px; display: flex; align-items: center; justify-content: center; color: #718b65; font-size: 11px; }
.toast { position: fixed; bottom: 27px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; padding: 13px 18px; background: #c3d6b5; color: #111713; box-shadow: 0 8px 25px #c3d6b520; border-radius: 12px; font-size: 12px; z-index: 20; max-width: calc(100vw - 32px); }
.toast .icon { width: 15px; height: 15px; color: #344b2a; }
.confirm-dialog { border: 1px solid var(--line); border-radius: 17px; padding: 28px; max-width: min(420px, calc(100vw - 32px)); color: var(--ink); box-shadow: 0 25px 80px #c3d6b520; }
.confirm-dialog::backdrop { background: #c3d6b565; backdrop-filter: blur(3px); }
.confirm-icon { display: flex; align-items: center; justify-content: center; width: 43px; height: 43px; border-radius: 12px; color: var(--danger); background: var(--danger-soft); margin-bottom: 16px; }
.confirm-dialog h2 { font-size: 20px; font-weight: 600; letter-spacing: -.3px; }
.confirm-dialog p { margin-top: 11px; color: #96b184; line-height: 1.75; font-size: 12px; overflow-wrap: anywhere; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 25px; }
.confirm-actions .quiet { border-color: var(--line); }

@media (min-width: 1600px) { .workspace { padding-top: 40px; } }
@media (max-width: 1150px) {
  .app-view { grid-template-columns: 266px minmax(0,1fr); }
  .sidebar { padding-left: 15px; padding-right: 15px; }
  .workspace { padding: 30px 25px 22px; }
  .inbox-layout { grid-template-columns: 240px minmax(0,1fr); }
  .address-card { padding: 21px; }
  .login-main { gap: 55px; grid-template-columns: 1fr 360px; }
  .login-story h1 { font-size: 48px; }
}
@media (max-width: 960px) {
  .app-view { grid-template-columns: 244px minmax(0,1fr); }
  .sidebar { padding: 28px 12px 18px; }
  .sidebar-brand { font-size: 21px; gap: 8px; }
  .sidebar-brand .brand-product { font-size: 16px; }
  .sidebar-brand .brand-divider { margin: 0 5px; }
  .workspace { padding: 27px 20px 20px; }
  .workspace-header h1 { font-size: 25px; }
  .private-pill { display: none; }
  .inbox-layout { grid-template-columns: 210px minmax(0,1fr); }
  .message-item { padding: 14px 10px; }
  .reader-heading { padding: 5px 18px 18px; }
  .reader-heading h2 { font-size: 18px; }
  .sender-details { flex-wrap: wrap; }
  #messageTime { width: 100%; max-width: none; text-align: left; margin: 4px 0 0 41px; }
  .message-body { padding: 19px; font-size: 12px; }
  .address-card { flex-wrap: wrap; gap: 13px; }
  .address-actions { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; }
  .active-address { font-size: 23px; }
  .inbox-layout { height: min(600px, calc(100svh - 355px)); }
  .sync-status { font-size: 8px; }
  .login-main { gap: 34px; grid-template-columns: 1fr 340px; padding-left: 35px; padding-right: 35px; }
  .login-story h1 { font-size: 43px; }
  .login-description { font-size: 13px; }
  .login-features { flex-direction: column; gap: 12px; }
  .envelope-art { margin-top: 35px; transform: rotate(-6deg) scale(.85); transform-origin: left top; height: 140px; }
}
@media (max-width: 760px) {
  .login-main { display: block; padding: 28px 26px 35px; max-width: 460px; }
  .login-header { padding: 24px; }
  .login-header .pill { font-size: 9px; padding: 6px 10px; }
  .login-story { text-align: center; }
  .login-story > .eyebrow { justify-content: center; font-size: 8px; }
  .login-story h1 { font-size: 39px; letter-spacing: -1.7px; margin-top: 15px; }
  .login-description { margin: 17px auto 0; max-width: 340px; font-size: 12px; }
  .login-features { display: none; }
  .envelope-art { display: none; }
  .login-card { margin-top: 28px; padding: 27px; border-radius: 16px; }
  .login-card h2 { font-size: 22px; }
  .login-card > p { margin-bottom: 23px; }
  .login-footer { padding: 21px 26px; font-size: 10px; }
  .app-view { display: block; }
  .sidebar { position: static; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 18px 20px 15px; display: grid; grid-template-columns: 1fr auto; column-gap: 15px; align-items: center; }
  .sidebar-brand { margin: 0; font-size: 22px; }
  .sidebar-brand .brand-mark { width: 31px; height: 31px; font-size: 29px; }
  .sidebar-intro { display: none; }
  .create-button { width: auto; min-height: 35px; padding: 9px 12px; border-radius: 8px; font-size: 10px; }
  .create-button .icon { width: 13px; height: 13px; }
  .sidebar-list-label { display: none; }
  .mailbox-list { grid-column: 1 / -1; flex-direction: row; overflow-x: auto; overflow-y: hidden; margin: 14px -3px 0; padding: 0 3px 3px; }
  .mailbox-item { width: auto; min-width: 185px; max-width: 240px; padding: 8px 10px; flex-shrink: 0; grid-template-columns: 25px minmax(0,1fr) auto; }
  .mailbox-item-icon { width: 24px; height: 24px; border-radius: 6px; }
  .mailbox-item-icon .icon { width: 13px; height: 13px; }
  .mailbox-item-address { font-size: 10px; }
  .mailbox-item-meta { font-size: 9px; }
  .sidebar-empty { grid-column: 1 / -1; padding: 13px 0 0; font-size: 10px; }
  .sidebar-empty br { display: none; }
  .sidebar-bottom { grid-column: 1 / -1; padding-top: 0; margin: 0; display: flex; justify-content: flex-end; }
  .storage-note { display: none; }
  .logout-button { width: auto; min-height: 27px; padding: 5px 0 0 10px; font-size: 9px; }
  .logout-button .icon { width: 12px; height: 12px; }
  .workspace { padding: 23px 20px 22px; }
  .workspace-header { margin-bottom: 20px; }
  .workspace-header .eyebrow { font-size: 8px; }
  .workspace-header h1 { font-size: 25px; }
  .address-card { padding: 18px 19px; border-radius: 12px; }
  .active-address { font-size: 23px; letter-spacing: -.5px; }
  .address-hint { font-size: 10px; }
  .address-actions { gap: 10px; }
  .copy-button { min-height: 33px; padding: 8px 11px; font-size: 10px; }
  .inbox-toolbar { padding-top: 22px; padding-bottom: 13px; }
  .inbox-layout { grid-template-columns: minmax(0,1fr); min-height: 360px; height: min(620px, 70svh); }
  .inbox-layout.is-empty { min-height: 350px; height: auto; }
  .message-list { border-right: 0; }
  .message-item { padding: 17px 14px; }
  .message-item-sender { font-size: 12px; }
  .message-item-subject { font-size: 13px; }
  .message-item-preview { font-size: 11px; -webkit-line-clamp: 1; }
  .message-item-time { font-size: 10px; }
  .reader-placeholder { display: none; }
  .inbox-layout.reading .message-list { display: none; }
  .inbox-layout:not(.reading) .message-reader { display: none; }
  .reader-toolbar { padding: 12px 18px 8px; }
  .reader-label { display: none; }
  .back-button { display: inline-flex; }
  .reader-heading { padding: 6px 20px 19px; }
  .reader-heading h2 { font-size: 21px; margin-bottom: 15px; }
  .sender-details { flex-wrap: nowrap; }
  #messageTime { width: auto; max-width: 80px; text-align: right; margin: 0 0 0 auto; }
  #messageSender { font-size: 12px; }
  .sender-address { font-size: 10px; }
  .message-body { font-size: 13px; padding: 21px; }
  .welcome-panel { min-height: 450px; padding: 45px 18px; }
  .welcome-panel h2 { font-size: 22px; }
  .welcome-visual { width: 100px; height: 100px; margin-bottom: 22px; }
  .welcome-visual > .icon { width: 43px; height: 43px; }
  .workspace-note { font-size: 8px; align-items: flex-start; }
  .workspace-note .icon { width: 11px; height: 11px; margin-top: 1px; }
}
@media (max-width: 380px) {
  .sidebar { padding-left: 15px; padding-right: 15px; }
  .workspace { padding-left: 15px; padding-right: 15px; }
  .workspace-header h1 { font-size: 23px; }
  .active-address { font-size: 20px; }
  .login-header { padding-left: 19px; padding-right: 19px; }
  .login-header .pill { font-size: 8px; }
  .login-header .brand { font-size: 22px; gap: 7px; }
  .brand-divider { margin: 0 6px; }
  .brand-product { font-size: 16px; }
  .login-main { padding-left: 19px; padding-right: 19px; }
  .login-card { padding: 24px; }
  .sync-status { max-width: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.clipboard-fallback { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }

/* Private mailspace: lime accents, saved inboxes and recoverable trash. */
::selection { background: #b4fa5345; color: #fff; }
.primary { color: #182608; box-shadow: 0 0 22px #b4fa5309; }
.primary:hover:not(:disabled) { box-shadow: 0 0 24px #b4fa531a; }
.brand-mark { color: var(--teal); background: #b4fa530e; border: 1px solid #b4fa5380; border-radius: 9px; }
.brand-product { font-family: var(--mono); font-size: 17px; }
.eyebrow { font-family: var(--mono); font-weight: 400; }
.login-view { background: radial-gradient(ellipse at 12% 62%, #b4fa5309, transparent 52%), linear-gradient(#26342916 1px, transparent 1px), linear-gradient(90deg, #26342916 1px, transparent 1px); background-size: auto, 48px 48px, 48px 48px; }
.login-story h1 { letter-spacing: -2.5px; }
.login-description { color: #93a196; }
.login-features > div { color: #abb8ac; }
.login-features .icon { width: 14px; height: 14px; color: var(--teal); }
.login-card { position: relative; border-color: #304131; box-shadow: 0 20px 60px #00000025; }
.login-card::before { content: ""; position: absolute; left: 30px; top: -1px; height: 2px; width: 52px; background: var(--teal); box-shadow: 0 0 16px #b4fa5345; }
.login-card .card-kicker { font: 8px var(--mono); color: #748b72; letter-spacing: 1.2px; margin: 0 0 8px; }
.login-card .login-card-description { color: #829784; margin: 11px 0 28px; }
.login-card input { background: #0c120e; border-color: #324236; }
.login-card input::placeholder { color: #718474; }
.login-card label { color: #bfccbd; }
.login-card .login-note { color: #8ca58b; border-color: var(--line); }
.terminal-art { position: relative; margin-top: 37px; max-width: 435px; border: 1px solid #354936; background: #0a100be0; border-radius: 11px; box-shadow: 0 12px 50px #00000018; transform: rotate(-2deg); }
.terminal-top { border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 6px; padding: 13px 16px; }
.terminal-top > span { width: 6px; height: 6px; border-radius: 50%; background: #475c49; }
.terminal-top > span:first-child { background: #a6ba61; }
.terminal-top code { font: 9px var(--mono); color: #839b85; margin-left: 9px; }
.terminal-content { padding: 19px 20px 24px; font: 11px/2.15 var(--mono); color: #c0cfbe; }
.terminal-content p > span:first-child { color: var(--teal); margin-right: 10px; }
.terminal-content em { font-style: normal; color: #8ca58e; }
.terminal-content .terminal-last { color: #8ca58e; margin-top: 9px; }
.terminal-cursor { color: var(--teal); padding-left: 3px; animation: boot-pulse 1.2s step-end infinite; }
.terminal-badge { position: absolute; right: -12px; bottom: -13px; border: 1px solid #5a7a36; background: #172010; padding: 8px 11px; border-radius: 5px; color: var(--teal); font: 9px var(--mono); letter-spacing: .4px; display: flex; align-items: center; gap: 8px; }
.terminal-badge .tiny-dot { width: 4px; height: 4px; }
.sidebar { background: #0d130f; }
.sidebar-intro { font-family: var(--mono); }
.create-mailbox-form { background: #121b13; border: 1px solid #283a28; border-radius: 10px; padding: 14px; }
.create-mailbox-form > label { display: block; font-size: 11px; font-weight: 600; margin-bottom: 10px; color: #d1decc; }
.alias-input-wrap { display: flex; align-items: center; border: 1px solid #354435; border-radius: 6px; background: #0b120d; min-height: 39px; overflow: hidden; }
.alias-input-wrap:focus-within { border-color: #97ce4b; outline: 1px solid #97ce4b; }
.alias-input-wrap input { width: 100%; min-width: 0; border: 0; background: transparent; padding: 10px 2px 10px 10px; color: var(--ink); font-family: var(--mono); font-size: 11px; }
.alias-input-wrap input:focus-visible { outline: 0; }
.alias-input-wrap input::placeholder { color: #81947e; font-family: "Segoe UI", system-ui, sans-serif; font-size: 11px; }
.alias-domain { font-family: var(--mono); font-size: 10px; color: #8aa581; padding: 0 9px 0 3px; white-space: nowrap; }
#customAliasHelp { font-size: 10px; color: #92a68b; margin: 7px 0 12px; }
.create-button { min-height: 38px; padding: 9px 8px; font-size: 11px; border-radius: 6px; }
.mailbox-item[aria-current="true"] { background: #b4fa530d; border-color: #b4fa5330; box-shadow: inset 2px 0 var(--teal); }
.mailbox-item[aria-current="true"] .mailbox-item-icon { background: #b4fa5313; }
.mailbox-item-address, .active-address { font-family: var(--mono); font-weight: 400; }
.mailbox-item-meta { color: #8aa57c; }
.trash-nav { width: 100%; justify-content: flex-start; padding: 10px; font-size: 11px; }
.trash-nav .icon { width: 16px; height: 16px; }
.trash-nav .count-pill { margin-left: auto; font-size: 9px; }
.trash-nav[aria-current="true"] { background: #b4fa530d; border-color: #b4fa5325; color: var(--teal); }
.storage-note { margin-top: 10px; }
.storage-note p { color: #90a584; }
.storage-note strong { color: #b4cd9f; }
.header-slash { color: #5d7754; margin: 0 2px; }
.private-pill { border-color: #34492c; color: #a7c994; }
.private-pill .tiny-dot { width: 4px; height: 4px; }
.address-card { background: linear-gradient(120deg, #b4fa530d, #b4fa5303), #111913; border-color: #38502c; }
.active-address { color: #d4edbe; }
.address-hint { color: #92aa84; }
.saved-status { color: #a8ce8a; }
.copy-button { background: #1f2d1d; border-color: #466039; color: #b9d1a2; }
.copy-button:hover:not(:disabled) { background: #2a3e21; border-color: #74984d; color: var(--teal); }
.message-item[aria-current="true"] { background: #b4fa5309; border-color: #b4fa5326; }
.message-item-subject { color: #d0dfc5; }
.message-item-preview { color: #8ba07e; }
.message-item-sender { color: #b2d197; }
.message-body { color: #c4d1bc; }
.sender-avatar { background: #253e1a; color: #a3c983; }
.otp-panel { background: #b4fa5308; border-color: #456931; }
#otpCode { font-family: var(--mono); color: var(--teal); }
.workspace-note, .sync-status { color: #839e72; }
.welcome-panel { background: radial-gradient(ellipse at 50% 30%, #b4fa5306, transparent 70%), var(--paper); }
.welcome-visual { background: #b4fa5309; border: 1px solid #b4fa5325; color: var(--teal); }
.welcome-panel > p:not(.eyebrow), .welcome-footnote { color: #9bb888; }
.error-banner { border-color: #ff927f35; color: var(--danger); }
.error-banner .icon-button { color: var(--danger); }
.icon-button[title^="Chuyển"]:hover:not(:disabled) { color: var(--danger); background: var(--danger-soft); }
.danger { color: var(--danger); background: var(--danger-soft); border-color: #ff927f35; }
.danger:hover:not(:disabled) { background: #ff927f20; }
.confirm-dialog { background: var(--paper); border-color: #3a4b32; box-shadow: 0 25px 80px #00000050; }
.confirm-dialog::backdrop { background: #050a06bb; }
.confirm-dialog p { color: #a3b89b; }
.confirm-actions .button { font-size: 11px; }
.toast { background: #1a2b15; border: 1px solid #526e39; color: #daedcb; box-shadow: 0 8px 35px #00000040; }
.toast .icon { color: var(--teal); }
.trash-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 30px; min-height: 570px; }
.trash-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 30px; }
.trash-heading-icon { display: flex; align-items: center; justify-content: center; width: 45px; height: 45px; color: var(--teal); border: 1px solid #b4fa5325; background: var(--teal-soft); border-radius: 11px; margin-bottom: 18px; }
.trash-header h2 { font-size: 23px; font-weight: 600; letter-spacing: -.6px; line-height: 1.4; }
.trash-header p { color: #98af89; font-size: 12px; line-height: 1.8; margin-top: 9px; }
.trash-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 55px 10px; }
.trash-empty h3 { font-size: 17px; color: #a3ba93; font-weight: 500; }
.trash-empty p { color: #94af82; font-size: 12px; margin-top: 9px; }
.trash-section + .trash-section { margin-top: 28px; }
.trash-section-title { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.trash-section-title h3 { font-size: 13px; font-weight: 500; color: #a3b995; }
.trash-list { display: flex; flex-direction: column; gap: 8px; }
.trash-item { display: flex; align-items: center; gap: 15px; border: 1px solid #2c3d28; background: #111b12; border-radius: 8px; padding: 15px; }
.trash-item-icon { display: flex; justify-content: center; align-items: center; width: 35px; height: 35px; border-radius: 8px; background: #25391e; color: #8fab7c; flex-shrink: 0; }
.trash-item-icon .icon { width: 17px; height: 17px; }
.trash-item-copy { flex: 1; min-width: 0; }
.trash-item-title { font-size: 13px; font-weight: 500; color: #d1dfc7; overflow-wrap: anywhere; }
.trash-mailbox .trash-item-title { font-family: var(--mono); font-size: 12px; }
.trash-item-meta { font-size: 10px; line-height: 1.7; color: #93b181; margin-top: 4px; overflow-wrap: anywhere; }
.restore-button { background: #22341a; border-color: #456635; color: #b7d49c; min-height: 34px; padding: 8px 10px; font-size: 10px; flex-shrink: 0; }
.restore-button:hover:not(:disabled) { background: #304b20; border-color: #7b9e55; color: var(--teal); }
.restore-button .icon { width: 13px; height: 13px; }
@media (max-width: 760px) {
  .login-features, .terminal-art { display: none; }
  .login-card-description { margin-bottom: 24px; }
  .sidebar-brand { grid-column: 1; }
  .sidebar-intro { display: flex; margin: 0; justify-self: end; font-size: 9px; }
  .sidebar-intro .domain-label { display: none; }
  .create-mailbox-form { grid-column: 1 / -1; margin-top: 20px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 10px; padding: 12px; }
  .create-mailbox-form > label { margin: 0; grid-column: 1 / -1; font-size: 10px; }
  .alias-input-wrap { grid-column: 1; min-height: 37px; }
  .alias-input-wrap input { font-size: 12px; padding-top: 9px; padding-bottom: 9px; }
  .create-button { grid-column: 2; grid-row: 2; min-height: 37px; padding: 8px 12px; }
  #customAliasHelp { grid-column: 1 / -1; margin: 0; font-size: 9px; }
  .sidebar-bottom { padding-top: 8px; justify-content: space-between; }
  .trash-nav, .logout-button { width: auto; min-height: 28px; padding: 6px 8px; font-size: 10px; }
  .trash-nav .icon, .logout-button .icon { width: 13px; height: 13px; }
  .trash-nav .count-pill { padding: 3px 5px; min-width: 18px; font-size: 8px; margin-left: 0; }
  .trash-panel { padding: 23px 18px; min-height: 450px; }
  .trash-header { margin-bottom: 23px; }
  .trash-header h2 { font-size: 21px; }
  .trash-header p { font-size: 11px; }
  .trash-item { padding: 12px; gap: 9px; flex-wrap: wrap; }
  .trash-item-icon { width: 29px; height: 29px; }
  .trash-item-title { font-size: 12px; }
  .trash-mailbox .trash-item-title { font-size: 11px; }
  .trash-item-meta { font-size: 9px; }
  .restore-button { margin-left: auto; min-height: 30px; }
}
@media (max-width: 380px) {
  .sidebar-intro { font-size: 8px; gap: 5px; }
  .sidebar-intro .tiny-dot { width: 4px; height: 4px; }
  .create-mailbox-form { grid-template-columns: minmax(0,1fr); }
  .alias-input-wrap, .create-button { grid-column: 1; }
  .create-button { grid-row: 4; width: 100%; }
  #customAliasHelp { grid-row: 3; }
  .confirm-actions { flex-direction: column-reverse; }
}
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.workspace-tools { display:flex; flex-direction:column; align-items:flex-end; gap:10px; min-width:min(410px,45%); }
.search-box { display:flex; gap:9px; align-items:center; width:100%; padding:8px 12px; border:1px solid #3a5234; background:#101711; border-radius:9px; color:#a9c692; }
.search-box input { width:100%; min-width:0; border:0; outline:none; background:transparent; color:#dfecd7; font-size:12px; padding:4px; }
.search-box input::placeholder { color:#96ac8b; }
.search-box:focus-within { border-color:#b4fa53; }
.search-panel { border:1px solid #405a35; border-radius:12px; background:#111913; margin-bottom:22px; padding:18px; max-height:65svh; overflow:auto; }
.search-panel-head { display:flex; justify-content:space-between; align-items:center; gap:12px; color:#aacb96; font-size:12px; margin-bottom:12px; }
.search-section-label { font-size:12px; color:#b4fa53; margin:17px 0 8px; }
.search-results { display:flex; flex-direction:column; gap:7px; }
.search-result { display:flex; flex-direction:column; align-items:flex-start; gap:5px; text-align:left; border:1px solid #29392a; background:#0b120d; color:#d7e8cd; padding:13px; border-radius:8px; overflow-wrap:anywhere; }
.search-result:hover { border-color:#b4fa53; background:#142013; }
.search-result strong { font-size:13px; font-weight:600; }
.search-result span { font-size:11px; color:#9eb28e; }
.search-result .search-preview { color:#d1ddc9; }
.workspace-header h1 { color:#e8eee8; }
@media (max-width:960px) { .workspace-header { flex-wrap:wrap; } .workspace-tools { align-items:flex-start; width:100%; min-width:0; } .search-box { max-width:100%; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none !important; transition:none !important; } }
.login-story h1, .login-card h2, .welcome-panel h2, .reader-heading h2 { color:#e8eee8; }
.login-story h1 span { color:#b4fa53; }
.login-card-icon, .feature-icon { background:#1b2c16; color:#b4fa53; }

.inbound-notice { margin:0 0 20px;padding:12px 15px;border:1px solid #916b2c;background:#2e2515;color:#ead29d;border-radius:9px;font-size:12px;line-height:1.6; }

.mail-view-controls { display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;padding:12px 22px;border-block:1px solid var(--line); }
.mail-format,.mail-downloads { display:flex;flex-wrap:wrap;gap:7px; }
.mail-view-controls .button { font-size:11px;min-height:32px;padding:7px 10px;text-decoration:none; }
.mail-format [aria-pressed="true"] { color:var(--teal);border-color:#5a7a36;background:#b4fa530d; }
.mail-html-frame { width:100%;min-height:560px;border:0;background:#fff;display:block;flex:1; }
.mail-html-status,.legacy-mail-notice { margin:10px 20px;color:#b2c6a0;font-size:12px; }
.legacy-mail-notice { padding:10px;border:1px solid #7b6330;border-radius:7px;background:#2a2314;color:#dcc28e; }
.mail-extras { padding:13px 22px;border-top:1px solid var(--line);overflow-wrap:anywhere; }
.mail-extras h3 { font-size:12px;margin-bottom:9px;color:#a8c68f; }
.mail-file,.mail-link { display:block;padding:9px 10px;margin-block:5px;color:#c9e2b2;background:#132012;border:1px solid #354832;border-radius:7px;font-size:12px; }
@media (max-width:760px){.mail-view-controls,.mail-extras {padding:10px 14px;} .mail-html-frame{min-height:500px;}}
/* Read the entire message instead of clipping a tall HTML document. */
.message-reader { overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:#547638 transparent; }
.reader-toolbar,.reader-heading,.mail-view-controls,.mail-extras,.mail-html-status,.legacy-mail-notice { flex-shrink:0; }
.mail-html-frame { flex:0 0 620px;height:620px;min-height:620px;max-width:100%; }
.message-body { flex:0 0 auto;min-height:220px;overflow-y:visible; }
.inbox-layout { height:clamp(480px,72svh,920px); }
@media (max-width:760px){.inbox-layout{height:75svh;min-height:440px;} .mail-html-frame{flex-basis:620px;height:620px;min-height:620px;}}
