*{box-sizing:border-box}
:root{--green:#0f2617;--green2:#173622;--green3:#2f4d35;--gold:#d7b360;--cream:#f7f4ed;--paper:#fff;--ink:#1f241f;--muted:#6f786f;--line:#dde3dd;--soft:#f3f6f3;--danger:#a13d35;--shadow:0 18px 55px rgba(8,23,13,.15)}
html,body{margin:0;min-height:100%;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;color:var(--ink);background:var(--cream);-webkit-text-size-adjust:100%;touch-action:pan-x pan-y}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
a{color:inherit}

.login-page{min-height:100vh;background:linear-gradient(135deg,#08170d,#173622);display:grid;place-items:center;padding:24px}
.login-wrap{width:min(100%,460px)}
.login-card{background:#fff;border:1px solid rgba(215,179,96,.28);border-radius:18px;box-shadow:var(--shadow);text-align:center;overflow:hidden}
.login-brand-header{background:linear-gradient(90deg,#12311f 0%,#0f2617 55%,#173622 100%);padding:16px 20px;border-bottom:1px solid rgba(255,255,255,.08)}
.login-card-body{padding:28px 34px 34px}
.brand{display:inline-flex;justify-content:center;margin-bottom:0;text-decoration:none}
.login-header-brand{display:flex;align-items:center;justify-content:flex-start;gap:12px;text-decoration:none;width:100%}
.login-main-logo{width:52px;height:52px;object-fit:contain;display:block;flex:0 0 auto;filter:drop-shadow(0 3px 10px rgba(0,0,0,.18))}
.login-brand-images{display:flex;flex-direction:column;min-width:0;flex:1;max-width:300px}
.login-form button:disabled{opacity:.7;cursor:wait}

.brand-full{width:min(100%,320px);flex-direction:column;align-items:center;gap:0}
.brand-text{width:100%;max-width:300px;height:auto;object-fit:contain;display:block}
.brand-slogan-row{display:flex;align-items:flex-end;justify-content:center;width:100%;margin-top:-10px}
.brand-slogan{width:78%;max-width:235px;height:auto;object-fit:contain}
.brand-leaf{width:42px;height:42px;object-fit:contain;margin-left:4px;margin-bottom:-5px;transform:rotate(70deg)}
.eyebrow{text-transform:uppercase;letter-spacing:.16em;font-size:11px;font-weight:900;color:#63705f}
.eyebrow.dark{color:#788178}
.login-card h1{margin:4px 0 6px;font-size:34px;color:var(--green)}
.subtext{margin:0 0 28px;color:var(--muted)}
.login-form{text-align:left;display:grid;gap:15px}
.login-form label,.compose-modal label{display:grid;gap:7px;font-size:13px;font-weight:800;color:#394239}
input,select,textarea{width:100%;border:1px solid #ccd5cc;border-radius:9px;background:#fff;color:var(--ink);outline:none;transition:.15s border-color,.15s box-shadow}
input,select{height:44px;padding:0 12px}
textarea{padding:12px;resize:vertical}
input:focus,select:focus,textarea:focus{border-color:#67856b;box-shadow:0 0 0 3px rgba(47,77,53,.12)}
.login-form button,.compose{border:0;border-radius:9px;background:var(--green2);color:#fff;font-weight:900;padding:13px 16px}
.login-form button:hover,.compose:hover{background:#21482d}
.form-message{min-height:18px;margin:0;text-align:center;font-size:13px;color:var(--danger)}
.preview-link{display:inline-block;margin-top:12px;color:#2f5a38;font-size:13px;font-weight:800}
.small-note{font-size:12px;color:#8b948b;margin:18px 0 0}

.topbar{height:78px;background:linear-gradient(90deg,#12311f,#0f2617 58%,#173622);color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 22px;border-bottom:1px solid rgba(255,255,255,.08)}
.topbar-brand{display:flex;align-items:center;gap:14px;text-decoration:none;color:#fff;min-width:0}
.topbar-brand-images{display:flex;flex-direction:column;width:300px;min-width:0}
.topbar-brand-text{width:100%;height:auto;object-fit:contain;display:block}
.topbar-slogan-row{display:flex;align-items:flex-end;margin-top:-9px}
.topbar-brand-slogan{width:78%;height:auto;object-fit:contain}
.topbar-brand-leaf{width:34px;height:34px;object-fit:contain;margin-left:3px;margin-bottom:-5px;transform:rotate(70deg)}
.topbar-email-label{font-size:26px;color:#eef4ed;font-weight:900;border-left:1px solid rgba(255,255,255,.18);padding-left:16px;line-height:1}
.topbar-actions{display:flex;align-items:center;gap:14px}
.topbar-corner-logo{width:52px;height:52px;object-fit:contain;display:block;filter:drop-shadow(0 3px 10px rgba(0,0,0,.18))}
.signout{text-decoration:none;font-size:13px;font-weight:800;color:#eef4ed;border:1px solid rgba(255,255,255,.16);padding:9px 12px;border-radius:8px;white-space:nowrap}

.mail-page{min-height:100vh;min-height:100dvh;background:#edf1ed;overflow:hidden}
.mail-shell{height:calc(100vh - 78px);height:calc(100dvh - 78px);display:grid;grid-template-columns:260px minmax(340px,440px) 1fr;background:#fff}
.sidebar{border-right:1px solid var(--line);padding:18px 14px;background:#f7f9f7;overflow:auto}
.compose{width:100%;margin-bottom:22px;display:flex;align-items:center;justify-content:center;gap:10px}
.btn-icon,.folder-icon,.account-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}
.btn-icon svg,.folder-icon svg,.account-icon svg{width:18px;height:18px;display:block}
.mailbox-title{text-transform:uppercase;letter-spacing:.11em;font-size:10px;font-weight:900;color:#899289;margin:0 8px 8px}
.account-list{display:grid;gap:4px}
.account-btn{border:0;background:transparent;text-align:left;border-radius:8px;padding:10px;color:#3a433a}
.account-btn strong{display:block;font-size:13px}
.account-btn span{display:block;font-size:11px;color:#7a847a;margin-top:2px;overflow:hidden;text-overflow:ellipsis}
.account-btn.active{background:#e6eee7;color:#173622}
.account-btn.active span{color:#59715c}
.folder-list{border-top:1px solid var(--line);margin-top:18px;padding-top:14px;display:grid;gap:3px}
.folder{border:0;background:transparent;text-align:left;padding:9px 10px;border-radius:7px;color:#596259;font-weight:700}
.folder.active{background:#edf2ed;color:#16371f}
.inbox-panel{border-right:1px solid var(--line);display:flex;flex-direction:column;min-width:0}
.inbox-head{padding:18px;border-bottom:1px solid var(--line);display:flex;gap:12px;justify-content:space-between;align-items:flex-end}
.inbox-head h1{font-size:24px;margin:2px 0;color:#19311f}
.inbox-head p{font-size:12px;color:#7d877d;margin:0}
.inbox-actions{display:flex;align-items:center;gap:7px}
.inbox-actions input{width:150px;height:38px}
.inbox-actions button{width:38px;height:38px;border:1px solid #ccd4cc;background:#fff;border-radius:8px;color:#415041;display:inline-flex;align-items:center;justify-content:center}.inbox-actions button svg{width:18px;height:18px;display:block}
.message-list{overflow:auto;flex:1}
.message-row{width:100%;border:0;border-bottom:1px solid #edf0ed;background:#fff;text-align:left;padding:14px 16px;display:grid;grid-template-columns:1fr auto;gap:6px 10px}
.message-row:hover,.message-row.active{background:#f4f7f4}
.message-row.unread{background:#fbfcfb}
.message-row.unread .sender,.message-row.unread .subject{font-weight:900}
.sender{font-size:13px;color:#243024}
.time{font-size:11px;color:#8b948b}
.subject{font-size:13px;color:#374137;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.snippet{grid-column:1/-1;font-size:12px;color:#788178;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.reader-panel{min-width:0;background:#fff;overflow:auto}
.empty-reader{height:100%;display:grid;place-content:center;text-align:center;color:#8d968d;gap:6px}
.mail-icon{width:44px;height:44px;color:#96a496;margin:0 auto}.mail-icon svg{width:100%;height:100%;display:block}
.empty-reader strong{color:#526052}
.reader{padding:28px;max-width:850px;margin:0 auto}
.reader h2{margin:8px 0 8px;font-size:25px;color:#1b3020}
.reader-meta{font-size:12px;color:#7e887e;padding-bottom:18px;border-bottom:1px solid var(--line)}
.reader-body{font-size:14px;line-height:1.65;color:#303930;white-space:pre-wrap;padding-top:20px}
.modal-backdrop{position:fixed;inset:0;background:rgba(7,17,10,.48);display:grid;place-items:center;padding:18px;z-index:30;overflow:auto;-webkit-overflow-scrolling:touch}
.hidden{display:none}
.compose-modal{width:min(680px,100%);max-height:calc(100dvh - 36px);overflow:auto;-webkit-overflow-scrolling:touch;background:#fff;border-radius:14px;box-shadow:var(--shadow);padding:18px;display:grid;gap:12px}
.compose-head{display:flex;justify-content:space-between;align-items:center;color:#173622}
.compose-head button{border:0;background:transparent;font-size:28px;color:#687268}
.compose-modal textarea{min-height:220px}
.compose-actions{display:flex;align-items:center;justify-content:space-between;gap:16px}
.compose-actions span{font-size:11px;color:#879087}
.compose-actions button{border:0;border-radius:8px;background:var(--green2);color:#fff;font-weight:900;padding:10px 22px}

@media(max-width:900px){
  .topbar-brand-images{width:220px}
  .topbar-email-label{font-size:22px}
  .mail-shell{grid-template-columns:210px 1fr;position:relative}
  .reader-panel{display:none}
  .reader-panel.mobile-open{display:block;position:absolute;inset:0;z-index:12;background:#fff;overflow:auto;-webkit-overflow-scrolling:touch}
  .reader-panel.mobile-open .mobile-reader-back{display:inline-flex;align-items:center}
  .inbox-panel{border-right:0}
  .reader{padding:22px 20px;max-width:none}
}
@media(max-width:650px){
  .topbar{height:64px;padding:0 10px;padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
  .topbar-left{gap:8px;min-width:0}
  .topbar-main-logo{width:34px;height:34px}
  .topbar-brand-images{width:min(46vw,150px)}
  .topbar-email-label{display:none}
  .topbar-brand-leaf{width:22px;height:22px}
  .signout{font-size:12px;padding:8px 9px}
  .mail-shell{height:calc(100vh - 64px);height:calc(100dvh - 64px);grid-template-columns:1fr}
  .sidebar{display:none}
  .inbox-head{align-items:flex-start;flex-direction:column;padding:14px}
  .inbox-head h1{font-size:22px}
  .inbox-actions{width:100%;gap:6px}
  .inbox-actions input{flex:1;width:auto;min-width:0}
  .message-row{padding:12px 14px}
  .reader{padding:16px 14px calc(24px + env(safe-area-inset-bottom))}
  .reader h2{font-size:21px;line-height:1.2;overflow-wrap:anywhere}
  .reader-meta{font-size:11px;overflow-wrap:anywhere}
  .rich-message-body{padding-top:12px}
  .email-frame{min-height:calc(100dvh - 230px)}
  .email-attachment{width:calc(50% - 5px);min-width:0}
  .modal-backdrop{place-items:start center;padding:10px;padding-top:max(10px,env(safe-area-inset-top));padding-bottom:max(10px,env(safe-area-inset-bottom))}
  .compose-modal{width:100%;max-height:calc(100dvh - 20px);padding:14px;border-radius:12px;gap:10px}
  .compose-modal textarea{min-height:180px}
  .compose-actions{position:sticky;bottom:0;background:#fff;padding-top:8px}
  .login-page{padding:14px;min-height:100dvh}
  .login-brand-header{padding:14px 16px}
  .login-main-logo{width:44px;height:44px}
  .login-header-brand{gap:10px}
  .login-brand-images{max-width:260px}
  .login-card-body{padding:24px 20px 26px}
}
@media(max-width:380px){
  .topbar-brand-images{width:128px}
  .signout{padding:7px 8px}
  .compose-actions{gap:8px}
  .compose-actions button{padding:10px 16px}
  .email-attachment{width:100%}
}

/* Mail account row + top-left branding */
.topbar-left{display:flex;align-items:center;gap:12px;min-width:0}
.topbar-main-logo{width:54px;height:54px;object-fit:contain;display:block;flex:0 0 auto;filter:drop-shadow(0 3px 10px rgba(0,0,0,.18))}
.account-btn{display:flex;align-items:center;gap:10px;width:100%}
.account-icon{width:20px;height:20px;color:#667466}
.account-btn.active .account-icon{color:#173622}
.account-copy{display:block;min-width:0;flex:1}
.account-copy strong{display:block}
.account-copy>span{display:block}
.folder{display:flex;align-items:center;gap:10px;width:100%}
.folder-icon{width:19px;height:19px}
.folder-icon svg{width:19px;height:19px}
.no-access{padding:10px 8px;font-size:12px;color:#7a847a}


/* Auth upgrades */
.password-wrap{position:relative;display:grid;grid-template-columns:1fr 42px 42px;align-items:center}
.password-wrap input{grid-column:1/-1;padding-right:88px}
.password-wrap .icon-btn{position:absolute;top:50%;transform:translateY(-50%);width:34px;height:34px;padding:0;border:0;background:transparent;color:#526052;display:grid;place-items:center;border-radius:7px}
.password-wrap .icon-btn:hover{background:#eef3ee}
.password-wrap .icon-btn svg{width:18px;height:18px}
.password-wrap .password-toggle{right:42px}
.password-wrap .copy-password{right:6px}
.primary-auth-btn{width:100%}
.text-button{border:0!important;background:transparent!important;color:#31573a!important;padding:3px 0!important;font-size:13px!important;font-weight:800!important;text-align:center}
.text-button:hover{text-decoration:underline}
.password-hint{font-size:11px;color:#7e887e;margin-top:-6px}
.form-message.success{color:#2f6b3c}


/* Rich email reader */
.reader-rich{max-width:1000px}
.rich-message-body{padding-top:16px}
.email-frame{width:100%;min-height:560px;border:0;background:#fff;display:block}
.email-attachments{border-top:1px solid var(--line);margin-top:18px;padding-top:16px}
.email-attachments-title{font-size:11px;text-transform:uppercase;letter-spacing:.12em;font-weight:900;color:#778177;margin-bottom:10px}
.email-attachment-list{display:flex;flex-wrap:wrap;gap:10px}
.email-attachment{width:150px;min-height:76px;border:1px solid var(--line);border-radius:10px;padding:8px;text-decoration:none;color:#324032;background:#fafcfa;display:flex;flex-direction:column;gap:7px;justify-content:center}
.email-attachment img{width:100%;height:90px;object-fit:cover;border-radius:6px;background:#eef2ee}
.email-attachment span{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.attachment-file-icon{font-size:24px!important;text-align:center}
.muted-email-body{color:#7e887e}


/* Mobile mailbox refinements */
.mobile-reader-back{display:none;border:0;background:#eef3ee;color:#173622;font-weight:800;border-radius:8px;padding:9px 12px;margin:0 0 14px}
.reader-panel,.message-list,.sidebar,.compose-modal{overscroll-behavior:contain}
.reader img,.reader video,.reader canvas,.reader svg{max-width:100%;height:auto}
.reader table{max-width:100%;overflow-wrap:anywhere}


/* Account navigation + account pages */
.topbar-nav{display:flex;align-items:center;gap:4px}
.topbar-tab{text-decoration:none;font-size:12px;font-weight:800;color:#dfe9df;padding:8px 10px;border-radius:8px;white-space:nowrap}
.topbar-tab:hover,.topbar-tab.active{background:rgba(255,255,255,.12);color:#fff}
.account-page{min-height:100vh;min-height:100dvh;background:#edf1ed}
.account-page-main{width:min(920px,calc(100% - 32px));margin:32px auto;padding-bottom:40px}
.account-page-head{margin-bottom:20px}
.account-page-head h1{margin:4px 0 6px;color:#19311f;font-size:30px}
.account-page-head p{margin:0;color:#6f786f}
.account-card{background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 10px 35px rgba(8,23,13,.08);padding:22px;margin-bottom:18px}
.account-card h2{margin:0 0 6px;color:#19311f;font-size:19px}
.account-card-subtext{margin:0 0 18px;color:#768076;font-size:13px}
.account-form{display:grid;gap:16px}
.account-form label{display:grid;gap:7px;font-size:13px;font-weight:800;color:#394239}
.account-form button,.account-primary-btn{border:0;border-radius:9px;background:var(--green2);color:#fff;font-weight:900;padding:12px 16px;width:max-content}
.account-form button:disabled{opacity:.65;cursor:wait}
.account-message{min-height:18px;margin:0;font-size:13px;color:var(--danger)}
.account-message.success{color:#2f6b3c}
.email-account-row{display:flex;align-items:center;justify-content:space-between;gap:18px;border:1px solid var(--line);border-radius:11px;padding:16px;background:#fbfcfb}
.email-account-copy{min-width:0}
.email-account-copy strong{display:block;color:#263326;font-size:14px;margin-bottom:3px}
.email-account-copy span{display:block;color:#768076;font-size:12px;overflow-wrap:anywhere}
.email-badge{font-size:11px;font-weight:900;color:#2f5a38;background:#e7f0e8;padding:6px 9px;border-radius:999px;white-space:nowrap}
.readonly-field{background:#f4f6f4;color:#687268}
.account-help{font-size:12px;line-height:1.55;color:#7a847a;margin:14px 0 0}
@media(max-width:760px){
  .topbar-actions{gap:6px}
  .topbar-nav{gap:2px}
  .topbar-tab{font-size:11px;padding:7px 7px}
  .account-page-main{width:min(100% - 20px,920px);margin:20px auto}
}
@media(max-width:650px){
  .topbar-brand{display:none}
  .topbar-left{flex:0 0 auto}
  .topbar-main-logo{width:34px;height:34px}
  .topbar-actions{flex:1;justify-content:flex-end;min-width:0}
  .topbar-nav{min-width:0}
  .topbar-tab{padding:7px 6px}
  .signout{padding:7px 7px}
  .account-page-main{margin:16px auto}
  .account-card{padding:18px}
  .email-account-row{align-items:flex-start}
}


/* Left-side account navigation */
.utility-nav{border-top:1px solid var(--line);margin-top:18px;padding-top:14px;display:grid;gap:3px}
.utility-link{display:flex;align-items:center;gap:10px;width:100%;text-decoration:none;text-align:left;padding:9px 10px;border-radius:7px;color:#596259;font-weight:700;font-size:13px}
.utility-link:hover,.utility-link.active{background:#edf2ed;color:#16371f}
.utility-icon{width:19px;height:19px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}
.utility-icon svg{width:19px;height:19px;display:block}
.account-shell{height:calc(100vh - 78px);height:calc(100dvh - 78px);display:grid;grid-template-columns:260px minmax(0,1fr);background:#edf1ed}
.account-sidebar{border-right:1px solid var(--line);padding:18px 14px;background:#f7f9f7;overflow:auto}
.account-sidebar .utility-nav{margin-top:0}
.account-shell .account-page-main{width:min(920px,calc(100% - 32px));margin:32px auto;padding-bottom:40px;overflow:auto}
@media(max-width:900px){
  .account-shell{grid-template-columns:210px minmax(0,1fr)}
}
@media(max-width:650px){
  .account-shell{height:auto;min-height:calc(100dvh - 64px);display:block}
  .account-sidebar{border-right:0;border-bottom:1px solid var(--line);padding:10px;background:#f7f9f7}
  .account-sidebar .utility-nav{border-top:0;padding-top:0;grid-template-columns:repeat(3,1fr);gap:6px}
  .account-sidebar .utility-link{justify-content:center;padding:9px 6px;font-size:11px}
  .account-sidebar .utility-link span:last-child{white-space:nowrap}
}


/* Keep utility links fixed in the same sidebar position */
.sidebar,.account-sidebar{display:flex;flex-direction:column}
.sidebar .utility-nav,.account-sidebar .utility-nav{margin-top:auto}
@media(max-width:650px){
  .account-sidebar{display:block}
  .account-sidebar .utility-nav{margin-top:0;grid-template-columns:repeat(2,1fr)}
}
