@font-face { font-family: "Cormorant Garamond"; font-weight: 500 700; font-display: swap; src: url(/fonts/CormorantGaramond-2fed1d.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400 700; font-display: swap; src: url(/fonts/Inter-567244.woff2) format("woff2"); }

:root {
  --m-950: #1A070B; --m-900: #2A0B12; --m-800: #3E111C; --m-700: #6B1A2B; --m-600: #82243A; --m-100: #F0DFE1; --m-50: #FAF2F2;
  --parch: #F7F2E8; --paper: #FCFAF5; --brass: #A9844C; --brass-lt: #D9BF8C;
  --ink: #1F1416; --body: #3D3133; --muted: #66585A; --line: #E6DCCB; --line-2: #D5C7AF;
  --on-dark: #F4ECE6; --on-dark-2: #D4C1BE; --wa: #157347; --danger: #A32020;
  --serif: "Cormorant Garamond", Georgia, serif; --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 10px; --side: 248px; --list: 380px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 15px/1.5 var(--sans); color: var(--body); background: var(--paper); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--m-700); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { height: 100vh; display: grid; place-items: center; background: var(--m-900); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(217,191,140,.25); border-top-color: var(--brass-lt); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent; background: var(--m-700); color: #fff; font-weight: 600; font-size: 14.5px; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--m-600); }
.btn--brass { background: var(--brass-lt); color: var(--m-900); }
.btn--brass:hover { background: #E5CFA4; }
.btn--line { background: transparent; color: var(--m-700); border-color: var(--line-2); }
.btn--line:hover { background: var(--m-50); border-color: var(--m-700); }
.btn--wa { background: var(--wa); }
.btn--wa:hover { background: #0F5C38; }
.btn--danger { background: transparent; color: var(--danger); border-color: #E7C3C3; }
.btn--danger:hover { background: #FBEDED; }
.btn[disabled] { opacity: .55; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--m-50); color: var(--m-700); }
.icon-btn.on { color: var(--brass); }

/* ------- sign in */
.auth { min-height: 100vh; height: 100vh; overflow: auto; display: grid; place-items: center; padding: 24px; background: var(--m-900) radial-gradient(1200px 600px at 50% -10%, #4A1522 0%, transparent 60%); }
.auth__card { width: 100%; max-width: 420px; background: var(--paper); border-radius: 14px; padding: 34px 30px 28px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--m-900); text-decoration: none; }
.brand svg { width: 34px; height: 40px; color: var(--brass); }
.brand b { display: block; font: 600 21px/1.05 var(--serif); }
.brand small { display: block; font: 600 10.5px/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--brass); }
.auth h1 { font: 600 30px/1.15 var(--serif); color: var(--ink); margin: 26px 0 6px; }
.auth p.lead { margin: 0 0 20px; color: var(--muted); font-size: 14.5px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.field small { color: var(--muted); font-weight: 400; }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; }
.field input:focus, .field textarea:focus, .input:focus { border-color: var(--m-700); outline: 2px solid rgba(107,26,43,.15); outline-offset: 0; }
.form-err { color: var(--danger); font-size: 14px; min-height: 20px; margin: 2px 0 10px; }
.auth .btn { width: 100%; }
.auth__switch { margin-top: 16px; font-size: 14px; text-align: center; color: var(--muted); }
.auth__switch button { background: none; border: 0; color: var(--m-700); text-decoration: underline; padding: 0; }
.lock { display: flex; gap: 8px; align-items: center; margin-top: 18px; font-size: 12.5px; color: var(--muted); }
.lock svg { width: 16px; height: 16px; color: var(--brass); }

/* ------- app shell */
.app { display: grid; grid-template-columns: var(--side) var(--list) 1fr; height: 100vh; height: 100dvh; }
.side { background: var(--m-900); color: var(--on-dark); display: flex; flex-direction: column; padding: 18px 12px calc(14px + var(--safe-b)); gap: 6px; overflow-y: auto; }
.side .brand { color: var(--on-dark); padding: 4px 8px 14px; }
.side .brand svg { color: var(--brass-lt); }
.side .brand small { color: var(--brass-lt); }
.side .compose { margin: 4px 4px 12px; }
.folders { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.folders button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--on-dark-2); text-align: left; font-weight: 500; }
.folders button:hover { background: rgba(255,255,255,.06); color: var(--on-dark); }
.folders button[aria-current="page"] { background: rgba(217,191,140,.14); color: #fff; }
.folders button[aria-current="page"] svg { color: var(--brass-lt); }
.folders .n { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--m-900); background: var(--brass-lt); border-radius: 999px; padding: 1px 8px; }
.folders .n:empty { display: none; }
.side__foot { margin-top: auto; border-top: 1px solid rgba(217,191,140,.18); padding-top: 10px; }
.side__me { font-size: 12.5px; color: var(--on-dark-2); padding: 8px 12px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; background: var(--paper); }
.list__head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; padding-top: calc(14px + var(--safe-t)); }
.list__head h2 { font: 600 24px/1 var(--serif); color: var(--ink); margin: 0; flex: 1; }
.menu-btn { display: none; }
.search { position: relative; margin: 0 14px 10px; }
.search svg { position: absolute; left: 11px; top: 12px; width: 18px; height: 18px; color: var(--muted); }
.search input { width: 100%; height: 42px; border-radius: 999px; border: 1px solid var(--line); background: var(--parch); padding: 0 14px 0 38px; }
.items { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0 0 calc(80px + var(--safe-b)); }
.item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 16px 12px 18px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; background: transparent; width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0; }
.item:hover { background: var(--parch); }
.item[aria-current="true"] { background: var(--m-50); box-shadow: inset 3px 0 0 var(--m-700); }
.item .from { font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .date { font-size: 12.5px; color: var(--muted); }
.item .subj { grid-column: 1 / -1; color: var(--body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.item .snip { grid-column: 1 / -1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.item.unread .from, .item.unread .subj { font-weight: 700; color: var(--ink); }
.item.unread::before { content: ""; position: absolute; left: 6px; top: 19px; width: 7px; height: 7px; border-radius: 50%; background: var(--m-700); }
.item .tags { display: flex; gap: 6px; align-items: center; }
.item .tags svg { width: 15px; height: 15px; color: var(--muted); }
.item .tags .star { color: var(--brass); }
.chip { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 7px; border-radius: 4px; background: #F3E9D6; color: #6A4D1F; }
.chip--book { background: var(--m-100); color: var(--m-700); }
.empty { text-align: center; color: var(--muted); padding: 60px 24px; }
.empty svg { width: 42px; height: 42px; color: var(--line-2); margin-bottom: 8px; }
.more { display: block; margin: 14px auto; }

.reader { overflow-y: auto; min-width: 0; background: #fff; display: flex; flex-direction: column; }
.reader__bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 2px; padding: 8px 12px; padding-top: calc(8px + var(--safe-t)); background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.reader__bar .sp { flex: 1; }
.back { display: none; }
.reader__body { padding: 22px 28px 120px; max-width: 900px; width: 100%; }
.reader h1 { font: 600 28px/1.2 var(--serif); color: var(--ink); margin: 0 0 16px; word-break: break-word; }
.meta { display: grid; grid-template-columns: 44px 1fr auto; gap: 2px 12px; align-items: center; margin-bottom: 18px; }
.avatar { grid-row: span 2; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--m-100); color: var(--m-700); font: 700 17px/1 var(--sans); }
.meta .who { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.meta .who span { font-weight: 400; color: var(--muted); }
.meta .to { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.meta .when { font-size: 13px; color: var(--muted); grid-row: 1; grid-column: 3; }
.banner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: 8px; background: var(--parch); border: 1px solid var(--line); font-size: 13.5px; margin-bottom: 16px; }
.banner svg { color: var(--brass); }
.banner .btn { min-height: 32px; padding: 0 12px; font-size: 13px; }
.banner--junk { background: #FFF6E5; border-color: #EBD3A4; }
.mail-frame { width: 100%; border: 0; min-height: 200px; display: block; }
.mail-text { white-space: pre-wrap; word-wrap: break-word; font-size: 15px; color: var(--ink); }
.atts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.att { display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px; border: 1px solid var(--line-2); border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 13.5px; max-width: 100%; }
.att:hover { border-color: var(--m-700); background: var(--m-50); }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att small { color: var(--muted); }
.nosel { display: grid; place-items: center; height: 100%; color: var(--muted); text-align: center; padding: 30px; }
.nosel svg { width: 56px; height: 66px; color: var(--line-2); }

/* booking card */
.booking { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.booking__head { background: var(--m-900); color: var(--on-dark); padding: 16px 20px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.booking__head b { font: 600 22px/1.2 var(--serif); }
.booking__ref { font: 600 14px/1 ui-monospace, Consolas, monospace; background: rgba(217,191,140,.16); color: var(--brass-lt); padding: 7px 10px; border-radius: 6px; letter-spacing: .04em; }
.booking dl { display: grid; grid-template-columns: 150px 1fr; margin: 0; }
.booking dt, .booking dd { margin: 0; padding: 11px 20px; border-bottom: 1px solid var(--line); }
.booking dt { color: var(--muted); font-size: 13.5px; background: var(--parch); }
.booking dd { color: var(--ink); font-weight: 500; word-break: break-word; }
.booking .msg { padding: 16px 20px; white-space: pre-wrap; color: var(--ink); }
.booking__act { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 20px; background: var(--parch); }

/* compose + settings sheets */
.sheet { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(26,7,11,.55); padding: 20px; }
.sheet__box { width: 100%; max-width: 760px; max-height: calc(100vh - 40px); background: #fff; border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.sheet__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 22px; border-bottom: 1px solid var(--line); background: var(--m-900); color: var(--on-dark); }
.sheet__head h2 { font: 600 22px/1 var(--serif); margin: 0; flex: 1; }
.sheet__head .icon-btn { color: var(--on-dark-2); }
.sheet__head .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.sheet__body { padding: 18px 22px; overflow-y: auto; }
.sheet__foot { display: flex; gap: 10px; align-items: center; padding: 12px 22px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); flex-wrap: wrap; }
.sheet__foot .sp { flex: 1; }
.crow { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.crow label { color: var(--muted); font-size: 14px; }
.crow input { border: 0; min-height: 46px; padding: 0; outline: none; width: 100%; background: transparent; }
.crow .link { background: none; border: 0; color: var(--m-700); font-size: 13.5px; }
.compose-text { width: 100%; min-height: 300px; border: 0; outline: none; resize: vertical; padding: 14px 0; font-size: 15px; line-height: 1.6; }
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.file { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--parch); border: 1px solid var(--line); font-size: 13px; }
.file button { border: 0; background: none; width: 26px; height: 26px; border-radius: 50%; color: var(--muted); }
.note { font-size: 13.5px; color: #6A4D1F; background: #FFF6E5; border: 1px solid #EBD3A4; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.set h3 { font: 600 20px/1.2 var(--serif); color: var(--ink); margin: 22px 0 8px; }
.set h3:first-child { margin-top: 0; }
.set p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.rows { list-style: none; padding: 0; margin: 0 0 10px; border: 1px solid var(--line); border-radius: 10px; }
.rows li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rows small { color: var(--muted); }
.code { font: 700 20px/1 ui-monospace, Consolas, monospace; letter-spacing: .06em; padding: 14px; background: var(--parch); border: 1px dashed var(--brass); border-radius: 8px; text-align: center; color: var(--m-900); margin: 8px 0; user-select: all; }
.inline { display: flex; gap: 10px; flex-wrap: wrap; }
.inline .input { flex: 1; min-width: 180px; }

#toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 50; background: var(--m-900); color: var(--on-dark); padding: 12px 18px; border-radius: 10px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.3); transition: .25s; max-width: calc(100vw - 32px); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
.fab { display: none; }
.scrim { display: none; }

/* ------- tablet */
@media (max-width: 1180px) { :root { --side: 216px; --list: 330px; } }
/* ------- phone: one pane at a time */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 20; transform: translateX(-100%); transition: transform .22s ease; padding-top: calc(18px + var(--safe-t)); }
  .app.drawer .side { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.35); }
  .app.drawer .scrim { display: block; position: fixed; inset: 0; background: rgba(26,7,11,.5); z-index: 15; }
  .menu-btn { display: inline-grid; }
  .list { border-right: 0; }
  .reader { position: fixed; inset: 0; z-index: 10; transform: translateX(100%); transition: transform .22s ease; }
  .app.reading .reader { transform: none; }
  .back { display: inline-grid; }
  .reader__body { padding: 18px 18px 120px; }
  .reader h1 { font-size: 24px; }
  .fab { display: inline-flex; position: fixed; right: 18px; bottom: calc(18px + var(--safe-b)); z-index: 5; min-height: 54px; padding: 0 22px; border-radius: 16px; box-shadow: 0 10px 26px rgba(42,11,18,.35); }
  .side .compose { display: none; }
  .sheet { padding: 0; place-items: stretch; }
  .sheet__box { max-width: none; max-height: none; height: 100%; border-radius: 0; }
  .sheet__head { padding-top: calc(12px + var(--safe-t)); }
  .meta { grid-template-columns: 44px 1fr; }
  .avatar { grid-row: span 3; }
  .meta .when { grid-column: 2; grid-row: 3; }
  .booking dl { grid-template-columns: 1fr; }
  .booking dt { padding-bottom: 2px; border-bottom: 0; background: none; padding-top: 12px; }
  .booking dd { padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* several addresses: inbox switcher, From choice, access ticks */
.boxes { list-style: none; margin: 0 0 14px; padding: 0 0 12px; display: grid; gap: 4px; border-bottom: 1px solid rgba(255,255,255,.08); }
.boxes button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; background: rgba(255,255,255,.03); color: var(--on-dark-2); text-align: left; }
.boxes button:hover { background: rgba(255,255,255,.07); color: var(--on-dark); }
.boxes button[aria-current="true"] { background: rgba(217,191,140,.16); border-color: rgba(217,191,140,.45); color: #fff; }
.boxes__t { display: grid; min-width: 0; }
.boxes__t b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boxes__t small { font-size: 11.5px; opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boxes .n { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--m-900); background: var(--brass-lt); border-radius: 999px; padding: 1px 8px; }
.boxes .n:empty { display: none; }
.from-pick { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: inherit; padding: 8px 0; }
.ticks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0 2px; }
.tick { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.tick input { width: 18px; height: 18px; accent-color: var(--m-700, #6b1f2a); }
.boxedit { padding: 10px 0 12px; border-bottom: 1px solid var(--line, rgba(0,0,0,.08)); }
.boxedit p { margin: 0 0 8px; }
