/* St. Maria Mail: Outlook-style three panes on the school's scrapbook palette (see ../../webmail-mockup). */
:root {
  --red: #9C2434; --red-deep: #7A1A28; --red-soft: #F4DADC;
  --green: #23483B; --green-deep: #183328;
  --gold: #D3A33B; --gold-soft: #F6E3A6;
  --cream: #F3E7D2; --paper: #FBF4E6; --paper-2: #FFFCF6;
  --navy: #24304B; --brown: #4A302A; --ink: #2B2420; --muted: #8A7A70;
  --line: rgba(74,48,42,.14);
  --display: "Iowan Old Style", Georgia, "Times New Roman", "Songti SC", "STSong", "SimSun", serif;
  --zh: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --ui: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --label: "Rockwell", "Roboto Slab", Georgia, serif;
  --type: Georgia, "Times New Roman", serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font: 14px/1.45 var(--ui); color: var(--ink);
  background-color: var(--green-deep);
  background-image:
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(156,36,52,.35) 46px 58px, transparent 58px 70px, rgba(211,163,59,.18) 70px 72px, transparent 72px 104px),
    repeating-linear-gradient(0deg, transparent 0 46px, rgba(156,36,52,.35) 46px 58px, transparent 58px 70px, rgba(211,163,59,.18) 70px 72px, transparent 72px 104px);
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
button:disabled { cursor: default; opacity: .5; }
a { color: var(--red); }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- shared bits ---- */
.crest { width: 34px; height: 41px; transform: rotate(-4deg); filter: drop-shadow(1px 2px 0 rgba(0,0,0,.25)); flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 4px; font-weight: 600; }
.btn.primary { background: var(--red); color: var(--cream); box-shadow: 2px 3px 0 var(--green-deep); }
.btn.primary:hover:not(:disabled) { background: var(--red-deep); }
.btn.green { background: var(--green); color: var(--cream); }
.btn.ghost { border: 1.5px solid var(--green); color: var(--green); }
.btn.ghost:hover:not(:disabled) { background: rgba(35,72,59,.08); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field span { font-size: 13px; font-weight: 600; color: var(--brown); }
.input { width: 100%; height: 40px; padding: 0 12px; border: 1.5px solid rgba(74,48,42,.22); border-radius: 4px; background: var(--paper-2); }
.input:focus { border-color: var(--red); outline: none; }
.error { color: var(--red); font-size: 13px; min-height: 18px; margin: 4px 0 0; }
.muted { color: var(--muted); }

/* ---- login: an admission card pinned to the tartan ---- */
.login { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; }
.login-card { position: relative; width: min(420px, 100%); background: var(--paper); padding: 34px 32px 26px; border-top: 6px solid var(--red);
  background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(36,48,75,.08) 27px 28px);
  box-shadow: 3px 4px 0 rgba(0,0,0,.2), 0 24px 34px -16px rgba(0,0,0,.6); transform: rotate(-.6deg); }
.login-card::before { content: ""; position: absolute; top: -14px; left: 50%; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #E8888F, var(--red) 60%, var(--red-deep)); box-shadow: 1px 3px 3px rgba(0,0,0,.35); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand .crest { width: 46px; height: 56px; }
.login-brand b { display: block; font-family: var(--display); font-weight: 900; font-variation-settings: "opsz" 72, "wdth" 60; font-size: 28px; color: var(--red); line-height: 1; }
.login-brand small { display: block; font-family: var(--zh); font-weight: 900; font-size: 12px; letter-spacing: .5em; color: var(--green); margin-top: 6px; }
.login-card h1 { font-family: var(--zh); font-weight: 900; font-size: 22px; color: var(--green-deep); margin: 0 0 4px; }
.login-card .lead { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 2px 0 16px; color: var(--brown); }
.login-card .btn { width: 100%; height: 42px; }
.login-foot { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 13px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.login-goose { position: absolute; right: -46px; bottom: -18px; width: 86px; transform: rotate(6deg); pointer-events: none; }
.stamp { position: absolute; right: 20px; top: 22px; transform: rotate(8deg); border: 2px solid var(--red); color: var(--red); padding: 3px 9px; font-family: var(--label); font-size: 10px; letter-spacing: .14em; opacity: .65; }

/* ---- app shell ---- */
.app { height: 100%; display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.top { display: flex; align-items: center; gap: 16px; height: 60px; padding: 0 16px 0 12px; background: var(--red); color: var(--cream); position: relative; box-shadow: 0 3px 0 var(--red-deep); z-index: 5; }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 6px; background: repeating-linear-gradient(90deg, var(--gold) 0 14px, transparent 14px 20px); opacity: .9; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; width: 258px; flex: none; }
.brand .n { display: grid; line-height: 1; }
.brand .en { font-family: var(--display); font-weight: 900; font-variation-settings: "opsz" 72, "wdth" 60; font-size: 22px; }
.brand .cn { font-family: var(--zh); font-weight: 900; font-size: 10.5px; letter-spacing: .5em; color: var(--gold-soft); margin-top: 4px; }
.menu-btn { display: none; width: 36px; height: 36px; place-items: center; border-radius: 4px; }
.top .tools > .search-toggle { display: none; }
.search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 12px; background: var(--paper); color: var(--muted); border-radius: 4px; }
.search input { flex: 1; min-width: 0; border: 0; background: none; height: 100%; color: var(--ink); outline: none; }
.search button { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 3px; }
.top .tools { margin-left: auto; display: flex; align-items: center; gap: 4px; position: relative; }
.top .tools > button, .top .tools > a { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 4px; color: inherit; }
.top .tools > button:hover, .top .tools > a:hover { background: rgba(0,0,0,.18); }
.avatar-btn { width: auto !important; padding: 0 4px 0 8px; display: flex !important; gap: 8px; }
.avatar-btn span.who { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--red-deep); font-family: var(--label); font-size: 12px; box-shadow: 0 0 0 2px var(--cream); flex: none; }
.popover { position: absolute; right: 0; top: 46px; width: 280px; background: var(--paper); color: var(--ink); border-radius: 6px; box-shadow: 0 14px 30px -8px rgba(0,0,0,.5); padding: 14px; z-index: 20; border-top: 5px solid var(--gold); }
.popover .me { font-weight: 700; } .popover .addr { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; word-break: break-all; }
.popover hr { border: 0; border-top: 1px dashed var(--line); margin: 12px 0; }
.popover .row { display: flex; gap: 8px; }
.popover .row .input { height: 34px; }
.popover .link { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-radius: 4px; color: var(--brown); text-decoration: none; width: 100%; text-align: left; }
.popover .link:hover { background: rgba(211,163,59,.18); }

.body { display: grid; grid-template-columns: 56px 216px minmax(300px, 380px) 1fr; min-height: 0; padding: 16px 14px 14px 0; }
.body.contacts-mode { grid-template-columns: 56px 1fr; }
.rail { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 4px; color: var(--cream); }
.rail button, .rail a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 6px; opacity: .78; color: inherit; }
.rail .on { background: var(--paper); color: var(--red); opacity: 1; box-shadow: 2px 2px 0 rgba(0,0,0,.25); }
.rail button:hover, .rail a:hover { opacity: 1; }
.sheet { background: var(--paper); box-shadow: 3px 4px 0 rgba(0,0,0,.2), 0 18px 28px -14px rgba(0,0,0,.6); min-height: 0; }

/* folder pane */
.folders { border-radius: 6px 0 0 6px; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); overflow: auto; }
.new { display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; margin: 0 4px 14px; flex: none;
  background: var(--red); color: var(--cream); border-radius: 4px; font-weight: 700; box-shadow: 2px 3px 0 var(--green-deep); transform: rotate(-1deg); transition: transform .15s; }
.new:hover { transform: rotate(0); }
.sec { font-family: var(--label); font-size: 11px; letter-spacing: .16em; color: var(--green); padding: 12px 10px 6px; }
.f { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: 4px; color: var(--brown); text-align: left; width: 100%; }
.f span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f:hover { background: rgba(211,163,59,.18); }
.f.on { background: var(--gold-soft); color: var(--red-deep); font-weight: 700; box-shadow: inset 3px 0 0 var(--red); }
.f .c { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--red); }
.f.drop { background: var(--red-soft); }
.goose-note { margin-top: auto; padding: 14px 6px 0; display: grid; grid-template-columns: 54px 1fr; gap: 8px; align-items: end; }
.goose-note img { width: 54px; }
.goose-note p { margin: 0 0 6px; font-family: var(--type); font-variation-settings: "wdth" 75; font-size: 11.5px; color: var(--muted); line-height: 1.35; background: var(--paper-2); padding: 6px 8px; border: 1px dashed var(--line); transform: rotate(1.5deg); }

/* message list */
.list { border-right: 1px solid var(--line); display: grid; grid-template-rows: auto auto 1fr; min-height: 0; background: var(--paper-2); }
.list-h { display: flex; align-items: baseline; gap: 10px; padding: 16px 18px 8px; }
.list-h h2 { margin: 0; font-family: var(--zh); font-weight: 900; font-size: 20px; color: var(--green-deep); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-h h2 small { font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--red); margin-left: 6px; letter-spacing: .04em; }
.list-h .tools { margin-left: auto; display: flex; gap: 2px; }
.list-h .tools button { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 4px; color: var(--muted); }
.list-h .tools button:hover { background: rgba(211,163,59,.2); color: var(--brown); }
.tabs { display: flex; gap: 18px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 8px 0; font-weight: 500; color: var(--muted); position: relative; }
.tabs button.on { color: var(--red); font-weight: 700; }
.tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--red); border-radius: 2px; }
.tabs .count { margin-left: auto; align-self: center; font-size: 12px; color: var(--muted); }
.msgs { overflow: auto; }
.day { font-family: var(--label); font-size: 10.5px; letter-spacing: .16em; color: var(--green); padding: 12px 18px 4px; }
.m { display: grid; grid-template-columns: 36px 1fr auto; gap: 3px 12px; padding: 10px 18px 11px 15px; border-left: 3px solid transparent; border-bottom: 1px solid var(--line); cursor: pointer; width: 100%; text-align: left; }
.m:hover { background: rgba(211,163,59,.1); }
.m.unread { border-left-color: var(--red); }
.m.unread .who, .m.unread .sub { font-weight: 700; color: var(--ink); }
.m.sel { background: var(--red-soft); border-left-color: var(--red); }
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-family: var(--label); font-size: 12px; flex: none; }
.m .av { grid-row: span 3; }
.m .who { color: var(--brown); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m .t { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.m .t svg { width: 13px; height: 13px; }
.m .flag { color: var(--red); fill: var(--red); }
.m .sub { grid-column: 2 / 4; color: var(--brown); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m .pv { grid-column: 2 / 4; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1em; }
.more { display: block; width: calc(100% - 36px); margin: 14px 18px 18px; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 48px 20px; text-align: center; color: var(--muted); }
.empty img { width: 92px; opacity: .9; }
.empty b { font-family: var(--zh); color: var(--green-deep); font-size: 16px; }

/* reading pane */
.read { border-radius: 0 6px 6px 0; display: grid; grid-template-rows: auto 1fr; min-height: 0; background: var(--paper); }
.bar { display: flex; align-items: center; gap: 2px; padding: 8px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 49px; }
.bar button, .bar a { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 4px; color: var(--brown); font-size: 13px; text-decoration: none; }
.bar button:hover:not(:disabled) { background: rgba(211,163,59,.2); }
.bar .sp { flex: 1; }
.bar .back { display: none; }
.bar select { height: 32px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper-2); padding: 0 6px; max-width: 150px; }
.scroll { overflow: auto; padding: 22px 30px 34px; display: flex; flex-direction: column; min-height: 0; }
.subject { margin: 0 0 14px; font-family: var(--zh); font-weight: 900; font-size: 23px; color: var(--green-deep); line-height: 1.35; overflow-wrap: anywhere; }
.from { display: grid; grid-template-columns: 44px 1fr auto; gap: 2px 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.from .av { grid-row: span 2; width: 44px; height: 44px; font-size: 13px; }
.from b { color: var(--ink); overflow-wrap: anywhere; }
.from .addr { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.from .meta { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.from .t { grid-row: span 2; font-size: 12.5px; color: var(--muted); align-self: start; white-space: nowrap; }
.images-note { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; padding: 8px 12px; background: var(--gold-soft); font-size: 13px; border-radius: 4px; }
.images-note button { color: var(--red); font-weight: 700; }
.letter { position: relative; margin: 22px 0 0; background: var(--paper-2); border-top: 6px solid var(--red); box-shadow: 2px 3px 0 rgba(74,48,42,.15); flex: 1 0 360px; display: flex; }
.letter::before { content: ""; position: absolute; top: -14px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #E8888F, var(--red) 60%, var(--red-deep)); box-shadow: 1px 3px 3px rgba(0,0,0,.35); }
.letter iframe { border: 0; width: 100%; flex: 1; min-height: 360px; background: transparent; }
.attach { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.att { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 4px; min-width: 200px; max-width: 100%; color: var(--ink); text-decoration: none; }
.att:hover { border-color: var(--gold); }
.att .ic { width: 34px; height: 40px; background: var(--green); color: var(--cream); display: grid; place-items: center; font-family: var(--label); font-size: 9.5px; flex: none; clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%); }
.att div { min-width: 0; } .att div span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att small { display: block; color: var(--muted); font-size: 12px; }
.read-empty { display: grid; place-items: center; align-content: center; gap: 12px; height: 100%; color: var(--muted); text-align: center; padding: 30px; }
.read-empty img { width: 110px; }
.read-empty b { font-family: var(--zh); font-size: 18px; color: var(--green-deep); }

/* contacts */
.contacts { border-radius: 6px; display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.contacts-h { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.contacts-h h2 { margin: 0; font-family: var(--zh); font-weight: 900; font-size: 22px; color: var(--green-deep); }
.contacts-h h2 small { font-family: var(--display); font-size: 13px; color: var(--red); margin-left: 6px; }
.contacts-h form { display: flex; gap: 8px; margin-left: auto; }
.contacts-h .input { height: 36px; width: 220px; }
.cards { overflow: auto; padding: 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; align-content: start; }
.card { position: relative; background: var(--paper-2); padding: 18px 16px 14px; border-top: 5px solid var(--green);
  background-image: repeating-linear-gradient(0deg, transparent 0 25px, rgba(36,48,75,.08) 25px 26px); box-shadow: 2px 3px 0 rgba(74,48,42,.15);
  display: grid; grid-template-columns: 44px 1fr; gap: 4px 12px; align-items: center; }
.card:nth-child(3n+1) { transform: rotate(-.6deg); } .card:nth-child(3n+2) { transform: rotate(.5deg); border-top-color: var(--red); } .card:nth-child(3n) { border-top-color: var(--gold); }
.card .av { width: 44px; height: 44px; grid-row: span 2; }
.card b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .addr { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .acts { grid-column: 1 / 3; display: flex; gap: 6px; margin-top: 10px; }
.card .acts button, .card .acts a { font-size: 12.5px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 3px; color: var(--brown); text-decoration: none; background: var(--paper); }
.card .acts button:hover, .card .acts a:hover { border-color: var(--green); color: var(--green); }
.pager { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }

/* compose */
.compose-wrap { position: fixed; inset: 0; background: rgba(24,51,40,.55); display: grid; place-items: center; padding: 20px; z-index: 30; }
.compose { width: min(760px, 100%); max-height: calc(100vh - 40px); background: var(--paper); border-top: 6px solid var(--red); box-shadow: 0 24px 50px -10px rgba(0,0,0,.6); display: grid; grid-template-rows: auto 1fr auto; border-radius: 0 0 6px 6px; }
.compose-h { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.compose-h h3 { margin: 0; font-family: var(--zh); font-weight: 900; color: var(--green-deep); font-size: 18px; }
.compose-h button { margin-left: auto; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 4px; }
.compose-h button:hover { background: rgba(211,163,59,.2); }
.compose-b { overflow: auto; padding: 4px 16px 10px; display: flex; flex-direction: column; min-height: 0; }
.crow { display: grid; grid-template-columns: 60px 1fr auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); min-height: 42px; }
.crow label { font-size: 13px; color: var(--muted); }
.crow input { border: 0; background: none; height: 40px; outline: none; min-width: 0; }
.crow .toggle { font-size: 12.5px; color: var(--red); }
.compose textarea { flex: 1; min-height: 260px; border: 0; background: var(--paper-2); margin-top: 12px; padding: 14px 16px; resize: vertical; outline: none; line-height: 1.75;
  background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(36,48,75,.08) 27px 28px); background-attachment: local; border-left: 3px solid var(--gold-soft); }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border: 1px solid var(--line); border-radius: 14px; font-size: 12.5px; background: var(--paper-2); max-width: 100%; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; }
.chip button:hover { background: var(--red-soft); }
.compose-f { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.compose-f .sp { flex: 1; }
.compose-f .hint { font-size: 12px; color: var(--muted); }
.suggest { position: absolute; z-index: 40; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 10px 20px -6px rgba(0,0,0,.35); max-height: 220px; overflow: auto; min-width: 260px; }
.suggest button { display: block; width: 100%; text-align: left; padding: 7px 12px; }
.suggest button small { color: var(--muted); margin-left: 6px; }
.suggest button:hover, .suggest button.on { background: var(--gold-soft); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) rotate(-1deg); background: var(--gold-soft); color: var(--brown); padding: 10px 18px; font-family: var(--ui); box-shadow: 2px 4px 0 rgba(0,0,0,.25); z-index: 50; max-width: calc(100% - 32px); }
.toast.bad { background: var(--red); color: var(--cream); }
.loading { padding: 30px; text-align: center; color: var(--muted); font-family: var(--type); font-variation-settings: "wdth" 75; }

/* ---- tablet: drop the folder column into a drawer ---- */
@media (max-width: 1100px) {
  .body { grid-template-columns: 56px minmax(280px, 340px) 1fr; }
  .folders { position: fixed; left: 0; top: 60px; bottom: 0; width: 260px; z-index: 15; border-radius: 0; transform: translateX(-105%); transition: transform .2s; }
  .app.drawer .folders { transform: none; }
  .list { border-radius: 6px 0 0 6px; }
  .menu-btn { display: grid; }
  .brand { width: auto; }
}
/* ---- phone: one pane at a time ---- */
@media (max-width: 760px) {
  .top { gap: 8px; padding: 0 10px; }
  .brand .en { font-size: 18px; } .brand .cn { display: none; }
  .search { display: none; }
  .top .tools > .search-toggle { display: grid; }
  .app.searching .search { display: flex; position: absolute; left: 10px; right: 10px; top: 12px; max-width: none; z-index: 6; }
  .avatar-btn span.who { display: none; }
  .body, .body.contacts-mode { grid-template-columns: 1fr; padding: 14px 10px 10px; }
  .rail { position: fixed; left: 0; right: 0; bottom: 0; flex-direction: row; justify-content: space-around; background: var(--red); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 10; }
  .body { padding-bottom: 70px; }
  .list, .read, .contacts { border-radius: 6px; }
  .read { display: none; }
  .app.reading .read { display: grid; }
  .app.reading .list { display: none; }
  .bar .back { display: flex; }
  .bar .label { display: none; }
  .scroll { padding: 18px 16px 24px; }
  .subject { font-size: 20px; }
  .from { grid-template-columns: 40px 1fr; }
  .from .av { width: 40px; height: 40px; grid-row: span 3; }
  .from .t { grid-row: auto; grid-column: 2; order: 3; }
  .from .addr { display: block; }
  .bar { gap: 0; padding: 6px 8px; }
  .bar button, .bar a { padding: 0 8px; }
  .bar select { max-width: 110px; }
  .letter { flex-basis: 300px; }
  .contacts-h form { margin-left: 0; width: 100%; } .contacts-h .input { flex: 1; width: auto; }
  .cards { padding: 16px; grid-template-columns: 1fr; }
  .compose-wrap { padding: 0; place-items: stretch; }
  .compose { max-height: none; height: 100%; border-radius: 0; }
  .login-goose { right: -8px; bottom: -30px; width: 70px; }
}
